diff --git a/htdocs/langs/en_US/cashdesk.lang b/htdocs/langs/en_US/cashdesk.lang
index a96f919e4f4..094c70ca687 100644
--- a/htdocs/langs/en_US/cashdesk.lang
+++ b/htdocs/langs/en_US/cashdesk.lang
@@ -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
diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php
index ab3b200df35..52df6df9b79 100644
--- a/htdocs/takepos/admin/setup.php
+++ b/htdocs/takepos/admin/setup.php
@@ -364,6 +364,13 @@ print '
';
print ajax_constantonoff("TAKEPOS_GIFT_RECEIPT", array(), $conf->entity, 0, 0, 1, 0);
print " | \n";
+// Delayed Pay Button
+print '| ';
+print $langs->trans('AllowDelayedPayment');
+print ' | ';
+print ajax_constantonoff("TAKEPOS_DELAYED_PAYMENT", array(), $conf->entity, 0, 0, 1, 0);
+print " |
\n";
+
// Numbering module
//print '| ';
//print $langs->trans("BillsNumberingModule");
diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php
index 350299814ec..d4274d90444 100644
--- a/htdocs/takepos/invoice.php
+++ b/htdocs/takepos/invoice.php
@@ -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) {
diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php
index 0f47c7f2b04..0a1c60a5a57 100644
--- a/htdocs/takepos/pay.php
+++ b/htdocs/takepos/pay.php
@@ -375,6 +375,10 @@ foreach ($action_buttons as $button) {
$newclass = $class.($button["class"] ? " ".$button["class"] : "");
print '';
}
+
+if ($conf->global->TAKEPOS_DELAYED_PAYMENT) {
+ print '';
+}
?>
|