Merge pull request #14456 from andreubisquerra/master

NEW: Delayed payment in TakePOS
This commit is contained in:
Laurent Destailleur 2020-08-19 14:36:34 +02:00 committed by GitHub
commit 25dfd32e0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 3 deletions

View File

@ -120,3 +120,4 @@ DefineTablePlan=Define tables plan
GiftReceiptButton=Add a "Gift receipt" button
GiftReceipt=Gift receipt
ModuleReceiptPrinterMustBeEnabled=Module Receipt printer must have been enabled first
AllowDelayedPayment=Allow delayed payment

View File

@ -364,6 +364,13 @@ print '<td colspan="2">';
print ajax_constantonoff("TAKEPOS_GIFT_RECEIPT", array(), $conf->entity, 0, 0, 1, 0);
print "</td></tr>\n";
// Delayed Pay Button
print '<tr class="oddeven"><td>';
print $langs->trans('AllowDelayedPayment');
print '<td colspan="2">';
print ajax_constantonoff("TAKEPOS_DELAYED_PAYMENT", array(), $conf->entity, 0, 0, 1, 0);
print "</td></tr>\n";
// Numbering module
//print '<tr class="oddeven"><td>';
//print $langs->trans("BillsNumberingModule");

View File

@ -156,7 +156,7 @@ if ($action == 'valid' && $user->rights->facture->creer)
}
}
if ($bankaccount <= 0) {
if ($bankaccount <= 0 && $pay != "delayed") {
$errormsg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BankAccount"));
$error++;
}
@ -249,8 +249,10 @@ if ($action == 'valid' && $user->rights->facture->creer)
$payment->paiementid = $paiementid;
$payment->num_payment = $invoice->ref;
$payment->create($user);
$payment->addPaymentToBank($user, 'payment', '(CustomerInvoicePayment)', $bankaccount, '', '');
if ($pay != "delayed") {
$payment->create($user);
$payment->addPaymentToBank($user, 'payment', '(CustomerInvoicePayment)', $bankaccount, '', '');
}
$remaintopay = $invoice->getRemainToPay(); // Recalculate remain to pay after the payment is recorded
if ($remaintopay == 0) {

View File

@ -375,6 +375,10 @@ foreach ($action_buttons as $button) {
$newclass = $class.($button["class"] ? " ".$button["class"] : "");
print '<button type="button" class="'.$newclass.'" onclick="'.$button["function"].'"><span '.$button["span"].'>'.$button["text"].'</span></button>';
}
if ($conf->global->TAKEPOS_DELAYED_PAYMENT) {
print '<button type="button" class="calcbutton2" onclick="Validate(\'delayed\');">'.$langs->trans("Reported").'</button>';
}
?>
</div>