diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php
index 0f490bb828a..9e2f443b5a6 100644
--- a/htdocs/admin/mails_templates.php
+++ b/htdocs/admin/mails_templates.php
@@ -540,7 +540,7 @@ print "";
// Show fields for topic, join files and body
$fieldsforcontent = array('topic', 'joinfiles', 'content');
-if (!empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) { $fieldsforcontent = array('content', 'content_lines'); }
+if (!empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) { $fieldsforcontent = array('topic', 'joinfiles', 'content', 'content_lines'); }
foreach ($fieldsforcontent as $tmpfieldlist)
{
print '
| ';
diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php
index 74efaaeb27a..b28bc7d062c 100644
--- a/htdocs/expedition/list.php
+++ b/htdocs/expedition/list.php
@@ -800,7 +800,7 @@ if ($resql)
}
$db->free($resql);
- $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
+ $parameters = array('arrayfields'=>$arrayfields, 'totalarray' => $totalarray, 'sql'=>$sql);
$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
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/projet/class/api_tasks.class.php b/htdocs/projet/class/api_tasks.class.php
index 084292d0727..8466fdc3bcb 100644
--- a/htdocs/projet/class/api_tasks.class.php
+++ b/htdocs/projet/class/api_tasks.class.php
@@ -35,7 +35,8 @@ class Tasks extends DolibarrApi
*/
static $FIELDS = array(
'ref',
- 'label'
+ 'label',
+ 'fk_project'
);
/**
diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php
index 10f5a36d67f..0d737dfea7f 100644
--- a/htdocs/projet/class/task.class.php
+++ b/htdocs/projet/class/task.class.php
@@ -62,7 +62,7 @@ class Task extends CommonObject
/**
* @var int ID parent task
*/
- public $fk_task_parent;
+ public $fk_task_parent = 0;
/**
* @var string Label of task
@@ -145,6 +145,9 @@ class Task extends CommonObject
{
global $conf, $langs;
+ //For the date
+ $now = dol_now();
+
$error = 0;
// Clean parameters
@@ -175,7 +178,7 @@ class Task extends CommonObject
$sql .= ", ".$this->fk_task_parent;
$sql .= ", '".$this->db->escape($this->label)."'";
$sql .= ", '".$this->db->escape($this->description)."'";
- $sql .= ", '".$this->db->idate($this->date_c)."'";
+ $sql .= ", '".$this->db->idate($now)."'";
$sql .= ", ".$user->id;
$sql .= ", ".($this->date_start != '' ? "'".$this->db->idate($this->date_start)."'" : 'null');
$sql .= ", ".($this->date_end != '' ? "'".$this->db->idate($this->date_end)."'" : 'null');
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 '';
+}
?>
|