From dd32dbacb5dff2ffddaf56155aea00b76ea1bff3 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Wed, 21 Aug 2013 18:55:11 +0200 Subject: [PATCH] Fix retrieving of margin info when invoice created automatically from order (used by workflow module) --- htdocs/compta/facture/class/facture.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index bd0bbaf121e1a..4916e7bf6efd1 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -695,6 +695,10 @@ function createFromOrder($object) $line->special_code = $object->lines[$i]->special_code; $line->fk_parent_line = $object->lines[$i]->fk_parent_line; + $line->fk_fournprice = $object->lines[$i]->fk_fournprice; + $marginInfos = getMarginInfos($object->lines[$i]->subprice, $object->lines[$i]->remise_percent, $object->lines[$i]->tva_tx, $object->lines[$i]->localtax1_tx, $object->lines[$i]->localtax2_tx, $object->lines[$i]->fk_fournprice, $object->lines[$i]->pa_ht); + $line->pa_ht = $marginInfos[0]; + $this->lines[$i] = $line; }