echo "<head><title>$title</title>\n";
echo "<meta http-equiv='Content-type' content='text/html; charset=$encoding' />\n";
echo "<link href='$path_to_root/themes/$def_theme/default.css' rel='stylesheet' type='text/css'> \n";
+ echo "<link href='$path_to_root/themes/default/images/favicon.png' rel='icon' type='image/png'> \n";
send_scripts();
if (!$login_timeout)
{
//---------------------------------------------------------------------------------------------
-function get_bank_accounts($show_inactive)
+function get_bank_accounts($show_inactive=false)
{
$sql = "SELECT account.*, gl_account.account_name
FROM ".TB_PREF."bank_accounts account, ".TB_PREF."chart_master gl_account
global $date_system;
//for MySQL dates are in the format YYYY-mm-dd
- if ($date_ == null || strlen($date_) == 0)
- return "";
if (strpos($date_, "/"))
{ // In MySQL it could be either / or -
{
list($year, $month, $day) = explode("-", $date_);
}
+ if (!isset($day)) // data format error
+ return "";
if (strlen($day) > 4)
{ /*chop off the time stuff */
//-----------------------------------------------------------------------------------------------
-function bank_accounts_list($name, $selected_id=null, $submit_on_change=false)
+function bank_accounts_list($name, $selected_id=null, $submit_on_change=false, $spec_option=false, $submit_on_change=false)
{
$sql = "SELECT ".TB_PREF."bank_accounts.id, bank_account_name, bank_curr_code, inactive
FROM ".TB_PREF."bank_accounts";
array(
'format' => '_format_add_curr',
'select_submit'=> $submit_on_change,
+ 'spec_option' => $spec_option,
+ 'spec_id' => '',
'async' => false
) );
}
return !key_in_foreign_table($id, $tables, 'debtor_no');
}
+
+function get_customer_by_ref($reference)
+{
+ $sql = "SELECT * FROM ".TB_PREF."debtors_master WHERE debtor_ref=".db_escape($reference);
+
+ $result = db_query($sql, "could not get customer");
+
+ return db_fetch($result);
+}
+
?>
\ No newline at end of file