From 14175bfc95a7ffb1303494f7915931c9096a6898 Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Wed, 30 Jan 2013 13:01:42 +0100 Subject: [PATCH] Added favicon to default theme, get_customer_by_ref() helper and a couple of cleanups. --- access/login.php | 1 + gl/includes/db/gl_db_bank_accounts.inc | 2 +- includes/date_functions.inc | 4 ++-- includes/ui/ui_lists.inc | 4 +++- sales/includes/db/customers_db.inc | 10 ++++++++++ themes/default/images/favicon.png | Bin 0 -> 885 bytes 6 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 themes/default/images/favicon.png diff --git a/access/login.php b/access/login.php index 9984e0a6..00b74403 100644 --- a/access/login.php +++ b/access/login.php @@ -56,6 +56,7 @@ function defaultCompany() echo "$title\n"; echo "\n"; echo " \n"; + echo " \n"; send_scripts(); if (!$login_timeout) { diff --git a/gl/includes/db/gl_db_bank_accounts.inc b/gl/includes/db/gl_db_bank_accounts.inc index 1669d200..d668dd70 100644 --- a/gl/includes/db/gl_db_bank_accounts.inc +++ b/gl/includes/db/gl_db_bank_accounts.inc @@ -76,7 +76,7 @@ function get_bank_account($id) //--------------------------------------------------------------------------------------------- -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 diff --git a/includes/date_functions.inc b/includes/date_functions.inc index 2c99d059..96ecb31b 100644 --- a/includes/date_functions.inc +++ b/includes/date_functions.inc @@ -344,8 +344,6 @@ function sql2date($date_) 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 - @@ -355,6 +353,8 @@ function sql2date($date_) { list($year, $month, $day) = explode("-", $date_); } + if (!isset($day)) // data format error + return ""; if (strlen($day) > 4) { /*chop off the time stuff */ diff --git a/includes/ui/ui_lists.inc b/includes/ui/ui_lists.inc index d2be5fab..596144e1 100644 --- a/includes/ui/ui_lists.inc +++ b/includes/ui/ui_lists.inc @@ -1409,7 +1409,7 @@ function workcenter_list_row($label, $name, $selected_id=null, $all_option=false //----------------------------------------------------------------------------------------------- -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"; @@ -1418,6 +1418,8 @@ function bank_accounts_list($name, $selected_id=null, $submit_on_change=false) array( 'format' => '_format_add_curr', 'select_submit'=> $submit_on_change, + 'spec_option' => $spec_option, + 'spec_id' => '', 'async' => false ) ); } diff --git a/sales/includes/db/customers_db.inc b/sales/includes/db/customers_db.inc index b1f83433..36db9e1a 100644 --- a/sales/includes/db/customers_db.inc +++ b/sales/includes/db/customers_db.inc @@ -177,4 +177,14 @@ function is_new_customer($id) 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 diff --git a/themes/default/images/favicon.png b/themes/default/images/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..26e232cf1271ed3aae979bcaea508579b7f008f5 GIT binary patch literal 885 zcmV-*1B(2KP)Px#32;bRa{vG$ng9SIngPDu`zinc00(qQO+^RY0UirB9SNPj000032T4RhR9M69 zS6xU`VHkeS&er@LV!A(3ENj}28@sTY;bkUPLl9w3a@UG~Y$?oEaU`U28rv)Aj;Amkz8y3t}C! zQ2j7*`}^-oeE1G>3k+LRR(*VaydUGWCH&G*XYK*9uzr=KL%BK+5|3JBF*Sf^|Fjxj;9uX#N(Z1`H{}ba)J^(z0O_hOcS!0IT6GI3Q(Hjg<&f>_Bvyj$a`XyIoLI{U|Wh za%Xayg6g{oLa%#OMYeC9u=Te?cK9^^d7!TT;vWLh%sf|s{PlRoIt_DODUwf?f)J4F z0zd>i6|-Is1}o0NKG3zMYR*2DO=cwH_Ma*INj1)G0H|2=@8`jHamrO2O100000 LNkvXXu0mjfhg6bc literal 0 HcmV?d00001 -- 2.30.2