* Copyright (C) 2010-2014 Laurent Destailleur * Copyright (C) 2012-2013 Christophe Battarel * Copyright (C) 2012 Cédric Salvador * Copyright (C) 2014 Florian Henry * Copyright (C) 2014 Raphaël Doursenaud * Copyright (C) 2015-2016 Marcos García * Copyright (C) 2018-2019 Frédéric France * Copyright (C) 2018 Ferran Marcet * * 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 * $forceall (0 by default, 1 for supplier invoices/orders) */ // Protection to avoid direct call of template if (empty($object) || !is_object($object)) { print "Error: this template page cannot be called directly as an URL"; exit; } global $forceall, $forcetoshowtitlelines; if (empty($forceall)) $forceall = 0; // Define colspan for the button 'Add' $colspan = 3; // Columns: total ht + col edit + col delete //print $object->element; // Lines for extrafield $objectline = new BOMLine($this->db); print "\n"; $nolinesbefore = (count($this->lines) == 0 || $forcetoshowtitlelines); if ($nolinesbefore) { print ''; if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { print ''; } print ''; print '
'.$langs->trans('AddNewLine').''; print ''; print ''.$langs->trans('Qty').''; if (!empty($conf->global->PRODUCT_USE_UNITS)) { print ''; print ''; print $langs->trans('Unit'); print ''; } print ''.$form->textwithpicto($langs->trans('QtyFrozen'), $langs->trans("QuantityConsumedInvariable")).''; print ''.$form->textwithpicto($langs->trans('DisableStockChange'), $langs->trans('DisableStockChangeHelp')).''; print ''.$form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')).''; print ' '; print ''; } print ''; $coldisplay = 0; // Adds a line numbering column if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { $coldisplay++; echo ''; } $coldisplay++; print ''; // Predefined product/service if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { if ($forceall >= 0 && $freelines) echo '
'; echo ''; $filtertype = ''; if (!empty($object->element) && $object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $filtertype = '1'; $statustoshow = -1; if (!empty($conf->global->ENTREPOT_EXTRA_STATUS)) { // hide products in closed warehouse, but show products for internal transfer $form->select_produits(GETPOST('idprod', 'int'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array')); } else { $form->select_produits(GETPOST('idprod', 'int'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, '', GETPOST('combinations', 'array')); } echo ''; } $coldisplay++; print ''; print ''; if (!empty($conf->global->PRODUCT_USE_UNITS)) { $coldisplay++; print ''; print ''; } $coldisplay++; print ''; print ''; $coldisplay++; print ''; print ''; $coldisplay++; print ''; print ''; print ''; $coldisplay++; print ''; print ' '; print ''; $coldisplay += $colspan; print ''; print ''; print ''; print ''; if (is_object($objectline)) { print $objectline->showOptionals($extrafields, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$coldisplay), '', '', 1); } ?>