From 308dea92b31be946ff54512841bb680217b56d50 Mon Sep 17 00:00:00 2001 From: josemariagomezroncero Date: Mon, 10 Aug 2020 20:40:11 +0200 Subject: [PATCH 1/9] Bug, this option disable topic input. Bug, MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES disable topic input. We need the subject for email for save. --- htdocs/admin/mails_templates.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 0f490bb828a..3ac0a5df674 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', 'content', 'content_lines'); } foreach ($fieldsforcontent as $tmpfieldlist) { print ''; From 3be723f3a1b3e1852db9f6d7678c90a7f59e8bd5 Mon Sep 17 00:00:00 2001 From: "jove@bisquerra.com" Date: Tue, 11 Aug 2020 07:49:54 +0200 Subject: [PATCH 2/9] NEW: Delayed payment in TakePOS --- htdocs/langs/en_US/cashdesk.lang | 1 + htdocs/takepos/admin/setup.php | 7 +++++++ htdocs/takepos/invoice.php | 6 +++--- htdocs/takepos/pay.php | 4 ++++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/htdocs/langs/en_US/cashdesk.lang b/htdocs/langs/en_US/cashdesk.lang index 73d8bdaa0df..9d4856135ef 100644 --- a/htdocs/langs/en_US/cashdesk.lang +++ b/htdocs/langs/en_US/cashdesk.lang @@ -120,3 +120,4 @@ DefineTablePlan=Define tables plan GiftReceiptButton=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 22355c70d9d..82d31045897 100644 --- a/htdocs/takepos/admin/setup.php +++ b/htdocs/takepos/admin/setup.php @@ -372,6 +372,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 cfde72c9fd3..ce4219ab5cd 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,8 @@ 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); + if ($pay!="delayed") $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 ''; +} ?> From 134bd11f47843f2b184546c0cb061e3ef0c2ba21 Mon Sep 17 00:00:00 2001 From: josemariagomezroncero Date: Fri, 14 Aug 2020 21:19:51 +0200 Subject: [PATCH 3/9] Update mails_templates.php --- htdocs/admin/mails_templates.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 3ac0a5df674..02746653aba 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('topic', 'content', 'content_lines'); } +if (!empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) { $fieldsforcontent = array('topic', 'content', 'content_lines', 'joinfiles' ); } foreach ($fieldsforcontent as $tmpfieldlist) { print ''; From 7f540ac6f0c31a0105bb0cb980bb245197c73c1f Mon Sep 17 00:00:00 2001 From: "Abdessalam@MEGALOGI" Date: Tue, 18 Aug 2020 23:27:36 +0100 Subject: [PATCH 4/9] Passing $totalarray as a parameter to printFieldListFooter Hook's Sometimes, we need $totalarray to know nbfield or to display some vars in the footer of list. --- htdocs/expedition/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; From 1c6a062486486b1336c0d06f713127be2cf624be Mon Sep 17 00:00:00 2001 From: abichotte Date: Wed, 19 Aug 2020 11:24:32 +0200 Subject: [PATCH 5/9] FIX|fix #14502 fix to create a task for a project with api --- htdocs/projet/class/api_tasks.class.php | 3 ++- htdocs/projet/class/task.class.php | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) 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..89189802a15 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'); From 8057ccb2236fdebbcdb856f892223cc0732b4505 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 Aug 2020 14:13:30 +0200 Subject: [PATCH 6/9] Update task.class.php --- htdocs/projet/class/task.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 89189802a15..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=0; + public $fk_task_parent = 0; /** * @var string Label of task From f57f729d40801662972dcd6adfcb7d90b8aeb811 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 Aug 2020 14:35:15 +0200 Subject: [PATCH 7/9] Update invoice.php --- htdocs/takepos/invoice.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index ce4219ab5cd..ebfb5fa5c5f 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -249,8 +249,8 @@ if ($action == 'valid' && $user->rights->facture->creer) $payment->paiementid = $paiementid; $payment->num_payment = $invoice->ref; - if ($pay!="delayed") $payment->create($user); - if ($pay!="delayed") $payment->addPaymentToBank($user, 'payment', '(CustomerInvoicePayment)', $bankaccount, '', ''); + if ($pay != "delayed") $payment->create($user); + if ($pay != "delayed") $payment->addPaymentToBank($user, 'payment', '(CustomerInvoicePayment)', $bankaccount, '', ''); $remaintopay = $invoice->getRemainToPay(); // Recalculate remain to pay after the payment is recorded if ($remaintopay == 0) { From ea478721e7d59101c63408e10619a4a62459304e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 Aug 2020 14:36:03 +0200 Subject: [PATCH 8/9] Update invoice.php --- htdocs/takepos/invoice.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index ebfb5fa5c5f..7d645f0bd70 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -249,8 +249,10 @@ if ($action == 'valid' && $user->rights->facture->creer) $payment->paiementid = $paiementid; $payment->num_payment = $invoice->ref; - if ($pay != "delayed") $payment->create($user); - if ($pay != "delayed") $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) { From 4edf19026411377a0d1e42168fe693ed2e6a4067 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 Aug 2020 14:38:02 +0200 Subject: [PATCH 9/9] Update mails_templates.php --- htdocs/admin/mails_templates.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 02746653aba..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('topic', 'content', 'content_lines', 'joinfiles' ); } +if (!empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) { $fieldsforcontent = array('topic', 'joinfiles', 'content', 'content_lines'); } foreach ($fieldsforcontent as $tmpfieldlist) { print '';