From 90b9e7c136c357fd85c57e9a3eee4a4fa310377f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sun, 14 Apr 2013 13:06:13 +0200 Subject: [PATCH 1/3] Fixed bug #807: Margins modules with orders2invoice does not respect cost price Also, removed duplicated requires in orderstoinvoice.php --- htdocs/commande/orderstoinvoice.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index a6b2fe44a1f..5fdfaa59201 100755 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -28,9 +28,9 @@ */ require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; @@ -84,17 +84,12 @@ if ($action == 'create') if (($action == 'create' || $action == 'add') && empty($mesgs)) { - require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; - require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php'; - require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; - require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; - require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; } $langs->load('bills'); $langs->load('products'); @@ -287,7 +282,9 @@ if (($action == 'create' || $action == 'add') && empty($mesgs)) $lines[$i]->special_code, $object->origin, $lines[$i]->rowid, - $fk_parent_line + $fk_parent_line, + $lines[$i]->fk_fournprice, + $lines[$i]->pa_ht ); if ($result > 0) { From b6ce386513b8d6bfca758183a20a08fa3749500c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sun, 14 Apr 2013 13:07:05 +0200 Subject: [PATCH 2/3] Converted indentation to tabs --- htdocs/commande/orderstoinvoice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index 5fdfaa59201..42a39dd9fa8 100755 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -284,7 +284,7 @@ if (($action == 'create' || $action == 'add') && empty($mesgs)) $lines[$i]->rowid, $fk_parent_line, $lines[$i]->fk_fournprice, - $lines[$i]->pa_ht + $lines[$i]->pa_ht ); if ($result > 0) { From 0e34df43b1f0c944d44efb168d0e92b4857330c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sun, 14 Apr 2013 13:09:00 +0200 Subject: [PATCH 3/3] Updated changelog --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 74522e7b7c8..b410a03df2e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16,6 +16,7 @@ English Dolibarr ChangeLog - Fix: [ bug #774 ] Bug on creating event with box "all day" crossed - Fix: [ bug #817 ] Purchases journal does not reflect localtaxes - Fix: [ bug #816 ] Sales journal does not reflect localtaxes +- Fix: [ bug #806 ] Margins module with orders2invoice does not respect cost price - Fix: Orderstoinvoice didn't act as expected when no order was checked