12@phan-var-force CommonObjectLine|CommonOrderLine|ExpeditionLigne $line
13@phan-var-force Commande|Expedition $object
16if (!empty($line->origin_line_id)) {
17 print
'<!-- subtotal origin line id = ' . $line->origin_line_id .
' -->';
19 $element = $line->element;
21 $line_options = $line->extraparams[
"subtotal"] ?? array();
24 print
'<!-- subtotal commande line id = ' . $line->rowid .
' -->';
26 $element =
"commande";
27 $desc = $line->description;
28 $extraparams = (array) json_decode($line->extraparams,
true);
29 $line_options = $extraparams[
"subtotal"] ?? array();
32$langs->load(
'subtotals');
34$line_color =
$object->getSubtotalColors((
int) $line->qty);
44print
'<tr id="row-' .
$id .
'" data-id="' .
$id .
'" data-element="' . $element .
'" style="background:#' . $line_color .
'" >';
47 print
'<td class="center linecolnum">' . ($i + 1) .
'</td>';
50if ($line->qty > 0) { ?>
51 <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); ?>
54 if (array_key_exists(
'titleshowuponpdf', $line_options)) {
55 echo
' ' .
img_picto($langs->trans(
"ShowUPOnPDF"),
'invoicing');
57 if (array_key_exists(
'titleshowtotalexludingvatonpdf', $line_options)) {
58 echo
' <span title="' . $langs->trans(
"ShowTotalExludingVATOnPDF") .
'">%</span>';
60 if (array_key_exists(
'titleforcepagebreak', $line_options)) {
61 echo
' ' .
img_picto($langs->trans(
"ForcePageBreak"),
'file');
65<?php } elseif ($line->qty < 0) { ?>
66<td
class=
"linecollabel nowrap right" <?php echo !
colorIsLight($line_color) ?
' style="color: white"' :
' style="color: black"' ?> colspan=
"<?php echo $colspan ?>">
69 if (array_key_exists(
'subtotalshowtotalexludingvatonpdf', $line_options)) {
70 echo
' <span title="' . $langs->trans(
"ShowTotalExludingVATOnPDF") .
'">%</span>';
76if (isset($buttons) && $buttons) {
78 echo
'<td class="linecoldelete center">';
79 echo
'<a class="reposition" href="' . $_SERVER[
"PHP_SELF"] .
'?id=' .
$object->id .
'&action=ask_subtotal_deleteline&token=' .
newToken() .
'&lineid=' .
$id;
85 echo
img_delete(
'default',
'class="pictodelete" style="color: white"');
87 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.
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.
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.