First fix of PHP 8.2 deprecated errors. Not seen with $go_debug = 0, but error.log...
authorJoe <joe.hunt.consulting@gmail.com>
Mon, 7 Aug 2023 14:45:51 +0000 (16:45 +0200)
committerJoe <joe.hunt.consulting@gmail.com>
Mon, 7 Aug 2023 14:45:51 +0000 (16:45 +0200)
includes/hooks.inc
includes/prefs/userprefs.inc
includes/ui/allocation_cart.inc
includes/ui/attachment.inc
includes/ui/contacts_view.inc
purchasing/inquiry/supplier_inquiry.php
reporting/includes/class.graphic.inc
reporting/rep110.php
sales/includes/cart_class.inc
sales/inquiry/customer_inquiry.php

index 6a158a762e266a7536f07ce26bcd9069a3639818..63e1684ce853f990eef9ca71866da04d5ee384d1 100644 (file)
@@ -18,7 +18,7 @@
 //
 // To find how various hooks are processed look into respective hook_* functions below.
 //
-class hooks {
+class hooks extends \stdClass {
        var $module_name; // extension module name.
 
        // 
index 863dc1fab05f8a74a8583aef68e9e4a8ddba3bf6..24cd15c5cca9dbdc353025230122916ae284a341 100644 (file)
@@ -9,7 +9,8 @@
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
     See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
 ***********************************************************************/
-class user_prefs 
+
+class user_prefs extends \stdClass
 {
 
        var $language;
index 3491e35c972e3a8be0eb72527d9e4df853a6d96a..34f1784c85155111a31037ad2ca3229dda3176e4 100644 (file)
@@ -15,7 +15,7 @@
 */
 //-----------------------------------------------------------------------------------
 
-class allocation 
+class allocation extends \stdClass
 {
 
        var $trans_no; 
index 3ecf0ad0339ae6d8b72262054802eeb52e200bf9..f6500dafba2ecf01a2cfb8fa2caecf90ac3cc966 100644 (file)
@@ -24,7 +24,7 @@ class attachments extends simple_crud {
                $fields = array('type_no', 'trans_no','description','filename','tran_date' => 'date');
                parent::__construct($name, $fields);
                $this->class = $class;
-               $this->subclass = $subclass;
+               $this->sub_class = $subclass;
                $this->entity = $id;
                
        }
index 23474adc9e32aca2d66b90f06189569d24a13f87..82c06342d168ea39689408aa1260d7c32a170d37 100644 (file)
@@ -27,14 +27,14 @@ class contacts extends simple_crud {
 
                parent::__construct($name, $fields);
                $this->class = $class;
-               $this->subclass = $subclass;
+               $this->sub_class = $subclass;
                $this->entity = $id;
        }
 
        function list_view() {
                br();
 
-                       $contacts = get_crm_persons($this->class, $this->subclass, $this->entity);
+                       $contacts = get_crm_persons($this->class, $this->sub_class, $this->entity);
                        start_table(TABLESTYLE, "width='80%'");
 
                        $th = array(_('Assignment'), _("Reference"), _("Full Name"), _("Phone"), _("Sec Phone"), _("Fax"),
@@ -91,7 +91,7 @@ class contacts extends simple_crud {
                text_row(_("Reference:"), 'ref', @$this->data['ref'], 35, 40);
 
                crm_category_types_list_row(_("Contact active for:"), 'assgn', @$this->data['contacts'],
-                       array('subclass' => @$this->subclass,
+                       array('subclass' => @$this->sub_class,
                                'class' => @$this->class, 
                                'multi' =>true)
                                );
index 02e6b665b0c7b75215ff6db551dfff584b63a5d1..38623220f10118995272f9859b99c9470e33d6f9 100644 (file)
@@ -51,15 +51,18 @@ function display_supplier_summary($supplier_record)
        $pastdue1, $pastdue2, _("Total Balance"));
 
        table_header($th);
-    start_row();
-       label_cell($supplier_record["curr_code"]);
-    label_cell($supplier_record["terms"]);
-    amount_cell($supplier_record["Balance"] - $supplier_record["Due"]);
-    amount_cell($supplier_record["Due"] - $supplier_record["Overdue1"]);
-    amount_cell($supplier_record["Overdue1"] - $supplier_record["Overdue2"]);
-    amount_cell($supplier_record["Overdue2"]);
-    amount_cell($supplier_record["Balance"]);
-    end_row();
+       if ($supplier_record != false)
+       {
+           start_row();
+               label_cell($supplier_record["curr_code"]);
+           label_cell($supplier_record["terms"]);
+           amount_cell($supplier_record["Balance"] - $supplier_record["Due"]);
+           amount_cell($supplier_record["Due"] - $supplier_record["Overdue1"]);
+           amount_cell($supplier_record["Overdue1"] - $supplier_record["Overdue2"]);
+           amount_cell($supplier_record["Overdue2"]);
+           amount_cell($supplier_record["Balance"]);
+           end_row();
+       }
     end_table(1);
 }
 //------------------------------------------------------------------------------------------------
index 0a3591afa575d97923d8d4796669d70aa76c16a4..2e37b24df241db5c3eb2b117b20a1e6f4c6ae29f 100644 (file)
@@ -60,7 +60,7 @@ file for later presentation.
        Joe Hunt
 */
 define('MAXLEN', 27); // we cut after 25 chars + ...
-class Chart 
+class Chart extends \stdClass
 {
        var $id;
        var $labels = array();
index cc0f1c10b18b0ff01cdd43661820fd93e9f81cf6..5924f88075c9652b5f3b58ba2beadb8ad5b061de 100644 (file)
@@ -92,7 +92,7 @@ function print_deliveries()
                                        $rep->filename = "Packing_slip" . $myrow['reference'] . ".pdf";
                                }
                        }
-                       $rep->currency = $cur;
+                       $rep->currency = ($cur == null ? "USD" : $cur);
                        $rep->Font();
                        $rep->Info($params, $cols, null, $aligns);
 
index f7e05815c285efc2185f7a336e75d07c05ff97c5..11b2029dc5a296b64cb0de748d27d345d58feeb7 100644 (file)
@@ -21,7 +21,7 @@ iv)  a delivery note
 include_once($path_to_root . "/inventory/includes/inventory_db.inc");
 include_once($path_to_root . "/taxes/tax_calc.inc");
 
-class Cart
+class Cart extends \stdClass
 {
        var $trans_type; // invoice, order, quotation, delivery note ...
        var $trans_no = array();// array (num1=>ver1,..) or 0 for new
index b14882f2951e8396897347e82c34cbd820326078..20bd88a70b3ac9d78a2b3a5220eba72dde8b72a1 100644 (file)
@@ -113,7 +113,7 @@ function display_customer_summary($customer_record)
 {
        $past1 = get_company_pref('past_due_days');
        $past2 = 2 * $past1;
-    if ($customer_record["dissallow_invoices"] != 0)
+    if ($customer_record && $customer_record["dissallow_invoices"] != 0)
     {
        echo "<center><font color=red size=4><b>" . _("CUSTOMER ACCOUNT IS ON HOLD") . "</font></b></center>";
     }
@@ -126,16 +126,18 @@ function display_customer_summary($customer_record)
     $th = array(_("Currency"), _("Terms"), _("Current"), $nowdue,
        $pastdue1, $pastdue2, _("Total Balance"));
     table_header($th);
-
-       start_row();
-    label_cell($customer_record["curr_code"]);
-    label_cell($customer_record["terms"]);
-       amount_cell($customer_record["Balance"] - $customer_record["Due"]);
-       amount_cell($customer_record["Due"] - $customer_record["Overdue1"]);
-       amount_cell($customer_record["Overdue1"] - $customer_record["Overdue2"]);
-       amount_cell($customer_record["Overdue2"]);
-       amount_cell($customer_record["Balance"]);
-       end_row();
+    if ($customer_record != false)
+    {
+               start_row();
+           label_cell($customer_record["curr_code"]);
+           label_cell($customer_record["terms"]);
+               amount_cell($customer_record["Balance"] - $customer_record["Due"]);
+               amount_cell($customer_record["Due"] - $customer_record["Overdue1"]);
+               amount_cell($customer_record["Overdue1"] - $customer_record["Overdue2"]);
+               amount_cell($customer_record["Overdue2"]);
+               amount_cell($customer_record["Balance"]);
+               end_row();
+       }
 
        end_table();
 }