From d9ca9fe22d55a6013346739d009c31178b108c0e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 30 Oct 2020 14:50:38 +0100 Subject: [PATCH 1/6] Fix clean of contract --- htdocs/contrat/class/contrat.class.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 9787802691e..8390fda0c28 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1237,8 +1237,8 @@ class Contrat extends CommonObject } } - if (!$error) - { + // Delete lines + if (!$error) { // Delete contratdet extrafields $main = MAIN_DB_PREFIX . 'contratdet'; $ef = $main . "_extrafields"; @@ -1268,9 +1268,21 @@ class Contrat extends CommonObject } } + // Delete llx_ecm_files + if (!$error) { + $sql = 'DELETE FROM '.MAIN_DB_PREFIX."ecm_files WHERE src_object_type = '".$this->db->escape($this->table_element.(empty($this->module) ? '' : '@'.$this->module))."' AND src_object_id = ".$this->id; + $resql = $this->db->query($sql); + if (!$resql) + { + $this->error = $this->db->lasterror(); + $this->errors[] = $this->error; + $error++; + } + } + + // Delete contract if (!$error) { - // Delete contrat $sql = "DELETE FROM ".MAIN_DB_PREFIX."contrat"; $sql .= " WHERE rowid=".$this->id; From 63a03cdad61cee6157935ec435642d26c0633512 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 1 Nov 2020 14:34:29 +0100 Subject: [PATCH 2/6] FIX #15208 --- htdocs/accountancy/admin/productaccount.php | 26 ++++++++++++++------- htdocs/core/class/html.form.class.php | 2 +- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index e32e47b169d..11d144e26e7 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -618,7 +618,7 @@ if ($result) if (empty($defaultvalue)) $defaultvalue = $compta_prodbuy; $codesell = length_accountg($obj->accountancy_code_buy); if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid - print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1); + print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect'); print ''; } elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_INTRA') { // Accounting account buy intra (In EEC) @@ -628,7 +628,7 @@ if ($result) $codesell = length_accountg($obj->accountancy_code_buy_intra); //var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell); if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid - print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1); + print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect'); print ''; } elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_EXPORT') { // Accounting account buy export (Out of EEC) @@ -638,7 +638,7 @@ if ($result) $codesell = length_accountg($obj->accountancy_code_buy_export); //var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell); if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid - print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1); + print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect'); print ''; } elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL') { // Accounting account sell @@ -648,7 +648,7 @@ if ($result) $codesell = length_accountg($obj->accountancy_code_sell); //var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell); if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid - print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1); + print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect'); print ''; } elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA') { // Accounting account sell intra (In EEC) @@ -658,7 +658,7 @@ if ($result) $codesell = length_accountg($obj->accountancy_code_sell_intra); //var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell); if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid - print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1); + print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect'); print ''; } else { // Accounting account sell export (Out of EEC) @@ -667,13 +667,13 @@ if ($result) if (empty($defaultvalue)) $defaultvalue = $compta_prodsell; $codesell = length_accountg($obj->accountancy_code_sell_export); if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid - print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1); + print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect'); print ''; } // Checkbox select print ''; - print ''; + print ''; print ""; $i++; } @@ -697,7 +697,17 @@ if ($result) if (atleastoneselected) jQuery("#changeaccount").attr(\'class\',\'button\'); else jQuery("#changeaccount").attr(\'class\',\'button\'); } - jQuery(".checkforselect, #checkallactions").click(function() { + + jQuery(".checkforselect").change(function() { + init_savebutton(); + }); + jQuery(".productforselect").change(function() { + console.log($(this).attr("id")+" "+$(this).val()); + if ($(this).val() && $(this).val() != -1) { + $(".productforselect"+$(this).attr("id")).prop(\'checked\', true); + } else { + $(".productforselect"+$(this).attr("id")).prop(\'checked\', false); + } init_savebutton(); }); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 98cb1527031..450ed7364ca 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7817,7 +7817,7 @@ class Form $(document).ready(function() { $("#checkallactions'.$id.'").click(function() { if($(this).is(\':checked\')){ - console.log("We check all '.$cssclass.'"); + console.log("We check all '.$cssclass.' and trigger the change method"); $(".'.$cssclass.'").prop(\'checked\', true).trigger(\'change\'); } else From 45f834cb15122c034e1666a03e920f159183d7dd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 1 Nov 2020 15:20:33 +0100 Subject: [PATCH 3/6] FIX #15199 --- htdocs/langs/en_US/products.lang | 1 + htdocs/product/class/product.class.php | 2 +- htdocs/product/price.php | 10 +- htdocs/projet/tasks/time.php | 128 +++++++++++++------------ 4 files changed, 75 insertions(+), 66 deletions(-) diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index fb4379f5e1a..ecf9fb5ddbd 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -283,6 +283,7 @@ PriceExpressionEditorHelp5=Available global values: PriceMode=Price mode PriceNumeric=Number DefaultPrice=Default price +DefaultPriceLog=Log of previous default prices ComposedProductIncDecStock=Increase/Decrease stock on parent change ComposedProduct=Child products MinSupplierPrice=Minimum buying price diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 98c4084587c..55cc67de4a5 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1622,7 +1622,7 @@ class Product extends CommonObject * * @param Societe $thirdparty_seller Seller * @param Societe $thirdparty_buyer Buyer - * @param int $pqp Id of product per price if a selection was done of such a price + * @param int $pqp Id of product price per quantity if a selection was done of such a price * @return array Array of price information array('pu_ht'=> , 'pu_ttc'=> , 'tva_tx'=>'X.Y (code)', ...), 'tva_npr'=>0, ...) * @see get_buyprice(), find_min_price_product_fournisseur() */ diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 1bf94b28cde..6fa2a77d5da 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -1466,9 +1466,9 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul { // Default prices or // Log of previous customer prices - $backbutton = ''.$langs->trans("Back").''; + $backbutton = ''.$langs->trans("Back").''; - if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print_barre_liste($langs->trans("DefaultPrice"), 0, $_SERVER["PHP_SELF"], '', '', '', $backbutton, 0, $num, 'title_accountancy.png'); + if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print_barre_liste($langs->trans("DefaultPriceLog"), 0, $_SERVER["PHP_SELF"], '', '', '', $backbutton, 0, $num, 'title_accountancy.png'); else print_barre_liste($langs->trans("PriceByCustomerLog"), 0, $_SERVER["PHP_SELF"], '', '', '', '', 0, $num, 'title_accountancy.png'); //if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print_barre_liste($langs->trans("DefaultPrice"),'','','','','',$backbutton, 0, 0, 'title_accountancy.png'); //else print_barre_liste($langs->trans("PriceByCustomerLog"),'','','','','','', 0, 0, 'title_accountancy.png'); @@ -2100,7 +2100,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print img_info($langs->trans('PriceByCustomerLog')); print ''; print ' '; - print 'id.'">'; + print 'id.'">'; print img_edit('default', 0, 'style="vertical-align: middle;"'); print ''; print '   '; @@ -2186,11 +2186,11 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print img_info($langs->trans('PriceByCustomerLog')); print ''; print ' '; - print 'id.'&lineid='.$line->id.'">'; + print 'id.'&lineid='.$line->id.'">'; print img_edit('default', 0, 'style="vertical-align: middle;"'); print ''; print ' '; - print 'id.'&lineid='.$line->id.'">'; + print 'id.'&lineid='.$line->id.'">'; print img_delete('default', 'style="vertical-align: middle;"'); print ''; print ''; diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index c0adf0984cc..4a5d484abf8 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -363,13 +363,9 @@ if ($action == 'confirm_generateinvoice') { if (!empty($projectstatic->socid)) $projectstatic->fetch_thirdparty(); - - if (!($projectstatic->thirdparty->id > 0)) - { + if (!($projectstatic->thirdparty->id > 0)) { setEventMessages($langs->trans("ThirdPartyRequiredToGenerateInvoice"), null, 'errors'); - } - else - { + } else { include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; @@ -403,6 +399,7 @@ if ($action == 'confirm_generateinvoice') $prodDurationHours *= $tmpproduct->duration_value; $dataforprice = $tmpproduct->getSellPrice($mysoc, $projectstatic->thirdparty, 0); + $pu_ht = empty($dataforprice['pu_ht']) ? 0 : $dataforprice['pu_ht']; $txtva = $dataforprice['tva_tx']; $localtax1 = $dataforprice['localtax1']; @@ -962,69 +959,80 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) print ''; print ''; + // Form to convert time spent into invoice if ($massaction == 'generateinvoice') { - //var_dump($_REQUEST); print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - if ($conf->service->enabled) - { + if ($projectstatic->thirdparty->id > 0) { + print '
'; - print $langs->trans('DateInvoice'); - print ''; - print $form->selectDate('', '', '', '', '', '', 1, 1); - print '
'; - print $langs->trans('Mode'); - print ''; - $tmparray = array( - 'onelineperuser'=>'OneLinePerUser', - 'onelinepertask'=>'OneLinePerTask', - 'onelineperperiod'=>'OneLinePerPeriod', - ); - print $form->selectarray('generateinvoicemode', $tmparray, 'onelineperuser', 0, 0, 0, '', 1); - print '
'; print ''; - print ''; print ''; print ''; - } - print ''; - print ''; - print ''; - print ''; - /*print ''; - print ''; - print ''; - print '';*/ - print '
'; - print $langs->trans('ServiceToUseOnLines'); + print ''; + print $langs->trans('DateInvoice'); print ''; - $form->select_produits('', 'productid', '1', 0, 0, 1, 2, '', 0, array(), 0, 'None', 0, 'maxwidth500'); + print $form->selectDate('', '', '', '', '', '', 1, 1); print '
'; - print $langs->trans('InvoiceToUse'); - print ''; - $form->selectInvoice('invoice', '', 'invoiceid', 24, 0, $langs->trans('NewInvoice'), - 1, 0, 0, 'maxwidth500', '', 'all'); - print '
'; - print $langs->trans('ValidateInvoices'); - print ''; - print $form->selectyesno('validate_invoices', 0, 1); - print '
'; - print '
'; - print '
'; - print ' '; - print ''; - print '
'; - print '
'; + print ''; + print ''; + print $langs->trans('Mode'); + print ''; + print ''; + $tmparray = array( + 'onelineperuser'=>'OneLinePerUser', + 'onelinepertask'=>'OneLinePerTask', + 'onelineperperiod'=>'OneLinePerPeriod', + ); + print $form->selectarray('generateinvoicemode', $tmparray, 'onelineperuser', 0, 0, 0, '', 1); + print ''; + print ''; + + if ($conf->service->enabled) + { + print ''; + print ''; + print $langs->trans('ServiceToUseOnLines'); + print ''; + print ''; + $form->select_produits('', 'productid', '1', 0, $projectstatic->thirdparty->price_level, 1, 2, '', 0, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth500'); + print ''; + print ''; + } + + print ''; + print ''; + print $langs->trans('InvoiceToUse'); + print ''; + print ''; + $form->selectInvoice('invoice', '', 'invoiceid', 24, 0, $langs->trans('NewInvoice'), + 1, 0, 0, 'maxwidth500', '', 'all'); + print ''; + print ''; + /*print ''; + print ''; + print $langs->trans('ValidateInvoices'); + print ''; + print ''; + print $form->selectyesno('validate_invoices', 0, 1); + print ''; + print '';*/ + print ''; + + print '
'; + print '
'; + print ' '; + print ''; + print '
'; + print '
'; + } else { + print '
'.$langs->trans("ThirdPartyRequiredToGenerateInvoice").'
'; + print '
'; + print ''; + print '
'; + $massaction = ''; + } } /* @@ -1118,7 +1126,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) } /* - * Form to add time spent + * Form to add a new line of time spent */ if ($action == 'createtime' && $user->rights->projet->lire) { From 49ccf2a3cbb73299071514564f6873e87c7c49ee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 1 Nov 2020 15:55:51 +0100 Subject: [PATCH 4/6] Update doc --- htdocs/install/mysql/tables/llx_facturedet.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_facturedet.sql b/htdocs/install/mysql/tables/llx_facturedet.sql index ff2b28d9a7f..b688c5c4195 100644 --- a/htdocs/install/mysql/tables/llx_facturedet.sql +++ b/htdocs/install/mysql/tables/llx_facturedet.sql @@ -36,7 +36,7 @@ create table llx_facturedet localtax1_type varchar(10) NULL, -- localtax1 type localtax2_tx double(6,3) DEFAULT 0, -- localtax2 rate localtax2_type varchar(10) NULL, -- localtax2 type - qty real, -- Quantity (exemple 2) + qty real, -- Quantity (exemple 2). Note: for credit note, the price is negative, not the quantity. Like for discount, price is negative, not quantity. remise_percent real DEFAULT 0, -- % de la remise ligne (exemple 20%) remise real DEFAULT 0, -- Montant calcule de la remise % sur PU HT (exemple 20) fk_remise_except integer NULL, -- Lien vers table des remises fixes From ad922bfde692875a9abfc2020a93ca2531485d34 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 1 Nov 2020 16:08:09 +0100 Subject: [PATCH 5/6] FIX #15074 --- htdocs/compta/stats/cabyuser.php | 3 +++ htdocs/compta/stats/casoc.php | 2 ++ 2 files changed, 5 insertions(+) diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php index 4d4f56a1354..5cfbef5b21a 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -236,6 +236,9 @@ if ($socid) $sql .= " AND f.fk_soc = ".$socid; $sql .= " GROUP BY u.rowid, u.lastname, u.firstname"; $sql .= " ORDER BY u.rowid"; +$amount = array(); + +dol_syslog("cabyuser", LOG_DEBUG); $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index bec20998cfa..8ba300d2dfc 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -293,6 +293,8 @@ $sql .= " GROUP BY s.rowid, s.nom, s.zip, s.town, s.fk_pays"; $sql .= " ORDER BY s.rowid"; //echo $sql; +$amount = array(); + dol_syslog("casoc", LOG_DEBUG); $result = $db->query($sql); if ($result) { From 72160deef706cec0bbee60713d49aaccd17ebf3f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 1 Nov 2020 17:01:26 +0100 Subject: [PATCH 6/6] FIX #14979 --- htdocs/compta/facture/card.php | 1 + htdocs/compta/facture/class/facture.class.php | 11 +++++------ htdocs/core/actions_addupdatedelete.inc.php | 1 + .../modules/bom/doc/doc_generic_bom_odt.modules.php | 2 ++ .../commande/doc/doc_generic_order_odt.modules.php | 2 ++ .../contract/doc/doc_generic_contract_odt.modules.php | 2 ++ .../doc/doc_generic_shipment_odt.modules.php | 2 ++ .../facture/doc/doc_generic_invoice_odt.modules.php | 2 ++ .../modules/mrp/doc/doc_generic_mo_odt.modules.php | 2 ++ .../project/doc/doc_generic_project_odt.modules.php | 2 ++ .../propale/doc/doc_generic_proposal_odt.modules.php | 4 +++- .../doc/doc_generic_reception_odt.modules.php | 2 ++ .../doc/doc_generic_supplier_proposal_odt.modules.php | 2 ++ .../modules/user/doc/doc_generic_user_odt.modules.php | 2 ++ 14 files changed, 30 insertions(+), 7 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 9118944d9f9..93ce8bc0f5f 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -717,6 +717,7 @@ if (empty($reshook)) $outputlangs->load('products'); } $model = $object->modelpdf; + $ret = $object->fetch($id); // Reload to get new records $result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 2e66cd0d240..8a2c75037ba 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -2523,7 +2523,7 @@ class Facture extends CommonInvoice $this->db->begin(); // Check parameters - if ($this->type == self::TYPE_REPLACEMENT) // si facture de remplacement + if ($this->type == self::TYPE_REPLACEMENT) // if this is a replacement invoice { // Controle que facture source connue if ($this->fk_facture_source <= 0) @@ -2533,7 +2533,7 @@ class Facture extends CommonInvoice return -10; } - // Charge la facture source a remplacer + // Load source invoice that has been replaced $facreplaced = new Facture($this->db); $result = $facreplaced->fetch($this->fk_facture_source); if ($result <= 0) @@ -2543,7 +2543,7 @@ class Facture extends CommonInvoice return -11; } - // Controle que facture source non deja remplacee par une autre + // Check that source invoice not already replaced by another one. $idreplacement = $facreplaced->getIdReplacingInvoice('validated'); if ($idreplacement && $idreplacement != $this->id) { @@ -4397,15 +4397,14 @@ class Facture extends CommonInvoice * @param int $hidedetails Hide details of lines * @param int $hidedesc Hide description * @param int $hideref Hide ref - * @param null|array $moreparams Array to provide more information + * @param null|array $moreparams Array to provide more information * @return int <0 if KO, >0 if OK */ public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null) { global $conf, $langs; - $langs->load("bills"); - $outputlangs->load("products"); + $outputlangs->loadLangs(array("bills", "products")); if (!dol_strlen($modele)) { diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 3091b77f0a4..bb648a71625 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -320,6 +320,7 @@ if ($action == 'confirm_validate' && $confirm == 'yes' && $permissiontoadd) $outputlangs->setDefaultLang($newlang); } $model = $object->modelpdf; + $ret = $object->fetch($id); // Reload to get new records $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); diff --git a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php index 9755369793e..d4929e8feb1 100644 --- a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php +++ b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php @@ -237,6 +237,8 @@ class doc_generic_bom_odt extends ModelePDFBom } } + $object->fetch_thirdparty(); + $dir = $conf->bom->multidir_output[isset($object->entity) ? $object->entity : 1]; $objectref = dol_sanitizeFileName($object->ref); if (!preg_match('/specimen/i', $objectref)) $dir .= "/".$objectref; diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index 75c5103c4ab..dc137609df7 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -249,6 +249,8 @@ class doc_generic_order_odt extends ModelePDFCommandes } } + $object->fetch_thirdparty(); + $dir = $conf->commande->multidir_output[$object->entity]; $objectref = dol_sanitizeFileName($object->ref); if (!preg_match('/specimen/i', $objectref)) $dir .= "/".$objectref; diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php index c938f40cfb2..f16c9147b36 100644 --- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php +++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php @@ -235,6 +235,8 @@ class doc_generic_contract_odt extends ModelePDFContract } } + $object->fetch_thirdparty(); + $dir = $conf->contrat->dir_output; $objectref = dol_sanitizeFileName($object->ref); if (!preg_match('/specimen/i', $objectref)) $dir .= "/".$objectref; diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php index 1ea817709e1..8b255e146d5 100644 --- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php +++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php @@ -249,6 +249,8 @@ class doc_generic_shipment_odt extends ModelePdfExpedition } } + $object->fetch_thirdparty(); + $dir = $conf->expedition->dir_output."/sending"; $objectref = dol_sanitizeFileName($object->ref); if (!preg_match('/specimen/i', $objectref)) $dir .= "/".$objectref; diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index acbebd54da8..ab5edb23733 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -248,6 +248,8 @@ class doc_generic_invoice_odt extends ModelePDFFactures } } + $object->fetch_thirdparty(); + $dir = $conf->facture->dir_output; $objectref = dol_sanitizeFileName($object->ref); if (!preg_match('/specimen/i', $objectref)) $dir .= "/".$objectref; diff --git a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php index e276fe1f5f7..9e82b38ad10 100644 --- a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php +++ b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php @@ -244,6 +244,8 @@ class doc_generic_mo_odt extends ModelePDFMo } } + $object->fetch_thirdparty(); + $dir = $conf->mrp->multidir_output[isset($object->entity) ? $object->entity : 1]; $objectref = dol_sanitizeFileName($object->ref); if (!preg_match('/specimen/i', $objectref)) $dir .= "/".$objectref; diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index 542ea728f84..972c6c8d472 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -513,6 +513,8 @@ class doc_generic_project_odt extends ModelePDFProjects } } + $object->fetch_thirdparty(); + $dir = $conf->projet->dir_output; $objectref = dol_sanitizeFileName($object->ref); if (!preg_match('/specimen/i', $objectref)) $dir .= "/".$objectref; diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index 33850c5d882..46262b72b62 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -227,7 +227,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales /** * Function to build a document on disk using the generic odt module. * - * @param Propale $object Object source to build document + * @param Propal $object Object source to build document * @param Translate $outputlangs Lang output object * @param string $srctemplatepath Full path of source filename for generator using a template file * @param int $hidedetails Do not show line details @@ -277,6 +277,8 @@ class doc_generic_proposal_odt extends ModelePDFPropales } } + $object->fetch_thirdparty(); + $dir = $conf->propal->multidir_output[$object->entity]; $objectref = dol_sanitizeFileName($object->ref); if (!preg_match('/specimen/i', $objectref)) $dir .= "/".$objectref; diff --git a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php index 89a532c2556..8b85854b753 100644 --- a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php +++ b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php @@ -241,6 +241,8 @@ class doc_generic_reception_odt extends ModelePdfReception } } + $object->fetch_thirdparty(); + $dir = $conf->reception->dir_output."/reception"; $objectref = dol_sanitizeFileName($object->ref); if (!preg_match('/specimen/i', $objectref)) $dir .= "/".$objectref; diff --git a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php index c97d2f94d63..f3a16422433 100644 --- a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php @@ -275,6 +275,8 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal } } + $object->fetch_thirdparty(); + $dir = $conf->supplier_proposal->dir_output; $objectref = dol_sanitizeFileName($object->ref); if (!preg_match('/specimen/i', $objectref)) $dir .= "/".$objectref; diff --git a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php index 881ba4cb469..b01352b12bd 100644 --- a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php +++ b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php @@ -257,6 +257,8 @@ class doc_generic_user_odt extends ModelePDFUser } } + $object->fetch_thirdparty(); + $dir = $conf->user->dir_output; $objectref = dol_sanitizeFileName($object->ref); if (!preg_match('/specimen/i', $objectref)) $dir .= "/".$objectref;