mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-06 17:13:03 +01:00
Debug v22
This commit is contained in:
@@ -2747,15 +2747,17 @@ function pdf_getSizeForImage($realpath)
|
||||
}
|
||||
|
||||
/**
|
||||
* Return line total amount discount
|
||||
* Return line total amount discount.
|
||||
* Calculated by taking the unit price (subprice) * quantity - (total without tax)
|
||||
*
|
||||
* @param Commande|Facture|Propal $object Object
|
||||
* @param int $i Current line number
|
||||
* @param Translate $outputlangs Object langs for output
|
||||
* @param int<0,2> $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
|
||||
* @param int<0,1> $multicurrency 1=Get value in the foreign currency
|
||||
* @return int|float|string Return total of line excl tax
|
||||
*/
|
||||
function pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, $hidedetails = 0)
|
||||
function pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, $hidedetails = 0, $multicurrency = 0)
|
||||
{
|
||||
global $hookmanager;
|
||||
|
||||
@@ -2777,7 +2779,8 @@ function pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, $hidedetails =
|
||||
'i' => $i,
|
||||
'outputlangs' => $outputlangs,
|
||||
'hidedetails' => $hidedetails,
|
||||
'special_code' => $special_code
|
||||
'special_code' => $special_code,
|
||||
'multicurrency' => $multicurrency
|
||||
);
|
||||
|
||||
$action = '';
|
||||
@@ -2792,7 +2795,11 @@ function pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, $hidedetails =
|
||||
}
|
||||
|
||||
if (empty($hidedetails) || $hidedetails > 1) {
|
||||
return (float) price2num($sign * (($object->lines[$i]->subprice * (float) $object->lines[$i]->qty) - $object->lines[$i]->total_ht), 'MT', 1);
|
||||
if (empty($multicurrency)) {
|
||||
return (float) price2num($sign * (($object->lines[$i]->subprice * (float) $object->lines[$i]->qty) - $object->lines[$i]->total_ht), 'MT', 1);
|
||||
} else {
|
||||
return (float) price2num($sign * (($object->lines[$i]->multicurrency_subprice * (float) $object->lines[$i]->qty) - $object->lines[$i]->multicurrency_total_ht), 'MT', 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user