cleanup2 according to Apmuthu's list.
authorJoe <unknown>
Wed, 21 Jan 2015 11:03:42 +0000 (12:03 +0100)
committerJoe <unknown>
Wed, 21 Jan 2015 11:03:42 +0000 (12:03 +0100)
includes/current_user.inc
reporting/rep111.php

index 8c754aec8f11091f835806537a75651fd9058b2d..87f71b1e45ce2a6c9ee10357bb4f3cc1ae4ee3c1 100644 (file)
@@ -486,9 +486,27 @@ function user_date_format()
 
 function user_date_display()
 {
-       global $SysPrefs;
-
-       return isset($_SESSION["wa_current_user"]) ? $_SESSION["wa_current_user"]->prefs->date_display() : $SysPrefs->dflt_date_sep;
+       $fmt ='m/d/Y';
+       if (isset($_SESSION["wa_current_user"])) {
+               $fmt = $_SESSION["wa_current_user"]->prefs->date_display();
+       } else {
+               $sep = user_date_sep();
+               $user_date_fmt = user_date_format();
+               switch ($user_date_fmt) {
+                       case 0:
+                       $fmt = "m".$sep."d".$sep."Y"; break;
+                       case 1:
+                       $fmt = "d".$sep."m".$sep."Y"; break;
+                       case 2:
+                       $fmt = "Y".$sep."m".$sep."d"; break;
+                       case 3:
+                       $fmt = "M".$sep."j".$sep."Y"; break;
+                       case 4:
+                       $fmt = "j".$sep."M".$sep."Y"; break;
+                       default:
+                       $fmt = "Y".$sep."M".$sep."j";
+               }
+       }
 }
 
 function user_date_sep()
index 4f3588b0be16f19dbc953ccdb9f5b1d180ae77d4..df2b2dbe7378606d0a823d95850fb43eeec08e40 100644 (file)
@@ -84,8 +84,8 @@ function print_sales_quotations()
                $rep->Info($params, $cols, null, $aligns);
 
                $contacts = get_branch_contacts($branch['branch_code'], 'order', $branch['debtor_no'], true);
-               $rep->SetHeaderType('Header2');
                $rep->SetCommonData($myrow, $branch, $myrow, $baccount, ST_SALESQUOTE, $contacts);
+               $rep->SetHeaderType('Header2');
                $rep->NewPage();
 
                $result = get_sales_order_details($i, ST_SALESQUOTE);