From 37401df1062f509adc93321a8484af23b4532858 Mon Sep 17 00:00:00 2001 From: Laurent Dinclaux Date: Wed, 8 Jul 2020 14:48:34 +1100 Subject: [PATCH 01/29] Improve printStdColumnContent by passing the $pdf object. It isn't possible to replace the pdf edition done by this method without the $pdf object. --- htdocs/core/class/commondocgenerator.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 72d45f2467c..a8d5fac0c3c 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -1082,7 +1082,8 @@ abstract class CommonDocGenerator $parameters = array( 'curY' => &$curY, 'columnText' => $columnText, - 'colKey' => $colKey + 'colKey' => $colKey, + 'pdf' => $pdf, ); $reshook = $hookmanager->executeHooks('printStdColumnContent', $parameters, $this); // Note that $action and $object may have been modified by hook if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); From 1bc1fd4cb4323fc7d658dd7e989d73fe72e26eb9 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Wed, 15 Jul 2020 11:24:11 +0200 Subject: [PATCH 02/29] Fix date in supplier price log tooltip. --- htdocs/fourn/class/fournisseur.product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index f9dcdbeee6a..994b2e662d8 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -1008,7 +1008,7 @@ class ProductFournisseur extends Product //$out .= ''.$langs->trans("QtyMin").''; $out .= ''.$langs->trans("User").''; foreach ($productFournLogList as $productFournLog) { - $out .= ''.dol_print_date($this->db->jdate($productFournLog['datec']), 'dayhour', 'tzuser').''; + $out .= ''.dol_print_date($this->db->idate($productFournLog['datec']), 'dayhour', 'tzuser').''; $out .= ''.price($productFournLog['price']).''; //$out.= ''.$productFournLog['quantity'].''; $out .= ''.$productFournLog['lastname'].''; From c2030a7db56204eb27aec367ea4d46f32c287c11 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Sun, 19 Jul 2020 09:43:15 +0200 Subject: [PATCH 03/29] jdate already in function listProductFournisseurPriceLog So no conversion needed. --- htdocs/fourn/class/fournisseur.product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 994b2e662d8..d6da85cf2ae 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -1008,7 +1008,7 @@ class ProductFournisseur extends Product //$out .= ''.$langs->trans("QtyMin").''; $out .= ''.$langs->trans("User").''; foreach ($productFournLogList as $productFournLog) { - $out .= ''.dol_print_date($this->db->idate($productFournLog['datec']), 'dayhour', 'tzuser').''; + $out .= ''.dol_print_date($productFournLog['datec'], 'dayhour', 'tzuser').''; $out .= ''.price($productFournLog['price']).''; //$out.= ''.$productFournLog['quantity'].''; $out .= ''.$productFournLog['lastname'].''; From 3cdabbaafff7c338aa5e7bce3e5dcda90c1eeae1 Mon Sep 17 00:00:00 2001 From: Laurent Dinclaux Date: Sun, 19 Jul 2020 21:53:06 +1100 Subject: [PATCH 04/29] Explicitly pass the pdf object by reference in the printStdColumnContent hook call. --- htdocs/core/class/commondocgenerator.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index a8d5fac0c3c..f66430e30a2 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -1083,7 +1083,7 @@ abstract class CommonDocGenerator 'curY' => &$curY, 'columnText' => $columnText, 'colKey' => $colKey, - 'pdf' => $pdf, + 'pdf' => &$pdf, ); $reshook = $hookmanager->executeHooks('printStdColumnContent', $parameters, $this); // Note that $action and $object may have been modified by hook if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); From 55298317e389bb7e87796c608d64666b4197203c Mon Sep 17 00:00:00 2001 From: VERDOL Gauthier Date: Mon, 20 Jul 2020 16:22:48 +0200 Subject: [PATCH 05/29] FIX : wrong link to third invoice templates --- htdocs/comm/card.php | 2 +- htdocs/compta/facture/invoicetemplate_list.php | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 9130efabeeb..37c19525afa 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -1065,7 +1065,7 @@ if ($object->id > 0) print ''; print ''; - print ''; print ''; print ''; + print ' '.$langs->trans("By").' '.$muser->getFullName($langs).''; print ''; @@ -223,7 +226,9 @@ if ($id > 0 || $ref) $result = $acc->fetch($conf->global->PRELEVEMENT_ID_BANKACCOUNT); print ''; print ''; print '
'; + print ''; print ''; } diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 661f9604500..c030d0d5464 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -53,6 +53,8 @@ $cancel = GETPOST('cancel', 'alpha'); $toselect = GETPOST('toselect', 'array'); $contextpage= GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'invoicetemplatelist'; // To manage different context of search +$socid = GETPOST('socid', 'int'); + // Security check $id=(GETPOST('facid', 'int')?GETPOST('facid', 'int'):GETPOST('id', 'int')); $lineid=GETPOST('lineid', 'int'); @@ -141,6 +143,11 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab } } +if ($socid > 0) { + $tmpthirdparty = new Societe($db); + $res = $tmpthirdparty->fetch($socid); + if ($res > 0) $search_societe = $tmpthirdparty->name; +} /* * Actions From e2592d90490b46ac251b767197a65ed5cc95971f Mon Sep 17 00:00:00 2001 From: Frans Bosman Date: Wed, 22 Jul 2020 11:44:26 +0200 Subject: [PATCH 06/29] Update card_presend.tpl.php Add hidden options for specific sender email-adress for Invoices, Shipments and Order-confirmations --- htdocs/core/tpl/card_presend.tpl.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index a8594ec1b62..aac72ce774f 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -131,6 +131,21 @@ if ($action == 'presend') { $formmail->fromid = $user->id; } + if ($object->element === 'facture' && !empty($conf->global->INVOICE_EMAIL_SENDER)) { + $formmail->frommail = $conf->global->INVOICE_EMAIL_SENDER; + $formmail->fromname = ''; + $formmail->fromtype = 'special'; + } + if ($object->element === 'shipping' && !empty($conf->global->SHIPPING_EMAIL_SENDER)) { + $formmail->frommail = $conf->global->SHIPPING_EMAIL_SENDER; + $formmail->fromname = ''; + $formmail->fromtype = 'special'; + } + if ($object->element === 'commande' && !empty($conf->global->COMMANDE_EMAIL_SENDER)) { + $formmail->frommail = $conf->global->COMMANDE_EMAIL_SENDER; + $formmail->fromname = ''; + $formmail->fromtype = 'special'; + } $formmail->trackid=$trackid; if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set { From 7bc683b23409fd9eee014975822454f7229d3db7 Mon Sep 17 00:00:00 2001 From: quentin Date: Wed, 22 Jul 2020 15:07:55 +0200 Subject: [PATCH 07/29] FIX warning --- htdocs/core/tpl/extrafields_list_print_fields.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index 0d2949b4e24..85dd111bf55 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -60,7 +60,7 @@ if (!empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_e // we keep position for the first line $totalarray['totalizable'][$key]['pos'] = $totalarray['nbfield']; } - $totalarray['totalizable'][$key]['total'] += $obj->$tmpkey; + if(is_numeric($obj->$tmpkey)) $totalarray['totalizable'][$key]['total'] += $obj->$tmpkey; } if (!empty($val['isameasure'])) { From fc1de5b4f37cf521f39f5cc7c0e84aa7b864fe0e Mon Sep 17 00:00:00 2001 From: John Botella Date: Thu, 23 Jul 2020 11:10:18 +0200 Subject: [PATCH 08/29] Fix multicurecy option not applied --- htdocs/compta/facture/class/facture.class.php | 2 +- htdocs/fourn/class/fournisseur.commande.class.php | 6 +++++- htdocs/fourn/class/fournisseur.facture.class.php | 2 +- htdocs/supplier_proposal/class/supplier_proposal.class.php | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index d3c9ae19721..a9267201858 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -416,7 +416,7 @@ class Facture extends CommonInvoice $this->brouillon = 1; // Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate) - if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code); + if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $this->date); else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code); if (empty($this->fk_multicurrency)) { diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index bc975a9267a..cd35e1d34de 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1271,11 +1271,15 @@ class CommandeFournisseur extends CommonOrder $error = 0; $now = dol_now(); + // $date_commande is deprecated + $date = ($this->date_commande ? $this->date_commande : $this->date); // in case of date is set + if(empty($date)) $date = $now; + // Clean parameters if (empty($this->source)) $this->source = 0; // Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate) - if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code); + if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $date); else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code); if (empty($this->fk_multicurrency)) { diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 9cbcec32a9a..46c2c032786 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -359,7 +359,7 @@ class FactureFournisseur extends CommonInvoice $remise = $this->remise; // Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate) - if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code); + if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $this->date); else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code); if (empty($this->fk_multicurrency)) { diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index d292ebe13bf..1801bf16d71 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -891,7 +891,7 @@ class SupplierProposal extends CommonObject } // Multicurrency - if (!empty($this->multicurrency_code)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code); + if (!empty($this->multicurrency_code)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $now); if (empty($this->fk_multicurrency)) { $this->multicurrency_code = $conf->currency; From 55e65bbabf46919368a3dde1eeaefdca93bec316 Mon Sep 17 00:00:00 2001 From: John Botella Date: Thu, 23 Jul 2020 11:12:04 +0200 Subject: [PATCH 09/29] Fix variable init --- htdocs/multicurrency/class/multicurrency.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/multicurrency/class/multicurrency.class.php b/htdocs/multicurrency/class/multicurrency.class.php index 3c6b7044486..50288459a7d 100644 --- a/htdocs/multicurrency/class/multicurrency.class.php +++ b/htdocs/multicurrency/class/multicurrency.class.php @@ -530,7 +530,7 @@ class MultiCurrency extends CommonObject $sql1.= " AND m.entity IN (".getEntity('multicurrency').")"; $sql2= ''; if (!empty($conf->global->MULTICURRENCY_USE_RATE_ON_DOCUMENT_DATE) && !empty($date_document)) $sql2.= ' AND DATE_FORMAT(mc.date_sync, "%Y-%m-%d") = "'.date('Y-m-d', $date_document).'"'; - $sql3.= ' ORDER BY mc.date_sync DESC LIMIT 1'; + $sql3 = ' ORDER BY mc.date_sync DESC LIMIT 1'; dol_syslog(__METHOD__, LOG_DEBUG); $resql = $db->query($sql1.$sql2.$sql3); From 94498b191bb7c584be3df5a5adb0a827a35f877c Mon Sep 17 00:00:00 2001 From: Frans Bosman Date: Fri, 24 Jul 2020 10:37:19 +0200 Subject: [PATCH 10/29] Update card_presend.tpl.php --- htdocs/core/tpl/card_presend.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index aac72ce774f..67de56e16fa 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -139,7 +139,7 @@ if ($action == 'presend') if ($object->element === 'shipping' && !empty($conf->global->SHIPPING_EMAIL_SENDER)) { $formmail->frommail = $conf->global->SHIPPING_EMAIL_SENDER; $formmail->fromname = ''; - $formmail->fromtype = 'special'; + $formmail->fromtype = 'special'; } if ($object->element === 'commande' && !empty($conf->global->COMMANDE_EMAIL_SENDER)) { $formmail->frommail = $conf->global->COMMANDE_EMAIL_SENDER; From 8273dbcd4948b79baac12f2d5d0f9adc95a8bf33 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 24 Jul 2020 08:39:09 +0000 Subject: [PATCH 11/29] Fixing style errors. --- htdocs/core/tpl/card_presend.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index 67de56e16fa..aac72ce774f 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -139,7 +139,7 @@ if ($action == 'presend') if ($object->element === 'shipping' && !empty($conf->global->SHIPPING_EMAIL_SENDER)) { $formmail->frommail = $conf->global->SHIPPING_EMAIL_SENDER; $formmail->fromname = ''; - $formmail->fromtype = 'special'; + $formmail->fromtype = 'special'; } if ($object->element === 'commande' && !empty($conf->global->COMMANDE_EMAIL_SENDER)) { $formmail->frommail = $conf->global->COMMANDE_EMAIL_SENDER; From 6261fa191fbdb3efbd178120d75dab057db88895 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Jul 2020 12:47:29 +0200 Subject: [PATCH 12/29] Prepare compatibilty with mysql 8 --- test/phpunit/CodingSqlTest.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/phpunit/CodingSqlTest.php b/test/phpunit/CodingSqlTest.php index b62b9befcc7..207f2db0d47 100644 --- a/test/phpunit/CodingSqlTest.php +++ b/test/phpunit/CodingSqlTest.php @@ -156,7 +156,10 @@ class CodingSqlTest extends PHPUnit\Framework\TestCase continue; print 'Check sql file '.$file."\n"; - $filecontent=file_get_contents($dir.'/'.$file); + $filecontent = file_get_contents($dir.'/'.$file); + + // Allow ` for 'rank' column name + $filecontent = str_replace('`rank`', '_rank_', $filecontent); $result=strpos($filecontent, '`'); print __METHOD__." Result for checking we don't have back quote = ".$result."\n"; From 943e7c988f1ead77e506d5b093b76a88bd24a4e0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Jul 2020 12:55:12 +0200 Subject: [PATCH 13/29] Update extrafields_list_print_fields.tpl.php --- htdocs/core/tpl/extrafields_list_print_fields.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index 85dd111bf55..817d1aadfc9 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -60,7 +60,7 @@ if (!empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_e // we keep position for the first line $totalarray['totalizable'][$key]['pos'] = $totalarray['nbfield']; } - if(is_numeric($obj->$tmpkey)) $totalarray['totalizable'][$key]['total'] += $obj->$tmpkey; + if (is_numeric($obj->$tmpkey)) $totalarray['totalizable'][$key]['total'] += $obj->$tmpkey; } if (!empty($val['isameasure'])) { From fb1c226e5681f69cd88dc6445458f7d8fc909518 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Jul 2020 13:05:19 +0200 Subject: [PATCH 14/29] Init var --- htdocs/core/db/pgsql.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index 6b71366c46c..08b23156f64 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -183,6 +183,8 @@ class DoliDBPgsql extends DoliDB if ($type == 'dml') { + $reg = array(); + $line = preg_replace('/\s/', ' ', $line); // Replace tabulation with space // we are inside create table statement so lets process datatypes From d6f1a897f65b74771962c1d4353109ccc4670627 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Jul 2020 13:44:32 +0200 Subject: [PATCH 15/29] Fix size of module box --- htdocs/theme/eldy/info-box.inc.php | 10 ++++++++-- htdocs/theme/md/info-box.inc.php | 12 ++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index c5f4b8d248c..3b6bf98a1f9 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/htdocs/theme/eldy/info-box.inc.php @@ -381,12 +381,18 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) $conf->global->THEME_SATURATE_RATIO = height: 0; } +.info-box-title { + width: calc(100% - 20px); +} .info-box-module { min-width: 350px; max-width: 350px; } -.info-box-title { - width: calc(100% - 20px); +@media only screen and (max-width: 1740px) { + .info-box-module { + min-width: 315px; + max-width: 315px; + } } @media only screen and (max-width: 767px) { .info-box-module { diff --git a/htdocs/theme/md/info-box.inc.php b/htdocs/theme/md/info-box.inc.php index f1c58b4241e..86e6411a923 100644 --- a/htdocs/theme/md/info-box.inc.php +++ b/htdocs/theme/md/info-box.inc.php @@ -439,6 +439,18 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) $conf->global->THEME_SATURATE_RATIO = min-width: 350px; max-width: 350px; } +@media only screen and (max-width: 1740px) { + .info-box-module { + min-width: 315px; + max-width: 315px; + } +} +@media only screen and (max-width: 767px) { + .info-box-module { + min-width: 260px; + } +} + .info-box-module .info-box-content { height: 6.3em; } From b82b6736d1139a50cf01d73701ab49d96b65d834 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Jul 2020 18:13:01 +0200 Subject: [PATCH 16/29] Look and feel --- htdocs/holiday/define_holiday.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index d957ade168e..5e8798d901a 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -268,7 +268,7 @@ else print ''; // Action column - print ''; From 573feed66fecbefd2ed45f2a92d46964a7208e0d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 25 Jul 2020 02:59:49 +0200 Subject: [PATCH 17/29] FIX locataxes lost on lines when cloning a vendor invoice --- htdocs/core/lib/price.lib.php | 4 ++-- htdocs/fourn/class/fournisseur.facture.class.php | 6 +++++- htdocs/fourn/facture/card.php | 2 +- htdocs/societe/card.php | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/price.lib.php b/htdocs/core/lib/price.lib.php index 81c62958418..2cb8d8e30f6 100644 --- a/htdocs/core/lib/price.lib.php +++ b/htdocs/core/lib/price.lib.php @@ -40,8 +40,8 @@ * @param float $pu Unit price (HT or TTC selon price_base_type) * @param float $remise_percent_ligne Discount for line * @param float $txtva 0=do not apply VAT tax, VAT rate=apply (this is VAT rate only without text code, we don't need text code because we alreaydy have all tax info into $localtaxes_array) - * @param float $uselocaltax1_rate 0=do not use this localtax, >0=apply and get value from localtaxes_array (or database if empty), -1=autodetect according to seller if we must apply, get value from localtaxes_array (or database if empty). Try to always use -1. - * @param float $uselocaltax2_rate 0=do not use this localtax, >0=apply and get value from localtaxes_array (or database if empty), -1=autodetect according to seller if we must apply, get value from localtaxes_array (or database if empty). Try to always use -1. + * @param float $uselocaltax1_rate 0=do not use localtax1, >0=apply and get value from localtaxes_array (or database if empty), -1=autodetect according to seller if we must apply, get value from localtaxes_array (or database if empty). Try to always use -1. + * @param float $uselocaltax2_rate 0=do not use localtax2, >0=apply and get value from localtaxes_array (or database if empty), -1=autodetect according to seller if we must apply, get value from localtaxes_array (or database if empty). Try to always use -1. * @param float $remise_percent_global 0 * @param string $price_base_type HT=Unit price parameter is HT, TTC=Unit price parameter is TTC * @param int $info_bits Miscellaneous informations on line diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index b877cd0b0d6..63ca7e0d88b 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -486,7 +486,7 @@ class FactureFournisseur extends CommonInvoice $idligne, $this->lines[$i]->description, $this->lines[$i]->pu_ht, - $this->lines[$i]->tva_tx, + $this->lines[$i]->tva_tx.($this->lines[$i]->vat_src_code ? ' ('.$this->lines[$i]->vat_src_code.')' : ''), $this->lines[$i]->localtax1_tx, $this->lines[$i]->localtax2_tx, $this->lines[$i]->qty, @@ -1945,6 +1945,8 @@ class FactureFournisseur extends CommonInvoice $localtaxes_type = getLocalTaxesFromRate($vatrate, 0, $mysoc, $this->thirdparty); + $reg = array(); + // Clean vat code $vat_src_code = ''; if (preg_match('/\((.*)\)/', $vatrate, $reg)) @@ -2648,6 +2650,8 @@ class FactureFournisseur extends CommonInvoice $object->id = 0; $object->statut = self::STATUS_DRAFT; + $object->fetch_thirdparty(); // We need it to recalculate VAT localtaxes according to main sale taxes and vendor + // Clear fields $object->ref_supplier = (empty($this->ref_supplier) ? $langs->trans("CopyOf").' '.$object->ref_supplier : $this->ref_supplier); $object->author = $user->id; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 2113d7ebb12..10cf8ee1b6f 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2016 Laurent Destailleur + * Copyright (C) 2004-2020 Laurent Destailleur * Copyright (C) 2004 Christophe Combelles * Copyright (C) 2005 Marc Barilley * Copyright (C) 2005-2013 Regis Houssin diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 97226314209..2ac6d0d33f3 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2044,7 +2044,7 @@ else print ''; } print ''; - if ($conf->browser->layout == 'phone') print ''; + print ''; print ''; - $html_id = !empty($object->id) ? $object->element.'_extras_'.$key.'_'.$object->id : ''; + $html_id = !empty($object->id) ? $object->element.'_extras_'.$tmpkeyextra.'_'.$object->id : ''; - print ''; From 8c06e3577df185428c01cc971d3e2a06f6e14865 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 27 Jul 2020 19:33:24 +0200 Subject: [PATCH 29/29] Fix several trouble with diret debit module and credit transfer module --- dev/resources/sepa/sample-credit-transfer.xml | 172 ++++++++++++++++++ .../{test.xml => sample-direct-debit.xml} | 0 htdocs/compta/paymentbybanktransfer/index.php | 5 +- htdocs/compta/prelevement/card.php | 29 ++- .../class/bonprelevement.class.php | 137 ++++++++++++-- htdocs/compta/prelevement/create.php | 6 +- htdocs/compta/prelevement/demandes.php | 8 + htdocs/compta/prelevement/factures.php | 57 ++++-- htdocs/compta/prelevement/fiche-rejet.php | 35 ++-- htdocs/compta/prelevement/fiche-stat.php | 41 +++-- htdocs/core/lib/prelevement.lib.php | 7 +- htdocs/langs/en_US/withdrawals.lang | 8 +- 12 files changed, 426 insertions(+), 79 deletions(-) create mode 100644 dev/resources/sepa/sample-credit-transfer.xml rename dev/resources/sepa/{test.xml => sample-direct-debit.xml} (100%) diff --git a/dev/resources/sepa/sample-credit-transfer.xml b/dev/resources/sepa/sample-credit-transfer.xml new file mode 100644 index 00000000000..087fd2f57d7 --- /dev/null +++ b/dev/resources/sepa/sample-credit-transfer.xml @@ -0,0 +1,172 @@ + + + + + message-id-001 + 2010-09-28T14:07:00 + 1 + 10.1 + + Bedrijfsnaam + + + + 123456789123456 + + + + + + + minimaal gevuld + TRF + 1 + 10.1 + 2009-11-01 + + Naam + + + + NL44RABO0123456789 + + + + + RABONL2U + + + + + non ref + + + 10.1 + + SLEV + + + ABNANL2A + + + + Naam creditor + + + + NL90ABNA0111111111 + + + + vrije tekst + + + + + maximaal gevuld + TRF + true + 1 + 20.2 + + NORM + + SEPA + + + IDEAL + + + SECU + + + 2009-11-01 + + Naam + + NL + Debtor straat 1 + 9999 XX Plaats debtor + + + + + NL44RABO0123456789 + + + + + RABONL2U + + + + + + + 12345678 + + klantnummer + + klantnummer uitgifte instantie + + + + + SLEV + + + debtor-to-debtor-bank-01 + End-to-end-id-debtor-to-creditor-01 + + + 20.2 + + + + ABNANL2A + + + + Naam creditor + + NL + Straat creditor 1 + 9999 XX Plaats creditor + + + + + NL90ABNA0111111111 + + + + + + + 1969-07-03 + PLAATS + NL + + + + + + CHAR + + + + + + + SCOR + + CUR + + 1234567 + + + + + + + diff --git a/dev/resources/sepa/test.xml b/dev/resources/sepa/sample-direct-debit.xml similarity index 100% rename from dev/resources/sepa/test.xml rename to dev/resources/sepa/sample-direct-debit.xml diff --git a/htdocs/compta/paymentbybanktransfer/index.php b/htdocs/compta/paymentbybanktransfer/index.php index 1fc6c53cf99..79bb2f6e7fb 100644 --- a/htdocs/compta/paymentbybanktransfer/index.php +++ b/htdocs/compta/paymentbybanktransfer/index.php @@ -94,7 +94,7 @@ print '
'.$langs->trans("LatestCustomerTemplateInvoices", ($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllCustomerTemplateInvoices").' '.$num.''; print '
'.$langs->trans("LatestCustomerTemplateInvoices", ($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllCustomerTemplateInvoices").' '.$num.'
'; + print ''; $searchpicto = $form->showFilterButtons(); print $searchpicto; print '
'.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed", $mysoc->country_code), 'localtax2assuj_value', '', $object, 0).''; print $form->selectyesno('localtax2assuj_value', $object->localtax2_assuj, 1); if (!isOnlyOneLocalTax(2)) From dd86c213822fbde73ea0f91155c37a33bb674292 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Jul 2020 11:53:44 +0200 Subject: [PATCH 18/29] FIX dolGetElementUrl and agenda page for external modules --- htdocs/comm/action/card.php | 5 +++-- htdocs/core/lib/company.lib.php | 8 +++++--- htdocs/core/lib/functions2.lib.php | 19 ++++++++++--------- htdocs/langs/en_US/main.lang | 3 ++- .../template/class/myobject.class.php | 4 ++-- .../doc/pdf_standard_myobject.modules.php | 2 +- .../template/myobject_agenda.php | 2 +- .../modulebuilder/template/myobject_card.php | 2 +- 8 files changed, 25 insertions(+), 20 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 860254756c9..129696a60d9 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -6,8 +6,8 @@ * Copyright (C) 2010-2013 Juanjo Menent * Copyright (C) 2013 Florian Henry * Copyright (C) 2014 Cedric GROSS - * Copyright (C) 2015 Alexandre Spangaro - * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2018-2019 Frédéric France * Copyright (C) 2019 Ferran Marcet * * This program is free software; you can redistribute it and/or modify @@ -1105,6 +1105,7 @@ if ($action == 'create') print ''; } + $reg = array(); if (GETPOST("datep") && preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])$/', GETPOST("datep"), $reg)) { $object->datep = dol_mktime(0, 0, 0, $reg[2], $reg[3], $reg[1]); diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index e102e0e155d..67611649142 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1286,7 +1286,7 @@ function show_actions_todo($conf, $langs, $db, $filterobj, $objcon = '', $noprin * @param Conf $conf Object conf * @param Translate $langs Object langs * @param DoliDB $db Object db - * @param mixed $filterobj Filter on object Adherent|Societe|Project|Product|CommandeFournisseur|Dolresource|Ticket|... to list events linked to an object + * @param mixed $filterobj Filter on object Adherent|Societe|Project|Product|CommandeFournisseur|Dolresource|Ticket... to list events linked to an object * @param Contact $objcon Filter on object contact to filter events on a contact * @param int $noprint Return string but does not output it * @param string $actioncode Filter on actioncode @@ -1294,9 +1294,10 @@ function show_actions_todo($conf, $langs, $db, $filterobj, $objcon = '', $noprin * @param array $filters Filter on other fields * @param string $sortfield Sort field * @param string $sortorder Sort order + * @param string $module You can add module name here if elementtype in table llx_actioncomm is objectkey@module * @return string|void Return html part or void if noprint is 1 */ -function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprint = 0, $actioncode = '', $donetodo = 'done', $filters = array(), $sortfield = 'a.datep,a.id', $sortorder = 'DESC') +function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprint = 0, $actioncode = '', $donetodo = 'done', $filters = array(), $sortfield = 'a.datep,a.id', $sortorder = 'DESC', $module = '') { global $user, $conf; global $form; @@ -1416,7 +1417,8 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin } elseif (is_object($filterobj) && is_array($filterobj->fields) && is_array($filterobj->fields['rowid']) && is_array($filterobj->fields['ref']) && $filterobj->table_element && $filterobj->element) { - $sql .= " AND a.fk_element = o.rowid AND a.elementtype = '".$db->escape($filterobj->element)."'"; + // Generic case + $sql .= " AND a.fk_element = o.rowid AND a.elementtype = '".$db->escape($filterobj->element).($module ? '@'.$module : '')."'"; if ($filterobj->id) $sql .= " AND a.fk_element = ".$filterobj->id; } } diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index b50090ee2cf..84670de46d2 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1809,18 +1809,19 @@ function dolGetElementUrl($objectid, $objecttype, $withpicto = 0, $option = '') $ret = ''; $regs = array(); - // If we ask an resource form external module (instead of default path) + // If we ask a resource form external module (instead of default path) if (preg_match('/^([^@]+)@([^@]+)$/i', $objecttype, $regs)) { $myobject = $regs[1]; $module = $regs[2]; } - - // Parse $objecttype (ex: project_task) - $module = $myobject = $objecttype; - if (preg_match('/^([^_]+)_([^_]+)/i', $objecttype, $regs)) - { - $module = $regs[1]; - $myobject = $regs[2]; + else { + // Parse $objecttype (ex: project_task) + $module = $myobject = $objecttype; + if (preg_match('/^([^_]+)_([^_]+)/i', $objecttype, $regs)) + { + $module = $regs[1]; + $myobject = $regs[2]; + } } // Generic case for $classpath @@ -1896,7 +1897,7 @@ function dolGetElementUrl($objectid, $objecttype, $withpicto = 0, $option = '') // Generic case for $classfile and $classname $classfile = strtolower($myobject); $classname = ucfirst($myobject); - //print "objecttype=".$objecttype." module=".$module." subelement=".$subelement." classfile=".$classfile." classname=".$classname; + //print "objecttype=".$objecttype." module=".$module." subelement=".$subelement." classfile=".$classfile." classname=".$classname." classpath=".$classpath; if ($objecttype == 'invoice_supplier') { $classfile = 'fournisseur.facture'; diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index ab9ead7e991..f87f3a277de 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1037,4 +1037,5 @@ ShowOtherLanguages=Show other languages SwitchInEditModeToAddTranslation=Switch in edit mode to add translations for this language NotUsedForThisCustomer=Not used for this customer AmountMustBePositive=Amount must be positive -ByStatus=By status \ No newline at end of file +ByStatus=By status +InformationMessage=Information \ No newline at end of file diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 19a5cbc99ce..bfd1cd46fb5 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -840,7 +840,7 @@ class MyObject extends CommonObject if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; - //$langs->load("mymodule"); + //$langs->load("mymodule@mymodule"); $this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Draft'); $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Enabled'); $this->labelStatus[self::STATUS_CANCELED] = $langs->trans('Disabled'); @@ -953,7 +953,7 @@ class MyObject extends CommonObject public function getNextNumRef() { global $langs, $conf; - $langs->load("mymodule@myobject"); + $langs->load("mymodule@mymodule"); if (empty($conf->global->MYMODULE_MYOBJECT_ADDON)) { $conf->global->MYMODULE_MYOBJECT_ADDON = 'mod_myobject_standard'; diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php index 7c242c26444..417a3b0c173 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php @@ -147,7 +147,7 @@ class pdf_standard_myobject extends ModelePDFMyObject $this->db = $db; $this->name = "standard"; - $this->description = $langs->trans('PDFStandardDescription'); + $this->description = $langs->trans('DocumentModelStandardPDF'); $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template // Dimension page diff --git a/htdocs/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php index 8f4117a871e..58d64b622d0 100644 --- a/htdocs/modulebuilder/template/myobject_agenda.php +++ b/htdocs/modulebuilder/template/myobject_agenda.php @@ -249,7 +249,7 @@ if ($object->id > 0) $filters['search_agenda_label'] = $search_agenda_label; // TODO Replace this with same code than into list.php - show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder); + show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, 'mymmodule'); } } diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index f67be16ade1..e00c0a3b618 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -589,7 +589,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions = new FormActions($db); - $somethingshown = $formactions->showactions($object, $object->element, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlright); + $somethingshown = $formactions->showactions($object, $object->element.'@mymodule', (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlright); print ''; } From 378c45fe5cd6110b5c7393624f53c2d618dd0262 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 26 Jul 2020 19:21:47 +0200 Subject: [PATCH 19/29] Fix look and feel --- htdocs/admin/confexped.php | 2 +- htdocs/admin/expedition.php | 2 +- htdocs/admin/expedition_extrafields.php | 2 +- htdocs/admin/expeditiondet_extrafields.php | 2 +- htdocs/admin/livraison.php | 2 +- htdocs/admin/livraison_extrafields.php | 2 +- htdocs/admin/livraisondet_extrafields.php | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/admin/confexped.php b/htdocs/admin/confexped.php index fd93b0fa83d..8e666c4be93 100644 --- a/htdocs/admin/confexped.php +++ b/htdocs/admin/confexped.php @@ -93,7 +93,7 @@ print load_fiche_titre($langs->trans("SendingsSetup"), $linkback, 'title_setup') print '
'; $head = expedition_admin_prepare_head(); -dol_fiche_head($head, 'general', $langs->trans("Sendings"), -1, 'sending'); +dol_fiche_head($head, 'general', $langs->trans("Sendings"), -1, 'shipment'); // Miscellaneous parameters diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index be9e7091300..4fc0e241dc0 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -197,7 +197,7 @@ print load_fiche_titre($langs->trans("SendingsSetup"), $linkback, 'title_setup') print '
'; $head = expedition_admin_prepare_head(); -dol_fiche_head($head, 'shipment', $langs->trans("Sendings"), -1, 'sending'); +dol_fiche_head($head, 'shipment', $langs->trans("Sendings"), -1, 'shipment'); // Shipment numbering model diff --git a/htdocs/admin/expedition_extrafields.php b/htdocs/admin/expedition_extrafields.php index 6ff8cd42669..e40519f9104 100644 --- a/htdocs/admin/expedition_extrafields.php +++ b/htdocs/admin/expedition_extrafields.php @@ -76,7 +76,7 @@ print "
\n"; $head = expedition_admin_prepare_head(); -dol_fiche_head($head, 'attributes_shipment', $langs->trans("Sendings"), -1, 'sending'); +dol_fiche_head($head, 'attributes_shipment', $langs->trans("Sendings"), -1, 'shipment'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; diff --git a/htdocs/admin/expeditiondet_extrafields.php b/htdocs/admin/expeditiondet_extrafields.php index 8b27aec895e..03cd140d0ee 100644 --- a/htdocs/admin/expeditiondet_extrafields.php +++ b/htdocs/admin/expeditiondet_extrafields.php @@ -77,7 +77,7 @@ print "
\n"; $head = expedition_admin_prepare_head(); -dol_fiche_head($head, 'attributeslines_shipment', $langs->trans("Sendings"), -1, 'sending'); +dol_fiche_head($head, 'attributeslines_shipment', $langs->trans("Sendings"), -1, 'shipment'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php index 4cd8f4841e5..83e2e3b7d54 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/livraison.php @@ -187,7 +187,7 @@ print load_fiche_titre($langs->trans("SendingsSetup"), $linkback, 'title_setup') print '
'; $head = expedition_admin_prepare_head(); -dol_fiche_head($head, 'receivings', $langs->trans("Receivings"), -1, 'sending'); +dol_fiche_head($head, 'receivings', $langs->trans("Receivings"), -1, 'shipment'); // Delivery numbering model diff --git a/htdocs/admin/livraison_extrafields.php b/htdocs/admin/livraison_extrafields.php index 5594273320f..3b6d03ac98e 100644 --- a/htdocs/admin/livraison_extrafields.php +++ b/htdocs/admin/livraison_extrafields.php @@ -76,7 +76,7 @@ print "
\n"; $head = expedition_admin_prepare_head(); -dol_fiche_head($head, 'attributes_receivings', $langs->trans("Receivings"), -1, 'sending'); +dol_fiche_head($head, 'attributes_receivings', $langs->trans("Receivings"), -1, 'shipment'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; diff --git a/htdocs/admin/livraisondet_extrafields.php b/htdocs/admin/livraisondet_extrafields.php index 2c9aae6b253..ebed8de9608 100644 --- a/htdocs/admin/livraisondet_extrafields.php +++ b/htdocs/admin/livraisondet_extrafields.php @@ -77,7 +77,7 @@ print "
\n"; $head = expedition_admin_prepare_head(); -dol_fiche_head($head, 'attributeslines_receivings', $langs->trans("Receivings"), -1, 'sending'); +dol_fiche_head($head, 'attributeslines_receivings', $langs->trans("Receivings"), -1, 'shipment'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; From cdf7261c7e7e8d325a65d782d67d6196038ceda1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 26 Jul 2020 19:27:29 +0200 Subject: [PATCH 20/29] Fix look and feel --- htdocs/expedition/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index ad5bbdd0867..f2cb455cc6b 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1954,7 +1954,7 @@ elseif ($id || $ref) print '
'; print '
'; - print ''; + print '
'; // Sending method print 'attributes[$object->table_element]['required'][$key])) print ' fieldrequired'; + if ((!empty($action) && ($action == 'create' || $action == 'edit')) && !empty($extrafields->attributes[$object->table_element]['required'][$tmpkeyextra])) print ' fieldrequired'; print '">'; - if (!empty($extrafields->attributes[$object->table_element]['help'][$key])) print $form->textwithpicto($langs->trans($label), $langs->trans($extrafields->attributes[$object->table_element]['help'][$key])); - else print $langs->trans($label); + if (!empty($extrafields->attributes[$object->table_element]['help'][$tmpkeyextra])) print $form->textwithpicto($langs->trans($tmplabelextra), $langs->trans($extrafields->attributes[$object->table_element]['help'][$tmpkeyextra])); + else print $langs->trans($tmplabelextra); print ''; //TODO Improve element and rights detection @@ -151,54 +147,52 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] if ($object->element == 'mo') $permok = $user->rights->mrp->write; $isdraft = ((isset($object->statut) && $object->statut == 0) || (isset($object->status) && $object->status == 0)); - if (($isdraft || !empty($extrafields->attributes[$object->table_element]['alwayseditable'][$key])) - && $permok && $enabled != 5 && ($action != 'edit_extras' || GETPOST('attribute') != $key) - && empty($extrafields->attributes[$object->table_element]['computed'][$key])) + if (($isdraft || !empty($extrafields->attributes[$object->table_element]['alwayseditable'][$tmpkeyextra])) + && $permok && $enabled != 5 && ($action != 'edit_extras' || GETPOST('attribute') != $tmpkeyextra) + && empty($extrafields->attributes[$object->table_element]['computed'][$tmpkeyextra])) { $fieldid = 'id'; if ($object->table_element == 'societe') $fieldid = 'socid'; - print ''; + print ''; } print '
'; From 353e99c26a77f1fbda89b7f91cc599322b4d9044 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 26 Jul 2020 19:43:55 +0200 Subject: [PATCH 21/29] Fix look and feel --- htdocs/admin/boxes.php | 6 +++--- htdocs/admin/menus.php | 2 +- htdocs/admin/menus/index.php | 2 +- htdocs/admin/menus/other.php | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index c6ff9e94749..afad55a6211 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -324,7 +324,7 @@ $boxactivated = InfoBox::listBoxes($db, 'activated', -1, null); print "
\n"; print "\n\n".''."\n"; -print load_fiche_titre($langs->trans("BoxesAvailable")); +print load_fiche_titre($langs->trans("BoxesAvailable"), '', ''); print '
'."\n"; print ''."\n"; @@ -390,7 +390,7 @@ print "\n".''."\n"; //var_dump($boxactivated); print "
\n\n"; -print load_fiche_titre($langs->trans("BoxesActivated")); +print load_fiche_titre($langs->trans("BoxesActivated"), '', ''); print '
'; print ''."\n"; @@ -452,7 +452,7 @@ print '
'; // Other parameters print "\n\n".''."\n"; -print load_fiche_titre($langs->trans("Other")); +print load_fiche_titre($langs->trans("Other"), '', ''); print ''; print ''; print ''; diff --git a/htdocs/admin/menus.php b/htdocs/admin/menus.php index 856ad50c28b..7e734a5b093 100644 --- a/htdocs/admin/menus.php +++ b/htdocs/admin/menus.php @@ -153,7 +153,7 @@ print ''; print ''; print ''; -dol_fiche_head($head, 'handler', $langs->trans("Menus"), -1); +dol_fiche_head($head, 'handler', '', -1); print ''.$langs->trans("MenusDesc")."
\n"; print "
\n"; diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index 1dea0ca4473..0cb69efdf4a 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -235,7 +235,7 @@ $head[$h][1] = $langs->trans("Miscellaneous"); $head[$h][2] = 'misc'; $h++; -dol_fiche_head($head, 'editor', $langs->trans("Menus"), -1); +dol_fiche_head($head, 'editor', '', -1); print ''.$langs->trans("MenusEditorDesc")."
\n"; print "
\n"; diff --git a/htdocs/admin/menus/other.php b/htdocs/admin/menus/other.php index ed35f48d90e..bed6c2a3b4e 100644 --- a/htdocs/admin/menus/other.php +++ b/htdocs/admin/menus/other.php @@ -76,7 +76,7 @@ $head[$h][1] = $langs->trans("Miscellaneous"); $head[$h][2] = 'misc'; $h++; -dol_fiche_head($head, 'misc', $langs->trans("Menus"), -1); +dol_fiche_head($head, 'misc', '', -1); // Other Options From d945ef67e11031f8ff91f607bed56479c77efcd9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 26 Jul 2020 20:51:49 +0200 Subject: [PATCH 22/29] FIX Picto of HRM module Conflicts: htdocs/core/lib/functions.lib.php --- htdocs/core/lib/functions.lib.php | 4 ++-- htdocs/hrm/index.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a72d2057004..f971afc73c5 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3172,7 +3172,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'setup', 'sign-out', 'split', 'stripe-s', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'vcard', 'wrench', 'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp', 'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top', - 'home', 'companies', 'products', 'commercial', 'invoicing', 'preview', 'project', 'projectpub', 'supplier_invoice', 'hrm', 'members', 'ticket', 'generic', + 'home', 'hrm', 'companies', 'products', 'commercial', 'invoicing', 'pencil-ruler', 'preview', 'project', 'projectpub', 'supplier_invoice', 'members', 'ticket', 'generic', 'error', 'warning', 'supplier_proposal', 'supplier_order', 'supplier_invoice', 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda' ) @@ -3195,7 +3195,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'company'=>'building', 'contact'=>'address-book', 'contract'=>'suitcase', 'conversation'=>'comments', 'donation'=>'file-alt', 'dynamicprice'=>'hand-holding-usd', 'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins', 'accounting'=>'chart-line', 'category'=>'tag', 'dollyrevert'=>'dolly', - 'hrm'=>'umbrella-beach', 'margin'=>'calculator', 'members'=>'users', 'ticket'=>'ticket-alt', 'globe'=>'external-link-alt', 'lot'=>'barcode', + 'hrm'=>'user-tie', 'margin'=>'calculator', 'members'=>'users', 'ticket'=>'ticket-alt', 'globe'=>'external-link-alt', 'lot'=>'barcode', 'email'=>'at', 'edit'=>'pencil-alt', 'grip_title'=>'arrows-alt', 'grip'=>'arrows-alt', 'help'=>'info-circle', 'generic'=>'file', 'holiday'=>'umbrella-beach', 'label'=>'layer-group', diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index e31266f755c..ba33ecbbdb3 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -77,7 +77,7 @@ $childids[] = $user->id; llxHeader('', $langs->trans('HRMArea')); -print load_fiche_titre($langs->trans("HRMArea"), '', 'user'); +print load_fiche_titre($langs->trans("HRMArea"), '', 'hrm'); if (!empty($setupcompanynotcomplete)) From 714481f7e5289d63ec1908669b1d3aeb22574ef8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 26 Jul 2020 21:07:39 +0200 Subject: [PATCH 23/29] FIX Navigation in object fails to find the next ref in some cases --- htdocs/core/class/commonobject.class.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 9601320af49..7fc42512baf 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1899,14 +1899,15 @@ abstract class CommonObject $row = $this->db->fetch_row($result); $this->ref_previous = $row[0]; - $sql = "SELECT MIN(te.".$fieldid.")"; $sql .= " FROM ".(empty($nodbprefix) ?MAIN_DB_PREFIX:'').$this->table_element." as te"; if ($this->element == 'user' && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { $sql .= ",".MAIN_DB_PREFIX."usergroup_user as ug"; } - if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 'fk_soc@societe') $sql .= ", ".MAIN_DB_PREFIX."societe as s"; // If we need to link to societe to limit select to entity - elseif ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe as s"; // If we need to link to societe to limit select to socid + if (isset($this->ismultientitymanaged) && !is_numeric($this->ismultientitymanaged)) { + $tmparray = explode('@', $this->ismultientitymanaged); + $sql .= ", ".MAIN_DB_PREFIX.$tmparray[1]." as ".($tmparray[1] == 'societe' ? 's' : 'parenttable'); // If we need to link to this table to limit select to entity + } elseif ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe as s"; // If we need to link to societe to limit select to socid elseif ($this->restrictiononfksoc == 2 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON te.fk_soc = s.rowid"; // If we need to link to societe to limit select to socid if ($this->restrictiononfksoc && !$user->rights->societe->client->voir && !$socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON ".$aliastablesociete.".rowid = sc.fk_soc"; $sql .= " WHERE te.".$fieldid." > '".$this->db->escape($this->ref)."'"; // ->ref must always be defined (set to id if field does not exists) @@ -1917,8 +1918,10 @@ abstract class CommonObject if (!preg_match('/^\s*AND/i', $filter)) $sql .= " AND "; // For backward compatibility $sql .= $filter; } - if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 'fk_soc@societe') $sql .= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to entity - elseif ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql .= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to socid + if (isset($this->ismultientitymanaged) && !is_numeric($this->ismultientitymanaged)) { + $tmparray = explode('@', $this->ismultientitymanaged); + $sql .= ' AND te.'.$tmparray[0].' = '.($tmparray[1] == 'societe' ? 's' : 'parenttable').'.rowid'; // If we need to link to this table to limit select to entity + } elseif ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql .= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to socid if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) { if ($this->element == 'user' && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { if (!empty($user->admin) && empty($user->entity) && $conf->entity == 1) { @@ -1931,6 +1934,10 @@ abstract class CommonObject $sql .= ' AND te.entity IN ('.getEntity($this->element).')'; } } + if (isset($this->ismultientitymanaged) && !is_numeric($this->ismultientitymanaged) && $this->element != 'societe') { + $tmparray = explode('@', $this->ismultientitymanaged); + $sql .= ' AND parenttable.entity IN ('.getEntity($tmparray[1]).')'; + } if ($this->restrictiononfksoc == 1 && $socid && $this->element != 'societe') $sql .= ' AND te.fk_soc = '.$socid; if ($this->restrictiononfksoc == 2 && $socid && $this->element != 'societe') $sql .= ' AND (te.fk_soc = '.$socid.' OR te.fk_soc IS NULL)'; if ($this->restrictiononfksoc && $socid && $this->element == 'societe') $sql .= ' AND te.rowid = '.$socid; From 26c253113b08342a98ae030aba0c8618803bf35e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 26 Jul 2020 22:04:19 +0200 Subject: [PATCH 24/29] Removed not used files --- htdocs/public/ticket/img/bg_ticket.png | Bin 9235 -> 0 bytes htdocs/public/ticket/img/index.html | 1 - 2 files changed, 1 deletion(-) delete mode 100644 htdocs/public/ticket/img/bg_ticket.png delete mode 100644 htdocs/public/ticket/img/index.html diff --git a/htdocs/public/ticket/img/bg_ticket.png b/htdocs/public/ticket/img/bg_ticket.png deleted file mode 100644 index c5fd05c662a721015116ec7cc87e4acf3276721d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9235 zcmXw9cTkhh(}#r6LP8G#0tqM(ng#`=6MFQE5SkR}h*G2~T}r5eKq81BA`*&5lqy|% z7g34`2vP%zi1c3HIKO%SdFEzzZ*O;R?{4?APa@vP0KzK3N=HWrxr);@rK6)iPaE$u zGt$0#{?FOy=*~@C)zvZ&rvE$T`UK%RaklX+5!@;AkxM(4!&b*Ph#9s|eGXZL9TQwZ zwX+x4(-KzV6>i0JaB2IFq5RHUUAp=ztnk;~S+4p?zVVCPXSvUs-!7Lntlrb`Nqbt{ zTy}VU=bIRBa<$(DXtz|FRI;2nTe5{OrWaL-J|o)saz35Yv5gg3jJW5L?8Mflx6kp( zm$TvF8Cb)YV^s_2A1rK;A9i!*2iyfd<##^U01ByNieW{LjiisYQStT)t38TE7oz04 zF*R)`l=w~I9u+<0O#36Rge!S~GUv=!xh~0a$#&~f=ChEyV=G(N9&E&H@R~b{2Y%A* zhM(&ghg>ED9Oh=za%Ym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}U`G9EP(Nxx=B4K6aKx#*RhoZzK5 z7{L$S_2U1$(lEQ%i%qhn$10hi%9t`JNSt(kg*3d3p4q=wMnYOJB7rsLE9 zwFK4ugqB698KJfbxmVx*_fK8`hF2LqY6vx}FdF`6U9>xo@WVyn^fx^~ct%YFO-0>X0ve@>6HDmZfzpz6WIb@;}9PzY(i@SM`U7AAJ7E z!W&>;&KPXHxDF5>FS`xHdAZEVGw{{?Y2W>6W*a4P!)(!oaBHrL-@DtnSKd?3yZiPH zRT!@OM3&I)B;bJpYJd$p>fF3fZqar(N5w_;n7%9zb}iASF_ZmY--~k3d}Qj^fWVphC%Bsa@!;8QRZ2bXWC^bW61zqyG Date: Mon, 27 Jul 2020 02:25:09 +0200 Subject: [PATCH 25/29] FIX Setup of clicktodial hang on smartphone --- htdocs/admin/clicktodial.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index 8d22e01b436..f6033934077 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -62,6 +62,8 @@ if ($action == 'setvalue' && $user->admin) * View */ +$form = new Form($db); + $user->fetch_clicktodial(); $wikihelp = 'EN:Module_ClickToDial_En|FR:Module_ClickToDial|ES:Módulo_ClickTodial_Es'; From 9798bb1b30b92b18ff05495983538533d94b91b3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 27 Jul 2020 02:27:27 +0200 Subject: [PATCH 26/29] Fix responsive --- htdocs/admin/clicktodial.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index f6033934077..13efb42af1a 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -79,6 +79,7 @@ print ''; print ''; print ''; +print '
'; print '
'; print ''; print ''; @@ -111,6 +112,7 @@ print $langs->trans("Example").':
http://myphoneserver/mypage?login=__LOGIN__ print '
'; print '
'.$langs->trans("Name").'
'; +print '
'; print '

