From 2be75420caaf2e95a29585d3f73ae24194dd592e Mon Sep 17 00:00:00 2001 From: altatof Date: Mon, 7 Aug 2017 10:21:38 +0200 Subject: [PATCH 1/7] FIX : supplier id was not passed to hooks --- htdocs/fourn/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index d3c0fa7357d..ee6ac67412a 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -66,7 +66,7 @@ $hookmanager->initHooks(array('suppliercard','globalcard')); * Action */ -$parameters=array('socid'=>$socid); +$parameters=array('id'=>$id); $reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); From 0bf4ac6fb3d592d5fc0d8d06535fd6b562e742dc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 7 Aug 2017 20:06:26 +0200 Subject: [PATCH 2/7] Add missing field fk_supplier_proposal --- htdocs/install/mysql/migration/3.9.0-4.0.0.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql index f1c94f346cf..8880f3fae97 100644 --- a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql +++ b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql @@ -34,6 +34,7 @@ ALTER TABLE llx_product_customer_price ADD COLUMN localtax1_type varchar(10) NO ALTER TABLE llx_product_customer_price ADD COLUMN localtax2_type varchar(10) NOT NULL DEFAULT '0' after localtax2_tx; ALTER TABLE llx_product_customer_price_log ADD COLUMN localtax1_type varchar(10) NOT NULL DEFAULT '0' after localtax1_tx; ALTER TABLE llx_product_customer_price_log ADD COLUMN localtax2_type varchar(10) NOT NULL DEFAULT '0' after localtax2_tx; +ALTER TABLE llx_supplier_proposaldet CHANGE COLUMN fk_askpricesupplier fk_supplier_proposal integer NOT NULL; ALTER TABLE llx_opensurvey_sondage ADD COLUMN status integer DEFAULT 1 after date_fin; From ca3cdfabec0886fbf24c2545a5b821bcf5f769ef Mon Sep 17 00:00:00 2001 From: fappels Date: Wed, 9 Aug 2017 14:15:26 +0200 Subject: [PATCH 3/7] FIX Best buy price calculation Best buy price also depends on buy discount. --- htdocs/fourn/class/fournisseur.product.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 34a11663e2a..4d155bbce5f 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -581,7 +581,8 @@ class ProductFournisseur extends Product foreach($record_array as $record) { $fourn_price = $record["price"]; - $fourn_unitprice = $record["unitprice"]; + // discount calculated buy price + $fourn_unitprice = $record["unitprice"] * (1 - $record["remise_percent"] / 100) + $record["unitcharges"] - $record["remise"]; if (!empty($conf->dynamicprices->enabled) && !empty($record["fk_supplier_price_expression"])) { $prod_supplier = new ProductFournisseur($this->db); $prod_supplier->product_fourn_price_id = $record["product_fourn_price_id"]; @@ -613,7 +614,7 @@ class ProductFournisseur extends Product $this->fourn_qty = $record["quantity"]; $this->fourn_remise_percent = $record["remise_percent"]; $this->fourn_remise = $record["remise"]; - $this->fourn_unitprice = $fourn_unitprice; + $this->fourn_unitprice = $record["unitprice"]; $this->fourn_charges = $record["charges"]; // deprecated $this->fourn_unitcharges = $record["unitcharges"]; // deprecated $this->fourn_tva_tx = $record["tva_tx"]; @@ -622,7 +623,7 @@ class ProductFournisseur extends Product $this->delivery_time_days = $record["delivery_time_days"]; $this->fk_supplier_price_expression = $record["fk_supplier_price_expression"]; $this->id = $prodid; - $min = $this->fourn_unitprice; + $min = $fourn_unitprice; } } } From 112a6f7b44f4b3cd6b9d962f18be3a0a99293945 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 17 Aug 2017 23:51:35 +0200 Subject: [PATCH 4/7] Fix travis --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 4c18c5caa3b..58e749a532d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,7 @@ # from Dolibarr GitHub repository. # For syntax, see http://about.travis-ci.org/docs/user/languages/php/ +dist: precise sudo: required language: php From b77fe285dc9acc03aaf9be20d670a8d34bb7e6b8 Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Sun, 20 Aug 2017 09:39:51 +0200 Subject: [PATCH 5/7] fix 'Error cronjob->run_job: Permission denied' and add time and login used for debug helps --- scripts/cron/cron_run_jobs.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php index fb03cad5757..28de8c46ab3 100755 --- a/scripts/cron/cron_run_jobs.php +++ b/scripts/cron/cron_run_jobs.php @@ -68,9 +68,11 @@ $error=0; /* * Main */ +// current date +$now=dol_now(); @set_time_limit(0); -print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n"; +print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." ***** userlogin=" . $userlogin . " ***** " . $now . " *****\n"; // Check security key if ($key != $conf->global->CRON_KEY) @@ -114,7 +116,9 @@ else exit(-1); } } - +//erics cf https://www.dolibarr.org/forum/12-howto-help/26035-cron-run-jobs-php-error-permission-denied +$user->getrights(); + if (isset($argv[3]) || $argv[3]) { $id = $argv[3]; @@ -138,9 +142,6 @@ if ($result<0) // TODO This sequence of code must be shared with code into cron_run_jobs.php php page. -// current date -$now=dol_now(); - if(is_array($object->lines) && (count($object->lines)>0)) { // Loop over job From 64aed245397f36e740b0ec540eccc0680b08dcbb Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Sun, 20 Aug 2017 09:45:11 +0200 Subject: [PATCH 6/7] remove comment --- scripts/cron/cron_run_jobs.php | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php index 28de8c46ab3..5c32272bed1 100755 --- a/scripts/cron/cron_run_jobs.php +++ b/scripts/cron/cron_run_jobs.php @@ -116,7 +116,6 @@ else exit(-1); } } -//erics cf https://www.dolibarr.org/forum/12-howto-help/26035-cron-run-jobs-php-error-permission-denied $user->getrights(); if (isset($argv[3]) || $argv[3]) From 749355abc2b96ac4d19c86c2c8be688cd5adfc50 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 22 Aug 2017 10:41:30 +0200 Subject: [PATCH 7/7] Update cron_run_jobs.php --- scripts/cron/cron_run_jobs.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php index 5c32272bed1..a0d4cb7caee 100755 --- a/scripts/cron/cron_run_jobs.php +++ b/scripts/cron/cron_run_jobs.php @@ -55,9 +55,9 @@ $key=$argv[1]; if (! isset($argv[2]) || ! $argv[2]) { usage($path,$script_file); exit(-1); -} else { - $userlogin=$argv[2]; -} +} + +$userlogin=$argv[2]; // Global variables