From: Janusz Dobrowolski Date: Wed, 30 Jan 2013 12:01:42 +0000 (+0100) Subject: Added favicon to default theme, get_customer_by_ref() helper and a couple of cleanups. X-Git-Tag: 2.3-final~320 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=14175bfc95a7ffb1303494f7915931c9096a6898;hp=c4778ed550b246b7fb559a2f4c913b799352041f;p=fa-stable.git Added favicon to default theme, get_customer_by_ref() helper and a couple of cleanups. --- 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 00000000..26e232cf Binary files /dev/null and b/themes/default/images/favicon.png differ