From 8ef5fcd90a507747cf08157a27a3be36fe8b369e Mon Sep 17 00:00:00 2001 From: Articoder InfoSec Team Date: Fri, 14 Jul 2017 15:57:22 -0700 Subject: [PATCH 1/6] Reason: similar change is present elsewhere in the code Notes: please review carefully before accepting. patch propagation. manual test run. Reviewed By: https://github.com/dchichkov Cherry picked from: === From 0d62bd704e7a61d66842a7c91cf3e50a249461f9 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Wed, 22 Jun 2016 18:59:51 +0200 Subject: [PATCH] Fix: Bad column totalizing if MAIN_SHOW_HT_ON_SUMMARY activated --- htdocs/compta/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 321c2456ddd..46104845ba0 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -378,7 +378,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) print ''; $total_ttc += $obj->total_ttc; - $total += $obj->total; + $total += $obj->total_hc; $totalam += $obj->am; $i++; From 2166b3d467f38e401690a3f5400431dc99962f2e Mon Sep 17 00:00:00 2001 From: hguibourgdev Date: Sat, 15 Jul 2017 12:04:59 +0200 Subject: [PATCH 2/6] Update card.php FIX "!" is missing on test : empty($object->date_livraison) --- htdocs/commande/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index d99aa6a4f46..c4bb0ace2f2 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2084,7 +2084,7 @@ if ($action == 'create' && $user->rights->commande->creer) print ''; } else { print $object->date ? dol_print_date($object->date, 'day') : ' '; - if ($object->hasDelay() && empty($object->date_livraison)) { + if ($object->hasDelay() && ! empty($object->date_livraison)) { print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning"); } } From 4633d1ae7eccc3d20e72605265d58185caea5352 Mon Sep 17 00:00:00 2001 From: hguibourgdev Date: Sat, 15 Jul 2017 19:04:10 +0200 Subject: [PATCH 3/6] Update list.php FIX copy-paste error (sell versus buy) --- htdocs/product/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index af5e500fbf5..13793438a7b 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -311,7 +311,7 @@ else if ($fourn_id > 0) $sql.= " AND pfp.fk_soc = ".$fourn_id; if ($search_tobatch != '' && $search_tobatch >= 0) $sql.= " AND p.tobatch = ".$db->escape($search_tobatch); if ($search_accountancy_code_sell) $sql.= natural_search('p.accountancy_code_sell', $search_accountancy_code_sell); - if ($search_accountancy_code_sell) $sql.= natural_search('p.accountancy_code_buy', $search_accountancy_code_buy); + if ($search_accountancy_code_buy) $sql.= natural_search('p.accountancy_code_buy', $search_accountancy_code_buy); // Add where from extra fields if (!empty($conf->variants->enabled) && $search_hidechildproducts && ($search_type === 0)) { From 9bb1431fd9a71d4cc2d14991358fae112234e9da Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 16 Jul 2017 08:03:51 +0200 Subject: [PATCH 4/6] Fix: change version --- .travis.yml | 3 +++ htdocs/install/mysql/migration/6.0.0-7.0.0.sql | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index db0f3196cf8..64744627dc5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -305,6 +305,9 @@ script: php upgrade.php 5.0.0 6.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade500600.log php upgrade2.php 5.0.0 6.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL > $TRAVIS_BUILD_DIR/upgrade500600-2.log php step5.php 5.0.0 6.0.0 > $TRAVIS_BUILD_DIR/upgrade500600-3.log + php upgrade.php 6.0.0 7.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade600700.log + php upgrade2.php 6.0.0 7.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL > $TRAVIS_BUILD_DIR/upgrade600700-2.log + php step5.php 6.0.0 7.0.0 > $TRAVIS_BUILD_DIR/upgrade600700-3.log cd - set +e echo diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql index ac0741cd80a..43c2b813536 100644 --- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql +++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql @@ -1,7 +1,7 @@ -- -- Be carefull to requests order. -- This file must be loaded by calling /install/index.php page --- when current version is 6.0.0 or higher. +-- when current version is 7.0.0 or higher. -- -- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new; -- To add a column: ALTER TABLE llx_table ADD COLUMN newcol varchar(60) NOT NULL DEFAULT '0' AFTER existingcol; @@ -26,6 +26,6 @@ ALTER TABLE llx_facture_fourn ADD COLUMN date_pointoftax date DEFAULT NULL; -ALTER TABLE llx_facture_fourn ADD COLUMN date_valid date; +ALTER TABLE llx_facture_fourn ADD COLUMN date_valid date; From 3a05b6a1643539411e3af33b8bd19acdd35a5b0b Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio Date: Tue, 18 Jul 2017 10:20:16 +0200 Subject: [PATCH 5/6] NEW add fk_unit field into product/service import/export --- htdocs/core/modules/modProduct.class.php | 2 ++ htdocs/core/modules/modService.class.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index 504d48efea3..48f35db439b 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -159,6 +159,7 @@ class modProduct extends DolibarrModules if (! empty($conf->fournisseur->enabled) || !empty($conf->margin->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('p.cost_price'=>'CostPrice')); if (! empty($conf->global->EXPORTTOOL_CATEGORIES)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('group_concat(cat.label)'=>'Categories')); if (! empty($conf->global->MAIN_MULTILANGS)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('l.lang'=>'Language', 'l.label'=>'TranslatedLabel','l.description'=>'TranslatedDescription','l.note'=>'TranslatedNote')); + if (! empty($conf->global->PRODUCT_USE_UNITS)) $this->export_fields_array[$r]['p.fk_unit'] = 'Unit'; $this->export_TypeFields_array[$r]=array('p.ref'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.url'=>"Text",'p.accountancy_code_sell'=>"Text",'p.accountancy_code_buy'=>"Text",'p.note'=>"Text",'p.length'=>"Numeric",'p.surface'=>"Numeric",'p.volume'=>"Numeric",'p.weight'=>"Numeric",'p.customcode'=>'Text','p.price_base_type'=>"Text",'p.price'=>"Numeric",'p.price_ttc'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean",'p.datec'=>'Date','p.tms'=>'Date'); if (! empty($conf->stock->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r],array('p.stock'=>'Numeric','p.seuil_stock_alerte'=>'Numeric','p.desiredstock'=>'Numeric','p.pmp'=>'Numeric','p.cost_price'=>'Numeric')); if (! empty($conf->barcode->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r],array('p.barcode'=>'Text')); @@ -257,6 +258,7 @@ class modProduct extends DolibarrModules if (! empty($conf->fournisseur->enabled) || !empty($conf->margin->enabled)) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r],array('p.cost_price'=>'CostPrice')); if ($mysoc->useNPR()) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r],array('p.recuperableonly'=>'NPR')); if (! empty($conf->barcode->enabled)) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r],array('p.barcode'=>'BarCode')); + if (! empty($conf->global->PRODUCT_USE_UNITS)) $this->import_fields_array[$r]['p.fk_unit'] = 'Unit'; // Add extra fields $import_extrafield_sample=array(); $sql="SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'product' AND entity IN (0, ".$conf->entity.')'; diff --git a/htdocs/core/modules/modService.class.php b/htdocs/core/modules/modService.class.php index 7a5db7fcffd..35780b34218 100644 --- a/htdocs/core/modules/modService.class.php +++ b/htdocs/core/modules/modService.class.php @@ -145,6 +145,7 @@ class modService extends DolibarrModules $this->export_permission[$r]=array(array("service","export")); $this->export_fields_array[$r]=array('p.rowid'=>"Id",'p.ref'=>"Ref",'p.label'=>"Label",'p.description'=>"Description",'p.accountancy_code_sell'=>"ProductAccountancySellCode",'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",'p.note'=>"Note",'p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC",'p.tva_tx'=>'VATRate','p.tosell'=>"OnSell",'p.tobuy'=>"OnBuy",'p.duration'=>"Duration",'p.datec'=>'DateCreation','p.tms'=>'DateModification'); if (! empty($conf->stock->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('p.stock'=>'Stock')); + if (! empty($conf->global->PRODUCT_USE_UNITS)) $this->export_fields_array[$r]['p.fk_unit'] = 'Unit'; //$this->export_TypeFields_array[$r]=array('p.ref'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.accountancy_code_sell'=>"Text",'p.accountancy_code_buy'=>"Text",'p.note'=>"Text",'p.price_base_type'=>"Text",'p.price'=>"Numeric",'p.price_ttc'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",'p.duration'=>"Duree",'p.datec'=>'Date','p.tms'=>'Date'); $this->export_TypeFields_array[$r]=array('p.ref'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.accountancy_code_sell'=>"Text",'p.accountancy_code_buy'=>"Text",'p.note'=>"Text",'p.price_base_type'=>"Text",'p.price'=>"Numeric",'p.price_ttc'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean",'p.duration'=>"Duree",'p.datec'=>'Date','p.tms'=>'Date'); if (! empty($conf->stock->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r],array('p.stock'=>'Numeric')); @@ -240,6 +241,7 @@ class modService extends DolibarrModules $this->import_tables_creator_array[$r]=array('p'=>'fk_user_author'); // Fields to store import user id $this->import_fields_array[$r]=array('p.ref'=>"Ref*",'p.label'=>"Label*",'p.description'=>"Description",'p.url'=>"PublicUrl",'p.accountancy_code_sell'=>"ProductAccountancySellCode",'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",'p.note'=>"Note",'p.length'=>"Length",'p.surface'=>"Surface",'p.volume'=>"Volume",'p.weight'=>"Weight",'p.duration'=>"Duration",'p.customcode'=>'CustomCode','p.price'=>"SellingPriceHT",'p.price_ttc'=>"SellingPriceTTC",'p.tva_tx'=>'VAT','p.tosell'=>"OnSell*",'p.tobuy'=>"OnBuy*",'p.fk_product_type'=>"Type*",'p.finished'=>'Nature','p.datec'=>'DateCreation'); if (! empty($conf->barcode->enabled)) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r],array('p.barcode'=>'BarCode')); + if (! empty($conf->global->PRODUCT_USE_UNITS)) $this->import_fields_array[$r]['p.fk_unit'] = 'Unit'; // Add extra fields $sql="SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'product' AND entity = ".$conf->entity; $resql=$this->db->query($sql); From ba660a041cdd1bf02c3821947c2752b4c7e6f130 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Jul 2017 14:33:32 +0200 Subject: [PATCH 6/6] Update index.php --- htdocs/compta/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 46104845ba0..103ec747e37 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -378,7 +378,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) print ''; $total_ttc += $obj->total_ttc; - $total += $obj->total_hc; + $total += $obj->total_ht; $totalam += $obj->am; $i++;