From b8721e0c64af8ec050fe7059b65a31c67e9777cc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Jul 2020 16:00:15 +0200 Subject: [PATCH 1/6] FIX Change position of line in BOM --- htdocs/core/ajax/row.php | 4 ++-- htdocs/core/class/commonobject.class.php | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/core/ajax/row.php b/htdocs/core/ajax/row.php index 852910ce9e3..afb33907593 100644 --- a/htdocs/core/ajax/row.php +++ b/htdocs/core/ajax/row.php @@ -47,8 +47,8 @@ top_httphead(); print ''."\n"; // Registering the location of boxes -if ((!empty($_POST['roworder'])) && (!empty($_POST['table_element_line'])) - && (!empty($_POST['fk_element'])) && (!empty($_POST['element_id']))) +if (GETPOST('roworder', 'alpha') && GETPOST('table_element_line', 'alpha', 2) + && GETPOST('fk_element', 'alpha', 2) && GETPOST('element_id', 'int', 2)) { $roworder = GETPOST('roworder', 'alpha', 2); $table_element_line = GETPOST('table_element_line', 'alpha', 2); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 77a4c155fa6..9601320af49 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -8154,6 +8154,9 @@ abstract class CommonObject $sql .= ' FROM '.MAIN_DB_PREFIX.$objectline->table_element; $sql .= ' WHERE fk_'.$this->element.' = '.$this->id; if ($morewhere) $sql .= $morewhere; + if (isset($objectline->fields['position'])) { + $sql .= $this->db->order('position', 'ASC'); + } $resql = $this->db->query($sql); if ($resql) From 6b5f46624cc230bc4e436bd68f38323d385b7042 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Jul 2020 16:19:40 +0200 Subject: [PATCH 2/6] Fix label of AWP --- htdocs/bom/tpl/objectline_title.tpl.php | 2 +- htdocs/langs/en_US/stocks.lang | 4 ++-- htdocs/product/fournisseurs.php | 32 +++++++++++++++---------- htdocs/product/stock/product.php | 16 ++++++++++--- 4 files changed, 35 insertions(+), 19 deletions(-) diff --git a/htdocs/bom/tpl/objectline_title.tpl.php b/htdocs/bom/tpl/objectline_title.tpl.php index ab0184189a8..56e6cb59657 100644 --- a/htdocs/bom/tpl/objectline_title.tpl.php +++ b/htdocs/bom/tpl/objectline_title.tpl.php @@ -69,7 +69,7 @@ print ''.$form->textwithpicto($langs print ''.$form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')).''; // Cost -print ''.$langs->trans('CostPrice').''; +print ''.$form->textwithpicto($langs->trans("TotalCost"), $langs->trans("BOMTotalCost")).''; print ''; // No width to allow autodim diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index f62bf5d9cc5..cd11bdb9803 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -90,8 +90,8 @@ DescWareHouse=Description warehouse LieuWareHouse=Localisation warehouse WarehousesAndProducts=Warehouses and products WarehousesAndProductsBatchDetail=Warehouses and products (with detail per lot/serial) -AverageUnitPricePMPShort=Weighted average input price -AverageUnitPricePMP=Weighted average input price +AverageUnitPricePMPShort=Weighted average price +AverageUnitPricePMPDesc=The input average unit price we had to pay to suppliers to get the product into our stock. SellPriceMin=Selling Unit Price EstimatedStockValueSellShort=Value for sell EstimatedStockValueSell=Value for sell diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 7cc5d3966c1..563fb881152 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -413,19 +413,7 @@ if ($id > 0 || $ref) print '
'; print ''; - // Minimum Price - print ''; - print ''; - // Cost price. Can be used for margin module for option "calculate margin on explicit cost price - // Accountancy sell code print ''; - print '
'.$langs->trans("BuyingPriceMin").''; - $product_fourn = new ProductFournisseur($db); - if ($product_fourn->find_min_price_product_fournisseur($object->id) > 0) - { - if ($product_fourn->product_fourn_price_id > 0) print $product_fourn->display_price_product_fournisseur(); - else print $langs->trans("NotDefined"); - } - print '
'; $textdesc = $langs->trans("CostPriceDescription"); $textdesc .= "
".$langs->trans("CostPriceUsage"); @@ -435,7 +423,25 @@ if ($id > 0 || $ref) print $form->editfieldval($text, 'cost_price', $object->cost_price, $object, $usercancreate, 'amount:6'); print '
'; + // PMP + print ''.$form->textwithpicto($langs->trans("AverageUnitPricePMPShort"), $langs->trans("AverageUnitPricePMPDesc")).''; + print ''; + if ($object->pmp > 0) print price($object->pmp).' '.$langs->trans("HT"); + print ''; + print ''; + + // Best buying Price + print ''.$langs->trans("BuyingPriceMin").''; + print ''; + $product_fourn = new ProductFournisseur($db); + if ($product_fourn->find_min_price_product_fournisseur($object->id) > 0) + { + if ($product_fourn->product_fourn_price_id > 0) print $product_fourn->display_price_product_fournisseur(); + else print $langs->trans("NotDefined"); + } + print ''; + + print ''; print ''; print '
'; diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 89e99df4b1e..5ae9e06f2ca 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -54,7 +54,7 @@ if (!empty($conf->variants->enabled)) { } // Load translation files required by the page -$langs->loadlangs(array('products', 'orders', 'bills', 'stocks', 'sendings')); +$langs->loadlangs(array('products', 'suppliers', 'orders', 'bills', 'stocks', 'sendings', 'margins')); if (!empty($conf->productbatch->enabled)) $langs->load("productbatch"); $backtopage = GETPOST('backtopage', 'alpha'); @@ -564,8 +564,18 @@ if ($id > 0 || $ref) print ''; } + // Cost price. Can be used for margin module for option "calculate margin on explicit cost price + print ''; + $textdesc = $langs->trans("CostPriceDescription"); + $textdesc .= "
".$langs->trans("CostPriceUsage"); + $text = $form->textwithpicto($langs->trans("CostPrice"), $textdesc, 1, 'help', ''); + print $form->editfieldkey($text, 'cost_price', $object->cost_price, $object, $usercancreate, 'amount:6'); + print ''; + print $form->editfieldval($text, 'cost_price', $object->cost_price, $object, $usercancreate, 'amount:6'); + print ''; + // PMP - print ''.$langs->trans("AverageUnitPricePMP").''; + print ''.$form->textwithpicto($langs->trans("AverageUnitPricePMPShort"), $langs->trans("AverageUnitPricePMPDesc")).''; print ''; if ($object->pmp > 0) print price($object->pmp).' '.$langs->trans("HT"); print ''; @@ -822,7 +832,7 @@ if (!$variants) { print ''; print ''.$langs->trans("Warehouse").''; print ''.$langs->trans("NumberOfUnit").''; - print ''.$langs->trans("AverageUnitPricePMPShort").''; + print ''.$form->textwithpicto($langs->trans("AverageUnitPricePMPShort"), $langs->trans("AverageUnitPricePMPDesc")).''; print ''.$langs->trans("EstimatedStockValueShort").''; print ''.$langs->trans("SellPriceMin").''; print ''.$langs->trans("EstimatedStockValueSellShort").''; From cb7f78e9d3be31d4e8ab931a8c502c4901690c1d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Jul 2020 16:25:51 +0200 Subject: [PATCH 3/6] Fix tpl --- htdocs/bom/tpl/objectline_view.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index 667c66848ae..e1e94dc2076 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -113,7 +113,7 @@ if ($this->status == 0 && ($object_rights->write) && $action != 'selectlines') { $coldisplay++; if (($line->info_bits & 2) == 2 || !empty($disableedit)) { } else { - print 'id.'#line_'.$line->id.'">'.img_edit().''; + print 'id.'">'.img_edit().''; } print ''; From d18188d5657762ef3851e583f07bba096e0aca4e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Jul 2020 00:57:29 +0200 Subject: [PATCH 4/6] Fix missing trans --- htdocs/langs/en_US/languages.lang | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/htdocs/langs/en_US/languages.lang b/htdocs/langs/en_US/languages.lang index 6185183161b..57aa8e94925 100644 --- a/htdocs/langs/en_US/languages.lang +++ b/htdocs/langs/en_US/languages.lang @@ -1,8 +1,11 @@ # Dolibarr language file - Source file is en_US - languages +Language_am_ET=Ethiopian Language_ar_AR=Arabic Language_ar_EG=Arabic (Egypt) Language_ar_SA=Arabic +Language_az_AZ=Azerbaijani Language_bn_BD=Bengali +Language_bn_IN=Bengali (India) Language_bg_BG=Bulgarian Language_bs_BA=Bosnian Language_ca_ES=Catalan @@ -20,6 +23,7 @@ Language_en_GB=English (United Kingdom) Language_en_IN=English (India) Language_en_NZ=English (New Zealand) Language_en_SA=English (Saudi Arabia) +Language_en_SG=English (Singapore) Language_en_US=English (United States) Language_en_ZA=English (South Africa) Language_es_ES=Spanish @@ -29,6 +33,7 @@ Language_es_CL=Spanish (Chile) Language_es_CO=Spanish (Colombia) Language_es_DO=Spanish (Dominican Republic) Language_es_EC=Spanish (Ecuador) +Language_es_GT=Spanish (Guatemala) Language_es_HN=Spanish (Honduras) Language_es_MX=Spanish (Mexico) Language_es_PA=Spanish (Panama) @@ -36,6 +41,7 @@ Language_es_PY=Spanish (Paraguay) Language_es_PE=Spanish (Peru) Language_es_PR=Spanish (Puerto Rico) Language_es_UY=Spanish (Uruguay) +Language_es_GT=Spanish (USA) Language_es_VE=Spanish (Venezuela) Language_et_EE=Estonian Language_eu_ES=Basque @@ -44,15 +50,21 @@ Language_fi_FI=Finnish Language_fr_BE=French (Belgium) Language_fr_CA=French (Canada) Language_fr_CH=French (Switzerland) +Language_fr_CI=French (Cost Ivory) +Language_fr_CM=French (Cameroun) Language_fr_FR=French +Language_fr_GA=French (Gabon) Language_fr_NC=French (New Caledonia) Language_fy_NL=Frisian +Language_gl_ES=Galician Language_he_IL=Hebrew +Language_hi_IN=Hindi (India) Language_hr_HR=Croatian Language_hu_HU=Hungarian Language_id_ID=Indonesian Language_is_IS=Icelandic Language_it_IT=Italian +Language_it_CH=Italian (Switzerland) Language_ja_JP=Japanese Language_ka_GE=Georgian Language_km_KH=Khmer @@ -64,6 +76,7 @@ Language_lv_LV=Latvian Language_mk_MK=Macedonian Language_mn_MN=Mongolian Language_nb_NO=Norwegian (Bokmål) +Language_ne_NP=Nepali Language_nl_BE=Dutch (Belgium) Language_nl_NL=Dutch Language_pl_PL=Polish @@ -86,4 +99,5 @@ Language_uz_UZ=Uzbek Language_vi_VN=Vietnamese Language_zh_CN=Chinese Language_zh_TW=Chinese (Traditional) +Language_zh_HK=Chinese (Hong Kong) Language_bh_MY=Malay From e8dd99a9cdff881f5c8df548a32c0cf4a4ff5d0a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Jul 2020 01:11:37 +0200 Subject: [PATCH 5/6] Trans --- htdocs/langs/en_US/suppliers.lang | 2 +- htdocs/langs/fr_FR/suppliers.lang | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/suppliers.lang b/htdocs/langs/en_US/suppliers.lang index b69b11272b4..51562b8bb7a 100644 --- a/htdocs/langs/en_US/suppliers.lang +++ b/htdocs/langs/en_US/suppliers.lang @@ -43,5 +43,5 @@ NotTheGoodQualitySupplier=Low quality ReputationForThisProduct=Reputation BuyerName=Buyer name AllProductServicePrices=All product / service prices -AllProductReferencesOfSupplier=All product / service references of vendor +AllProductReferencesOfSupplier=All references of vendor BuyingPriceNumShort=Vendor prices diff --git a/htdocs/langs/fr_FR/suppliers.lang b/htdocs/langs/fr_FR/suppliers.lang index 2f9b93ff323..81860c25a45 100644 --- a/htdocs/langs/fr_FR/suppliers.lang +++ b/htdocs/langs/fr_FR/suppliers.lang @@ -43,5 +43,5 @@ NotTheGoodQualitySupplier=Mauvaise qualité ReputationForThisProduct=Réputation BuyerName=Nom de l'acheteur AllProductServicePrices=Tous les prix du produits / service -AllProductReferencesOfSupplier=Toutes les références des produits/services du fournisseur +AllProductReferencesOfSupplier=Toutes les références du fournisseur BuyingPriceNumShort=Prix fournisseurs From 7fdccf4eb84b9c1e02dfd93dd2d40ecf620a6d51 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Jul 2020 02:28:00 +0200 Subject: [PATCH 6/6] Fix error in stripe payment if no country defined --- htdocs/public/payment/newpayment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index bcee660a17d..e7d1a3b5fa9 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -2142,7 +2142,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment thirdparty) && !empty($object->thirdparty->phone)) { ?>, phone: 'thirdparty->phone); ?>' thirdparty)) { ?>, address: { city: 'thirdparty->town); ?>', - country: 'thirdparty->country_code); ?>', + thirdparty->country_code) { ?>country: 'thirdparty->country_code); ?>', line1: 'thirdparty->address)); ?>', postal_code: 'thirdparty->zip); ?>'} }