From bb2f13aed4e56b872e02cc8cb9cb31e23a843cdc Mon Sep 17 00:00:00 2001 From: Quentin VIAL-GOUTEYRON Date: Thu, 25 Jan 2024 14:40:11 +0100 Subject: [PATCH 1/6] FIX : crabe PDF is generating in conf->entity instead of object->entity --- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index af927f6d188..8f4dbd66606 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -304,11 +304,11 @@ class pdf_crabe extends ModelePDFFactures // Definition of $dir and $file if ($object->specimen) { - $dir = empty($conf->facture->multidir_output[$conf->entity]) ? $conf->facture->dir_output : $conf->facture->multidir_output[$conf->entity]; + $dir = empty($conf->facture->multidir_output[$object->entity]) ? $conf->facture->dir_output : $conf->facture->multidir_output[$object->entity]; $file = $dir."/SPECIMEN.pdf"; } else { $objectref = dol_sanitizeFileName($object->ref); - $dir = (empty($conf->facture->multidir_output[$conf->entity]) ? $conf->facture->dir_output : $conf->facture->multidir_output[$conf->entity])."/".$objectref; + $dir = (empty($conf->facture->multidir_output[$object->entity]) ? $conf->facture->dir_output : $conf->facture->multidir_output[$object->entity])."/".$objectref; $file = $dir."/".$objectref.".pdf"; } if (!file_exists($dir)) { From 8dce4e711409be5d449ec2c0179b2a8e5645bee8 Mon Sep 17 00:00:00 2001 From: Alban Durrheimer Date: Fri, 26 Jan 2024 10:00:51 +0100 Subject: [PATCH 2/6] Fix port in Docker MailDev --- build/docker/Dockerfile | 2 +- build/docker/docker-compose.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/docker/Dockerfile b/build/docker/Dockerfile index 69f4d27b26f..5cd4c60673b 100644 --- a/build/docker/Dockerfile +++ b/build/docker/Dockerfile @@ -50,7 +50,7 @@ RUN echo 'xdebug.idekey="netbeans-xdebug"' >> ${PHP_INI_DIR}/php.ini # set up sendmail config, to use maildev RUN echo "account default" > /etc/msmtprc RUN echo "auth off" >> /etc/msmtprc -RUN echo "port 25" >> /etc/msmtprc +RUN echo "port 1025" >> /etc/msmtprc RUN echo "host mail" >> /etc/msmtprc RUN echo "from local@localdomain.com" >> /etc/msmtprc RUN echo "domain localhost.localdomain" >> /etc/msmtprc diff --git a/build/docker/docker-compose.yml b/build/docker/docker-compose.yml index ddcdc58560a..cc2988a67d1 100644 --- a/build/docker/docker-compose.yml +++ b/build/docker/docker-compose.yml @@ -55,8 +55,8 @@ services: mail: image: maildev/maildev ports: - - "8081:80" - - "25:25" + - "8081:1080" + - "25:1025" networks: - internal-pod - external-pod From 5a412c66f77430f3579af4a6d8b2dd1d1eb2f3bc Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 26 Jan 2024 10:58:23 +0100 Subject: [PATCH 3/6] fix broken feature in 19 for product on task time --- htdocs/projet/tasks/time.php | 63 +++++++++++++++++------------------- 1 file changed, 29 insertions(+), 34 deletions(-) diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 8a4c7f1c976..37f74e0f603 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -158,36 +158,6 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa $massaction = ''; } -// Definition of fields for list -$arrayfields = array(); -$arrayfields['t.element_date'] = array('label'=>$langs->trans("Date"), 'checked'=>1); -$arrayfields['p.fk_soc'] = array('label'=>$langs->trans("ThirdParty"), 'type'=>'integer:Societe:/societe/class/societe.class.php:1','checked'=>1); -$arrayfields['s.name_alias'] = array('label'=>$langs->trans("AliasNameShort"), 'type'=>'integer:Societe:/societe/class/societe.class.php:1'); -if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) { // Not a dedicated task - if (! empty($allprojectforuser)) { - $arrayfields['p.project_ref'] = ['label' => $langs->trans('RefProject'), 'checked' => 1]; - $arrayfields['p.project_label'] = ['label' => $langs->trans('ProjectLabel'), 'checked' => 1]; - } - $arrayfields['t.element_ref'] = array('label'=>$langs->trans("RefTask"), 'checked'=>1); - $arrayfields['t.element_label'] = array('label'=>$langs->trans("LabelTask"), 'checked'=>1); -} -$arrayfields['author'] = array('label' => $langs->trans("By"), 'checked' => 1); -$arrayfields['t.note'] = array('label' => $langs->trans("Note"), 'checked' => 1); -if (!getDolGlobalInt('PROJECT_HIDE_TASKS') && getDolGlobalInt('PROJECT_BILL_TIME_SPENT') && !$projectstatic->usage_bill_time ) { - $projectstatic->usage_bill_time=1; -} -if (isModEnabled('service') && !empty($projectstatic->thirdparty) && $projectstatic->thirdparty->id > 0 && $projectstatic->usage_bill_time) { - $arrayfields['t.fk_product'] = array('label' => $langs->trans("Product"), 'checked' => 1); -} -$arrayfields['t.element_duration'] = array('label'=>$langs->trans("Duration"), 'checked'=>1); -$arrayfields['value'] = array('label'=>$langs->trans("Value"), 'checked'=>1, 'enabled'=>isModEnabled("salaries")); -$arrayfields['valuebilled'] = array('label'=>$langs->trans("Billed"), 'checked'=>1, 'enabled'=>(((getDolGlobalInt('PROJECT_HIDE_TASKS') || !getDolGlobalInt('PROJECT_BILL_TIME_SPENT')) ? 0 : 1) && $projectstatic->usage_bill_time)); -// Extra fields -include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php'; - -$arrayfields = dol_sort_array($arrayfields, 'position'); - - $parameters = array('socid' => $socid, 'projectid' => $projectid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -1296,7 +1266,31 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser // Print form confirm print $formconfirm; + // Definition of fields for list + $arrayfields = array(); + $arrayfields['t.element_date'] = array('label'=>$langs->trans("Date"), 'checked'=>1); + $arrayfields['p.fk_soc'] = array('label'=>$langs->trans("ThirdParty"), 'type'=>'integer:Societe:/societe/class/societe.class.php:1','checked'=>1); + $arrayfields['s.name_alias'] = array('label'=>$langs->trans("AliasNameShort"), 'type'=>'integer:Societe:/societe/class/societe.class.php:1'); + if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) { // Not a dedicated task + if (! empty($allprojectforuser)) { + $arrayfields['p.project_ref'] = ['label' => $langs->trans('RefProject'), 'checked' => 1]; + $arrayfields['p.project_label'] = ['label' => $langs->trans('ProjectLabel'), 'checked' => 1]; + } + $arrayfields['t.element_ref'] = array('label'=>$langs->trans("RefTask"), 'checked'=>1); + $arrayfields['t.element_label'] = array('label'=>$langs->trans("LabelTask"), 'checked'=>1); + } + $arrayfields['author'] = array('label' => $langs->trans("By"), 'checked' => 1); + $arrayfields['t.note'] = array('label' => $langs->trans("Note"), 'checked' => 1); + if (isModEnabled('service') && !empty($projectstatic->thirdparty) && $projectstatic->thirdparty->id > 0 && $projectstatic->usage_bill_time) { + $arrayfields['t.fk_product'] = array('label' => $langs->trans("Product"), 'checked' => 1); + } + $arrayfields['t.element_duration'] = array('label'=>$langs->trans("Duration"), 'checked'=>1); + $arrayfields['value'] = array('label'=>$langs->trans("Value"), 'checked'=>1, 'enabled'=>isModEnabled("salaries")); + $arrayfields['valuebilled'] = array('label'=>$langs->trans("Billed"), 'checked'=>1, 'enabled'=>(((getDolGlobalInt('PROJECT_HIDE_TASKS') || !getDolGlobalInt('PROJECT_BILL_TIME_SPENT')) ? 0 : 1) && $projectstatic->usage_bill_time)); + // Extra fields + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php'; + $arrayfields = dol_sort_array($arrayfields, 'position'); $param = ''; if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { @@ -1840,8 +1834,8 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser if (isModEnabled("service") && !empty($projectstatic->thirdparty) && $projectstatic->thirdparty->id > 0 && $projectstatic->usage_bill_time) { print ''; - print img_picto('', 'product'); - print $form->select_produits('', 'fk_product', '1', 0, $projectstatic->thirdparty->price_level, 1, 2, '', 1, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth150', 0, '', null, 1); + print img_picto('', 'service'); + print $form->select_produits((GETPOSTISSET('fk_product')?GETPOST("fk_product", 'int'):''), 'fk_product', '1', 0, $projectstatic->thirdparty->price_level, 1, 2, '', 1, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth150', 0, '', null, 1); print ''; } } @@ -2345,9 +2339,10 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser // Product if (!empty($arrayfields['t.fk_product']['checked'])) { - print ''; + print ''; if ($action == 'editline' && $_GET['lineid'] == $task_time->rowid) { - $form->select_produits($task_time->fk_product, 'fk_product', '1', 0, $projectstatic->thirdparty->price_level, 1, 2, '', 0, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth500'); + print img_picto('', 'service'); + print $form->select_produits($task_time->fk_product, 'fk_product', '1', 0, $projectstatic->thirdparty->price_level, 1, 2, '', 1, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth500', 0, '', null, 1); } elseif (!empty($task_time->fk_product)) { $product = new Product($db); $resultFetch = $product->fetch($task_time->fk_product); From 78c06fbd074372c0e1890bb0ce34397d7ea5909e Mon Sep 17 00:00:00 2001 From: William Mead Date: Fri, 26 Jan 2024 11:08:50 +0100 Subject: [PATCH 4/6] Fixed empty parent company list column --- htdocs/societe/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 9e00065606f..8e4b086b93d 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -1694,7 +1694,7 @@ while ($i < $imaxinloop) { $companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur; $companystatic->fk_prospectlevel = $obj->fk_prospectlevel; - $companystatic->fk_parent = $obj->fk_parent; + $companystatic->parent = $obj->fk_parent; $companystatic->entity = $obj->entity; } From 9c638968ff993a1c96ab07ed36cf8d7ac5da35ea Mon Sep 17 00:00:00 2001 From: tnegre Date: Fri, 26 Jan 2024 16:00:17 +0100 Subject: [PATCH 5/6] Takepos : display errors on payment error --- htdocs/takepos/invoice.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 4130ac5c3cb..db223e58f9c 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -305,7 +305,11 @@ if ($action == 'valid' && $user->rights->facture->creer) { if ($pay != "delayed") { $payment->create($user); - $payment->addPaymentToBank($user, 'payment', '(CustomerInvoicePayment)', $bankaccount, '', ''); + $res = $payment->addPaymentToBank($user, 'payment', '(CustomerInvoicePayment)', $bankaccount, '', ''); + if ($res < 0) { + $error++; + dol_htmloutput_errors($langs->trans('ErrorNoPaymentDefined'), $payment->errors, 1); + } $remaintopay = $invoice->getRemainToPay(); // Recalculate remain to pay after the payment is recorded } } From 673b1727e2c241054bacc0e435fde2d98127c080 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 27 Jan 2024 10:38:23 +0100 Subject: [PATCH 6/6] fix getMultidirOutput can't find multidir_output for mycompany --- htdocs/core/class/conf.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 92afb54af52..e8dd4158b60 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -534,6 +534,9 @@ class Conf extends stdClass } // For mycompany storage + $this->mycompany->multidir_output = array($this->entity => $rootfordata."/mycompany"); + $this->mycompany->multidir_temp = array($this->entity => $rootfortemp."/mycompany/temp"); + // For backward compatibility $this->mycompany->dir_output = $rootfordata."/mycompany"; $this->mycompany->dir_temp = $rootfortemp."/mycompany/temp";