Merge pull request #18360 from andreubisquerra/develop

NEW Customer Display with TakePOS
This commit is contained in:
Laurent Destailleur 2021-08-11 20:00:36 +02:00 committed by GitHub
commit 8e9d0a567a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 45 additions and 1 deletions

View File

@ -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

View File

@ -254,6 +254,14 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector" && filter_var($con
print "</td></tr>\n";
}
if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector" && filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) {
print '<tr class="oddeven"><td>';
print $langs->trans('CustomerDisplay');
print '<td colspan="2">';
print ajax_constantonoff("TAKEPOS_CUSTOMER_DISPLAY", array(), $conf->entity, 0, 0, 1, 0);
print "</td></tr>\n";
}
print '</table>';
print '</div>';

View File

@ -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);
<?php if (!empty($conf->global->TAKEPOS_CUSTOMER_DISPLAY)) echo "CustomerDisplay();";?>
});
}

View File

@ -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() {
});
<?php
if (!empty($conf->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 "}";
}
?>
</script>
<?php

View File

@ -255,6 +255,20 @@ if ($conf->global->TAKEPOS_NUMPAD == 0) {
});
}, 2500);
}
<?php
if (!empty($conf->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',
});";
}
?>
</script>
<div style="position:relative; padding-top: 20px; left:5%; height:150px; width:90%;">