* 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 * * 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) */ $usemargins=0; if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($object->element,array('facture','propal','commande'))) $usemargins=1; global $forceall, $senderissupplier, $inputalsopricewithtax; if (empty($dateSelector)) $dateSelector=0; if (empty($forceall)) $forceall=0; if (empty($senderissupplier)) $senderissupplier=0; if (empty($inputalsopricewithtax)) $inputalsopricewithtax=0; // Define colspan for button Add $colspan = 3; // Col total ht + col edit + col delete if (! empty($inputalsopricewithtax)) $colspan++; // We add 1 if col total ttc if (in_array($object->element,array('propal','supplier_proposal','facture','invoice','commande','order','order_supplier','invoice_supplier'))) $colspan++; // With this, there is a column move button ?> > global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>>global->MAIN_VIEW_LINE_NUMBER))?2:1; ?>
fk_product > 0) { ?> product_type==1) echo img_object($langs->trans('ShowService'),'service'); else print img_object($langs->trans('ShowProduct'),'product'); echo ' '.$line->ref; ?> product_label); ?>
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); } // Do not allow editing during a situation cycle if (empty($this->situation_cycle_ref) || $this->situation_counter == 1) { // editeur wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $nbrows=ROWS_2; if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; $enable=(isset($conf->global->FCKEDITOR_ENABLE_DETAILS)?$conf->global->FCKEDITOR_ENABLE_DETAILS:0); $toolbarname='dolibarr_details'; if (! empty($conf->global->FCKEDITOR_ENABLE_DETAILS_FULL)) $toolbarname='dolibarr_notes'; $doleditor=new DolEditor('product_desc',$line->description,'',164,$toolbarname,'',false,true,$enable,$nbrows,'98%'); $doleditor->Create(); } else { print ''; } ?> element == 'supplier_proposal') { ?> situation_counter == 1 || !$this->situation_cycle_ref) { print '' . $form->load_tva('tva_tx', $line->tva_tx, $seller, $buyer, 0, $line->info_bits, $line->product_type, false, 1) . ''; } else { print '%'; } $coldisplay++; print 'situation_counter > 1) print ' readonly'; print '>'; if (!empty($conf->multicurrency->enabled)) { print ''; } if ($inputalsopricewithtax) { $coldisplay++; print 'situation_counter > 1) print ' readonly'; print '>'; } ?> 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 'situation_counter > 1) print ' readonly'; print '>'; } else { ?>   global->PRODUCT_USE_UNITS) { print ''; print $form->selectUnits($line->fk_unit, "units"); print ''; } ?> info_bits & 2) != 2) { print 'situation_counter > 1) print ' readonly'; print '>%'; } else { ?>   situation_cycle_ref) { $coldisplay++; print '%'; } if (! empty($usemargins)) { ?> product->enabled) || ! empty($conf->service->enabled)) { ?> rights->margins->creer) { if (! empty($conf->global->DISPLAY_MARGIN_RATES)) { $margin_rate = (isset($_POST["np_marginRate"])?$_POST["np_marginRate"]:(($line->pa_ht == 0)?'':price($line->marge_tx))); // if credit note, dont allow to modify margin if ($line->subprice < 0) echo ''.$margin_rate.'%'; else echo '%'; $coldisplay++; } elseif (! empty($conf->global->DISPLAY_MARK_RATES)) { $mark_rate = (isset($_POST["np_markRate"])?$_POST["np_markRate"]:price($line->marque_tx)); // if credit note, dont allow to modify margin if ($line->subprice < 0) echo ''.$mark_rate.'%'; else echo '%'; $coldisplay++; } } } ?> ">
"> showOptionals($extrafieldsline,'edit',array('style'=>$bc[$var],'colspan'=>$coldisplay)); } ?> service->enabled) && $line->product_type == 1 && $dateSelector) { ?> > trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; ?> global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE:''); echo $form->select_date($line->date_start,'date_start',$hourmin,$hourmin,$line->date_start?0:1,"updateligne",1,0,1); echo ' '.$langs->trans('to').' '; echo $form->select_date($line->date_end,'date_end',$hourmin,$hourmin,$line->date_end?0:1,"updateligne",1,0,1); print '' ?>