Merge pull request #14456 from andreubisquerra/master
NEW: Delayed payment in TakePOS
This commit is contained in:
commit
25dfd32e0b
@ -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
|
||||
|
||||
@ -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");
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user