Added favicon to default theme, get_customer_by_ref() helper and a couple of cleanups.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Wed, 30 Jan 2013 12:01:42 +0000 (13:01 +0100)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Wed, 30 Jan 2013 12:01:42 +0000 (13:01 +0100)
access/login.php
gl/includes/db/gl_db_bank_accounts.inc
includes/date_functions.inc
includes/ui/ui_lists.inc
sales/includes/db/customers_db.inc
themes/default/images/favicon.png [new file with mode: 0644]

index 9984e0a6cf72894d90a6e0c06207d092a3bdd450..00b74403bfdf3813d29b6cbcb58480a35832d4bf 100644 (file)
@@ -56,6 +56,7 @@ function defaultCompany()
        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)
        {
index 1669d20005656ccff82c445f0f24dd4881870ea7..d668dd7024f809ad8a598288bc4fedddab43f0ab 100644 (file)
@@ -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 
index 2c99d059ae788fc439b6e678bb142799e012851e..96ecb31bcdcf2967a2e90c6cb4173410f1da88bb 100644 (file)
@@ -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 */
index d2be5fab97aec7eebcf1a62c3218e4d348e14f2a..596144e174809e4bc8b7b55ffb7dd160c18e779e 100644 (file)
@@ -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
        ) );
 }
index b1f834336da10aeeff204fed7f3ab3a1c44b3374..36db9e1a93b453196facf1964841f61629ce7195 100644 (file)
@@ -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 (file)
index 0000000..26e232c
Binary files /dev/null and b/themes/default/images/favicon.png differ