dolibarr 22.0.5
functions_subtotals.lib.php
1<?php
12function subtotals_completesubstitutionarray_lines(&$substitutionarray, $langs, $object, $line)
13{
14 global $conf, $db;
15
16
17 if (defined('SUBTOTALS_SPECIAL_CODE')) {
18 $substitutionarray['is_subtotals_line'] = ($line->special_code == SUBTOTALS_SPECIAL_CODE);
19 $substitutionarray['is_not_subtotals_line'] = !$substitutionarray['is_subtotals_line'];
20 $substitutionarray['is_subtotals_title'] = (($line->special_code == SUBTOTALS_SPECIAL_CODE) && $line->qty > 0);
21 $substitutionarray['is_subtotals_subtotal'] = (($line->special_code == SUBTOTALS_SPECIAL_CODE) && $line->qty < 0);
22 $subtotal_total = 0;
23 if (isModEnabled('multicurrency') && $object->multicurrency_code != $conf->currency) {
24 $subtotal_total = $object->getSubtotalLineMulticurrencyAmount($line); // @phan-suppress-current-line PhanPluginUnknownObjectMethodCall
25 } else {
26 $subtotal_total = $object->getSubtotalLineAmount($line); // @phan-suppress-current-line PhanPluginUnknownObjectMethodCall
27 }
28 $substitutionarray['subtotals_total'] = ($subtotal_total == 0) ? "" : $subtotal_total;
29 $substitutionarray['subtotals_level'] = abs($line->qty);
30 } else {
31 $substitutionarray['is_subtotals_line'] = false;
32 $substitutionarray['is_not_subtotals_line'] = true;
33 $substitutionarray['is_subtotals_title'] = false;
34 $substitutionarray['is_subtotals_subtotal'] = false;
35 $substitutionarray['subtotals_total'] = 0;
36 $substitutionarray['subtotals_level'] = 0;
37 }
38}
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:67
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
Definition member.php:79