From 984e302813d013f8b36522644d067d66f3d56e94 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 2 May 2023 16:05:28 +0200 Subject: [PATCH] FIX avoid warnings php8 --- htdocs/compta/cashcontrol/cashcontrol_card.php | 4 ++-- htdocs/compta/facture/list.php | 3 ++- htdocs/takepos/freezone.php | 2 +- htdocs/takepos/index.php | 2 +- htdocs/takepos/split.php | 4 ++-- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/htdocs/compta/cashcontrol/cashcontrol_card.php b/htdocs/compta/cashcontrol/cashcontrol_card.php index dfc8564b34c..5f481da2ba5 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_card.php +++ b/htdocs/compta/cashcontrol/cashcontrol_card.php @@ -295,7 +295,7 @@ if ($action == "create" || $action == "start" || $action == 'close') { } } - if ($terminalid != '') { + if (isset($terminalid) && $terminalid != '') { // Calculate $initialbalanceforterminal for terminal 0 foreach ($arrayofpaymentmode as $key => $val) { if ($key != 'cash') { @@ -305,7 +305,7 @@ if ($action == "create" || $action == "start" || $action == 'close') { // Get the bank account dedicated to this point of sale module/terminal $vartouse = 'CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse; - $bankid = $conf->global->$vartouse; + $bankid = getDolGlobalInt($vartouse); if ($bankid > 0) { $sql = "SELECT SUM(amount) as total FROM ".MAIN_DB_PREFIX."bank"; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 3de67f73acf..335330cd8e2 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -1185,6 +1185,7 @@ if ($resql) { $massactionbutton = $form->selectMassAction('', $arrayofmassactions); // Show the new button only when this page is not opend from the Extended POS + $newcardbutton = ''; if ($contextpage != 'poslist') { $url = DOL_URL_ROOT.'/compta/facture/card.php?action=create'; if (!empty($socid)) { @@ -2548,7 +2549,7 @@ if ($resql) { } // Use correct digits number for totals - $totalarray['val']['total_margin'] = price2num($totalarray['val']['total_margin'], 'MT'); + $totalarray['val']['total_margin'] = (isset($totalarray['val']['total_margin']) ? price2num($totalarray['val']['total_margin'], 'MT') : null); // Show total line include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; diff --git a/htdocs/takepos/freezone.php b/htdocs/takepos/freezone.php index e1b24ec286d..6d540f30aa8 100644 --- a/htdocs/takepos/freezone.php +++ b/htdocs/takepos/freezone.php @@ -84,7 +84,7 @@ $vatRateDefault = get_default_tva($mysoc, $soc); $arrayofcss = array('/takepos/css/pos.css.php'); $arrayofjs = array(); -top_htmlhead($head, '', 0, 0, $arrayofjs, $arrayofcss); +top_htmlhead('', '', 0, 0, $arrayofjs, $arrayofcss); ?> diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index dc2bd8b684a..4ae532010e5 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -936,7 +936,7 @@ $( document ).ready(function() { if ($resql) { $obj = $db->fetch_object($resql); // If there is no cash control from today open it - if ($obj->rowid == null) { + if (!isset($obj->rowid) || is_null($obj->rowid)) { print "ControlCashOpening();"; } } diff --git a/htdocs/takepos/split.php b/htdocs/takepos/split.php index 0391e911ba5..239b23f389d 100644 --- a/htdocs/takepos/split.php +++ b/htdocs/takepos/split.php @@ -125,7 +125,7 @@ if ($action=="split") { */ $invoice = new Facture($db); -if ($invoiceid > 0) { +if (isset($invoiceid) && $invoiceid > 0) { $invoice->fetch($invoiceid); } else { $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'"; @@ -134,7 +134,7 @@ if ($invoiceid > 0) { if ($obj) { $invoiceid = $obj->rowid; } - if (!$invoiceid) { + if (!isset($invoiceid)) { $invoiceid = 0; // Invoice does not exist yet } else { $invoice->fetch($invoiceid);