From 2f8968478d9260f9385ec1f866edd3a6447ed33b Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Sun, 12 Jul 2020 10:06:04 +0200 Subject: [PATCH 1/8] fix missing entity into fetch wahrehouse --- htdocs/product/stock/class/entrepot.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 0b259018cfc..39fad14c544 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -441,6 +441,7 @@ class Entrepot extends CommonObject } $sql = "SELECT rowid, fk_parent, ref as label, description, statut, lieu, address, zip, town, fk_pays as country_id"; + $sql .= " , entity"; $sql .= " FROM ".MAIN_DB_PREFIX."entrepot"; if ($id) { @@ -460,6 +461,7 @@ class Entrepot extends CommonObject $obj=$this->db->fetch_object($result); $this->id = $obj->rowid; + $this->entity = $obj->entity; $this->fk_parent = $obj->fk_parent; $this->ref = $obj->label; $this->label = $obj->label; From 7b5072a21b49fd4816f8cae72924e29743ae5dfd Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Sun, 12 Jul 2020 10:10:46 +0200 Subject: [PATCH 2/8] fix missing entity --- htdocs/product/stock/class/entrepot.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 39fad14c544..f5500812290 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -104,6 +104,7 @@ class Entrepot extends CommonObject */ public $fields=array( 'rowid' =>array('type'=>'integer', 'label'=>'ID', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>10), + 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>15), 'ref' =>array('type'=>'varchar(255)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'showoncombobox'=>1, 'position'=>25), 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>30), 'description' =>array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-2, 'position'=>35), From 32e4635e84203596db9ebcef85ef78863644e88a Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Sun, 12 Jul 2020 21:34:13 +0200 Subject: [PATCH 3/8] fix missing entity into fetch wharehouse --- htdocs/product/stock/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 057735c49cc..9baaeebf90e 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -209,7 +209,7 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as ccount ON ccount.rowid = t.fk $sql .= " WHERE t.entity IN (".getEntity('stock').")"; foreach ($search as $key => $val) { - if ($key == 'status' && $search[$key] == -1) continue; + if (($key == 'status' && $search[$key] == -1) || $key=='entity') continue; $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); if (strpos($object->fields[$key]['type'], 'integer:') === 0) { if ($search[$key] == '-1') $search[$key] = ''; From f4074428f8b8a6bdd2cf8a3b97a9aae6a1918e68 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Tue, 14 Jul 2020 09:38:52 +0200 Subject: [PATCH 4/8] fix filter wharehouse list on ref --- htdocs/product/stock/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 057735c49cc..8ccc887641f 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -215,7 +215,7 @@ foreach ($search as $key => $val) if ($search[$key] == '-1') $search[$key] = ''; $mode_search = 2; } - if ($search[$key] != '') $sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search)); + if ($search[$key] != '') $sql .= natural_search((($key == 'ref') ? 't.ref' : $key), $search[$key], (($key == 'status') ? 2 : $mode_search)); } if ($search_all) $sql .= natural_search(array_keys($fieldstosearchall), $search_all); // Add where from extra fields From 431b207dab66199f1dbcb75c8aff0bc5a2540077 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Jul 2020 01:02:07 +0200 Subject: [PATCH 5/8] Fix to solve sql error on some databases --- htdocs/core/lib/order.lib.php | 4 ++-- htdocs/install/mysql/migration/11.0.0-12.0.0.sql | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/order.lib.php b/htdocs/core/lib/order.lib.php index 3d2847e926b..96d66c3272a 100644 --- a/htdocs/core/lib/order.lib.php +++ b/htdocs/core/lib/order.lib.php @@ -65,10 +65,10 @@ function commande_prepare_head(Commande $object) $head[$h][0] = DOL_URL_ROOT.'/expedition/shipment.php?id='.$object->id; $text = ''; if ($conf->expedition_bon->enabled) $text .= $langs->trans("Shipments"); - if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled) $text .= '/'; + if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled) $text .= ' - '; if ($conf->livraison_bon->enabled) $text .= $langs->trans("Receivings"); if ($nbShipments > 0 || $nbReceiption > 0) $text .= ''.($nbShipments ? $nbShipments : 0); - if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled && ($nbShipments > 0 || $nbReceiption > 0)) $text .= '/'; + if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled && ($nbShipments > 0 || $nbReceiption > 0)) $text .= ' - '; if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled && ($nbShipments > 0 || $nbReceiption > 0)) $text .= ($nbReceiption ? $nbReceiption : 0); if ($nbShipments > 0 || $nbReceiption > 0) $text .= ''; $head[$h][1] = $text; diff --git a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql index 82a0f11e893..2d5bcd5d28e 100644 --- a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql +++ b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql @@ -329,3 +329,5 @@ ALTER TABLE llx_prelevement_facture_demande ADD INDEX idx_prelevement_facture_de insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (721, 72, '0','0','VAT Rate 0',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,note,active) values (722, 72, '18','0', '0.9', '1', 'VAT Rate 18+0.9', 1); + +ALTER TABLE llx_expedition ADD COLUMN billed smallint DEFAULT 0; From 99935ce11fd6019814504f32dab96630c5aa1527 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Jul 2020 01:30:34 +0200 Subject: [PATCH 6/8] FIX Should not be able to edit qty on shipment when no stock available --- htdocs/expedition/card.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index c362bcfb8ac..a14258e6419 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1524,8 +1524,11 @@ if ($action == 'create') } if ($subj == 0) // Line not shown yet, we show it { - print ''; - print ''; + $warehouse_selected_id = GETPOST('entrepot_id', 'int'); + + print ''; + print ''; + if ($line->product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { $disabled = ''; @@ -1533,6 +1536,9 @@ if ($action == 'create') { $disabled = 'disabled="disabled"'; } + if ($warehouse_selected_id <= 0) { // We did not force a given warehouse, so we won't have no warehouse to change qty. + $disabled = 'disabled="disabled"'; + } print ' '; } else @@ -1544,7 +1550,6 @@ if ($action == 'create') print ''; if ($line->product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { - $warehouse_selected_id = GETPOST('entrepot_id', 'int'); if ($warehouse_selected_id > 0) { $warehouseObject = new Entrepot($db); From 0f4e00a2a3e9f467b090dbaa2b9ab7cd3fe0d91a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Jul 2020 01:43:03 +0200 Subject: [PATCH 7/8] Fix language --- htdocs/langs/en_US/admin.lang | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 860d9e1b64c..5887f6cde4a 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -300,8 +300,9 @@ MAIN_MAIL_DEFAULT_FROMTYPE=Default sender email for manual sending (User email o UserEmail=User email CompanyEmail=Company Email FeatureNotAvailableOnLinux=Feature not available on Unix like systems. Test your sendmail program locally. +FixOnTransifex=Fix the translation on the online translation platform of project SubmitTranslation=If the translation for this language is not complete or you find errors, you can correct this by editing files in directory langs/%s and submit your change to www.transifex.com/dolibarr-association/dolibarr/ -SubmitTranslationENUS=If translation for this language is not complete or you find errors, you can correct this by editing files into directory langs/%s and submit modified files on dolibarr.org/forum or for developers on github.com/Dolibarr/dolibarr. +SubmitTranslationENUS=If translation for this language is not complete or you find errors, you can correct this by editing files into directory langs/%s and submit modified files on dolibarr.org/forum or, if you are a developer, with a PR on github.com/Dolibarr/dolibarr ModuleSetup=Module setup ModulesSetup=Modules/Application setup ModuleFamilyBase=System From 34a9eee7a6d7d648e56eec810a00da146eaf6db4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Jul 2020 01:50:57 +0200 Subject: [PATCH 8/8] Minor fix in translation --- htdocs/admin/translation.php | 8 ++++---- htdocs/core/lib/admin.lib.php | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index ecc25c58509..8f764a93b98 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -40,7 +40,7 @@ $transkey = GETPOST('transkey', 'alphanohtml'); $transvalue = GETPOST('transvalue', 'none'); -$mode = GETPOST('mode', 'aZ09') ?GETPOST('mode', 'aZ09') : 'overwrite'; +$mode = GETPOST('mode', 'aZ09') ?GETPOST('mode', 'aZ09') : 'searchkey'; $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); @@ -514,7 +514,7 @@ if ($mode == 'searchkey') if ($i > ($offset + $limit)) break; print ''.$langcode.''.$key.''; print dol_escape_htmltag($val); - print ''; + print ''; if (!empty($newlangfileonly->tab_translate[$key])) { if ($val != $newlangfileonly->tab_translate[$key]) @@ -534,7 +534,7 @@ if ($mode == 'searchkey') print ' '; print ''.img_delete().''; print '  '; - $htmltext = $langs->trans("OriginalValueWas", $newlangfileonly->tab_translate[$key]); + $htmltext = $langs->trans("OriginalValueWas", ''.$newlangfileonly->tab_translate[$key].''); print $form->textwithpicto('', $htmltext, 1, 'info'); } elseif (!empty($conf->global->MAIN_ENABLE_OVERWRITE_TRANSLATION)) @@ -549,7 +549,7 @@ if ($mode == 'searchkey') //$transifexurl = 'https://www.transifex.com/dolibarr-association/dolibarr/translate/#'.$langcode.'/'.$transifexlangfile.'?key='.$key; $transifexurl = 'https://www.transifex.com/dolibarr-association/dolibarr/translate/#'.$langcode.'/'.$transifexlangfile.'?q=key%3A'.$key; - print '   '.img_picto('FixOnTransifex', 'globe').''; + print '   '.img_picto($langs->trans('FixOnTransifex'), 'globe').''; } } else diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 12fb15d3b2a..7b3d66f9003 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -721,16 +721,16 @@ function translation_prepare_head() $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT."/admin/translation.php?mode=overwrite"; - $head[$h][1] = $langs->trans("TranslationOverwriteKey").''; - $head[$h][2] = 'overwrite'; - $h++; - $head[$h][0] = DOL_URL_ROOT."/admin/translation.php?mode=searchkey"; $head[$h][1] = $langs->trans("TranslationKeySearch"); $head[$h][2] = 'searchkey'; $h++; + $head[$h][0] = DOL_URL_ROOT."/admin/translation.php?mode=overwrite"; + $head[$h][1] = $langs->trans("TranslationOverwriteKey").''; + $head[$h][2] = 'overwrite'; + $h++; + complete_head_from_modules($conf, $langs, null, $head, $h, 'translation_admin'); complete_head_from_modules($conf, $langs, null, $head, $h, 'translation_admin', 'remove');