Exemple #1
0
                    $tmpproductsupplier->fetch_product_fournisseur_price($rowid, 1);
                    $default_vat = $tmpproductsupplier->fourn_tva_tx;
                } else {
                    if (empty($default_vat)) {
                        $default_vat = $object->tva_tx;
                    }
                }
                print '<input type="text" class="flat" size="5" name="tva_tx" value="' . (GETPOST("tva_tx") ? vatrate(GETPOST("tva_tx")) : ($default_vat != '' ? vatrate($default_vat) : '')) . '">';
                print '</td></tr>';
                if (!empty($conf->dynamicprices->enabled)) {
                    // Price mode selector
                    print '<tr><td class="fieldrequired">' . $langs->trans("PriceMode") . '</td><td>';
                    $price_expression = new PriceExpression($db);
                    $price_expression_list = array(0 => $langs->trans("PriceNumeric"));
                    //Put the numeric mode as first option
                    foreach ($price_expression->list_price_expression() as $entry) {
                        $price_expression_list[$entry->id] = $entry->title;
                    }
                    $price_expression_preselection = GETPOST('eid') ? GETPOST('eid') : ($object->fk_supplier_price_expression ? $object->fk_supplier_price_expression : '0');
                    print $form->selectarray('eid', $price_expression_list, $price_expression_preselection);
                    print '&nbsp; <div id="expression_editor" class="button">' . $langs->trans("PriceExpressionEditor") . '</div>';
                    print '</td></tr>';
                    // This code hides the numeric price input if is not selected, loads the editor page if editor button is pressed
                    print '<script type="text/javascript">
						jQuery(document).ready(run);
						function run() {
							jQuery("#expression_editor").click(on_click);
							jQuery("#eid").change(on_change);
							on_change();
						}
						function on_click() {