Fix retrieving of margin info when invoice created automatically from order (used by workflow module)

This commit is contained in:
Christophe Battarel
2013-08-21 18:55:11 +02:00
parent 7e27b9f221
commit dd32dbacb5

View File

@@ -695,6 +695,10 @@ class Facture extends CommonInvoice
$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;
}