From 43beb38c9b7b69f20c56efe167de9190b47ea3c3 Mon Sep 17 00:00:00 2001 From: simnandez Date: Tue, 10 Sep 2013 11:04:36 +0200 Subject: [PATCH 1/3] Fix: [ bug #1061 ] Bad info shipped products --- ChangeLog | 2 ++ htdocs/commande/class/commande.class.php | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 10992d1d875..c4a7b89e7af 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23,8 +23,10 @@ Fix: Intervention box links to contracts id Fix: Compatiblity with multicompany module Fix: Edit propal line was losing product supplier price id Fix: Delete linked element to supplier invoice when deleted +Fix: [ bug #1061 ] Bad info shipped products Qual: Add travis-ci integration + ***** ChangeLog for 3.4 compared to 3.3.* ***** For users: - New: Can use ODS templates as document templates. diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 21b55a39413..4e00900d995 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3,10 +3,10 @@ * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2013 Regis Houssin * Copyright (C) 2006 Andre Cianfarani - * Copyright (C) 2010-2012 Juanjo Menent + * Copyright (C) 2010-2013 Juanjo Menent * Copyright (C) 2011 Jean Heimburger * Copyright (C) 2012 Christophe Battarel - * Copyright (C) 2013 Florian Henry + * Copyright (C) 2013 Florian Henry * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU *General Public License as published by @@ -1597,7 +1597,7 @@ class Commande extends CommonOrder if ($filtre_statut >= 0) $sql.= ' ed.fk_expedition = e.rowid AND'; $sql.= ' ed.fk_origin_line = cd.rowid'; $sql.= ' AND cd.fk_commande =' .$this->id; - if ($filtre_statut >= 0) $sql.=' AND e.fk_statut = '.$filtre_statut; + if ($filtre_statut >= 0) $sql.=' AND e.fk_statut >= '.$filtre_statut; $sql.= ' GROUP BY cd.rowid, cd.fk_product'; //print $sql; From 5abbee02c8f34195a9cbc6ca5e07917dfbdb747d Mon Sep 17 00:00:00 2001 From: jfefe Date: Tue, 10 Sep 2013 11:23:36 +0200 Subject: [PATCH 2/3] Fix : missing lib / bad property name in order webservice --- htdocs/webservices/server_order.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/htdocs/webservices/server_order.php b/htdocs/webservices/server_order.php index 25839b5d76d..8b3d4569dbf 100644 --- a/htdocs/webservices/server_order.php +++ b/htdocs/webservices/server_order.php @@ -351,11 +351,11 @@ function getOrder($authentication,$id='',$ref='',$ref_ext='') 'desc'=>$line->desc, 'qty'=>$line->qty, 'price'=>$line->price, - 'subprice'=>$line->subprice, + 'unitprice'=>$line->subprice, 'vat_rate'=>$line->tva_tx, 'remise'=>$line->remise, 'remise_percent'=>$line->remise_percent, - 'fk_product'=>$line->fk_product, + 'product_id'=>$line->fk_product, 'product_type'=>$line->product_type, 'total_net'=>$line->total_ht, 'total_vat'=>$line->total_tva, @@ -515,7 +515,7 @@ function getOrdersForThirdParty($authentication,$idthirdparty) 'desc'=>$line->desc, 'qty'=>$line->qty, 'price'=>$line->price, - 'subprice'=>$line->subprice, + 'unitprice'=>$line->subprice, 'tva_tx'=>$line->tva_tx, 'remise'=>$line->remise, 'remise_percent'=>$line->remise_percent, @@ -610,6 +610,8 @@ function createOrder($authentication,$order) { global $db,$conf,$langs; + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; + $now=dol_now(); dol_syslog("Function: createOrder login=".$authentication['login']." socid :".$order['socid']); @@ -654,10 +656,11 @@ function createOrder($authentication,$order) $newline->type=$line['type']; $newline->desc=$line['desc']; - $newline->fk_product=$line['fk_product']; + $newline->fk_product=$line['product_id']; $newline->tva_tx=$line['vat_rate']; $newline->qty=$line['qty']; - $newline->subprice=$line['subprice']; + $newline->price=$line['price']; + $newline->subprice=$line['unitprice']; $newline->total_ht=$line['total_net']; $newline->total_tva=$line['total_vat']; $newline->total_ttc=$line['total']; From 0cb8e2e71099b9ee08eb3ae269b5dc7789e95d5f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 10 Sep 2013 12:26:48 +0200 Subject: [PATCH 3/3] Removed warnings --- .travis.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 64fae25edca..6bee6a229b2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,7 +34,7 @@ before_script: - echo "extension = apc.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini # - echo "extension = memcache.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - - echo "extension = xdebug.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini + - echo "zend_extension_ts = xdebug.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - cat ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - echo Init database - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS myapp_test;' -U postgres; fi" @@ -72,8 +72,10 @@ before_script: # use the $DB env variable to determine the phpunit.xml to use #script: phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml --coverage-text test/phpunit/AllTests.php #script: phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml --coverage-text test/phpunit/BuildDocTest.php -script: phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml test/phpunit/AllTests.php #script: phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml test/phpunit/WebservicesOtherTest.php +script: +# - phpcs -s --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/documents/,/includes/,/test/report/ . + - phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml test/phpunit/AllTests.php after_script: # - echo Output dolibarr log file; cat $(pwd)/htdocs/documents/dolibarr.log