* Copyright (C) 2010-2011 Laurent Destailleur * Copyright (C) 2012-2013 Christophe Battarel * Copyright (C) 2012 Cédric Salvador * Copyright (C) 2012-2014 Raphaël Doursenaud * Copyright (C) 2013 Florian Henry * Copyright (C) 2017 Juanjo Menent * Copyright (C) 2022 OpenDSI * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2025 Lenin Rivas * * 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 . */ /** * @var CommonObject|Facture $this * @var CommonObject $object * @var CommonObjectLine $line * @var Form $form * @var HookManager $hookmanager * @var Translate $langs * @var Conf $conf * @var User $user * * @var int $disableedit * @var int $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax) * @var int $outputalsopricetotalwithtax * @var int $usemargins (0 to disable all margins columns, 1 to show according to margin setup) */ // Protection to avoid direct call of template if (empty($object) || !is_object($object)) { print "Error, template page can't be called as URL"; exit(1); } '@phan-var-force CommonObject|Facture $this @phan-var-force CommonObject $object'; print "\n"; // Title line print "\n"; print ''; // Adds a line numbering column if (getDolGlobalString('MAIN_VIEW_LINE_NUMBER')) { print ' '; } // Description print ''.$langs->trans('Description'); $constant = get_class($object)."::STATUS_DRAFT"; if (in_array($object->element, array('propal', 'commande', 'facture', 'order_supplier', 'invoice_supplier')) && defined($constant) && $object->status == constant($constant)) { if (empty($disableedit) && GETPOST('mode', 'aZ09') != 'servicedateforalllines') { print 'id.'">'.img_edit($langs->trans("UpdateForAllLines"), 0, 'class="clickvatforalllines opacitymedium paddingleft cursorpointer"').''; } if (GETPOST('mode', 'aZ09') == 'servicedateforalllines') { print '  
'; $hourmin = getDolGlobalInt('MAIN_USE_HOURMIN_IN_DATE_RANGE'); print $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; print $form->selectDate('', 'alldate_start', $hourmin, $hourmin, 1, "updatealllines", 1, 0); print ' '.$langs->trans('to').' '; print $form->selectDate('', 'alldate_end', $hourmin, $hourmin, 1, "updatealllines", 1, 0); print ''; print '
'; } } print ''; // Supplier ref if ($this->element == 'supplier_proposal' || $this->element == 'order_supplier' || $this->element == 'invoice_supplier' || $this->element == 'invoice_supplier_rec') { print ''.$langs->trans("SupplierRef").''; } // VAT print ''; if (getDolGlobalString('FACTURE_LOCAL_TAX1_OPTION') || getDolGlobalString('FACTURE_LOCAL_TAX2_OPTION')) { print $langs->trans('Taxes'); } else { print $langs->trans('VAT'); } // @phan-suppress-next-line PhanUndeclaredConstantOfClass if (in_array($object->element, array('propal', 'commande', 'facture', 'supplier_proposal', 'order_supplier', 'invoice_supplier')) && $object->status == $object::STATUS_DRAFT) { global $mysoc; if (empty($disableedit) && GETPOST('mode', 'aZ09') != 'vatforalllines') { print 'id.'">'.img_edit($langs->trans("UpdateForAllLines"), 0, 'class="clickvatforalllines opacitymedium paddingleft cursorpointer"').''; } //print ''; if (GETPOST('mode', 'aZ09') == 'vatforalllines') { print '
'; $societe_vendeuse = strpos($object->element, 'supplier') === false ? $mysoc : $object->thirdparty; $societe_acheteuse = strpos($object->element, 'supplier') === false ? $object->thirdparty : $mysoc; $vat_mode = strpos($object->element, 'supplier') === false ? 1 : 2; print $form->load_tva('vatforalllines', '', $societe_vendeuse, $societe_acheteuse, 0, 0, '', false, 1, $vat_mode); print ''; print '
'; } } print ''; // Price HT / excl tax print ''.$langs->trans('PriceUHT').''; // Multicurrency HT / excl tax if (isModEnabled("multicurrency") && $this->multicurrency_code && $this->multicurrency_code != $conf->currency) { print ''.$langs->trans('PriceUHT'); print ' ('.$langs->getCurrencySymbol($this->multicurrency_code).')'; } // Price TTC / incl tax if (!empty($inputalsopricewithtax) && !getDolGlobalInt('MAIN_NO_INPUT_PRICE_WITH_TAX')) { print ''.$langs->trans('PriceUTTC').''; } // Multicurrency TTC / incl tax if (isModEnabled("multicurrency") && $this->multicurrency_code && $this->multicurrency_code != $conf->currency && !empty($inputalsopricewithtax) && !getDolGlobalInt('MAIN_NO_INPUT_PRICE_WITH_TAX')) { print ''.$langs->trans('PriceUTTC'); print ' ('.$langs->getCurrencySymbol($this->multicurrency_code).')'; } // Qty print ''.$langs->trans('Qty').''; // Unit if (getDolGlobalString('PRODUCT_USE_UNITS')) { print ''.$langs->trans('Unit').''; } // Reduction short print ''; print $langs->trans('ReductionShort'); // @phan-suppress-next-line PhanUndeclaredConstantOfClass if (in_array($object->element, array('propal', 'commande', 'facture')) && $object->status == $object::STATUS_DRAFT) { global $mysoc; if (empty($disableedit) && GETPOST('mode', 'aZ09') != 'remiseforalllines') { print 'id.'">'.img_edit($langs->trans("UpdateForAllLines"), 0, 'class="clickvatforalllines opacitymedium paddingleft cursorpointer"').''; } //print ''; if (GETPOST('mode', 'aZ09') == 'remiseforalllines') { print '
'; print ''; print ''; print '
'; } } print ''; // Fields for situation invoice if (property_exists($this, 'situation_cycle_ref') && isset($this->situation_cycle_ref) && $this->situation_cycle_ref) { print ''.$langs->trans('CumulativeProgression').''; if (getDolGlobalInt('INVOICE_USE_SITUATION') == 2) { print '' . $langs->trans('SituationInvoiceProgressCurrent') . ''; } print ''.$form->textwithpicto($langs->trans('TotalHT100Short'), $langs->trans('UnitPriceXQtyLessDiscount')).''; } // Purchase price if ($usemargins && isModEnabled('margin') && empty($user->socid)) { if ($user->hasRight('margins', 'creer')) { if (getDolGlobalString('MARGIN_TYPE') == "1") { print ''.$langs->trans('BuyingPrice').''; } else { print ''.$langs->trans('CostPrice').''; } } if (getDolGlobalString('DISPLAY_MARGIN_RATES') && $user->hasRight('margins', 'liretous')) { print ''.$langs->trans('MarginRate'); // @phan-suppress-next-line PhanUndeclaredConstantOfClass if (in_array($object->element, array('propal', 'commande', 'facture', 'supplier_proposal', 'order_supplier', 'invoice_supplier')) && $object->status == $object::STATUS_DRAFT) { print 'id.'">'.img_edit($langs->trans("UpdateForAllLines"), 0, 'class="clickmarginforalllines opacitymedium paddingleft cursorpointer"').''; if (GETPOST('mode', 'aZ09') == 'marginforalllines') { print '
'; print ''; print ''; print '
'; } } print ''; } if (getDolGlobalString('DISPLAY_MARK_RATES') && $user->hasRight('margins', 'liretous')) { print ''.$langs->trans('MarkRate'); if (in_array($object->element, array('propal', 'commande', 'facture')) && $object->status == get_class($object)::STATUS_DRAFT) { print 'id.'">'.img_edit($langs->trans("UpdateForAllLines"), 0, 'class="clickmarkforalllines opacitymedium paddingleft cursorpointer"').''; if (GETPOST('mode', 'aZ09') == 'markforalllines') { print '
'; print ''; print ''; print '
'; } } print ''; } } // Total HT print ''.$langs->trans('TotalHTShort').''; // Multicurrency if (isModEnabled("multicurrency") && $this->multicurrency_code && $this->multicurrency_code != $conf->currency) { print ''.$langs->trans('TotalHTShort'); print ' ('.$langs->getCurrencySymbol($this->multicurrency_code).')'; } if ($outputalsopricetotalwithtax) { print ''.$langs->trans('TotalTTCShort').''; } if (isModEnabled('asset') && $object->element == 'invoice_supplier') { print ''; } print ''; // No width to allow autodim print ''; print ''; if ($action == 'selectlines') { print ''; print ''; print ''; print ''; } print "\n"; print "\n"; print "\n";