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
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 '';
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();";?>
});
}
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 "}";
+}
+?>
+
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',
+ });";
+}
+?>