'; From 19b550009b3dd9710d6795acc8c0229641967e1e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 27 Jul 2020 02:38:31 +0200 Subject: [PATCH 27/29] Trans --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 5887f6cde4a..c99c436915d 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1687,7 +1687,7 @@ AGENDA_SHOW_LINKED_OBJECT=Show linked object into agenda view ##### Clicktodial ##### ClickToDialSetup=Click To Dial module setup ClickToDialUrlDesc=Url called when a click on phone picto is done. In URL, you can use tags
__PHONETO__ that will be replaced with the phone number of person to call
__PHONEFROM__ that will be replaced with phone number of calling person (yours)
__LOGIN__ that will be replaced with clicktodial login (defined on user card)
__PASS__ that will be replaced with clicktodial password (defined on user card). -ClickToDialDesc=This module makea phone numbers clickable links. A click on the icon will make your phone call the number. This can be used to call a call-center system from Dolibarr that can call the phone number on a SIP system for example. +ClickToDialDesc=This module change phone numbers, when using a desktop computer, into clickable links. A click will call the number. This can be used to start the phone call when using a soft phone on your desktop or when using a CTI system based on SIP protocol for example. Note: When using a smartphone, phone numbers are always clickable. ClickToDialUseTelLink=Use just a link "tel:" on phone numbers ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or a software interface installed on the same computer as the browser, and called when you click on a link in your browser that starts with "tel:". If you need a full server solution (no need of local software installation), you must set this to "No" and fill next field. ##### Point Of Sale (CashDesk) ##### From 6d8060bc502784a439c47d939a412807ea467d28 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 27 Jul 2020 14:04:41 +0200 Subject: [PATCH 28/29] FIX DO not erase variable $key and $label during output of extrafields Conflicts: htdocs/core/tpl/extrafields_view.tpl.php --- htdocs/core/tpl/extrafields_view.tpl.php | 86 +++++++++++------------- 1 file changed, 40 insertions(+), 46 deletions(-) diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index 9b324817464..f3a181f0b2e 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -54,50 +54,48 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] $extrafields_collapse_num = ''; $extrafields_collapse_num_old = ''; $i = 0; - foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $label) + foreach ($extrafields->attributes[$object->table_element]['label'] as $tmpkeyextra => $tmplabelextra) { $i++; // Discard if extrafield is a hidden field on form $enabled = 1; - if ($enabled && isset($extrafields->attributes[$object->table_element]['enabled'][$key])) + if ($enabled && isset($extrafields->attributes[$object->table_element]['enabled'][$tmpkeyextra])) { - $enabled = dol_eval($extrafields->attributes[$object->table_element]['enabled'][$key], 1); + $enabled = dol_eval($extrafields->attributes[$object->table_element]['enabled'][$tmpkeyextra], 1); } - if ($enabled && isset($extrafields->attributes[$object->table_element]['list'][$key])) + if ($enabled && isset($extrafields->attributes[$object->table_element]['list'][$tmpkeyextra])) { - $enabled = dol_eval($extrafields->attributes[$object->table_element]['list'][$key], 1); + $enabled = dol_eval($extrafields->attributes[$object->table_element]['list'][$tmpkeyextra], 1); } $perms = 1; - if ($perms && isset($extrafields->attributes[$object->table_element]['perms'][$key])) + if ($perms && isset($extrafields->attributes[$object->table_element]['perms'][$tmpkeyextra])) { - $perms = dol_eval($extrafields->attributes[$object->table_element]['perms'][$key], 1); + $perms = dol_eval($extrafields->attributes[$object->table_element]['perms'][$tmpkeyextra], 1); } - //print $key.'-'.$enabled.'-'.$perms.'-'.$label.$_POST["options_" . $key].'
'."\n"; + //print $tmpkeyextra.'-'.$enabled.'-'.$perms.'-'.$tmplabelextra.$_POST["options_" . $tmpkeyextra].'
'."\n"; if (empty($enabled)) continue; // 0 = Never visible field if (abs($enabled) != 1 && abs($enabled) != 3 && abs($enabled) != 5 && abs($enabled) != 4) continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list <> 4 = not visible at the creation if (empty($perms)) continue; // 0 = Not visible // Load language if required - if (!empty($extrafields->attributes[$object->table_element]['langfile'][$key])) $langs->load($extrafields->attributes[$object->table_element]['langfile'][$key]); + if (!empty($extrafields->attributes[$object->table_element]['langfile'][$tmpkeyextra])) $langs->load($extrafields->attributes[$object->table_element]['langfile'][$tmpkeyextra]); if ($action == 'edit_extras') { - $value = (isset($_POST["options_".$key]) ? $_POST["options_".$key] : $object->array_options["options_".$key]); - } - else - { - $value = $object->array_options["options_".$key]; - //var_dump($key.' - '.$value); + $value = (isset($_POST["options_".$tmpkeyextra]) ? $_POST["options_".$tmpkeyextra] : $object->array_options["options_".$tmpkeyextra]); + } else { + $value = $object->array_options["options_".$tmpkeyextra]; + //var_dump($tmpkeyextra.' - '.$value); } // Print line tr of extra field - if ($extrafields->attributes[$object->table_element]['type'][$key] == 'separate') + if ($extrafields->attributes[$object->table_element]['type'][$tmpkeyextra] == 'separate') { $extrafields_collapse_num = ''; - $extrafield_param = $extrafields->attributes[$object->table_element]['param'][$key]; + $extrafield_param = $extrafields->attributes[$object->table_element]['param'][$tmpkeyextra]; if (!empty($extrafield_param) && is_array($extrafield_param)) { $extrafield_param_list = array_keys($extrafield_param['options']); @@ -105,17 +103,15 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] $extrafield_collapse_display_value = intval($extrafield_param_list[0]); if ($extrafield_collapse_display_value == 1 || $extrafield_collapse_display_value == 2) { - $extrafields_collapse_num = $extrafields->attributes[$object->table_element]['pos'][$key]; + $extrafields_collapse_num = $extrafields->attributes[$object->table_element]['pos'][$tmpkeyextra]; } } } - print $extrafields->showSeparator($key, $object); + print $extrafields->showSeparator($tmpkeyextra, $object); - $lastseparatorkeyfound = $key; - } - else - { + $lastseparatorkeyfound = $tmpkeyextra; + } else { print '
'.img_edit().''.img_edit().'
'; print '
'; + print ''; // Convert date into timestamp format - if (in_array($extrafields->attributes[$object->table_element]['type'][$key], array('date', 'datetime'))) + if (in_array($extrafields->attributes[$object->table_element]['type'][$tmpkeyextra], array('date', 'datetime'))) { - $datenotinstring = $object->array_options['options_'.$key]; - // print 'X'.$object->array_options['options_' . $key].'-'.$datenotinstring.'x'; - if (!is_numeric($object->array_options['options_'.$key])) // For backward compatibility + $datenotinstring = $object->array_options['options_'.$tmpkeyextra]; + // print 'X'.$object->array_options['options_' . $tmpkeyextra].'-'.$datenotinstring.'x'; + if (!is_numeric($object->array_options['options_'.$tmpkeyextra])) // For backward compatibility { $datenotinstring = $db->jdate($datenotinstring); } - //print 'x'.$object->array_options['options_' . $key].'-'.$datenotinstring.' - '.dol_print_date($datenotinstring, 'dayhour'); - $value = isset($_POST["options_".$key]) ? dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]) : $datenotinstring; + //print 'x'.$object->array_options['options_' . $tmpkeyextra].'-'.$datenotinstring.' - '.dol_print_date($datenotinstring, 'dayhour'); + $value = isset($_POST["options_".$tmpkeyextra]) ? dol_mktime($_POST["options_".$tmpkeyextra."hour"], $_POST["options_".$tmpkeyextra."min"], 0, $_POST["options_".$tmpkeyextra."month"], $_POST["options_".$tmpkeyextra."day"], $_POST["options_".$tmpkeyextra."year"]) : $datenotinstring; } //TODO Improve element and rights detection - if ($action == 'edit_extras' && $permok && GETPOST('attribute', 'none') == $key) + if ($action == 'edit_extras' && $permok && GETPOST('attribute', 'none') == $tmpkeyextra) { $fieldid = 'id'; if ($object->table_element == 'societe') $fieldid = 'socid'; print ''; print ''; - print ''; + print ''; print ''; print ''; - print $extrafields->showInputField($key, $value, '', '', '', 0, $object->id, $object->table_element); + print $extrafields->showInputField($tmpkeyextra, $value, '', '', '', 0, $object->id, $object->table_element); print ''; print ''; - } - else - { - //var_dump($key.'-'.$value.'-'.$object->table_element); - print $extrafields->showOutputField($key, $value, '', $object->table_element); + } else { + //var_dump($tmpkeyextra.'-'.$value.'-'.$object->table_element); + print $extrafields->showOutputField($tmpkeyextra, $value, '', $object->table_element); } print '

