Jelajahi Sumber

MMI Core Display price with reduction in document lines

Mathieu Moulin 1 tahun lalu
induk
melakukan
fd7e6c2c4c

+ 7 - 0
htdocs/core/tpl/objectline_title.tpl.php

@@ -124,6 +124,13 @@ if (in_array($object->element, array('propal', 'commande', 'facture')) && $objec
 }
 print '</th>';
 
+// MMI Hack : Reduction
+if (!empty($conf->global->MMI_PRICE_REMISE_AFF)) {
+	print '<th class="linecoldiscount right nowraponall">';
+	print $langs->trans('PriceUHT').' '.$langs->trans('ReductionShort');
+	print '</th>';
+}
+
 // Fields for situation invoice
 if (isset($this->situation_cycle_ref) && $this->situation_cycle_ref) {
 	print '<th class="linecolcycleref right">'.$langs->trans('Progress').'</th>';

+ 11 - 0
htdocs/core/tpl/objectline_view.tpl.php

@@ -367,6 +367,17 @@ if (!empty($line->remise_percent) && $line->special_code != 3) {
 	$coldisplay++;
 }
 
+// MMI Hack : Reduction
+if (!empty($conf->global->MMI_PRICE_REMISE_AFF)) {
+	if (!empty($line->remise_percent) && $line->special_code != 3) {
+		$price_reduced = price($sign * $line->subprice * (1-$line->remise_percent/100));
+	} else {
+		$price_reduced = price($sign * $line->subprice);
+	}
+	print '<td class="linecoluht_currency nowrap right">'.$price_reduced.'</td>';
+	$coldisplay++;
+}
+
 // Fields for situation invoices
 if (isset($this->situation_cycle_ref) && $this->situation_cycle_ref) {
 	include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';