Merge pull request #24665 from hregis/fix_takepos_php8

FIX avoid warnings php8
This commit is contained in:
Laurent Destailleur 2023-05-05 01:00:35 +02:00 committed by GitHub
commit a4bbbd485d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 7 deletions

View File

@ -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";

View File

@ -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';

View File

@ -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);
?>
<body>

View File

@ -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();";
}
}

View File

@ -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);