'; */ $sql = "SELECT f.ref, f.rowid, f.total_ttc, f.fk_statut, f.paye, f.type,"; $sql .= " pfd.date_demande, pfd.amount,"; -$sql .= " s.nom as name, s.email, s.rowid as socid"; +$sql .= " s.nom as name, s.email, s.rowid as socid, s.tva_intra"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f,"; $sql .= " ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -138,13 +138,14 @@ if ($resql) $thirdpartystatic->id = $obj->socid; $thirdpartystatic->name = $obj->name; $thirdpartystatic->email = $obj->email; + $thirdpartystatic->tva_intra = $obj->tva_intra; print '
'; print $invoicestatic->getNomUrl(1, 'withdraw'); print ''; - print $thirdpartystatic->getNomUrl(1, 'customer'); + print $thirdpartystatic->getNomUrl(1, 'supplier'); print ''; diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index 3ad145e2f56..23b6fdac500 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -31,10 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.p require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Load translation files required by the page -$langs->loadLangs(array('banks', 'categories', 'bills', 'withdrawals')); - -if (!$user->rights->prelevement->bons->lire) -accessforbidden(); +$langs->loadLangs(array('banks', 'categories', 'bills', 'companies', 'withdrawals')); // Security check if ($user->socid > 0) accessforbidden(); @@ -44,7 +41,6 @@ $action = GETPOST('action', 'alpha'); $id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); $socid = GETPOST('socid', 'int'); - $type = GETPOST('type', 'aZ09'); // Load variable for pagination @@ -67,6 +63,13 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ $hookmanager->initHooks(array('directdebitprevcard', 'globalcard', 'directdebitprevlist')); +if (!$user->rights->prelevement->bons->lire && $object->type != 'bank-transfer') { + accessforbidden(); +} +if (!$user->rights->paymentbybanktransfer->read && $object->type == 'bank-transfer') { + accessforbidden(); +} + /* * Actions @@ -174,7 +177,7 @@ if ($id > 0 || $ref) }*/ - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref'); @@ -200,7 +203,7 @@ if ($id > 0 || $ref) print '
'.$langs->trans("TransData").''; print dol_print_date($object->date_trans, 'day'); - print ' '.$langs->trans("By").' '.$muser->getFullName($langs).'
'.$langs->trans("TransMetod").''; print $object->methodes_trans[$object->method_trans]; print '
'; - print $langs->trans("BankToReceiveWithdraw"); + $labelofbankfield = "BankToReceiveWithdraw"; + if ($object->type == 'bank-transfer') $labelofbankfield = 'BankToPayCreditTransfer'; + print $langs->trans($labelofbankfield); print ''; if ($acc->id > 0) @@ -232,9 +237,13 @@ if ($id > 0 || $ref) print '
'; - print $langs->trans("WithdrawalFile").''; + $labelfororderfield = 'WithdrawalFile'; + if ($object->type == 'bank-transfer') $labelfororderfield = 'CreditTransferFile'; + print $langs->trans($labelfororderfield).''; $relativepath = 'receipts/'.$object->ref.'.xml'; - print ''.$relativepath.''; + $modulepart = 'prelevement'; + if ($object->type == 'bank-transfer') $modulepart = 'paymentbybanktransfer'; + print ''.$relativepath.''; print '
'; print ''; diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 8cf77667a62..29c70ba8fab 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -295,6 +295,7 @@ class BonPrelevement extends CommonObject $sql .= ", p.method_trans, p.fk_user_trans"; $sql .= ", p.date_credit as date_credit"; $sql .= ", p.fk_user_credit"; + $sql .= ", p.type"; $sql .= ", p.statut as status"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; $sql .= " WHERE p.entity IN (".getEntity('invoice').")"; @@ -322,6 +323,8 @@ class BonPrelevement extends CommonObject $this->date_credit = $this->db->jdate($obj->date_credit); $this->user_credit = $obj->fk_user_credit; + $this->type = $obj->type; + $this->status = $obj->status; $this->statut = $obj->status; // For backward compatibility @@ -930,14 +933,14 @@ class BonPrelevement extends CommonObject foreach ($factures as $key => $fac) { if ($type != 'bank-transfer') { - $fact = new Facture($this->db); + $tmpinvoice = new Facture($this->db); } else { - $fact = new FactureFournisseur($this->db); + $tmpinvoice = new FactureFournisseur($this->db); } - $resfetch = $fact->fetch($fac[0]); + $resfetch = $tmpinvoice->fetch($fac[0]); if ($resfetch >= 0) // Field 0 of $fac is rowid of invoice { - if ($soc->fetch($fact->socid) >= 0) + if ($soc->fetch($tmpinvoice->socid) >= 0) { $bac = new CompanyBankAccount($this->db); $bac->fetch(0, $soc->id); @@ -963,9 +966,9 @@ class BonPrelevement extends CommonObject } else { - dol_syslog(__METHOD__."::Check BAN Error on default bank number IBAN/BIC for thirdparty reported by verif() ".$fact->socid." ".$soc->name, LOG_WARNING); - $this->invoice_in_error[$fac[0]] = "Error on default bank number IBAN/BIC for invoice ".$fact->getNomUrl(0)." for thirdparty ".$soc->getNomUrl(0); - $this->thirdparty_in_error[$soc->id] = "Error on default bank number IBAN/BIC for invoice ".$fact->getNomUrl(0)." for thirdparty ".$soc->getNomUrl(0); + dol_syslog(__METHOD__."::Check BAN Error on default bank number IBAN/BIC for thirdparty reported by verif() ".$tmpinvoice->socid." ".$soc->name, LOG_WARNING); + $this->invoice_in_error[$fac[0]] = "Error on default bank number IBAN/BIC for invoice ".$tmpinvoice->getNomUrl(0)." for thirdparty ".$soc->getNomUrl(0); + $this->thirdparty_in_error[$soc->id] = "Error on default bank number IBAN/BIC for invoice ".$tmpinvoice->getNomUrl(0)." for thirdparty ".$soc->getNomUrl(0); } } else @@ -1142,7 +1145,7 @@ class BonPrelevement extends CommonObject * Create file of direct debit order or credit transfer into a XML file */ - dol_syslog(__METHOD__."::Init direct debit file for ".count($factures_prev)." invoices", LOG_DEBUG); + dol_syslog(__METHOD__."::Init direct debit or credit transfer file for ".count($factures_prev)." invoices", LOG_DEBUG); if (count($factures_prev) > 0) { @@ -1168,8 +1171,8 @@ class BonPrelevement extends CommonObject $this->factures = $factures_prev_id; $this->context['factures_prev'] = $factures_prev; - // Generation of SEPA file $this->filename - // This also the the property $this->total that is included into file + // Generation of direct debit or credti transfer file $this->filename (May be a SEPA file for european countries) + // This also set the property $this->total with amount that is included into file $result = $this->generate($format, $executiondate, $type); } dol_syslog(__METHOD__."::End withdraw receipt, file ".$this->filename, LOG_DEBUG); @@ -1499,8 +1502,110 @@ class BonPrelevement extends CommonObject $found++; if ($type == 'bank-transfer') { - print 'TODO'; - exit; + /** + * SECTION CREATION FICHIER SEPA - CREDIT TRANSFER + */ + // SEPA Initialisation + $CrLf = "\n"; + + $now = dol_now(); + + $dateTime_ECMA = dol_print_date($now, '%Y-%m-%dT%H:%M:%S'); + + $date_actu = $now; + if (!empty($executiondate)) $date_actu = $executiondate; + + $dateTime_YMD = dol_print_date($date_actu, '%Y%m%d'); + $dateTime_YMDHMS = dol_print_date($date_actu, '%Y%m%d%H%M%S'); + $fileCrediteurSection = ''; + $fileEmetteurSection = ''; + $i = 0; + + /* + * Section Creditor (sepa Crediteurs bloc lines) + */ + + $sql = "SELECT soc.code_client as code, soc.address, soc.zip, soc.town, c.code as country_code,"; + $sql .= " pl.client_nom as nom, pl.code_banque as cb, pl.code_guichet as cg, pl.number as cc, pl.amount as somme,"; + $sql .= " f.ref as fac, pf.fk_facture as idfac, rib.datec, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum, rib.rum, rib.date_rum"; + $sql .= " FROM"; + $sql .= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,"; + $sql .= " ".MAIN_DB_PREFIX."facture_fourn as f,"; + $sql .= " ".MAIN_DB_PREFIX."prelevement_facture as pf,"; + $sql .= " ".MAIN_DB_PREFIX."societe as soc,"; + $sql .= " ".MAIN_DB_PREFIX."c_country as c,"; + $sql .= " ".MAIN_DB_PREFIX."societe_rib as rib"; + $sql .= " WHERE pl.fk_prelevement_bons = ".$this->id; + $sql .= " AND pl.rowid = pf.fk_prelevement_lignes"; + $sql .= " AND pf.fk_facture_fourn = f.rowid"; + $sql .= " AND soc.fk_pays = c.rowid"; + $sql .= " AND soc.rowid = f.fk_soc"; + $sql .= " AND rib.fk_soc = f.fk_soc"; + $sql .= " AND rib.default_rib = 1"; + $sql .= " AND rib.type = 'ban'"; + //print $sql; + + // Define $fileCrediteurSection. One section DrctDbtTxInf per invoice. + $resql = $this->db->query($sql); + if ($resql) + { + $num = $this->db->num_rows($resql); + while ($i < $num) + { + $obj = $this->db->fetch_object($resql); + $daterum = (!empty($obj->date_rum)) ? $this->db->jdate($obj->date_rum) : $this->db->jdate($obj->datec); + $fileCrediteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->fac, $obj->idfac, $obj->iban, $obj->bic, $daterum, $obj->drum, $obj->rum); + $this->total = $this->total + $obj->somme; + $i++; + } + $nbtotalDrctDbtTxInf = $i; + } + else + { + fputs($this->file, 'ERROR CREDITOR '.$sql.$CrLf); // CREDITORS = Suppliers + $result = -2; + } + + // Define $fileEmetteurSection. Start of bloc PmtInf. Will contains all $nbtotalDrctDbtTxInf + if ($result != -2) + { + $fileEmetteurSection .= $this->EnregEmetteurSEPA($conf, $date_actu, $nbtotalDrctDbtTxInf, $this->total, $CrLf, $format); + } + + /** + * SECTION CREATION SEPA FILE - CREDTI TRANSFER - ISO200022 + */ + // SEPA File Header + fputs($this->file, '<'.'?xml version="1.0" encoding="UTF-8" standalone="yes"?'.'>'.$CrLf); + fputs($this->file, ''.$CrLf); + fputs($this->file, ' '.$CrLf); + // SEPA Group header + fputs($this->file, ' '.$CrLf); + fputs($this->file, ' '.('CREDTRANS'.$dateTime_YMD.'/REF'.$this->id).''.$CrLf); + fputs($this->file, ' '.$dateTime_ECMA.''.$CrLf); + fputs($this->file, ' '.$i.''.$CrLf); + fputs($this->file, ' '.$this->total.''.$CrLf); + fputs($this->file, ' '.$CrLf); + fputs($this->file, ' '.strtoupper(dol_string_unaccent($this->raison_sociale)).''.$CrLf); + fputs($this->file, ' '.$CrLf); + fputs($this->file, ' '.$CrLf); + fputs($this->file, ' '.$CrLf); + fputs($this->file, ' '.$conf->global->PRELEVEMENT_ICS.''.$CrLf); + fputs($this->file, ' '.$CrLf); + fputs($this->file, ' '.$CrLf); + fputs($this->file, ' '.$CrLf); + fputs($this->file, ' '.$CrLf); + fputs($this->file, ' '.$CrLf); + // SEPA File Emetteur (mycompany) + if ($result != -2) + { fputs($this-> file, $fileEmetteurSection); } + // SEPA File Creditors + if ($result != -2) + { fputs($this-> file, $fileCrediteurSection); } + // SEPA FILE FOOTER + fputs($this->file, ' '.$CrLf); + fputs($this->file, ' '.$CrLf); + fputs($this->file, ''.$CrLf); } else { /** * SECTION CREATION FICHIER SEPA @@ -1566,18 +1671,14 @@ class BonPrelevement extends CommonObject $result = -2; } - // Define $fileEmetteurSection. Start of bloc PmtInf. Will contains all DrctDbtTxInf + // Define $fileEmetteurSection. Start of bloc PmtInf. Will contains all $nbtotalDrctDbtTxInf if ($result != -2) { $fileEmetteurSection .= $this->EnregEmetteurSEPA($conf, $date_actu, $nbtotalDrctDbtTxInf, $this->total, $CrLf, $format); } - else - { - fputs($this->file, 'ERROR CREDITOR'.$CrLf); // CREDITOR = My company - } /** - * SECTION CREATION SEPA FILE + * SECTION CREATION SEPA FILE - ISO200022 */ // SEPA File Header fputs($this->file, '<'.'?xml version="1.0" encoding="UTF-8" standalone="yes"?'.'>'.$CrLf); diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index ff25af5e0e9..fdbb6189c5c 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -104,7 +104,11 @@ if (empty($reshook)) } else { - setEventMessages($langs->trans("DirectDebitOrderCreated", $bprev->getNomUrl(1)), null); + if ($type != 'bank-transfer') { + setEventMessages($langs->trans("DirectDebitOrderCreated", $bprev->getNomUrl(1)), null); + } else { + setEventMessages($langs->trans("CreditTransferOrderCreated", $bprev->getNomUrl(1)), null); + } header("Location: ".DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$bprev->id); exit; diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index b92df4e446c..2d2be116aaf 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -192,6 +192,14 @@ print ''; $param = ''; +$label = 'NewStandingOrder'; +$typefilter = ''; +if ($type == 'bank-transfer') { + $label = 'NewPaymentByBankTransfer'; + $typefilter = 'type='.$type; +} +$newcardbutton .= dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/prelevement/create.php'.($typefilter ? '?'.$typefilter : '')); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit); print ''; diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index 556f40de9be..816795bfdbd 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -32,21 +32,21 @@ require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Load translation files required by the page -$langs->loadLangs(array('banks', 'categories', 'companies', 'withdrawals', 'bills')); +$langs->loadLangs(array('banks', 'categories', 'bills', 'companies', 'withdrawals')); // Securite acces client if ($user->socid > 0) accessforbidden(); // Get supervariables $id = GETPOST('id', 'int'); -$socid = GETPOST('socid', 'int'); $ref = GETPOST('ref', 'alpha'); - +$socid = GETPOST('socid', 'int'); $type = GETPOST('type', 'aZ09'); +// Load variable for pagination $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; -$sortfield = GETPOST("sortfield", 'alpha'); -$sortorder = GETPOST("sortorder", 'alpha'); +$sortfield = GETPOST('sortfield', 'alpha'); +$sortorder = GETPOST('sortorder', 'alpha'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $limit * $page; @@ -57,6 +57,17 @@ if (!$sortorder) $sortorder = 'DESC'; $object = new BonPrelevement($db); +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals + +$hookmanager->initHooks(array('directdebitprevcard', 'globalcard', 'directdebitprevlist')); + +if (!$user->rights->prelevement->bons->lire && $object->type != 'bank-transfer') { + accessforbidden(); +} +if (!$user->rights->paymentbybanktransfer->read && $object->type == 'bank-transfer') { + accessforbidden(); +} /* @@ -75,19 +86,17 @@ if ($id > 0 || $ref) $head = prelevement_prepare_head($object); dol_fiche_head($head, 'invoices', $langs->trans("WithdrawalsReceipts"), -1, 'payment'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref'); print '
'; print '
'; - print '
'; + print '
'."\n"; //print ''; print ''; print ''; - // Status - //print ''; if ($object->date_trans <> 0) { @@ -119,7 +128,9 @@ if ($id > 0 || $ref) $result = $acc->fetch($conf->global->PRELEVEMENT_ID_BANKACCOUNT); print ''; print ''; print '
'.$langs->trans("Ref").''.$object->getNomUrl(1).'
'.$langs->trans("Date").''.dol_print_date($object->datec, 'day').'
'.$langs->trans("Amount").''.price($object->amount).'
'.$langs->trans('Status').''.$object->getLibStatut(1).'
'; - print $langs->trans("BankToReceiveWithdraw"); + $labelofbankfield = "BankToReceiveWithdraw"; + if ($object->type == 'bank-transfer') $labelofbankfield = 'BankToPayCreditTransfer'; + print $langs->trans($labelofbankfield); print ''; if ($acc->id > 0) @@ -128,9 +139,13 @@ if ($id > 0 || $ref) print '
'; - print $langs->trans("WithdrawalFile").''; + $labelfororderfield = 'WithdrawalFile'; + if ($object->type == 'bank-transfer') $labelfororderfield = 'CreditTransferFile'; + print $langs->trans($labelfororderfield).''; $relativepath = 'receipts/'.$object->ref.'.xml'; - print ''.$relativepath.''; + $modulepart = 'prelevement'; + if ($object->type == 'bank-transfer') $modulepart = 'paymentbybanktransfer'; + print ''.$relativepath.''; print '
'; print ''; @@ -151,13 +166,25 @@ $sql .= " s.rowid as socid, s.nom as name, pl.statut, pl.amount as amount_reques $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; $sql .= ", ".MAIN_DB_PREFIX."prelevement_lignes as pl"; $sql .= ", ".MAIN_DB_PREFIX."prelevement_facture as pf"; -$sql .= ", ".MAIN_DB_PREFIX."facture as f"; +if ($object->type != 'bank-transfer') { + $sql .= ", ".MAIN_DB_PREFIX."facture as f"; +} else { + $sql .= ", ".MAIN_DB_PREFIX."facture_fourn as f"; +} $sql .= ", ".MAIN_DB_PREFIX."societe as s"; $sql .= " WHERE pf.fk_prelevement_lignes = pl.rowid"; $sql .= " AND pl.fk_prelevement_bons = p.rowid"; $sql .= " AND f.fk_soc = s.rowid"; -$sql .= " AND pf.fk_facture = f.rowid"; -$sql .= " AND f.entity IN (".getEntity('invoice').")"; +if ($object->type != 'bank-transfer') { + $sql .= " AND pf.fk_facture = f.rowid"; +} else { + $sql .= " AND pf.fk_facture_fourn = f.rowid"; +} +if ($object->type != 'bank-transfer') { + $sql .= " AND f.entity IN (".getEntity('invoice').")"; +} else { + $sql .= " AND f.entity IN (".getEntity('supplier_invoice').")"; +} if ($object->id > 0) $sql .= " AND p.rowid=".$object->id; if ($socid) $sql .= " AND s.rowid = ".$socid; $sql .= $db->order($sortfield, $sortorder); diff --git a/htdocs/compta/prelevement/fiche-rejet.php b/htdocs/compta/prelevement/fiche-rejet.php index 75cff74da8a..10abbcf5166 100644 --- a/htdocs/compta/prelevement/fiche-rejet.php +++ b/htdocs/compta/prelevement/fiche-rejet.php @@ -21,7 +21,7 @@ /** * \file htdocs/compta/prelevement/fiche-rejet.php * \ingroup prelevement - * \brief Withdraw reject + * \brief Debit order or credit transfer reject */ require '../../main.inc.php'; @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Load translation files required by the page $langs->loadLangs(array("banks", "categories", 'withdrawals', 'bills')); -// Securite acces client +// Security check if ($user->socid > 0) accessforbidden(); // Get supervariables @@ -55,6 +55,15 @@ $pagenext = $page + 1; $object = new BonPrelevement($db); +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals + +if (!$user->rights->prelevement->bons->lire && $object->type != 'bank-transfer') { + accessforbidden(); +} +if (!$user->rights->paymentbybanktransfer->read && $object->type == 'bank-transfer') { + accessforbidden(); +} @@ -71,7 +80,7 @@ if ($prev_id > 0 || $ref) $head = prelevement_prepare_head($object); dol_fiche_head($head, 'rejects', $langs->trans("WithdrawalsReceipts"), -1, 'payment'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref'); @@ -83,13 +92,6 @@ if ($prev_id > 0 || $ref) print ''.$langs->trans("Date").''.dol_print_date($object->datec, 'day').''; print ''.$langs->trans("Amount").''.price($object->amount).''; - // Status - /* - print ''.$langs->trans('Status').''; - print ''.$object->getLibStatut(1).''; - print ''; - */ - if ($object->date_trans <> 0) { $muser = new User($db); @@ -120,7 +122,9 @@ if ($prev_id > 0 || $ref) $result = $acc->fetch($conf->global->PRELEVEMENT_ID_BANKACCOUNT); print ''; - print $langs->trans("BankToReceiveWithdraw"); + $labelofbankfield = "BankToReceiveWithdraw"; + if ($object->type == 'bank-transfer') $labelofbankfield = 'BankToPayCreditTransfer'; + print $langs->trans($labelofbankfield); print ''; print ''; if ($acc->id > 0) @@ -129,9 +133,13 @@ if ($prev_id > 0 || $ref) print ''; print ''; - print $langs->trans("WithdrawalFile").''; + $labelfororderfield = 'WithdrawalFile'; + if ($object->type == 'bank-transfer') $labelfororderfield = 'CreditTransferFile'; + print $langs->trans($labelfororderfield).''; $relativepath = 'receipts/'.$object->ref.'.xml'; - print ''.$relativepath.''; + $modulepart = 'prelevement'; + if ($object->type == 'bank-transfer') $modulepart = 'paymentbybanktransfer'; + print ''.$relativepath.''; print ''; print ''; @@ -144,6 +152,7 @@ if ($prev_id > 0 || $ref) } } + $rej = new RejetPrelevement($db, $user); /* diff --git a/htdocs/compta/prelevement/fiche-stat.php b/htdocs/compta/prelevement/fiche-stat.php index 899ff69fea1..49508cdde46 100644 --- a/htdocs/compta/prelevement/fiche-stat.php +++ b/htdocs/compta/prelevement/fiche-stat.php @@ -20,7 +20,7 @@ /** * \file htdocs/compta/prelevement/fiche-stat.php * \ingroup prelevement - * \brief Prelevement statistics + * \brief Debit order or credit transfer statistics */ require '../../main.inc.php'; @@ -54,6 +54,17 @@ $pagenext = $page + 1; $object = new BonPrelevement($db); +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals + +if (!$user->rights->prelevement->bons->lire && $object->type != 'bank-transfer') { + accessforbidden(); +} +if (!$user->rights->paymentbybanktransfer->read && $object->type == 'bank-transfer') { + accessforbidden(); +} + + /* * View @@ -68,7 +79,7 @@ if ($prev_id > 0 || $ref) $head = prelevement_prepare_head($object); dol_fiche_head($head, 'statistics', $langs->trans("WithdrawalsReceipts"), -1, 'payment'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref'); @@ -80,13 +91,6 @@ if ($prev_id > 0 || $ref) print ''.$langs->trans("Date").''.dol_print_date($object->datec, 'day').''; print ''.$langs->trans("Amount").''.price($object->amount).''; - // Status - /* - print ''.$langs->trans('Status').''; - print ''.$object->getLibStatut(1).''; - print ''; - */ - if ($object->date_trans <> 0) { $muser = new User($db); @@ -117,7 +121,9 @@ if ($prev_id > 0 || $ref) $result = $acc->fetch($conf->global->PRELEVEMENT_ID_BANKACCOUNT); print ''; - print $langs->trans("BankToReceiveWithdraw"); + $labelofbankfield = "BankToReceiveWithdraw"; + if ($object->type == 'bank-transfer') $labelofbankfield = 'BankToPayCreditTransfer'; + print $langs->trans($labelofbankfield); print ''; print ''; if ($acc->id > 0) @@ -126,9 +132,13 @@ if ($prev_id > 0 || $ref) print ''; print ''; - print $langs->trans("WithdrawalFile").''; + $labelfororderfield = 'WithdrawalFile'; + if ($object->type == 'bank-transfer') $labelfororderfield = 'CreditTransferFile'; + print $langs->trans($labelfororderfield).''; $relativepath = 'receipts/'.$object->ref.'.xml'; - print ''.$relativepath.''; + $modulepart = 'prelevement'; + if ($object->type == 'bank-transfer') $modulepart = 'paymentbybanktransfer'; + print ''.$relativepath.''; print ''; print ''; @@ -137,14 +147,13 @@ if ($prev_id > 0 || $ref) } else { - $langs->load("errors"); - print $langs->trans("Error"); + dol_print_error($db); } /* * Stats */ - $ligne = new LignePrelevement($db); + $line = new LignePrelevement($db); $sql = "SELECT sum(pl.amount), pl.statut"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl"; @@ -170,7 +179,7 @@ if ($prev_id > 0 || $ref) print ''; - print $ligne->LibStatut($row[1], 1); + print $line->LibStatut($row[1], 1); print ''; print price($row[0]); diff --git a/htdocs/core/lib/prelevement.lib.php b/htdocs/core/lib/prelevement.lib.php index a404e19184e..8008c9fd51f 100644 --- a/htdocs/core/lib/prelevement.lib.php +++ b/htdocs/core/lib/prelevement.lib.php @@ -39,8 +39,13 @@ function prelevement_prepare_head(BonPrelevement $object) $h = 0; $head = array(); + $titleoftab = "WithdrawalsReceipts"; + if ($object->type == 'bank-transfer') { + $titleoftab = "BankTransferReceipts"; + } + $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$object->id; - $head[$h][1] = $langs->trans("WithdrawalsReceipts"); + $head[$h][1] = $langs->trans($titleoftab); $head[$h][2] = 'prelevement'; $h++; diff --git a/htdocs/langs/en_US/withdrawals.lang b/htdocs/langs/en_US/withdrawals.lang index 841a9c2d480..662c587108a 100644 --- a/htdocs/langs/en_US/withdrawals.lang +++ b/htdocs/langs/en_US/withdrawals.lang @@ -77,12 +77,12 @@ StatusMotif8=Other reason CreateForSepaFRST=Create direct debit file (SEPA FRST) CreateForSepaRCUR=Create direct debit file (SEPA RCUR) CreateAll=Create direct debit file (all) -CreateFileForPaymentByBankTransfer=Create credit transfer (all) +CreateFileForPaymentByBankTransfer=Create file for credit transfer (all) CreateSepaFileForPaymentByBankTransfer=Create credit transfer file (SEPA) CreateGuichet=Only office CreateBanque=Only bank OrderWaiting=Waiting for treatment -NotifyTransmision=Withdrawal Transmission +NotifyTransmision=File transmission NotifyCredit=Withdrawal Credit NumeroNationalEmetter=National Transmitter Number WithBankUsingRIB=For bank accounts using RIB @@ -95,7 +95,8 @@ ShowWithdraw=Show Direct Debit Order IfInvoiceNeedOnWithdrawPaymentWontBeClosed=However, if invoice has at least one direct debit payment order not yet processed, it won't be set as paid to allow prior withdrawal management. DoStandingOrdersBeforePayments=This tab allows you to request a direct debit payment order. Once done, go into menu Bank->Payment by direct debit to generate and manage the direct debit order. When direct debit order is closed, payment on invoices will be automatically recorded, and invoices closed if remainder to pay is null. DoCreditTransferBeforePayments=This tab allows you to request a credit transfer order. Once done, go into menu Bank->Payment by credit transfer to generate and manage the credit transfer order. When credit transfer order is closed, payment on invoices will be automatically recorded, and invoices closed if remainder to pay is null. -WithdrawalFile=Withdrawal file +WithdrawalFile=Debit order file +CreditTransferFile=Credit transfer file SetToStatusSent=Set to status "File Sent" ThisWillAlsoAddPaymentOnInvoice=This will also record payments on invoices and will classify them as "Paid" if remain to pay is null StatisticsByLineStatus=Statistics by status of lines @@ -121,6 +122,7 @@ SEPAFrstOrRecur=Type of payment ModeRECUR=Recurring payment ModeFRST=One-off payment PleaseCheckOne=Please check one only +CreditTransferOrderCreated=Credit transfer order %s created DirectDebitOrderCreated=Direct debit order %s created AmountRequested=Amount requested SEPARCUR=SEPA CUR