From 32b73415025eec5989d8109f4b8b0f872a5132e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Mon, 18 May 2015 00:51:51 +0200 Subject: [PATCH] Added support for thirdparty-defined discounts --- importorderlines/class/Utils.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/importorderlines/class/Utils.php b/importorderlines/class/Utils.php index 96d1fd0..69823f7 100644 --- a/importorderlines/class/Utils.php +++ b/importorderlines/class/Utils.php @@ -204,6 +204,13 @@ public static function addOrderLine(Commande $object, Product $prod, $qty) if ($tva_npr) $info_bits |= 0x01; + //Percent remise + if (! empty($object->client->remise_percent)) { + $percent_remise = $object->client->remise_percent; + } else { + $percent_remise=0; + } + // Insert line $result = $object->addline( $desc, @@ -213,7 +220,7 @@ public static function addOrderLine(Commande $object, Product $prod, $qty) $localtax1_tx, $localtax2_tx, $prod->id, - 0, + $percent_remise, $info_bits, 0, $price_base_type,