From 1ec763fc14f324ea1301fafefd00d3d72bf7b667 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 30 Dec 2020 21:22:54 +0100 Subject: [PATCH 1/7] FIX When creating a new POS sell, the creation date must be modified. --- htdocs/takepos/index.php | 7 ++++--- htdocs/takepos/invoice.php | 13 ++++--------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index d3fc6b7416a..4eeb9dcf9a7 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -448,7 +448,7 @@ function TakeposOrderNotes() { } function Refresh() { - console.log("Refresh"); + console.log("Refresh by reloading place="+place); $("#poslines").load("invoice.php?place="+place, function() { //$('#poslines').scrollTop($('#poslines')[0].scrollHeight); }); @@ -456,9 +456,10 @@ function Refresh() { function New() { // If we go here,it means $conf->global->TAKEPOS_BAR_RESTAURANT is not defined - console.log("New with place = , js place="+place); - invoiceid = $("#invoiceid").val(); + + console.log("New with place = , js place="+place+", invoiceid="+invoiceid); + $.getJSON('/takepos/ajax/ajax.php?action=getInvoice&id='+invoiceid, function(data) { var r; diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 493202376a9..0bc6087409d 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -395,16 +395,9 @@ if ($action == "deleteline") { } } +// Action to delete or discard an invoice if ($action == "delete") { // $placeid is the invoice id (it differs from place) and is defined if the place is set and the ref of invoice is '(PROV-POS'.$_SESSION["takeposterminal"].'-'.$place.')', so the fetch at begining of page works. - - /*$reg = array(); - if (preg_match('/^(\d+)-(\d+)$/', $place, $reg)) { - - $place = $reg[1]; - var_dump($place); - }*/ - if ($placeid > 0) { $result = $invoice->fetch($placeid); @@ -422,7 +415,9 @@ if ($action == "delete") { } } - $sql = "UPDATE ".MAIN_DB_PREFIX."facture set fk_soc=".$conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"]}; + $sql = "UPDATE ".MAIN_DB_PREFIX."facture"; + $sql .= " SET fk_soc=".$conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"]}.", "; + $sql .= " datec = '".$db->idate(dol_now())."'"; $sql .= " WHERE ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'"; $resql1 = $db->query($sql); From 6ef7d3db79b3eda90d89cedb980c6cc50e374750 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 30 Dec 2020 21:43:04 +0100 Subject: [PATCH 2/7] FIX Dates of sales start in TakePOS --- htdocs/langs/en_US/cashdesk.lang | 1 + htdocs/takepos/index.php | 2 +- htdocs/takepos/invoice.php | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/langs/en_US/cashdesk.lang b/htdocs/langs/en_US/cashdesk.lang index 8e529fe92f2..bb433583797 100644 --- a/htdocs/langs/en_US/cashdesk.lang +++ b/htdocs/langs/en_US/cashdesk.lang @@ -99,6 +99,7 @@ CashDeskRefNumberingModules=Numbering module for POS sales CashDeskGenericMaskCodes6 =
{TN} tag is used to add the terminal number TakeposGroupSameProduct=Group same products lines StartAParallelSale=Start a new parallel sale +SaleStartedAt=Sale started at %s ControlCashOpening=Control cash desk at opening POS CloseCashFence=Close cash desk control CashReport=Cash report diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index ef6ca77722a..5e75749dc00 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -832,7 +832,7 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) {