* Copyright (C) 2024 MDW * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2025 Charlene Benke * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * or see https://www.gnu.org/ */ /** * @var Propal|Contrat|Commande|Facture|Expedition|Delivery|CommandeFournisseur|FactureFournisseur|SupplierProposal $object * @var Propal|Contrat|Commande|Facture|Expedition|Delivery|CommandeFournisseur|FactureFournisseur|SupplierProposal $this * @var CommonObjectLine|CommonInvoiceLine|CommonOrderLine|ExpeditionLigne|PropaleLigne $line * @var Conf $conf * @var Form $form * @var Societe $mysoc * @var Translate $langs * @var User $user * @var string $action * * @var int $num * @var int $i */ ' @phan-var-force CommonObjectLine|CommonInvoiceLine|CommonOrderLine|ExpeditionLigne|PropaleLigne $line @phan-var-force Propal|Contrat|Commande|Facture|Expedition|Delivery|CommandeFournisseur|FactureFournisseur|SupplierProposal $this @phan-var-force Propal|Contrat|Commande|Facture|Expedition|Delivery|CommandeFournisseur|FactureFournisseur|SupplierProposal $object @phan-var-force int $num '; echo "\n"; $langs->load('subtotals'); $line_options = $line->extraparams["subtotal"] ?? array(); $line_color = $this->getSubtotalColors($line->qty); echo ''; // Showing line number if conf is enabled if (getDolGlobalString('MAIN_VIEW_LINE_NUMBER')) { echo '' . ($i + 1) . ''; } if ($line->qty > 0) { ?> >qty - 1) * 8); ?> desc; if (array_key_exists('titleshowuponpdf', $line_options)) { echo ' ' . img_picto($langs->trans("ShowUPOnPDF"), 'invoicing'); } if (array_key_exists('titleshowtotalexludingvatonpdf', $line_options)) { echo '  %'; } if (array_key_exists('titleforcepagebreak', $line_options)) { echo ' ' . img_picto($langs->trans("ForcePageBreak"), 'file'); } ?> status == 0 && $object->element != 'facturerec') { if (GETPOST('mode', 'aZ09') == 'vatforblocklines' && GETPOSTINT('lineid') == $line->id) { $type_tva = $type_tva ?? 0; print '
'; print $form->load_tva('vatforblocklines', '', $mysoc, $object->thirdparty, 0, (int) $line->info_bits, $line->product_type, false, 1, $type_tva); print ''; print ''; print '
'; } else { print 'id . '">'; if (!colorIsLight($line_color)) { echo img_edit($langs->trans("ApplyVATForBlock"), 0, 'style="color: white"'); } else { echo img_edit($langs->trans("ApplyVATForBlock"), 0, 'style="color: #666"'); } echo ''; } } ?> multicurrency_code && $this->multicurrency_code != $conf->currency) { print ''; } // Handling colspan if MAIN_NO_INPUT_PRICE_WITH_TAX conf is enabled if (!getDolGlobalInt('MAIN_NO_INPUT_PRICE_WITH_TAX') && $object->element != 'facturerec') { print ''; } print ''; // Handling colspan if PRODUCT_USE_UNITS conf is enabled if (getDolGlobalString('PRODUCT_USE_UNITS')) { print ''; } ?> status == 0 && $object->element != 'facturerec') { if (GETPOST('mode', 'aZ09') == 'discountforblocklines' && GETPOSTINT('lineid') == $line->id) { print '
'; print '%'; print ''; print ''; print '
'; } else { print 'id . '">'; if (!colorIsLight($line_color)) { echo img_edit($langs->trans("ApplyDiscountForBlock"), 0, 'style="color: white"'); } else { echo img_edit($langs->trans("ApplyDiscountForBlock"), 0, 'style="color: #666"'); } echo ''; } } ?> situation_cycle_ref) && $this->situation_cycle_ref) { print ''; if (getDolGlobalInt('INVOICE_USE_SITUATION') == 2) { print ''; } print ''; } // Handling colspan if margin module is enabled if (!empty($object->element) && in_array($object->element, array('facture', 'facturerec', 'propal', 'commande')) && isModEnabled('margin') && empty($user->socid)) { if ($user->hasRight('margins', 'creer')) { print ''; } if (getDolGlobalString('DISPLAY_MARGIN_RATES') && $user->hasRight('margins', 'liretous')) { print ''; } if (getDolGlobalString('DISPLAY_MARK_RATES') && $user->hasRight('margins', 'liretous')) { print ''; } } ?> multicurrency_code && $this->multicurrency_code != $conf->currency) { ?> qty < 0) { // Base colspan if there is no module activated to display line correctly $colspan = 3; if (property_exists($this, 'situation_cycle_ref') && isset($this->situation_cycle_ref) && $this->situation_cycle_ref) { $colspan += 2; if (getDolGlobalInt('INVOICE_USE_SITUATION') == 2) { $colspan += 1; } } // Handling colspan if margin module is enabled if (!empty($object->element) && in_array($object->element, array('facture', 'facturerec', 'propal', 'commande')) && isModEnabled('margin') && empty($user->socid)) { if ($user->hasRight('margins', 'creer')) { $colspan += 1; } if (getDolGlobalString('DISPLAY_MARGIN_RATES') && $user->hasRight('margins', 'liretous')) { $colspan += 1; } if (getDolGlobalString('DISPLAY_MARK_RATES') && $user->hasRight('margins', 'liretous')) { $colspan += 1; } } // Handling colspan if multicurrency module is enabled if (isModEnabled('multicurrency') && $object->multicurrency_code != $conf->currency) { $colspan += 1; } // Handling colspan if MAIN_NO_INPUT_PRICE_WITH_TAX conf is enabled if (!getDolGlobalInt('MAIN_NO_INPUT_PRICE_WITH_TAX') && $object->element != 'facturerec') { $colspan += 1; } // Handling colspan if PRODUCT_USE_UNITS conf is enabled if (getDolGlobalString('PRODUCT_USE_UNITS')) { $colspan += 1; } ?> colspan=""> desc; if (array_key_exists('subtotalshowtotalexludingvatonpdf', $line_options)) { echo '  %'; } echo ' :'; ?> > getSubtotalLineAmount($line); ?> multicurrency_code != $conf->currency) { echo ''; echo $this->getSubtotalLineMulticurrencyAmount($line); echo ''; } ?> status == 0) { // Edit picto echo ''; echo ''; if (!colorIsLight($line_color)) { echo img_edit('default', 0, 'style="color: white"'); } else { echo img_edit('default', 0, 'style="color: #666"'); } echo ' '; // Delete picto echo ''; echo ''; if (!colorIsLight($line_color)) { echo img_delete('default', 'class="pictodelete" style="color: white"'); } else { echo img_delete('default', 'class="pictodelete" style="color: #666"'); } echo ' '; // Move up-down picto if ($num > 1 && $conf->browser->layout != 'phone' && ((property_exists($this, 'situation_counter') && $this->situation_counter == 1) || (property_exists($this, 'situation_cycle_ref') && empty($this->situation_cycle_ref))) && empty($disablemove)) { echo ''; if ($i > 0) { echo ''; echo img_up('default', 0, 'imgupforline'); echo ''; } if ($i < $num - 1) { echo ''; echo img_down('default', 0, 'imgdownforline'); echo ''; } echo ''; } else { echo 'browser->layout != 'phone' && empty($disablemove)) ? ' class="linecolmove tdlineupdown center"' : ' class="linecolmove center"') . '>'; } } else { $colspan = 3; if (isModEnabled('asset') && $object->element == 'invoice_supplier') { $colspan++; } print ''; } if ($action == 'selectlines') { ?> '; echo ''; ?>