diff --git a/htdocs/core/tpl/freeproductline_create.tpl.php b/htdocs/core/tpl/freeproductline_create.tpl.php index 2bf8a55a3d0..214b1ac1472 100644 --- a/htdocs/core/tpl/freeproductline_create.tpl.php +++ b/htdocs/core/tpl/freeproductline_create.tpl.php @@ -39,9 +39,9 @@ if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($ob - global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>>
trans('AddNewLine').' - ' ?>trans("FreeZone"); ?> + global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>> +
+ trans('AddNewLine').' - ' ?>trans("FreeZone"); ?> trans('VAT'); ?> trans('PriceUHT'); ?> @@ -83,36 +83,36 @@ if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($ob > - global->MAIN_VIEW_LINE_NUMBER)) { - $coldisplay=2; } - else { - $coldisplay=0; } - ?> +global->MAIN_VIEW_LINE_NUMBER)) { + $coldisplay=2; } +else { + $coldisplay=0; } +?> global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>> - '; - echo $form->select_type_of_lines(isset($_POST["type"])?$_POST["type"]:-1,'type',1); - echo ''; + echo ''; + echo $form->select_type_of_lines(isset($_POST["type"])?$_POST["type"]:-1,'type',1); + echo ''; - if (is_object($hookmanager)) - { - $parameters=array(); - $reshook=$hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action); - } + if (is_object($hookmanager)) + { + $parameters=array('fk_parent_line'=>GETPOST('fk_parent_line','int')); + $reshook=$hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action); + } - if ((! empty($conf->product->enabled) && ! empty($conf->service->enabled)) || (empty($conf->product->enabled) && empty($conf->service->enabled))) echo '
'; + if ((! empty($conf->product->enabled) && ! empty($conf->service->enabled)) || (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,70); - $doleditor->Create(); - ?> + // 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,70); + $doleditor->Create(); + ?> margin->enabled) && ! empty($object->element) && in_array($ob else echo $form->load_tva('tva_tx', (isset($_POST["tva_tx"])?$_POST["tva_tx"]:-1), $seller, $buyer); ?> - "> - + "> "> remise_client); ?>" name="remise_percent">% margin->enabled) && ! empty($object->element) && in_array($ob if (! empty($usemargins)) { ?> - "> + + "> rights->margins->creer) @@ -155,21 +154,25 @@ if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($ob } } ?> - - 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)); - } + + + + 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)); + } + } ?> @@ -182,13 +185,14 @@ if (! empty($conf->service->enabled) && $dateSelector) if (! empty($usemargins)) { $colspan++; // For the buying price - if($conf->global->DISPLAY_MARGIN_RATES) $colspan++; - if($conf->global->DISPLAY_MARK_RATES) $colspan++; + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++; + if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++; } ?> > - "> + element) && $object->element == 'contrat') { print $langs->trans("DateStartPlanned").' '; @@ -212,101 +216,108 @@ if (! empty($conf->service->enabled) && $dateSelector) -margin->enabled && $user->rights->margins->creer) -{ -?> - +global->MAIN_MAX_DECIMALS_SHOWN; ?>; - var main_rounding = global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); ?>; - - var amount = num.toString().replace(',','.'); // should be useless - var nbdec = 0; - var rounding = main_rounding; - var pos = amount.indexOf('.'); - var decpart = ''; - if (pos >= 0) - decpart = amount.substr(pos+1).replace('/0+$/i',''); // Supprime les 0 de fin de partie decimale - nbdec = decpart.length; - if (nbdec > rounding) - rounding = nbdec; - // Si on depasse max - if (rounding > main_max_dec_shown) - { - rounding = main_max_dec_shown; - } - //amount = parseFloat(amount) + (1 / Math.pow(100, rounding)); // to avoid floating-point errors - return parseFloat(amount).toFixed(rounding); -} - -function formatFloat(num) { - return roundFloat(num).replace('.', ','); -} - - - +?> diff --git a/htdocs/core/tpl/predefinedproductline_create.tpl.php b/htdocs/core/tpl/predefinedproductline_create.tpl.php index 7fdc03d5169..3306e995d58 100644 --- a/htdocs/core/tpl/predefinedproductline_create.tpl.php +++ b/htdocs/core/tpl/predefinedproductline_create.tpl.php @@ -1,6 +1,6 @@ - * Copyright (C) 2010-2012 Laurent Destailleur + * Copyright (C) 2010-2013 Laurent Destailleur * Copyright (C) 2012-2013 Christophe Battarel * Copyright (C) 2013 Florian Henry * @@ -17,7 +17,6 @@ * 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: * $conf * $langs @@ -39,15 +38,6 @@ if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($ob - - - global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="4"' : ' colspan="3"'); ?>> trans('Qty'); ?> trans('ReductionShort'); ?> - - global->MARGIN_TYPE == "1") - echo $langs->trans('BuyingPrice'); - else - echo $langs->trans('CostPrice'); - - if ($user->rights->margins->creer) + $colspan = 4; + if (! empty($usemargins)) { - if(! empty($conf->global->DISPLAY_MARGIN_RATES)) + ?> + + global->MARGIN_TYPE == "1") + echo $langs->trans('BuyingPrice'); + else + echo $langs->trans('CostPrice'); + ?> + + rights->margins->creer) { - echo ''.$langs->trans('MarginRate').''; + if(! empty($conf->global->DISPLAY_MARGIN_RATES)) + { + echo ''.$langs->trans('MarginRate').''; + } + if(! empty($conf->global->DISPLAY_MARK_RATES)) + { + echo ''.$langs->trans('MarkRate').''; + } } - if(! empty($conf->global->DISPLAY_MARK_RATES)) + else { - echo ''.$langs->trans('MarkRate').''; + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++; + if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++; } } - else - { - if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++; - if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++; - } ?> - -   > global->MAIN_VIEW_LINE_NUMBER)) { - $coldisplay=4; } + $coldisplay=4; } else { - $coldisplay=3; } + $coldisplay=3; } ?> + global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="4"' : ' colspan="3"'); ?>> + + + '; @@ -128,8 +127,9 @@ else { $doleditor->Create(); ?> + - % + % - " name="addline"> + table_element_line=='commandedet') { $newline = new OrderLine($this->db); - }elseif ($this->table_element_line=='propaldet') { + } + elseif ($this->table_element_line=='propaldet') { $newline = new PropaleLigne($this->db); } elseif ($this->table_element_line=='facturedet') { @@ -209,9 +210,9 @@ if (! empty($conf->service->enabled) && $dateSelector) else { echo $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; - echo $form->select_date('','date_start_predef',$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,1,"addpredefinedproduct"); + echo $form->select_date('','date_start_predef',empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1,empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1,1,"addpredefinedproduct"); echo ' '.$langs->trans('to').' '; - echo $form->select_date('','date_end_predef',$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,1,"addpredefinedproduct"); + echo $form->select_date('','date_end_predef',empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1,empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1,1,"addpredefinedproduct"); } ?> @@ -223,40 +224,39 @@ if (! empty($conf->service->enabled) && $dateSelector) rights->margins->creer) { ?>