14@phan-var-force CommonObjectLine|CommonOrderLine|ExpeditionLigne $line
15@phan-var-force Commande|Expedition $object
18if (!empty($line->origin_line_id)) {
19 print
'<!-- subtotal origin line id = ' . $line->origin_line_id .
' -->';
21 $element = $line->element;
23 $line_options = $line->extraparams[
"subtotal"] ?? array();
26 print
'<!-- subtotal commande line id = ' . $line->rowid .
' -->';
28 $element =
"commande";
29 $desc = $line->description;
30 $extraparams = (array) json_decode($line->extraparams,
true);
31 $line_options = $extraparams[
"subtotal"] ?? array();
34$langs->load(
'subtotals');
36$line_color =
$object->getSubtotalColors((
int) $line->qty);
46print
'<tr id="row-' .
$id .
'" data-id="' .
$id .
'" data-element="' . $element .
'" style="background:#' . $line_color .
'" >';
49 print
'<td class="center linecolnum">' . ($i + 1) .
'</td>';
52if ($line->qty > 0) { ?>
53 <td
class=
"linecollabel" colspan=
"<?php echo $colspan ?>" <?php echo !
colorIsLight($line_color) ?
' style="color: white"' :
' style="color: black"' ?>><?php echo str_repeat(
' ', (
int) ($line->qty - 1) * 8); ?>
56 if (array_key_exists(
'titleshowuponpdf', $line_options)) {
57 echo
' ' .
img_picto($langs->trans(
"ShowUPOnPDF"),
'invoicing');
59 if (array_key_exists(
'titleshowtotalexludingvatonpdf', $line_options)) {
60 echo
' <span title="' . $langs->trans(
"ShowTotalExludingVATOnPDF") .
'">%</span>';
62 if (array_key_exists(
'titleforcepagebreak', $line_options)) {
63 echo
' ' .
img_picto($langs->trans(
"ForcePageBreak"),
'file');
67<?php } elseif ($line->qty < 0) { ?>
68<td
class=
"linecollabel nowrap right" <?php echo !
colorIsLight($line_color) ?
' style="color: white"' :
' style="color: black"' ?> colspan=
"<?php echo $colspan ?>">
71 if (array_key_exists(
'subtotalshowtotalexludingvatonpdf', $line_options)) {
72 echo
' <span title="' . $langs->trans(
"ShowTotalExludingVATOnPDF") .
'">%</span>';
76<?php } elseif ($line->qty == 0) { ?>
77<td
class=
"linecollabel" colspan=
"<?php echo $colspan ?>" <?php echo !
colorIsLight($line_color) ?
' style="color: white"' :
' style="color: black"' ?>>
78 <?php echo nl2br($desc); ?>
82if (isset($buttons) && $buttons) {
84 echo
'<td class="linecoldelete center">';
85 echo
'<a class="reposition" href="' . $_SERVER[
"PHP_SELF"] .
'?id=' .
$object->id .
'&action=ask_subtotal_deleteline&token=' .
newToken() .
'&lineid=' .
$id;
91 echo
img_delete(
'default',
'class="pictodelete" style="color: white"');
93 echo
img_delete(
'default',
'class="pictodelete" style="color: #666"');
$id
Support class for third parties, contacts, members, users or resources.
if(! $sortfield) if(! $sortorder) $object
const STATUS_DRAFT
Draft status.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
colorIsLight($stringcolor)
Return true if the color is light.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.