* 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 * * 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) * $element (used to test $user->rights->$element->creer) * $permtoedit (used to replace test $user->rights->$element->creer) * $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax) * $object_rights->creer initialized from = $object->getRights() * $disableedit, $disablemove, $disableremove * * $type, $text, $description, $line */ // 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, $senderissupplier, $inputalsopricewithtax, $outputalsopricetotalwithtax; if (empty($dateSelector)) { $dateSelector = 0; } if (empty($forceall)) { $forceall = 0; } if (empty($senderissupplier)) { $senderissupplier = 0; } if (empty($inputalsopricewithtax)) { $inputalsopricewithtax = 0; } if (empty($outputalsopricetotalwithtax)) { $outputalsopricetotalwithtax = 0; } // add html5 elements $domData = ' data-element="'.$line->element.'"'; $domData .= ' data-id="'.$line->id.'"'; $domData .= ' data-qty="'.$line->qty.'"'; $domData .= ' data-product_type="'.$line->product_type.'"'; // Lines for extrafield $objectline = new BOMLine($object->db); $coldisplay = 0; print "\n"; print ''; if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { print ''.($i + 1).''; $coldisplay++; } print ''; print '
'; $coldisplay++; $tmpproduct = new Product($object->db); $tmpproduct->fetch($line->fk_product); print $tmpproduct->getNomUrl(1); print ' - '.$tmpproduct->label; print ''; print ''; $coldisplay++; echo price($line->qty, 0, '', 0, 0); // Yes, it is a quantity, not a price, but we just want the formating role of function price print ''; if (!empty($conf->global->PRODUCT_USE_UNITS)) { print ''; $label = $tmpproduct->getLabelOfUnit('long'); if ($label !== '') { print $langs->trans($label); } print ''; } print ''; $coldisplay++; echo $line->qty_frozen ? yn($line->qty_frozen) : ''; print ''; print ''; $coldisplay++; echo $line->disable_stock_change ? yn($line->disable_stock_change) : ''; // Yes, it is a quantity, not a price, but we just want the formating role of function price print ''; print ''; $coldisplay++; echo $line->efficiency; print ''; print ''; $coldisplay++; echo price($line->total_cost); print ''; if ($this->status == 0 && ($object_rights->write) && $action != 'selectlines') { print ''; $coldisplay++; if (($line->info_bits & 2) == 2 || !empty($disableedit)) { } else { print 'id.'">'.img_edit().''; } print ''; print ''; $coldisplay++; if (($line->fk_prev_id == null) && empty($disableremove)) { //La suppression n'est autorisée que si il n'y a pas de ligne dans une précédente situation print 'id.'">'; print img_delete(); print ''; } print ''; if ($num > 1 && $conf->browser->layout != 'phone' && empty($disablemove)) { print ''; $coldisplay++; if ($i > 0) { print 'id.'">'; echo img_up('default', 0, 'imgupforline'); print ''; } if ($i < $num - 1) { print 'id.'">'; echo img_down('default', 0, 'imgdownforline'); print ''; } print ''; } else { print 'browser->layout != 'phone' && empty($disablemove)) ? ' class="linecolmove tdlineupdown center"' : ' class="linecolmove center"').'>'; $coldisplay++; } } else { print ''; $coldisplay = $coldisplay + 3; } if ($action == 'selectlines') { print ''; print ''; print ''; } print ''; //Line extrafield if (!empty($extrafields)) { print $line->showOptionals($extrafields, 'view', array('style'=>'class="drag drop oddeven"', 'colspan'=>$coldisplay), '', '', 1, 'line'); } print "\n";