* Copyright (C) 2024 MDW * Copyright (C) 2024-2025 Frédéric France * * 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 CommonObject $this * @var Propal|Contrat|Commande|Facture|Expedition|Delivery|CommandeFournisseur|FactureFournisseur|SupplierProposal|Fichinter $object * @var PropaleLigne|ContratLigne|OrderLine|FactureLigne|ExpeditionLigne|DeliveryLine|CommandeFournisseurLigne|SupplierInvoiceLine|SupplierProposalLine|FichinterLigne $line * @var Form $form * @var Translate $langs * @var User $user * @var Conf $conf * @var int $i */ ' @phan-var-force Propal|Contrat|Commande|Facture|Expedition|Delivery|CommandeFournisseur|FactureFournisseur|SupplierProposal|Fichinter $object @phan-var-force CommonObjectLine|CommonInvoiceLine|CommonOrderLine|ExpeditionLigne|PropaleLigne|FichinterLigne $line '; // Options for subtotal $sub_options = $line->extraparams["subtotal"] ?? array(); $titleshowuponpdf = !empty($sub_options['titleshowuponpdf']); $titleshowtotalexludingvatonpdf = !empty($sub_options['titleshowtotalexludingvatonpdf']); $titleforcepagebreak = !empty($sub_options['titleforcepagebreak']); $subtotalshowtotalexludingvatonpdf = !empty($sub_options['subtotalshowtotalexludingvatonpdf']); $line_options = array( 'titleshowuponpdf' => array('type' => array('title'), 'value' => 'on', 'checked' => $titleshowuponpdf, 'trans_key' => 'ShowUPOnPDF'), 'titleshowtotalexludingvatonpdf' => array('type' => array('title'), 'value' => 'on', 'checked' => $titleshowtotalexludingvatonpdf, 'trans_key' => 'ShowTotalExludingVATOnPDF'), 'titleforcepagebreak' => array('type' => array('title'), 'value' => 'on', 'checked' => $titleforcepagebreak, 'trans_key' => 'ForcePageBreak'), 'subtotalshowtotalexludingvatonpdf' => array('type' => array('subtotal'), 'value' => 'on', 'checked' => $subtotalshowtotalexludingvatonpdf, 'trans_key' => 'ShowTotalExludingVATOnPDF'), ); // Line type $line_type = $line->qty > 0 ? 'title' : 'subtotal'; print "\n"; echo ''; if (getDolGlobalString('MAIN_VIEW_LINE_NUMBER')) { echo '' . ($i + 1) . ''; } // Base colspan if there is no module activated to display line correctly $colspan = 4; // 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')) { $colspan += 1; } // Handling colspan if PRODUCT_USE_UNITS conf is enabled if (getDolGlobalString('PRODUCT_USE_UNITS')) { $colspan += 1; } ?>
fk_prev_id != null && in_array($object->element, array('facture', 'facturedet'))) { /** @var CommonInvoice $object */ // @phan-suppress-next-line PhanUndeclaredConstantOfClass if ($object->type == $object::TYPE_SITUATION) { // The constant TYPE_SITUATION exists only for object invoice // Set constant to disallow editing during a situation cycle $situationinvoicelinewithparent = 1; } } // Do not allow editing during a situation cycle // but in some situations that is required (update legal information for example) if (getDolGlobalString('INVOICE_SITUATION_CAN_FORCE_UPDATE_DESCRIPTION')) { $situationinvoicelinewithparent = 0; } $langs->load('subtotals'); if (!$situationinvoicelinewithparent) { print ''; $depth_array = $this->getPossibleLevels($langs); print $form->selectarray('line_depth', $depth_array, abs($line->qty), 0, 0, 0, '', 0, 0, $disabled); if ($disabled) { print ''; } print '
    '; foreach ($line_options as $key => $value) { if (in_array($line_type, $value['type'])) { print '
  • '; print '
  • '; } } print '
'; print ''; } else { print ''; } ?> ">
">