* Copyright (C) 2010-2014 Laurent Destailleur * Copyright (C) 2012-2013 Christophe Battarel * 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 * $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 $dateSelector, $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','facture','invoice','commande','order'))) $colspan++; // With this, there is a column move button ?> global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>>
trans('AddNewLine'); ?>trans("FreeZone"); ?> trans('VAT'); ?> trans('PriceUHT'); ?> trans('PriceUTTC'); ?> trans('Qty'); ?> trans('ReductionShort'); ?> global->MARGIN_TYPE == "1") echo $langs->trans('BuyingPrice'); else echo $langs->trans('CostPrice'); ?> rights->margins->creer && ! empty($conf->global->DISPLAY_MARGIN_RATES)) echo ''.$langs->trans('MarginRate').''; if ($user->rights->margins->creer && ! empty($conf->global->DISPLAY_MARK_RATES)) echo ''.$langs->trans('MarkRate').''; } ?>   > global->MAIN_VIEW_LINE_NUMBER)) { $coldisplay=2; } else { $coldisplay=0; } ?> global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>> '; // Show radio free line if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { echo 'product->enabled) || empty($conf->service->enabled)))?' checked="true"':'') ); echo (GETPOST('prod_entry_mode')=='free' ? ' checked="true"' : ''); echo '> '; } else echo ''; // Show type selector /* if (empty($conf->product->enabled) && empty($conf->service->enabled)) { // If module product and service disabled, by default this is a product except for contracts it is a service print ''; } else {*/ echo $langs->trans("FreeLineOfType"); /* if (empty($conf->product->enabled) && empty($conf->service->enabled)) echo $langs->trans("Type"); else if (! empty($forceall) || (! empty($conf->product->enabled) && ! empty($conf->service->enabled))) echo $langs->trans("FreeLineOfType"); else if (empty($conf->product->enabled) && ! empty($conf->service->enabled)) echo $langs->trans("FreeLineOfType").' '.$langs->trans("Service"); else if (! empty($conf->product->enabled) && empty($conf->service->enabled)) echo $langs->trans("FreeLineOfType").' '.$langs->trans("Product");*/ echo ' '; echo $form->select_type_of_lines(isset($_POST["type"])?$_POST["type"]:-1,'type',1,1,1); // } echo ''; // Predefined product/service if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { echo '
'; echo ' '; if (empty($senderissupplier)) { if (! empty($conf->product->enabled) && empty($conf->service->enabled)) echo $langs->trans('PredefinedProductsToSell'); else if (empty($conf->product->enabled) && ! empty($conf->service->enabled)) echo $langs->trans('PredefinedServicesToSell'); else echo $langs->trans('PredefinedProductsAndServicesToSell'); } else { if (! empty($conf->product->enabled) && empty($conf->service->enabled)) echo $langs->trans('PredefinedProductsToPurchase'); else if (empty($conf->product->enabled) && ! empty($conf->service->enabled)) echo $langs->trans('PredefinedServicesToPurchase'); else echo $langs->trans('PredefinedProductsAndServicesToPurchase'); } echo ' '; $filtertype=''; if (! empty($object->element) && $object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $filtertype='1'; if (empty($senderissupplier)) { $form->select_produits('', 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(),$buyer->id); } else { $ajaxoptions=array( 'update' => array('qty'=>'qty','remise_percent' => 'discount'), // html id tag will be edited with which ajax json response key 'option_disabled' => 'addPredefinedProductButton', // html id to disable once select is done 'warning' => $langs->trans("NoPriceDefinedForThisSupplier") // translation of an error saved into var 'error' ); $form->select_produits_fournisseurs($object->fourn_id, GETPOST('idprodfournprice'), 'idprodfournprice', '', '', $ajaxoptions, 1); } echo ''; } if (is_object($hookmanager) && empty($senderissupplier)) { $parameters=array('fk_parent_line'=>GETPOST('fk_parent_line','int')); $reshook=$hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action); } if (is_object($hookmanager) && ! empty($senderissupplier)) { $parameters=array('htmlname'=>'addproduct'); $reshook=$hookmanager->executeHooks('formCreateProductSupplierOptions',$parameters,$object,$action); } if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) echo '
'; // Editor wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $nbrows=ROWS_2; $enabled=(! empty($conf->global->FCKEDITOR_ENABLE_DETAILS)?$conf->global->FCKEDITOR_ENABLE_DETAILS:0); if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; $doleditor=new DolEditor('dp_desc',GETPOST('dp_desc'),'',100,'dolibarr_details','',false,true,$enabled,$nbrows,'98%'); $doleditor->Create(); ?> tva_assuj == "0") echo '0'; else echo $form->load_tva('tva_tx', (isset($_POST["tva_tx"])?$_POST["tva_tx"]:-1), $seller, $buyer); } ?> "> "> "> remise_client); ?>" name="remise_percent">% product->enabled) || ! empty($conf->service->enabled)) { ?> "> rights->margins->creer) { if (! empty($conf->global->DISPLAY_MARGIN_RATES)) { echo '%'; $coldisplay++; } if (! empty($conf->global->DISPLAY_MARK_RATES)) { echo '%'; $coldisplay++; } } else { if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $coldisplay++; if (! empty($conf->global->DISPLAY_MARK_RATES)) $coldisplay++; } } ?> table_element_line=='commandedet') { $newline = new OrderLine($this->db); } elseif ($this->table_element_line=='propaldet') { $newline = new PropaleLigne($this->db); } elseif ($this->table_element_line=='facturedet') { $newline = new FactureLigne($this->db); } if (is_object($newline)) { print $newline->showOptionals($extrafieldsline, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$coldisplay+8)); } } ?> service->enabled) && $dateSelector) { if(! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) $colspan = 10; else $colspan = 9; if (! empty($usemargins)) { $colspan++; // For the buying price if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++; if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++; } ?> > element) && $object->element == 'contrat') { print $langs->trans("DateStartPlanned").' '; $form->select_date($date_start,"date_start",$usehm,$usehm,1,"addproduct"); print '   '.$langs->trans("DateEndPlanned").' '; $form->select_date($date_end,"date_end",$usehm,$usehm,1,"addproduct"); } else { echo $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; echo $form->select_date($date_start,'date_start',empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1,empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1,1,"addproduct"); echo ' '.$langs->trans('to').' '; echo $form->select_date($date_end,'date_end',empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1,empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1,1,"addproduct"); } ?>