Merge pull request #1797 from Devensys/Develop-AddValueReduction

Add Reduction value in pdf
This commit is contained in:
Laurent Destailleur
2014-08-04 09:01:45 +02:00
3 changed files with 4580 additions and 4525 deletions

View File

@@ -1425,6 +1425,38 @@ function pdf_getlineremisepercent($object,$i,$outputlangs,$hidedetails=0)
}
}
/**
* Return line remise value
*
* @param Object $object Object
* @param int $i Current line number
* @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @return string
*/
function pdf_getlineremisevalue($object,$i,$outputlangs,$hidedetails=0)
{
global $hookmanager;
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
if ($object->lines[$i]->special_code != 3)
{
if (is_object($hookmanager) && ( ($object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code) ) || ! empty($object->lines[$i]->fk_parent_line) ) )
{
$special_code = $object->lines[$i]->special_code;
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
$action='';
return $hookmanager->executeHooks('pdf_getlineremisevalue',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
}
else
{
if (empty($hidedetails) || $hidedetails > 1) return price($object->lines[$i]->subprice * $object->lines[$i]->qty - $object->lines[$i]->total_ht);
}
}
}
/**
* Return line total excluding tax
*

File diff suppressed because it is too large Load Diff