diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php index 34da6f7d34e..9132cc4b4d1 100644 --- a/htdocs/admin/limits.php +++ b/htdocs/admin/limits.php @@ -299,7 +299,7 @@ if (empty($mysoc->country_code)) print ''.$langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU'); print " x ".$langs->trans("Quantity").": ".$qty; print " - ".$langs->trans("VAT").": ".$vat.'%'; - print '   ->   '.$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."
\n"; + print '   ->   '.$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."
\n"; $s = 10 / 3; $qty = 2; $vat = 10; $tmparray = calcul_price_total($qty, price2num($s, 'MU'), 0, $vat, -1, -1, 0, 'HT', 0, 0, $mysoc, $localtax_array); diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 5e75749dc00..ec012a8ddcd 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -167,6 +167,7 @@ var pageactions=0; var place=""; var editaction="qty"; var editnumber=""; +var invoiceid=0; /* var app = this; @@ -483,8 +484,8 @@ function TakeposOrderNotes() { } function Refresh() { - console.log("Refresh by reloading place="+place); - $("#poslines").load("invoice.php?place="+place, function() { + console.log("Refresh by reloading place="+place+" invoiceid="+invoiceid); + $("#poslines").load("invoice.php?place="+place+"&invoiceid="+invoiceid, function() { //$('#poslines').scrollTop($('#poslines')[0].scrollHeight); }); } diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index f8bbabf20c2..33c00190655 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -1000,7 +1000,7 @@ function CreditNote() { $( document ).ready(function() { - console.log("Set customer info and sales in header"); + console.log("Set customer info and sales in header placeid= status=statut; ?>"); trans("Customer"); @@ -1015,7 +1015,16 @@ $( document ).ready(function() { global->TAKEPOS_CAN_EDIT_IF_ALREADY_VALIDATED)) { + // By default, only invoices with a ref not already defined can in list of open invoice we can edit. + $sql .= " WHERE ref LIKE '(PROV-POS".$db->escape($_SESSION["takeposterminal"])."-0%' AND entity IN (".getEntity('invoice').")"; + } else { + // If TAKEPOS_CAN_EDIT_IF_ALREADY_VALIDATED set, we show also draft invoice that already has a reference defined + $sql .= " WHERE pos_source = '".$db->escape($_SESSION["takeposterminal"])."'"; + $sql .= " AND module_source = 'takepos'"; + $sql .= " AND entity IN (".getEntity('invoice').")"; + } + $sql .= $db->order('datec', 'ASC'); $resql = $db->query($sql); if ($resql) { @@ -1025,7 +1034,9 @@ $( document ).ready(function() { $num_sale = str_replace(")", "", str_replace("(PROV-POS".$_SESSION["takeposterminal"]."-", "", $obj->ref)); echo $num_sale; if (str_replace("-", "", $num_sale) > $max_sale) $max_sale = str_replace("-", "", $num_sale); - echo '\\\';Refresh();">'; + echo '\\\'; invoiceid=\\\''; + echo $obj->rowid; + echo '\\\'; Refresh();">'; if ($placeid == $obj->rowid) echo ""; echo dol_print_date($db->jdate($obj->datec), '%H:%M', 'tzuser'); if ($placeid == $obj->rowid) echo ""; @@ -1033,7 +1044,7 @@ $( document ).ready(function() { } echo '$("#customerandsales").append(\'\');'; + echo '\\\'; invoiceid=0; Refresh();">\');'; } else { dol_print_error($db); }