From: Joe Date: Mon, 7 Aug 2023 14:45:51 +0000 (+0200) Subject: First fix of PHP 8.2 deprecated errors. Not seen with $go_debug = 0, but error.log... X-Git-Url: https://delta.frontaccounting.com/gitweb/?p=fa-stable.git;a=commitdiff_plain;h=7ad222595e84451daea8aaa06c83d817cc3c774c First fix of PHP 8.2 deprecated errors. Not seen with $go_debug = 0, but error.log was huge. --- diff --git a/includes/hooks.inc b/includes/hooks.inc index 6a158a76..63e1684c 100644 --- a/includes/hooks.inc +++ b/includes/hooks.inc @@ -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. // diff --git a/includes/prefs/userprefs.inc b/includes/prefs/userprefs.inc index 863dc1fa..24cd15c5 100644 --- a/includes/prefs/userprefs.inc +++ b/includes/prefs/userprefs.inc @@ -9,7 +9,8 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License here . ***********************************************************************/ -class user_prefs + +class user_prefs extends \stdClass { var $language; diff --git a/includes/ui/allocation_cart.inc b/includes/ui/allocation_cart.inc index 3491e35c..34f1784c 100644 --- a/includes/ui/allocation_cart.inc +++ b/includes/ui/allocation_cart.inc @@ -15,7 +15,7 @@ */ //----------------------------------------------------------------------------------- -class allocation +class allocation extends \stdClass { var $trans_no; diff --git a/includes/ui/attachment.inc b/includes/ui/attachment.inc index 3ecf0ad0..f6500daf 100644 --- a/includes/ui/attachment.inc +++ b/includes/ui/attachment.inc @@ -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; } diff --git a/includes/ui/contacts_view.inc b/includes/ui/contacts_view.inc index 23474adc..82c06342 100644 --- a/includes/ui/contacts_view.inc +++ b/includes/ui/contacts_view.inc @@ -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) ); diff --git a/purchasing/inquiry/supplier_inquiry.php b/purchasing/inquiry/supplier_inquiry.php index 02e6b665..38623220 100644 --- a/purchasing/inquiry/supplier_inquiry.php +++ b/purchasing/inquiry/supplier_inquiry.php @@ -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); } //------------------------------------------------------------------------------------------------ diff --git a/reporting/includes/class.graphic.inc b/reporting/includes/class.graphic.inc index 0a3591af..2e37b24d 100644 --- a/reporting/includes/class.graphic.inc +++ b/reporting/includes/class.graphic.inc @@ -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(); diff --git a/reporting/rep110.php b/reporting/rep110.php index cc0f1c10..5924f880 100644 --- a/reporting/rep110.php +++ b/reporting/rep110.php @@ -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); diff --git a/sales/includes/cart_class.inc b/sales/includes/cart_class.inc index f7e05815..11b2029d 100644 --- a/sales/includes/cart_class.inc +++ b/sales/includes/cart_class.inc @@ -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 diff --git a/sales/inquiry/customer_inquiry.php b/sales/inquiry/customer_inquiry.php index b14882f2..20bd88a7 100644 --- a/sales/inquiry/customer_inquiry.php +++ b/sales/inquiry/customer_inquiry.php @@ -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 "
" . _("CUSTOMER ACCOUNT IS ON HOLD") . "
"; } @@ -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(); }