* Copyright (C) 2010-2012 Laurent Destailleur * Copyright (C) 2012 Christophe Battarel * Copyright (C) 2012 Cédric Salvador * Copyright (C) 2012-2014 Raphaël Doursenaud * Copyright (C) 2013 Florian Henry * Copyright (C) 2018 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 . * * Need to have following variables defined: * $object (invoice, order, ...) * $conf * $langs * $seller, $buyer * $dateSelector * $forceall (0 by default, 1 for supplier invoices/orders) * $senderissupplier (0 by default, 1 for supplier invoices/orders) * $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax) */ require_once DOL_DOCUMENT_ROOT."/product/class/html.formproduct.class.php"; // Protection to avoid direct call of template if (empty($object) || !is_object($object)) { print "Error, template page can't be called as URL"; exit; } global $forceall, $filtertype; if (empty($forceall)) { $forceall = 0; } if (empty($filtertype)) $filtertype = 0; $formproduct = new FormProduct($object->db); // Define colspan for the button 'Add' $colspan = 3; // Columns: total ht + col edit + col delete // Lines for extrafield $objectline = new BOMLine($this->db); print "\n"; $coldisplay = 0; print ''; // Adds a line numbering column if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { print ''.($i + 1).''; $coldisplay++; } $coldisplay++; ?>
fk_product > 0) { $tmpproduct = new Product($object->db); $tmpproduct->fetch($line->fk_product); print $tmpproduct->getNomUrl(1); } if (is_object($hookmanager)) { $fk_parent_line = (GETPOST('fk_parent_line') ? GETPOST('fk_parent_line') : $line->fk_parent_line); $parameters = array('line'=>$line, 'fk_parent_line'=>$fk_parent_line, 'var'=>$var, 'dateSelector'=>$dateSelector, 'seller'=>$seller, 'buyer'=>$buyer); $reshook = $hookmanager->executeHooks('formEditProductOptions', $parameters, $this, $action); } //Line extrafield if (is_object($objectline) && !empty($extrafields)) { $temps = $line->showOptionals($extrafields, 'edit', array('class'=>'tredited'), '', '', 1, 'line'); if (!empty($temps)) { print '
'; print $temps; print '
'; } } print ''; /*if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines { $coldisplay++; ?> '; if (($line->info_bits & 2) != 2) { // I comment this because it shows info even when not required // for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated // must also not be output for most entities (proposal, intervention, ...) //if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." "; print ''; } print ''; if ($filtertype != 1) { if (!empty($conf->global->PRODUCT_USE_UNITS)) { $coldisplay++; print ''; print ''; } $coldisplay++; print 'qty_frozen ? ' checked="checked"' : '')) . '>'; print ''; $coldisplay++; print 'disable_stock_change ? ' checked="checked"' : '')) . '">'; print ''; $coldisplay++; print ''; print ''; $coldisplay++; print ''; print ''; } else { $coldisplay++; print ''; print $formproduct->selectMeasuringUnits("fk_unit", "time", ($line->fk_unit) ? $line->fk_unit : '', 0, 0); print ''; $coldisplay++; print ''; print ''; $coldisplay++; print ''; print ''; } $coldisplay += $colspan; print ''; $coldisplay += $colspan; print ''; print ''; print ''; print ''; print "\n";