Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 17.0

This commit is contained in:
Laurent Destailleur 2023-05-10 04:49:41 +02:00
commit 55f37063cf
7 changed files with 11 additions and 9 deletions

View File

@ -1419,6 +1419,7 @@ if ($object->id > 0) {
$sql .= ', f.total_tva';
$sql .= ', f.total_ttc';
$sql .= ', f.entity';
$sql .= ', f.date_lim_reglement as dl';
$sql .= ', f.datef as df, f.datec as dc, f.paye as paye, f.fk_statut as status';
$sql .= ', s.nom, s.rowid as socid';
$sql .= ', SUM(pf.amount) as am';

View File

@ -2251,9 +2251,9 @@ if ($action == 'create') {
}
if (empty($conf->global->PROPAL_SKIP_ACCEPT_REFUSE)) {
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('SetAcceptedRefused'), $text, 'confirm_closeas', $formquestion, '', 1, 250);
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('SetAcceptedRefused'), '', 'confirm_closeas', $formquestion, '', 1, 250);
} else {
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?statut=3&id=' . $object->id, $langs->trans('Close'), $text, 'confirm_closeas', $formquestion, '', 1, 250);
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?statut=3&id=' . $object->id, $langs->trans('Close'), '', 'confirm_closeas', $formquestion, '', 1, 250);
}
} elseif ($action == 'delete') {
// Confirm delete

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