From 9ceec670b9300319315b1ed9b1b3c7ca0729d398 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 13 Jan 2020 13:52:48 +0100 Subject: [PATCH 01/12] Fix date format in FEC export --- htdocs/accountancy/class/accountancyexport.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index f36b98b15b1..46b7a532a35 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -704,9 +704,9 @@ class AccountancyExport print $end_line; foreach ($objectLines as $line) { - $date_creation = dol_print_date($line->date_creation, '%d%m%Y'); - $date_doc = dol_print_date($line->doc_date, '%d%m%Y'); - $date_valid = dol_print_date($line->date_validated, '%d%m%Y'); + $date_creation = dol_print_date($line->date_creation, '%Y%m%d'); + $date_doc = dol_print_date($line->doc_date, '%Y%m%d'); + $date_valid = dol_print_date($line->date_validated, '%Y%m%d'); // FEC:JournalCode print $line->code_journal.$separator; From b6ed6df75d89e6ec55f1fb55a823f24a1563441b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 13 Jan 2020 14:14:51 +0100 Subject: [PATCH 02/12] Remove property tha has no sense in output #12803 --- htdocs/societe/class/api_thirdparties.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index c855346dbec..07dd2ba6031 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -1685,6 +1685,8 @@ class Thirdparties extends DolibarrApi unset($object->particulier); unset($object->prefix_comm); + unset($object->commercial_id); // This property is used in create/update only. It does not exists in read mode because there is several sales representatives. + unset($object->total_ht); unset($object->total_tva); unset($object->total_localtax1); From 9d4e1a3941d0d1a099193f96cdb91474a70aa04a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 13 Jan 2020 14:25:48 +0100 Subject: [PATCH 03/12] FIX #12797 --- htdocs/core/lib/functions.lib.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 8980f2a41dd..861b49adde2 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1639,13 +1639,14 @@ function dol_bc($var, $moreclass = '') } /** - * Return a formated address (part address/zip/town/state) according to country rules + * Return a formated address (part address/zip/town/state) according to country rules. + * See https://en.wikipedia.org/wiki/Address * * @param Object $object A company or contact object - * @param int $withcountry 1=Add country into address string - * @param string $sep Separator to use to build string - * @param Translate $outputlangs Object lang that contains language for text translation. - * @param int $mode 0=Standard output, 1=Remove address + * @param int $withcountry 1=Add country into address string + * @param string $sep Separator to use to build string + * @param Translate $outputlangs Object lang that contains language for text translation. + * @param int $mode 0=Standard output, 1=Remove address * @return string Formated string * @see dol_print_address() */ @@ -1656,6 +1657,8 @@ function dol_format_address($object, $withcountry = 0, $sep = "\n", $outputlangs $ret = ''; $countriesusingstate = array('AU', 'CA', 'US', 'IN', 'GB', 'ES', 'UK', 'TR'); // See also MAIN_FORCE_STATE_INTO_ADDRESS + // See format of addresses on https://en.wikipedia.org/wiki/Address + // Address if (empty($mode)) { $ret .= $object->address; @@ -1692,7 +1695,7 @@ function dol_format_address($object, $withcountry = 0, $sep = "\n", $outputlangs { $ret .= ($ret ? $sep : '').$object->zip; $ret .= ($object->town ? (($object->zip ? ' ' : '').$object->town) : ''); - $ret .= ($object->state_id ? (' ('.($object->state_id).')') : ''); + $ret .= ($object->state_code ? (' '.($object->state_code)) : ''); } else // Other: title firstname name \n address lines \n zip town \n country { From ab4e0fe99cddfcd3c5c7b62025aa6e2de36edfc9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 13 Jan 2020 14:30:37 +0100 Subject: [PATCH 04/12] FIX #12758 --- build/generate_filelist_xml.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php index 59a39416b28..976f2cb6ba3 100755 --- a/build/generate_filelist_xml.php +++ b/build/generate_filelist_xml.php @@ -146,7 +146,7 @@ $iterator1 = new RecursiveIteratorIterator($dir_iterator1); $files = new RegexIterator($iterator1, '#^(?:[A-Z]:)?(?:/(?!(?:'.($includecustom?'':'custom\/|').'documents\/|conf\/|install\/))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i'); */ $regextoinclude='\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; -$regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install|public\/test|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs +$regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install|public\/test|sabre\/sabre\/.*\/tests|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs $files = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude, 'fullname'); $dir=''; $needtoclose=0; From 68169b6df045de3f0b8424c27f8fd644318a700f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 13 Jan 2020 14:43:27 +0100 Subject: [PATCH 05/12] Fix debian package --- build/debian/source/include-binaries | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/debian/source/include-binaries b/build/debian/source/include-binaries index 401eae93712..021641d5c04 100644 --- a/build/debian/source/include-binaries +++ b/build/debian/source/include-binaries @@ -1 +1,2 @@ -htdocs/install/doctemplates/websites/website_template-corporate.zip \ No newline at end of file +htdocs/install/doctemplates/websites/website_template-corporate.zip +htdocs/install/doctemplates/websites/website_template-stellar.zip \ No newline at end of file From 56fb6dce6199a36a3e6780ce517058bbb1406cdf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 13 Jan 2020 15:32:11 +0100 Subject: [PATCH 06/12] FIX #12756 --- htdocs/core/modules/modExpedition.class.php | 14 +++++++------- htdocs/core/modules/modSupplierProposal.class.php | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/core/modules/modExpedition.class.php b/htdocs/core/modules/modExpedition.class.php index 96d3d3f45a5..93cd08c7001 100644 --- a/htdocs/core/modules/modExpedition.class.php +++ b/htdocs/core/modules/modExpedition.class.php @@ -65,8 +65,8 @@ class modExpedition extends DolibarrModules "/expedition/sending/temp", "/expedition/receipt", "/expedition/receipt/temp", - "/doctemplates/shipment", - "/doctemplates/delivery" + "/doctemplates/shipments", + "/doctemplates/deliveries" ); // Config pages @@ -98,7 +98,7 @@ class modExpedition extends DolibarrModules $this->const[$r][0] = "EXPEDITION_ADDON_PDF_ODT_PATH"; $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/shipment"; + $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/shipments"; $this->const[$r][3] = ""; $this->const[$r][4] = 0; $r++; @@ -119,7 +119,7 @@ class modExpedition extends DolibarrModules $this->const[$r][0] = "LIVRAISON_ADDON_PDF_ODT_PATH"; $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/delivery"; + $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/deliveries"; $this->const[$r][3] = ""; $this->const[$r][4] = 0; $r++; @@ -127,7 +127,7 @@ class modExpedition extends DolibarrModules $this->const[$r][0] = "MAIN_SUBMODULE_EXPEDITION"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "1"; - $this->const[$r][3] = "Enable shipments"; + $this->const[$r][3] = "Enable delivery receipts"; $this->const[$r][4] = 0; $r++; @@ -326,8 +326,8 @@ class modExpedition extends DolibarrModules $this->remove($options); //ODT template - $src = DOL_DOCUMENT_ROOT.'/install/doctemplates/shipment/template_shipment.odt'; - $dirodt = DOL_DATA_ROOT.'/doctemplates/shipment'; + $src = DOL_DOCUMENT_ROOT.'/install/doctemplates/shipments/template_shipment.odt'; + $dirodt = DOL_DATA_ROOT.'/doctemplates/shipments'; $dest = $dirodt.'/template_shipment.odt'; if (file_exists($src) && !file_exists($dest)) diff --git a/htdocs/core/modules/modSupplierProposal.class.php b/htdocs/core/modules/modSupplierProposal.class.php index c24c3787a9c..e2d071ac730 100644 --- a/htdocs/core/modules/modSupplierProposal.class.php +++ b/htdocs/core/modules/modSupplierProposal.class.php @@ -93,7 +93,7 @@ class modSupplierProposal extends DolibarrModules $this->const[$r][0] = "SUPPLIER_PROPOSAL_ADDON_PDF_ODT_PATH"; $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/supplier_proposal"; + $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/supplier_proposals"; $this->const[$r][3] = ""; $this->const[$r][4] = 0; @@ -215,8 +215,8 @@ class modSupplierProposal extends DolibarrModules $this->remove($options); //ODT template - $src=DOL_DOCUMENT_ROOT.'/install/doctemplates/supplier_proposal/template_supplier_proposal.odt'; - $dirodt=DOL_DATA_ROOT.'/doctemplates/supplier_proposal'; + $src=DOL_DOCUMENT_ROOT.'/install/doctemplates/supplier_proposals/template_supplier_proposal.odt'; + $dirodt=DOL_DATA_ROOT.'/doctemplates/supplier_proposals'; $dest=$dirodt.'/template_supplier_proposal.odt'; if (file_exists($src) && ! file_exists($dest)) From e2e06b47fff965cf4833ebc2f233fde0f5942e63 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 13 Jan 2020 15:58:03 +0100 Subject: [PATCH 07/12] FIX #12617 --- htdocs/commande/class/commande.class.php | 1 + htdocs/contrat/card.php | 14 +++++++------- htdocs/contrat/class/contrat.class.php | 23 ++++++++++++----------- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index ef15d983d20..a21e9534f49 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1447,6 +1447,7 @@ class Commande extends CommonOrder $localtaxes_type = getLocalTaxesFromRate($txtva, 0, $this->thirdparty, $mysoc); // Clean vat code + $reg = array(); $vat_src_code = ''; if (preg_match('/\((.*)\)/', $txtva, $reg)) { diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index e61b0077ef7..9342a81395b 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2014 Laurent Destailleur + * Copyright (C) 2004-2019 Laurent Destailleur * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2010-2017 Juanjo Menent @@ -417,12 +417,12 @@ if (empty($reshook)) // Set if we used free entry or predefined product $predef = ''; $product_desc = (GETPOST('dp_desc') ?GETPOST('dp_desc') : ''); - $price_ht = GETPOST('price_ht'); - $price_ht_devise = GETPOST('multicurrency_price_ht'); - if (GETPOST('prod_entry_mode') == 'free') + $price_ht = price2num(GETPOST('price_ht')); + $price_ht_devise = price2num(GETPOST('multicurrency_price_ht')); + if (GETPOST('prod_entry_mode', 'alpha') == 'free') { $idprod = 0; - $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); + $tva_tx = (GETPOST('tva_tx', 'alpha') ? GETPOST('tva_tx', 'alpha') : 0); } else { @@ -430,7 +430,7 @@ if (empty($reshook)) $tva_tx = ''; } - $qty = GETPOST('qty'.$predef); + $qty = price2num(GETPOST('qty'.$predef)); $remise_percent = ((GETPOST('remise_percent'.$predef) != '') ? GETPOST('remise_percent'.$predef) : 0); if ($qty == '') @@ -438,7 +438,7 @@ if (empty($reshook)) setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Qty")), null, 'errors'); $error++; } - if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && empty($product_desc)) + if (GETPOST('prod_entry_mode', 'alpha') == 'free' && empty($idprod) && empty($product_desc)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Description")), null, 'errors'); $error++; diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 89ee93a39e8..ead2e1c816b 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1421,9 +1421,18 @@ class Contrat extends CommonObject $pu_ht = price2num($pu_ht); $pu_ttc = price2num($pu_ttc); $pa_ht = price2num($pa_ht); - if (!preg_match('/\((.*)\)/', $txtva)) { - $txtva = price2num($txtva); // $txtva can have format '5.0(XXX)' or '5' + + // Clean vat code + $reg = array(); + $vat_src_code = ''; + if (preg_match('/\((.*)\)/', $txtva, $reg)) + { + $vat_src_code = $reg[1]; + $txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate. } + + $txtva = price2num($txtva); + $txlocaltax1 = price2num($txlocaltax1); $txlocaltax2 = price2num($txlocaltax2); $remise_percent = price2num($remise_percent); @@ -1456,15 +1465,7 @@ class Contrat extends CommonObject $this->db->begin(); - $localtaxes_type = getLocalTaxesFromRate($txtva, 0, $this->societe, $mysoc); - - // Clean vat code - $vat_src_code = ''; - if (preg_match('/\((.*)\)/', $txtva, $reg)) - { - $vat_src_code = $reg[1]; - $txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate. - } + $localtaxes_type = getLocalTaxesFromRate($txtva.($vat_src_code ? ' ('.$vat_src_code.')' : ''), 0, $this->societe, $mysoc); // Calcul du total TTC et de la TVA pour la ligne a partir de // qty, pu, remise_percent et txtva From 1eff733e1cb4a8983110897d6b7ba3bc896824f1 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Mon, 13 Jan 2020 18:23:50 +0100 Subject: [PATCH 08/12] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 861b49adde2..228a0583ac4 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6039,6 +6039,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $substitutionarray['__REFCLIENT__'] = (isset($object->ref_client) ? $object->ref_client : (isset($object->ref_customer) ? $object->ref_customer : null)); $substitutionarray['__REFSUPPLIER__'] = (isset($object->ref_supplier) ? $object->ref_supplier : null); $substitutionarray['__SUPPLIER_ORDER_DATE_DELIVERY__'] = (isset($object->date_livraison) ? dol_print_date($object->date_livraison, 'day', 0, $outputlangs) : ''); + $substitutionarray['__SUPPLIER_ORDER_DELAY_DELIVERY__'] = (isset($object->availability_code) ? $outputlangs->transnoentities("AvailabilityType".$object->availability_code) : ''); $birthday = dol_print_date($object->birth, 'day'); From 96674b2a7e47df4cf382c9b23cd4503892ed628d Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 13 Jan 2020 21:19:32 +0100 Subject: [PATCH 09/12] FIX : Look & feel v11 --- htdocs/loan/card.php | 14 +++++++------- htdocs/loan/list.php | 22 ++++++++++++---------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index ca28b16261c..9e7b8f2565a 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -716,9 +716,9 @@ if ($id > 0) print ''.img_object($langs->trans("Payment"), "payment").' '.$objp->rowid.''; print ''.dol_print_date($db->jdate($objp->dp), 'day')."\n"; print "".$objp->paiement_type.' '.$objp->num_payment."\n"; - print ''.price($objp->amount_insurance, 0, $outputlangs, 1, -1, -1, $conf->currency)."\n"; - print ''.price($objp->amount_interest, 0, $outputlangs, 1, -1, -1, $conf->currency)."\n"; - print ''.price($objp->amount_capital, 0, $outputlangs, 1, -1, -1, $conf->currency)."\n"; + print ''.price($objp->amount_insurance, 0, $outputlangs, 1, -1, -1, $conf->currency)."\n"; + print ''.price($objp->amount_interest, 0, $outputlangs, 1, -1, -1, $conf->currency)."\n"; + print ''.price($objp->amount_capital, 0, $outputlangs, 1, -1, -1, $conf->currency)."\n"; print ""; $total_capital += $objp->amount_capital; $i++; @@ -728,14 +728,14 @@ if ($id > 0) if ($object->paid == 0) { - print ''.$langs->trans("AlreadyPaid").' :'.price($totalpaid, 0, $langs, 0, 0, -1, $conf->currency).''; - print ''.$langs->trans("AmountExpected").' :'.price($object->capital, 0, $outputlangs, 1, -1, -1, $conf->currency).''; + print ''.$langs->trans("AlreadyPaid").' :'.price($totalpaid, 0, $langs, 0, -1, -1, $conf->currency).''; + print ''.$langs->trans("AmountExpected").' :'.price($object->capital, 0, $outputlangs, 1, -1, -1, $conf->currency).''; $staytopay = $object->capital - $totalpaid; print ''.$langs->trans("RemainderToPay").' :'; - print ''; - print price($staytopay, 0, $langs, 0, 0, -1, $conf->currency); + print ''; + print price($staytopay, 0, $langs, 0, -1, -1, $conf->currency); print ''; } print ""; diff --git a/htdocs/loan/list.php b/htdocs/loan/list.php index 3b1ccfd2724..912b95c643a 100644 --- a/htdocs/loan/list.php +++ b/htdocs/loan/list.php @@ -124,14 +124,14 @@ if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit else { if ($limit) $sql .= $db->plimit($limit + 1, $offset); - + $resql = $db->query($sql); if (!$resql) { dol_print_error($db); exit; } - + $num = $db->num_rows($resql); } @@ -185,10 +185,10 @@ if ($resql) print ' '; print ''; print ''; - print ''; - print ''; + print ''; + $searchpicto=$form->showFilterAndCheckAddButtons(0); + print $searchpicto; print ''; - print ''; // Fields title label // -------------------------------------------------------------------- @@ -199,7 +199,9 @@ if ($resql) print_liste_field_titre("DateStart", $_SERVER["PHP_SELF"], "l.datestart", "", $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre("DateEnd", $_SERVER["PHP_SELF"], "l.dateend", "", $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "l.paid", "", $param, '', $sortfield, $sortorder, 'right '); - print_liste_field_titre(''); + print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch '); + print "\n"; + print "\n"; // Loop on record @@ -210,7 +212,7 @@ if ($resql) { $obj = $db->fetch_object($resql); if (empty($obj)) break; // Should not happen - + $loan_static->id = $obj->rowid; $loan_static->ref = $obj->rowid; $loan_static->label = $obj->label; @@ -252,12 +254,12 @@ if ($resql) $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; - + print ''."\n"; print ''."\n"; - + print ''."\n"; - + $db->free($resql); } else From a088c7827921b520a8cd8a05c41f2f6ef6382b3e Mon Sep 17 00:00:00 2001 From: atm-ph Date: Wed, 15 Jan 2020 09:46:44 +0100 Subject: [PATCH 10/12] Fix column type to be as llx_facture --- htdocs/install/mysql/migration/10.0.0-11.0.0.sql | 2 ++ htdocs/install/mysql/tables/llx_facture_rec.sql | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql index 18972bc6b8f..350e3d2065a 100644 --- a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql +++ b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql @@ -564,3 +564,5 @@ ALTER TABLE llx_mrp_production ADD INDEX idx_mrp_production_fk_mo (fk_mo); ALTER TABLE llx_emailcollector_emailcollector ADD UNIQUE INDEX uk_emailcollector_emailcollector_ref(ref, entity); ALTER TABLE llx_website ADD COLUMN use_manifest integer; + +ALTER TABLE llx_facture_rec MODIFY COLUMN fk_cond_reglement integer NOT NULL DEFAULT 1; diff --git a/htdocs/install/mysql/tables/llx_facture_rec.sql b/htdocs/install/mysql/tables/llx_facture_rec.sql index d60537a36d0..d0e4486262a 100644 --- a/htdocs/install/mysql/tables/llx_facture_rec.sql +++ b/htdocs/install/mysql/tables/llx_facture_rec.sql @@ -48,7 +48,7 @@ create table llx_facture_rec fk_projet integer, -- projet auquel est associe la facture - fk_cond_reglement integer DEFAULT 0, -- condition de reglement + fk_cond_reglement integer DEFAULT 1 NOT NULL, -- condition de reglement fk_mode_reglement integer DEFAULT 0, -- mode de reglement (Virement, Prelevement) date_lim_reglement date, -- date limite de reglement fk_account integer, -- bank account id From 14d59f43afdedc772a989e3ba0f4883efa45f1fd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 Jan 2020 11:33:02 +0100 Subject: [PATCH 11/12] Trans --- htdocs/langs/en_US/modulebuilder.lang | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index 67002f622f9..ca3fd3e68b8 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -135,3 +135,5 @@ CSSClass=CSS Class NotEditable=Not editable ForeignKey=Foreign key TypeOfFieldsHelp=Type of fields:
varchar(99), double(24,8), real, text, html, datetime, timestamp, integer, integer:ClassName:relativepath/to/classfile.class.php[:1[:filter]] ('1' means we add a + button after the combo to create the record, 'filter' can be 'status=1 AND fk_user = __USER_ID AND entity IN (__SHARED_ENTITIES__)' for example) +AsciiToHtmlConverter=Ascii to HTML converter +AsciiToPdfConverter=Ascii to PDF converter \ No newline at end of file From 0442105bd499a33cbc75cd6fe2c92556b3f88d30 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 Jan 2020 11:55:27 +0100 Subject: [PATCH 12/12] Fix Generation of zip of module --- htdocs/core/lib/files.lib.php | 6 ++++-- htdocs/modulebuilder/index.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index b84bef02910..b8595b435c1 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2071,9 +2071,10 @@ function dol_uncompress($inputfile, $outputdir) * @param string $outputfile Target file name (output directory must exists and be writable) * @param string $mode 'zip' * @param string $excludefiles A regex pattern. For example: '/\.log$|\/temp\//' + * @param string $rootdirinzip Add a root dir level in zip file * @return int <0 if KO, >0 if OK */ -function dol_compress_dir($inputdir, $outputfile, $mode = "zip", $excludefiles = '') +function dol_compress_dir($inputdir, $outputfile, $mode = "zip", $excludefiles = '', $rootdirinzip = '') { $foundhandler=0; @@ -2134,7 +2135,8 @@ function dol_compress_dir($inputdir, $outputfile, $mode = "zip", $excludefiles = { // Get real and relative path for current file $filePath = $file->getRealPath(); - $relativePath = substr($filePath, strlen($inputdir) + 1); + $relativePath = ($rootdirinzip ? $rootdirinzip.'/' : '').substr($filePath, strlen($inputdir) + 1); + if (empty($excludefiles) || ! preg_match($excludefiles, $filePath)) { // Add current file to archive diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index d67fa08fafa..f1de611051b 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1071,7 +1071,7 @@ if ($dirins && $action == 'generatepackage') if ($dirofmodule) { if (! dol_is_dir($dirofmodule)) dol_mkdir($dirofmodule); - $result = dol_compress_dir($dir, $outputfilezip, 'zip'); + $result = dol_compress_dir($dir, $outputfilezip, 'zip', '', $modulelowercase); } else {