From 091f5ab23be0c6d96e815b6fa0990130404d997d Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sun, 8 Aug 2021 19:12:45 +0200 Subject: [PATCH 1/5] Customer Display Lang --- htdocs/langs/en_US/cashdesk.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/cashdesk.lang b/htdocs/langs/en_US/cashdesk.lang index 86fdfd753a5..3b2d704a453 100644 --- a/htdocs/langs/en_US/cashdesk.lang +++ b/htdocs/langs/en_US/cashdesk.lang @@ -128,3 +128,4 @@ PrintPaymentMethodOnReceipts=Print payment method on tickets|receipts WeighingScale=Weighing scale ShowPriceHT = Display the column with the price excluding tax (on screen) ShowPriceHTOnReceipt = Display the column with the price excluding tax (on the receipt) +CustomerDisplay=Customer display From 49b53e04f4b0db61d5befd5b39597430f849fa35 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sun, 8 Aug 2021 19:13:31 +0200 Subject: [PATCH 2/5] Customer Display total on pay --- htdocs/takepos/pay.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index ba8ac8f82f7..773118e670f 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -255,6 +255,20 @@ if ($conf->global->TAKEPOS_NUMPAD == 0) { }); }, 2500); } + +global->TAKEPOS_CUSTOMER_DISPLAY)) { + echo "var line1='".$langs->trans('TotalTTC')."'.substring(0,20);"; + echo "line1=line1.padEnd(20);"; + echo "var line2='".price($invoice->total_ttc, 1, '', 1, -1, -1)."'.substring(0,20);"; + echo "line2=line2.padEnd(20);"; + echo "$.ajax({ + type: 'GET', + data: { text: line1+line2 }, + url: '".getDolGlobalString('TAKEPOS_PRINT_SERVER')."/display/index.php', + });"; +} +?>
From bae5b397069f00e549f8c42b420910d2296ce38e Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sun, 8 Aug 2021 19:14:28 +0200 Subject: [PATCH 3/5] Customer display on click product --- htdocs/takepos/invoice.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 721a7b92ae8..5526a5607d1 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -550,6 +550,10 @@ if ($action == "addline") { if ($idoflineadded <= 0) { $invoice->fetch_thirdparty(); $idoflineadded = $invoice->addline($prod->description, $price, 1, $tva_tx, $localtax1_tx, $localtax2_tx, $idproduct, $customer->remise_percent, '', 0, 0, 0, '', $price_base_type, $price_ttc, $prod->type, -1, 0, '', 0, $parent_line, null, '', '', 0, 100, '', null, 0); + if (!empty($conf->global->TAKEPOS_CUSTOMER_DISPLAY)) { + $CUSTOMER_DISPLAY_line1 = $prod->label; + $CUSTOMER_DISPLAY_line2 = price($price_ttc); + } } $invoice->fetch($placeid); @@ -1176,6 +1180,23 @@ $( document ).ready(function() { }); + +global->TAKEPOS_CUSTOMER_DISPLAY)) { + echo "function CustomerDisplay(){"; + echo "var line1='".$CUSTOMER_DISPLAY_line1."'.substring(0,20);"; + echo "line1=line1.padEnd(20);"; + echo "var line2='".$CUSTOMER_DISPLAY_line2."'.substring(0,20);"; + echo "line2=line2.padEnd(20);"; + echo "$.ajax({ + type: 'GET', + data: { text: line1+line2 }, + url: '".getDolGlobalString('TAKEPOS_PRINT_SERVER')."/display/index.php', + });"; + echo "}"; +} +?> + Date: Sun, 8 Aug 2021 19:15:18 +0200 Subject: [PATCH 4/5] Customer display on addline --- htdocs/takepos/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index e7b8b8af438..d11a081280c 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -434,7 +434,7 @@ function ClickProduct(position) { if (idproduct=="") return; // Call page invoice.php to generate the section with product lines $("#poslines").load("invoice.php?action=addline&place="+place+"&idproduct="+idproduct+"&selectedline="+selectedline, function() { - //$('#poslines').scrollTop($('#poslines')[0].scrollHeight); + global->TAKEPOS_CUSTOMER_DISPLAY)) echo "CustomerDisplay();";?> }); } From ea531a4c88c89fbd16f0eeb706a64afec2a50f64 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sun, 8 Aug 2021 19:16:11 +0200 Subject: [PATCH 5/5] Customer display settings --- htdocs/takepos/admin/receipt.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htdocs/takepos/admin/receipt.php b/htdocs/takepos/admin/receipt.php index 9b236fc837a..74a54400fef 100644 --- a/htdocs/takepos/admin/receipt.php +++ b/htdocs/takepos/admin/receipt.php @@ -254,6 +254,14 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector" && filter_var($con print "\n"; } +if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector" && filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) { + print ''; + print $langs->trans('CustomerDisplay'); + print ''; + print ajax_constantonoff("TAKEPOS_CUSTOMER_DISPLAY", array(), $conf->entity, 0, 0, 1, 0); + print "\n"; +} + print ''; print '
';