From 1065645fb67bc90899c6b470d133ece67fe45e00 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcos=20Garci=CC=81a?= <marcosgdf@gmail.com>
Date: Sat, 27 Apr 2013 13:45:25 +0200
Subject: [PATCH] Fix: [ bug #857 ] Invoice created from shipment does not have
 the order discount

---
 ChangeLog                                    | 1 +
 htdocs/expedition/class/expedition.class.php | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index e7991515f6a..4c717ab680d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -25,6 +25,7 @@ English Dolibarr ChangeLog
 - Fix: [ bug #810 ] Cannot update ODT template path
 - Fix: [ bug #824 ] MAIN_DB_PREFIX not use into dictionnary
 - Fix: [ bug #828 ] Error when code_region is not a number in llx_c_regions (with postgres)
+- Fix: [ bug #857 ] Invoice created from shipment does not have the order discount
 
 
 ***** ChangeLog for 3.3.1 compared to 3.3 *****
diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php
index 7c9a5917727..b9c1cc36a45 100644
--- a/htdocs/expedition/class/expedition.class.php
+++ b/htdocs/expedition/class/expedition.class.php
@@ -857,7 +857,7 @@ class Expedition extends CommonObject
 
 		$sql = "SELECT cd.rowid, cd.fk_product, cd.label as custom_label, cd.description, cd.qty as qty_asked";
 		$sql.= ", cd.total_ht, cd.total_localtax1, cd.total_localtax2, cd.total_ttc, cd.total_tva";
-		$sql.= ", cd.tva_tx, cd.localtax1_tx, cd.localtax2_tx, cd.price, cd.subprice";
+		$sql.= ", cd.tva_tx, cd.localtax1_tx, cd.localtax2_tx, cd.price, cd.subprice, cd.remise_percent";
 		$sql.= ", ed.qty as qty_shipped, ed.fk_origin_line, ed.fk_entrepot";
 		$sql.= ", p.ref as product_ref, p.label as product_label, p.fk_product_type";
 		$sql.= ", p.weight, p.weight_units, p.length, p.length_units, p.surface, p.surface_units, p.volume, p.volume_units";
-- 
GitLab