39if (empty($object) || !is_object($object)) {
40 print
"Error: this template page cannot be called directly as an URL";
45if (isModEnabled(
'margin') && !empty($object->element) && in_array($object->element, array(
'facture',
'facturerec',
'propal',
'commande'))) {
48if (!isset($dateSelector)) {
51global $forceall, $forcetoshowtitlelines, $senderissupplier, $inputalsopricewithtax;
54if (!isset($dateSelector)) {
56} elseif (empty($dateSelector)) {
59if (empty($forceall)) {
62if (empty($senderissupplier)) {
63 $senderissupplier = 0;
65if (empty($inputalsopricewithtax)) {
66 $inputalsopricewithtax = 0;
70if (isModEnabled(
"multicurrency") && $this->multicurrency_code != $conf->currency) {
73if (in_array($object->element, array(
'propal',
'commande',
'order',
'facture',
'facturerec',
'invoice',
'supplier_proposal',
'order_supplier',
'invoice_supplier',
'invoice_supplier_rec'))) {
76if (isModEnabled(
'asset') && $object->element ==
'invoice_supplier') {
83if (!empty($extrafields)) {
84 if ($this->table_element_line ==
'commandedet') {
86 } elseif ($this->table_element_line ==
'propaldet') {
88 } elseif ($this->table_element_line ==
'supplier_proposaldet') {
90 } elseif ($this->table_element_line ==
'facturedet') {
92 } elseif ($this->table_element_line ==
'contratdet') {
94 } elseif ($this->table_element_line ==
'commande_fournisseurdet') {
96 } elseif ($this->table_element_line ==
'facture_fourn_det') {
98 } elseif ($this->table_element_line ==
'facturedet_rec') {
100 } elseif ($this->table_element_line ==
'facture_fourn_det_rec') {
104print
"<!-- BEGIN PHP TEMPLATE objectline_create.tpl.php -->\n";
105$nolinesbefore = (count($this->lines) == 0 || $forcetoshowtitlelines);
108 <tr
class=
"liste_titre<?php echo (($nolinesbefore || $object->element == 'contrat') ? '' : ' liste_titre_add_') ?> nodrag nodrop">
109 <?php
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?>
110 <td
class=
"linecolnum center"></td>
112 <td
class=
"linecoldescription minwidth400imp">
113 <div
id=
"add"></div><span
class=
"hideonsmartphone"><?php echo $langs->trans(
'AddNewLine'); ?></span>
116 if ($object->element ==
'supplier_proposal' || $object->element ==
'order_supplier' || $object->element ==
'invoice_supplier' || $object->element ==
'invoice_supplier_rec') {
118 <td
class=
"linecolrefsupplier"><span
id=
"title_fourn_ref"><?php echo $langs->trans(
'SupplierRef'); ?></span></td>
122 <td
class=
"linecolvat right"><span
id=
"title_vat"><?php echo $langs->trans(
'VAT'); ?></span></td>
123 <td
class=
"linecoluht right"><span
id=
"title_up_ht"><?php echo $langs->trans(
'PriceUHT'); ?></span></td>
124 <?php
if (isModEnabled(
"multicurrency") && $this->multicurrency_code != $conf->currency) { ?>
125 <td
class=
"linecoluht_currency right"><span
id=
"title_up_ht_currency"><?php echo $langs->trans(
'PriceUHTCurrency'); ?></span></td>
127 <?php
if (!empty($inputalsopricewithtax) && !
getDolGlobalInt(
'MAIN_NO_INPUT_PRICE_WITH_TAX')) { ?>
128 <td
class=
"linecoluttc right"><span
id=
"title_up_ttc"><?php echo $langs->trans(
'PriceUTTC'); ?></span></td>
130 <td
class=
"linecolqty right"><?php echo $langs->trans(
'Qty'); ?></td>
133 print
'<td class="linecoluseunit left">';
134 print
'<span id="title_units">';
135 print $langs->trans(
'Unit');
136 print
'</span></td>';
139 <td
class=
"linecoldiscount right"><?php echo $langs->trans(
'ReductionShort'); ?></td>
142 if (isset($this->situation_cycle_ref) && $this->situation_cycle_ref) {
143 print
'<td class="linecolcycleref right">'.$langs->trans(
'Progress').
'</td>';
144 print
'<td class="linecolcycleref2 right"></td>';
146 if (!empty($usemargins)) {
147 if (empty($user->rights->margins->creer)) {
150 print
'<td class="margininfos linecolmargin1 right">';
151 if ($conf->global->MARGIN_TYPE ==
"1") {
152 echo $langs->trans(
'BuyingPrice');
154 echo $langs->trans(
'CostPrice');
157 if (!empty($conf->global->DISPLAY_MARGIN_RATES)) {
158 echo
'<td class="margininfos linecolmargin2 right"><span class="np_marginRate">'.$langs->trans(
'MarginRate').
'</span></td>';
160 if (!empty($conf->global->DISPLAY_MARK_RATES)) {
161 echo
'<td class="margininfos linecolmargin2 right"><span class="np_markRate">'.$langs->trans(
'MarkRate').
'</span></td>';
166 <td
class=
"linecoledit" colspan=
"<?php echo $colspan; ?>"> </td>
171<tr
class=
"pair nodrag nodrop nohoverpair<?php echo ($nolinesbefore || $object->element == 'contrat') ? '' : ' liste_titre_create'; ?>">
175 if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
177 echo
'<td class="nobottom linecolnum center"></td>';
181 <td
class=
"nobottom linecoldescription minwidth400imp">
184 if (empty($conf->global->MAIN_DISABLE_FREE_LINES)) {
187 if ($object->element ==
'contrat') {
188 if (!isModEnabled(
'product') && !isModEnabled(
'service') && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) {
190 } elseif (empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) {
195 echo
'<span class="prod_entry_mode_free">';
197 if ($forceall >= 0 && (isModEnabled(
"product") || isModEnabled(
"service"))) {
198 echo
'<label for="prod_entry_mode_free">';
199 echo
'<input type="radio" class="prod_entry_mode_free" name="prod_entry_mode" id="prod_entry_mode_free" value="free"';
201 echo ((
GETPOST(
'prod_entry_mode',
'alpha') ==
'free' || !empty($conf->global->MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT)) ?
' checked' :
'');
204 echo
'<span class="textradioforitem">'.$langs->trans(
"FreeLineOfType").
'</span>';
208 echo
'<input type="hidden" id="prod_entry_mode_free" name="prod_entry_mode" value="free">';
210 if ($forceall >= 0) {
211 if (!isModEnabled(
'product') || !isModEnabled(
'service')) {
212 echo $langs->trans(
"Type");
214 echo $langs->trans(
"FreeLineOfType");
219 $form->select_type_of_lines(GETPOSTISSET(
"type") ?
GETPOST(
"type",
'alpha', 2) : -1,
'type', 1, 1, $forceall);
223 if (isModEnabled(
"product") || isModEnabled(
"service")) {
224 if ($forceall >= 0 && $freelines) {
225 echo
'<br><span class="prod_entry_mode_predef paddingtop">';
227 echo
'<span class="prod_entry_mode_predef">';
229 echo
'<label for="prod_entry_mode_predef">';
230 echo
'<input type="radio" class="prod_entry_mode_predef" name="prod_entry_mode" id="prod_entry_mode_predef" value="predef"'.(GETPOST(
'prod_entry_mode') ==
'predef' ?
' checked' :
'').
'> ';
232 if (empty($conf->dol_optimize_smallscreen)) {
233 if (empty($senderissupplier)) {
234 if (isModEnabled(
"product") && !isModEnabled(
'service')) {
235 $labelforradio = $langs->trans(
'PredefinedProductsToSell');
236 } elseif ((!isModEnabled(
'product') && isModEnabled(
'service')) || ($object->element ==
'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS))) {
237 $labelforradio = $langs->trans(
'PredefinedServicesToSell');
239 $labelforradio = $langs->trans(
'PredefinedProductsAndServicesToSell');
242 if (isModEnabled(
"product") && !isModEnabled(
'service')) {
243 $labelforradio = $langs->trans(
'PredefinedProductsToPurchase');
244 } elseif (!isModEnabled(
'product') && isModEnabled(
'service')) {
245 $labelforradio = $langs->trans(
'PredefinedServicesToPurchase');
247 $labelforradio = $langs->trans(
'PredefinedProductsAndServicesToPurchase');
251 $labelforradio = $langs->trans(
'PredefinedItem');
253 print
'<span class="textradioforitem">'.$labelforradio.
'</span>';
257 if (!empty($object->element) && $object->element ==
'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) {
260 if (empty($senderissupplier)) {
262 $statuswarehouse =
'warehouseopen,warehouseinternal';
263 if (!empty($conf->global->ENTREPOT_WAREHOUSEINTERNAL_NOT_SELL)) $statuswarehouse =
'warehouseopen';
264 if (!empty($conf->global->ENTREPOT_EXTRA_STATUS)) {
266 $form->select_produits(
GETPOST(
'idprod'),
'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2,
'', 1, array(), $buyer->id,
'1', 0,
'maxwidth500', 0, $statuswarehouse,
GETPOST(
'combinations',
'array'));
268 $form->select_produits(
GETPOST(
'idprod'),
'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2,
'', 1, array(), $buyer->id,
'1', 0,
'maxwidth500', 0,
'',
GETPOST(
'combinations',
'array'));
270 if (!empty($conf->global->MAIN_AUTO_OPEN_SELECT2_ON_FOCUS_FOR_CUSTOMER_PRODUCTS)) {
273 $(document).ready(
function(){
275 $(document).on(
'focus',
'.select2-selection.select2-selection--single',
function (e) {
276 console.log(
'focus on a select2');
277 if ($(
this).attr(
'aria-labelledby') ==
'select2-idprod-container')
279 console.log(
'open combo');
280 $(
'#idprod').select2(
'open');
289 if ($senderissupplier != 2) {
290 $ajaxoptions = array(
291 'update' => array(
'qty'=>
'qty',
'remise_percent' =>
'discount',
'idprod' =>
'idprod'),
292 'option_disabled' =>
'idthatdoesnotexists',
293 'warning' => $langs->trans(
"NoPriceDefinedForThisSupplier")
295 $alsoproductwithnosupplierprice = 0;
297 $ajaxoptions = array(
302 $alsoproductwithnosupplierprice = 1;
304 $form->select_produits_fournisseurs($object->socid,
GETPOST(
'idprodfournprice'),
'idprodfournprice',
'',
'', $ajaxoptions, 1, $alsoproductwithnosupplierprice,
'minwidth300imp maxwidth500');
305 if (!empty($conf->global->MAIN_AUTO_OPEN_SELECT2_ON_FOCUS_FOR_SUPPLIER_PRODUCTS)) {
308 $(document).ready(
function(){
310 $(document).on(
'focus',
'.select2-selection.select2-selection--single',
function (e) {
312 if ($(
this).attr(
'aria-labelledby') ==
'select2-idprodfournprice-container')
314 $(
'#idprodfournprice').select2(
'open');
322 echo
'<input type="hidden" name="pbq" id="pbq" value="">';
326 if (!empty($conf->global->MAIN_ADD_LINE_AT_POSITION)) {
327 echo
'<br>'.$langs->trans(
'AddLineOnPosition').
' : <input type="number" name="rank" step="1" min="0" style="width: 5em;">';
330 if (is_object($hookmanager) && empty($senderissupplier)) {
331 $parameters = array(
'fk_parent_line'=>
GETPOST(
'fk_parent_line',
'int'));
332 $reshook = $hookmanager->executeHooks(
'formCreateProductOptions', $parameters, $object, $action);
333 if (!empty($hookmanager->resPrint)) {
334 print $hookmanager->resPrint;
337 if (is_object($hookmanager) && !empty($senderissupplier)) {
338 $parameters = array(
'htmlname'=>
'addproduct');
339 $reshook = $hookmanager->executeHooks(
'formCreateProductSupplierOptions', $parameters, $object, $action);
340 if (!empty($hookmanager->resPrint)) {
341 print $hookmanager->resPrint;
344 if (isModEnabled(
"product") || isModEnabled(
"service")) {
346 if (isModEnabled(
'variants')) {
347 echo
'<div id="attributes_box"></div>';
351 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
353 $enabled = (!empty($conf->global->FCKEDITOR_ENABLE_DETAILS) ? $conf->global->FCKEDITOR_ENABLE_DETAILS : 0);
354 if (!empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) {
355 $nbrows = $conf->global->MAIN_INPUT_DESC_HEIGHT;
357 $toolbarname =
'dolibarr_details';
358 if (!empty($conf->global->FCKEDITOR_ENABLE_DETAILS_FULL)) {
359 $toolbarname =
'dolibarr_notes';
361 $doleditor =
new DolEditor(
'dp_desc',
GETPOST(
'dp_desc',
'restricthtml'),
'', (empty($conf->global->MAIN_DOLEDITOR_HEIGHT) ? 100 : $conf->global->MAIN_DOLEDITOR_HEIGHT), $toolbarname,
'', false, true, $enabled, $nbrows,
'98%');
362 $doleditor->Create();
364 if (isModEnabled(
"service") && ($object->element ==
'facturerec' || $object->element ==
'invoice_supplier_rec')) {
365 echo
'<div class="divlinefordates"><br>';
366 echo $langs->trans(
'AutoFillDateFrom').
' ';
367 if (!empty($conf->global->INVOICE_REC_DATE_TO_YES)) {
368 $line->date_start_fill = 1;
369 $line->date_end_fill = 1;
371 echo $form->selectyesno(
'date_start_fill', $line->date_start_fill, 1);
373 echo $langs->trans(
'AutoFillDateTo').
' ';
374 echo $form->selectyesno(
'date_end_fill', $line->date_end_fill, 1);
377 if (is_object($objectline)) {
378 $temps = $objectline->showOptionals($extrafields,
'create', array(),
'',
'', 1,
'line');
380 if (!empty($temps)) {
381 print
'<div style="padding-top: 10px" id="extrafield_lines_area_create" name="extrafield_lines_area_create">';
387 if ($object->element ==
'supplier_proposal' || $object->element ==
'order_supplier' || $object->element ==
'invoice_supplier' || $object->element ==
'invoice_supplier_rec') {
390 <td
class=
"nobottom linecolrefsupplier"><input
id=
"fourn_ref" name=
"fourn_ref" class=
"flat minwidth50 maxwidth100 maxwidth125onsmartphone" value=
"<?php echo (GETPOSTISSET("fourn_ref
") ? GETPOST("fourn_ref
", 'alpha', 2) : ''); ?>"></td>
392 print
'<td class="nobottom linecolvat right">';
394 if ($seller->tva_assuj ==
"0") {
395 echo
'<input type="hidden" name="tva_tx" id="tva_tx" value="0">'.vatrate(0,
true);
397 echo $form->load_tva(
'tva_tx', (GETPOSTISSET(
"tva_tx") ?
GETPOST(
"tva_tx",
'alpha', 2) : -1), $seller, $buyer, 0, 0,
'', false, 1);
402 <td
class=
"nobottom linecoluht right"><?php $coldisplay++; ?>
403 <input
type=
"text" size=
"5" name=
"price_ht" id=
"price_ht" class=
"flat right" value=
"<?php echo (GETPOSTISSET("price_ht
") ? GETPOST("price_ht
", 'alpha', 2) : ''); ?>">
407 if (isModEnabled(
"multicurrency") && $this->multicurrency_code != $conf->currency) {
410 <td
class=
"nobottom linecoluht_currency right">
411 <input
type=
"text" size=
"5" name=
"multicurrency_price_ht" id=
"multicurrency_price_ht" class=
"flat right" value=
"<?php echo (GETPOSTISSET("multicurrency_price_ht
") ? GETPOST("multicurrency_price_ht
", 'alpha', 2) : ''); ?>">
415 if (!empty($inputalsopricewithtax) && !
getDolGlobalInt(
'MAIN_NO_INPUT_PRICE_WITH_TAX')) {
418 <td
class=
"nobottom linecoluttc right">
419 <input
type=
"text" size=
"5" name=
"price_ttc" id=
"price_ttc" class=
"flat right" value=
"<?php echo (GETPOSTISSET("price_ttc
") ? GETPOST("price_ttc
", 'alpha', 2) : ''); ?>">
425 <td
class=
"nobottom linecolqty right">
426 <?php $default_qty = (empty($conf->global->MAIN_OBJECTLINE_CREATE_EMPTY_QTY_BY_DEFAULT) ? 1 :
''); ?>
427 <input
type=
"text" name=
"qty" id=
"qty" class=
"flat width40 right" value=
"<?php echo (GETPOSTISSET("qty
") ? GETPOST("qty
", 'alpha', 2) : $default_qty); ?>">
432 print
'<td class="nobottom linecoluseunit left">';
433 print $form->selectUnits(empty($line->fk_unit) ? $conf->global->PRODUCT_USE_UNITS : $line->fk_unit,
"units");
436 $remise_percent = $buyer->remise_percent;
437 if ($object->element ==
'supplier_proposal' || $object->element ==
'order_supplier' || $object->element ==
'invoice_supplier') {
438 $remise_percent = $seller->remise_supplier_percent;
443 <td
class=
"nobottom nowrap linecoldiscount right"><input
type=
"text" name=
"remise_percent" id=
"remise_percent" class=
"flat width40 right" value=
"<?php echo (GETPOSTISSET("remise_percent
") ? GETPOST("remise_percent
", 'alpha', 2) : ($remise_percent ? $remise_percent : '')); ?>"><span
class=
"opacitymedium hideonsmartphone">%</span></td>
445 if (isset($this->situation_cycle_ref) && $this->situation_cycle_ref) {
447 print
'<td class="nobottom nowrap right"><input class="falt right" type="text" size="1" value="" name="progress"><span class="opacitymedium hideonsmartphone">%</span></td>';
451 if (!empty($usemargins)) {
452 if (!empty($user->rights->margins->creer)) {
455 <td
class=
"nobottom margininfos linecolmargin right">
456 <!-- For predef product -->
457 <?php
if (isModEnabled(
"product") || isModEnabled(
"service")) { ?>
458 <select
id=
"fournprice_predef" name=
"fournprice_predef" class=
"flat minwidth75imp maxwidth150" style=
"display: none;"></select>
460 <!-- For free product -->
461 <input
type=
"text" id=
"buying_price" name=
"buying_price" class=
"flat maxwidth75 right" value=
"<?php echo (GETPOSTISSET("buying_price
") ? GETPOST("buying_price
", 'alpha', 2) : ''); ?>">
464 if (!empty($conf->global->DISPLAY_MARGIN_RATES)) {
465 echo
'<td class="nobottom nowraponall margininfos right"><input class="flat right width40" type="text" id="np_marginRate" name="np_marginRate" value="'.(GETPOSTISSET(
"np_marginRate") ?
GETPOST(
"np_marginRate",
'alpha', 2) :
'').
'"><span class="np_marginRate opacitymedium hideonsmartphone">%</span></td>';
468 if (!empty($conf->global->DISPLAY_MARK_RATES)) {
469 echo
'<td class="nobottom nowraponall margininfos right"><input class="flat right width40" type="text" id="np_markRate" name="np_markRate" value="'.(GETPOSTISSET(
"np_markRate") ?
GETPOST(
"np_markRate",
'alpha', 2) :
'').
'"><span class="np_markRate opacitymedium hideonsmartphone">%</span></td>';
474 $coldisplay += $colspan;
476 <td
class=
"nobottom linecoledit center valignmiddle" colspan=
"<?php echo $colspan; ?>">
477 <input
type=
"submit" class=
"button reposition" value=
"<?php echo $langs->trans('Add'); ?>" name=
"addline" id=
"addline">
482if ((isModEnabled(
"service") || ($object->element ==
'contrat')) && $dateSelector &&
GETPOST(
'type') !=
'0') {
483 print
'<tr id="trlinefordates" class="oddeven">'.
"\n";
484 if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
487 print
'<td colspan="'.($coldisplay - (empty($conf->global->MAIN_VIEW_LINE_NUMBER) ? 0 : 1)).
'">';
491 $prefillDates =
false;
493 if (!empty($conf->global->MAIN_FILL_SERVICE_DATES_FROM_LAST_SERVICE_LINE) && !empty($object->lines)) {
494 for ($i = count($object->lines) - 1; $i >= 0; $i--) {
495 $lastline = $object->lines[$i];
497 if ($lastline->product_type ==
Product::TYPE_SERVICE && (!empty($lastline->date_start) || !empty($lastline->date_end))) {
498 $date_start_prefill = $lastline->date_start;
499 $date_end_prefill = $lastline->date_end;
501 $prefillDates =
true;
507 if (!empty($object->element) && $object->element ==
'contrat') {
508 print $langs->trans(
"DateStartPlanned").
' ';
509 print $form->selectDate($date_start,
"date_start", $usehm, $usehm, 1,
"addproduct");
510 print
' '.$langs->trans(
"DateEndPlanned").
' ';
511 print $form->selectDate($date_end,
"date_end", $usehm, $usehm, 1,
"addproduct");
513 print $langs->trans(
'ServiceLimitedDuration').
' '.$langs->trans(
'From').
' ';
514 print $form->selectDate($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", 1, 0);
515 print
' '.$langs->trans(
'to').
' ';
516 print $form->selectDate($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", 1, 0);
520 echo
' <span class="small"><a href="#" id="prefill_service_dates">'.$langs->trans(
'FillWithLastServiceDates').
'</a></span>';
527 function prefill_service_dates()
529 $(
'#date_start').val(
"<?php echo dol_escape_js(dol_print_date($date_start_prefill, 'day')); ?>").trigger(
'change');
530 $(
'#date_end').val(
"<?php echo dol_escape_js(dol_print_date($date_end_prefill, 'day')); ?>").trigger(
'change');
535 $(document).ready(
function()
537 $(
'#prefill_service_dates').click(prefill_service_dates);
544 if (isset($conf->global->MAIN_DEFAULT_DATE_START_HOUR)) {
545 print
'jQuery("#date_starthour").val("'.$conf->global->MAIN_DEFAULT_DATE_START_HOUR.
'");';
547 if (isset($conf->global->MAIN_DEFAULT_DATE_START_MIN)) {
548 print
'jQuery("#date_startmin").val("'.$conf->global->MAIN_DEFAULT_DATE_START_MIN.
'");';
552 if (isset($conf->global->MAIN_DEFAULT_DATE_END_HOUR)) {
553 print
'jQuery("#date_endhour").val("'.$conf->global->MAIN_DEFAULT_DATE_END_HOUR.
'");';
555 if (isset($conf->global->MAIN_DEFAULT_DATE_END_MIN)) {
556 print
'jQuery("#date_endmin").val("'.$conf->global->MAIN_DEFAULT_DATE_END_MIN.
'");';
566if (!empty($usemargins) && $user->rights->margins->creer) {
569 jQuery(document).ready(
function() {
571 if (!empty($conf->global->DISPLAY_MARGIN_RATES)) { ?>
572 $(
"input[name='np_marginRate']:first").blur(function(e) {
573 return checkFreeLine(e,
"np_marginRate");
577 if (!empty($conf->global->DISPLAY_MARK_RATES)) { ?>
578 $(
"input[name='np_markRate']:first").blur(
function(e) {
579 return checkFreeLine(e,
"np_markRate");
587 function checkFreeLine(e, npRate)
589 var buying_price = $(
"input[name='buying_price']:first");
590 var remise = $(
"input[name='remise_percent']:first");
592 var rate = $(
"input[name='"+npRate+
"']:first");
593 if (rate.val() ==
'')
596 if (! $.isNumeric(rate.val().replace(
',',
'.')))
598 alert(
'<?php echo dol_escape_js($langs->trans("rateMustBeNumeric")); ?>');
600 setTimeout(
function () { rate.focus() }, 50);
603 if (npRate ==
"np_markRate" && rate.val() >= 100)
605 alert(
'<?php echo dol_escape_js($langs->trans("markRateShouldBeLesserThan100")); ?>');
607 setTimeout(
function () { rate.focus() }, 50);
616 if (remisejs ==
'') remisejs=0;
621 if (npRate ==
"np_marginRate")
622 price = ((bpjs * (1 + ratejs / 100)) / (1 - remisejs / 100));
623 else if (npRate ==
"np_markRate")
624 price = ((bpjs / (1 - ratejs / 100)) / (1 - remisejs / 100));
627 $(
"input[name='price_ht']:first").val(
price);
637 jQuery(document).ready(
function() {
638 jQuery(
"#price_ht").keyup(
function(event) {
640 if (event.which != 9 && (event.which < 37 ||event.which > 40) && jQuery(
"#price_ht").val() !=
'') {
641 jQuery(
"#price_ttc").val(
'');
642 jQuery(
"#multicurrency_subprice").val(
'');
645 jQuery(
"#price_ttc").keyup(
function(event) {
647 if (event.which != 9 && (event.which < 37 || event.which > 40) && jQuery(
"#price_ttc").val() !=
'') {
648 jQuery(
"#price_ht").val(
'');
649 jQuery(
"#multicurrency_subprice").val(
'');
652 jQuery(
"#multicurrency_subprice").keyup(
function(event) {
654 if (event.which != 9 && (event.which < 37 || event.which > 40) && jQuery(
"#price_ttc").val() !=
'') {
655 jQuery(
"#price_ht").val(
'');
656 jQuery(
"#price_ttc").val(
'');
660 $(
"#prod_entry_mode_free").on(
"click",
function() {
663 $(
"#select_type").change(
function()
667 if (jQuery(
'#select_type').val() >= 0) {
668 console.log(
"Set focus on description field");
670 jQuery(
'#dp_desc').focus();
672 if (typeof CKEDITOR ==
"object" && typeof CKEDITOR.instances !=
"undefined") {
673 var editor = CKEDITOR.instances[
'dp_desc'];
680 console.log(
"Hide/show date according to product type");
681 if (jQuery(
'#select_type').val() ==
'0')
683 jQuery(
'#trlinefordates').hide();
684 jQuery(
'.divlinefordates').hide();
688 jQuery(
'#trlinefordates').show();
689 jQuery(
'.divlinefordates').show();
693 $(
"#prod_entry_mode_predef").on(
"click",
function() {
694 console.log(
"click prod_entry_mode_predef");
696 jQuery(
'#trlinefordates').show();
700 if (!$freelines) { ?>
701 $(
"#prod_entry_mode_predef").click();
705 if (in_array($this->table_element_line, array(
'propaldet',
'commandedet',
'facturedet'))) { ?>
706 $(
"#date_start, #date_end").focusout(
function() {
707 let
type = $(
this).attr(
'type');
708 let mandatoryP = $(
this).attr(
'mandatoryperiod');
709 if (
type == 1 && mandatoryP == 1) {
710 if ($(
this).val() ==
'' && !$(
this).hasClass(
'inputmandatory')) {
711 $(
this).addClass(
'inputmandatory');
713 $(
this).removeClass(
'inputmandatory');
720 $(
"#idprod, #idprodfournprice").change(
function()
722 console.log(
"objectline_create.tpl Call method change() after change on #idprod or #idprodfournprice (senderissupplier=<?php echo $senderissupplier; ?>). this.val = "+$(
this).val());
726 jQuery(
'#trlinefordates').show();
729 if (empty($conf->global->MAIN_DISABLE_EDIT_PREDEF_PRICEHT) && empty($senderissupplier)) {
731 var pbq = parseInt($(
'option:selected',
this).attr(
'data-pbq'));
732 if (isNaN(pbq)) { pbq = jQuery(
'#idprod').attr(
'data-pbq'); }
734 if ((jQuery(
'#idprod').val() > 0 || jQuery(
'#idprodfournprice').val()) && ! isNaN(pbq) && pbq > 0)
736 console.log(
"objectline_create.tpl We are in a price per qty context, we do not call ajax/product, init of fields is done few lines later");
738 <?php
if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { ?>
739 if (isNaN(pbq)) { console.log(
"We use experimental option PRODUIT_CUSTOMER_PRICES_BY_QTY or PRODUIT_CUSTOMER_PRICES_BY_QTY but we could not get the id of pbq from product combo list, so load of price may be 0 if product has differet prices"); }
742 console.log(
"Load unit price and set it into #price_ht or #price_ttc for product id="+$(
this).val()+
" socid=<?php print $object->socid; ?>");
743 $.post(
'<?php echo DOL_URL_ROOT; ?>/product/ajax/products.php?action=fetch',
744 {
'id': $(
this).val(),
'socid': <?php print $object->socid; ?>,
'token':
'<?php print currentToken(); ?>',
'addalsovatforthirdpartyid': 1 },
746 console.log(
"objectline_create.tpl Load unit price ends, we got value ht="+data.price_ht+
" ttc="+data.price_ttc+
" pricebasetype="+data.pricebasetype);
748 $(
'#date_start').removeAttr(
'type');
749 $(
'#date_end').removeAttr(
'type');
750 $(
'#date_start').attr(
'type', data.type);
751 $(
'#date_end').attr(
'type', data.type);
753 $(
'#date_start').removeAttr(
'mandatoryperiod');
754 $(
'#date_end').removeAttr(
'mandatoryperiod');
755 $(
'#date_start').attr(
'mandatoryperiod', data.mandatory_period);
756 $(
'#date_end').attr(
'mandatoryperiod', data.mandatory_period);
759 if (data.mandatory_period == 1 && data.type == 1) {
760 jQuery(
'#date_start').addClass(
'inputmandatory');
761 jQuery(
'#date_end').addClass(
'inputmandatory');
763 jQuery(
'#date_start').removeClass(
'inputmandatory');
764 jQuery(
'#date_end').removeClass(
'inputmandatory');
767 if (<?php echo (
int) $inputalsopricewithtax; ?> == 1 && data.pricebasetype ==
'TTC' && <?php print
getDolGlobalInt(
'MAIN_NO_INPUT_PRICE_WITH_TAX') ?
'false' :
'true'; ?>) {
768 console.log(
"objectline_create.tpl set content of price_ttc");
769 jQuery(
"#price_ttc").val(data.price_ttc);
771 console.log(
"objectline_create.tpl set content of price_ht");
772 jQuery(
"#price_ht").val(data.price_ht);
775 var tva_tx = data.tva_tx;
776 var default_vat_code = data.default_vat_code;
779 var stringforvatrateselection = tva_tx;
780 if (typeof default_vat_code !=
'undefined' && default_vat_code !=
null && default_vat_code !=
'') {
781 stringforvatrateselection = stringforvatrateselection+
' ('+default_vat_code+
')';
786 console.log(
"MAIN_SALETAX_AUTOSWITCH_I_CS_FOR_INDIA is on so we check if we need to autoswith the vat code");
787 console.log(
"mysoc->country_code=<?php echo $mysoc->country_code; ?> thirdparty->country_code=<?php echo $object->thirdparty->country_code; ?>");
788 new_default_vat_code = default_vat_code;
790 if ($mysoc->country_code ==
'IN' && !empty($object->thirdparty) && $object->thirdparty->country_code ==
'IN' && $mysoc->state_code == $object->thirdparty->state_code) {
793 console.log(
"Countries are both IN and states are same, so we revert I into CS in default_vat_code="+default_vat_code);
794 new_default_vat_code = default_vat_code.replace(/^I\-/,
'C+S-');
796 } elseif ($mysoc->country_code ==
'IN' && !empty($object->thirdparty) && $object->thirdparty->country_code ==
'IN' && $mysoc->state_code != $object->thirdparty->state_code) {
799 console.log(
"Countries are both IN and states differs, so we revert CS into I in default_vat_code="+default_vat_code);
800 new_default_vat_code = default_vat_code.replace(/^C\+S\-/,
'I-');
804 if (new_default_vat_code != default_vat_code && jQuery(
'#tva_tx option:contains("'+new_default_vat_code+
'")').val()) {
805 console.log(
"We found en entry into VAT with new default_vat_code, we will use it");
806 stringforvatrateselection = jQuery(
'#tva_tx option:contains("'+new_default_vat_code+
'")').val();
813 $(
'#tva_tx').val(tva_tx);
816 $(
'#tva_tx option').removeAttr(
'selected');
817 console.log(
"stringforvatrateselection="+stringforvatrateselection+
" -> value of option label for this key="+$(
'#tva_tx option[value="'+stringforvatrateselection+
'"]').val());
818 $(
'#tva_tx option[value="'+stringforvatrateselection+
'"]').prop(
'selected',
true);
821 if (!empty($conf->global->PRODUIT_AUTOFILL_DESC) && $conf->global->PRODUIT_AUTOFILL_DESC == 1) {
822 if (
getDolGlobalInt(
'MAIN_MULTILANGS') && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { ?>
823 var proddesc = data.desc_trans;
826 var proddesc = data.desc;
829 console.log(
"objectline_create.tpl Load desciption into text area : "+proddesc);
831 if (!empty($conf->global->FCKEDITOR_ENABLE_DETAILS)) { ?>
832 if (typeof CKEDITOR ==
"object" && typeof CKEDITOR.instances !=
"undefined")
834 var editor = CKEDITOR.instances[
'dp_desc'];
836 editor.setData(proddesc);
841 jQuery(
'#dp_desc').text(proddesc);
847 if (!empty($conf->global->PRODUCT_LOAD_EXTRAFIELD_INTO_OBJECTLINES)) { ?>
848 jQuery.each(data.array_options,
function( key, value ) {
849 jQuery(
'div[class*="det'+key.replace(
'options_',
'_extras_')+
'"] > #'+key).val(value);
860 if (!empty($usemargins) && $user->rights->margins->creer) {
861 $langs->load(
'stocks');
865 $(
"#fournprice_predef").find(
"option").remove();
866 $(
"#fournprice_predef").hide();
867 $(
"#buying_price").val(
"").show();
870 var token =
'<?php echo currentToken(); ?>';
871 $.post(
'<?php echo DOL_URL_ROOT; ?>/fourn/ajax/getSupplierPrices.php?bestpricefirst=1', {
'idprod': $(
this).val(),
'token': token },
function(data) {
872 if (data && data.length > 0)
874 var options =
''; var defaultkey =
''; var defaultprice =
''; var bestpricefound = 0;
876 var bestpriceid = 0; var bestpricevalue = 0;
877 var pmppriceid = 0; var pmppricevalue = 0;
878 var costpriceid = 0; var costpricevalue = 0;
881 var defaultbuyprice =
'<?php
882 if (isset($conf->global->MARGIN_TYPE)) {
883 if ($conf->global->MARGIN_TYPE == '1
') {
884 print 'bestsupplierprice
';
886 if ($conf->global->MARGIN_TYPE == 'pmp
') {
889 if ($conf->global->MARGIN_TYPE == 'costprice
') {
893 console.log(
"objectline_create.tpl we will set the field for margin. defaultbuyprice="+defaultbuyprice);
896 $(data).each(
function() {
898 if (this.
id !=
'pmpprice' && this.
id !=
'costprice')
901 this.price = parseFloat(this.price);
904 if (bestpricefound == 0 && this.price > 0) { defaultkey = this.id; defaultprice = this.
price; bestpriceid = this.id; bestpricevalue = this.
price; bestpricefound=1; }
906 if (this.
id ==
'pmpprice')
909 console.log(
"id="+this.
id+
"-price="+this.price);
910 if (
'pmp' == defaultbuyprice ||
'costprice' == defaultbuyprice)
912 if (this.price > 0) {
913 defaultkey = this.id; defaultprice = this.
price; pmppriceid = this.id; pmppricevalue = this.
price;
918 if (this.
id ==
'costprice')
921 console.log(
"id="+this.
id+
"-price="+this.price+
"-pmppricevalue="+pmppricevalue);
922 if (
'costprice' == defaultbuyprice)
924 if (this.price > 0) { defaultkey = this.id; defaultprice = this.
price; costpriceid = this.id; costpricevalue = this.
price; }
925 else if (pmppricevalue > 0) { defaultkey =
'pmpprice'; defaultprice = pmppricevalue; }
928 options +=
'<option value="'+this.
id+
'" price="'+this.price+
'">'+this.label+
'</option>';
930 options +=
'<option value="inputprice" price="'+defaultprice+
'"><?php echo dol_escape_js($langs->trans("InputPrice").'...
'); ?></option>';
932 console.log(
"finally selected defaultkey="+defaultkey+
" defaultprice for buying price="+defaultprice);
934 $(
"#fournprice_predef").html(options).show();
935 if (defaultkey !=
'')
937 $(
"#fournprice_predef").val(defaultkey);
941 $(
"#buying_price").hide();
944 var defaultprice = $(
"#fournprice_predef").find(
'option:selected').attr(
"price");
945 $(
"#buying_price").val(defaultprice);
947 $(
"#fournprice_predef").change(
function() {
948 console.log(
"change on fournprice_predef");
950 var linevalue=$(
this).find(
'option:selected').val();
951 var pricevalue = $(
this).find(
'option:selected').attr(
"price");
952 if (linevalue !=
'inputprice' && linevalue !=
'pmpprice') {
953 $(
"#buying_price").val(pricevalue).hide();
955 if (linevalue ==
'inputprice') {
956 $(
'#buying_price').show();
958 if (linevalue ==
'pmpprice') {
959 $(
"#buying_price").val(pricevalue);
960 $(
'#buying_price').hide();
972 if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
975 var pbq = parseInt($(
'option:selected',
this).attr(
'data-pbq'));
976 if (isNaN(pbq)) { pbq = jQuery(
'#idprod').attr(
'data-pbq'); }
977 var pbqup = parseFloat($(
'option:selected',
this).attr(
'data-pbqup'));
978 if (isNaN(pbqup)) { pbqup = jQuery(
'#idprod').attr(
'data-pbqup'); }
979 var pbqbase = $(
'option:selected',
this).attr(
'data-pbqbase');
980 if (isNaN(pbqbase)) { pbqbase = jQuery(
'#idprod').attr(
'data-pbqbase'); }
981 var pbqqty = parseFloat($(
'option:selected',
this).attr(
'data-pbqqty'));
982 if (isNaN(pbqqty)) { pbqqty = jQuery(
'#idprod').attr(
'data-pbqqty'); }
983 var pbqpercent = parseFloat($(
'option:selected',
this).attr(
'data-pbqpercent'));
984 if (isNaN(pbqpercent)) { pbqpercent = jQuery(
'#idprod').attr(
'data-pbqpercent'); }
986 if ((jQuery(
'#idprod').val() > 0) && ! isNaN(pbq) && pbq > 0)
990 console.log(
"We choose a price by quanty price_by_qty id = "+pbq+
" price_by_qty upht = "+pbqupht+
" price_by_qty qty = "+pbqqty+
" price_by_qty percent = "+pbqpercent);
991 jQuery(
"#pbq").val(pbq);
992 jQuery(
"#price_ht").val(pbqupht);
993 if (jQuery(
"#qty").val() < pbqqty)
995 jQuery(
"#qty").val(pbqqty);
997 if (jQuery(
"#remise_percent").val() < pbqpercent)
999 jQuery(
"#remise_percent").val(pbqpercent);
1001 }
else { jQuery(
"#pbq").val(
''); }
1008 if (jQuery(
'#idprodfournprice').val() > 0)
1010 console.log(
"objectline_create.tpl #idprodfournprice is an ID > 0, so we set some properties into page");
1012 var up = parseFloat($(
'option:selected',
this).attr(
'data-up'));
1013 if (isNaN(up)) { up = parseFloat(jQuery(
'#idprodfournprice').attr(
'data-up'));}
1015 var up_locale = $(
'option:selected',
this).attr(
'data-up-locale');
1016 if (typeof up_locale ===
'undefined') { up_locale = jQuery(
'#idprodfournprice').attr(
'data-up-locale');}
1018 var qty = parseFloat($(
'option:selected',
this).attr(
'data-qty'));
1019 if (isNaN(qty)) { qty = parseFloat(jQuery(
'#idprodfournprice').attr(
'data-qty'));}
1021 var discount = parseFloat($(
'option:selected',
this).attr(
'data-discount'));
1022 if (isNaN(discount)) { discount = parseFloat(jQuery(
'#idprodfournprice').attr(
'data-discount'));}
1024 var tva_tx = parseFloat($(
'option:selected',
this).attr(
'data-tvatx'));
1025 if (isNaN(tva_tx)) { tva_tx = parseFloat(jQuery(
'#idprodfournprice').attr(
'data-tvatx'));}
1027 var default_vat_code = $(
'option:selected',
this).attr(
'data-default-vat-code');
1028 if (typeof default_vat_code ===
'undefined') { default_vat_code = jQuery(
'#idprodfournprice').attr(
'data-default-vat-code');}
1030 var stringforvatrateselection = tva_tx;
1031 if (typeof default_vat_code !=
'undefined' && default_vat_code !=
null && default_vat_code !=
'') {
1032 stringforvatrateselection = stringforvatrateselection+
' ('+default_vat_code+
')';
1035 var supplier_ref = $(
'option:selected',
this).attr(
'data-supplier-ref');
1036 if (typeof supplier_ref ===
'undefined') { supplier_ref = jQuery(
'#idprodfournprice').attr(
'data-supplier-ref');}
1038 var has_multicurrency_up =
false;
1040 if (isModEnabled(
'multicurrency') && $object->multicurrency_code != $conf->currency) {
1042 var object_multicurrency_code =
'<?php print dol_escape_js($object->multicurrency_code); ?>';
1044 var multicurrency_code = $(
'option:selected',
this).attr(
'data-multicurrency-code');
1045 if (multicurrency_code == undefined) { multicurrency_code = jQuery(
'#idprodfournprice').attr(
'data-multicurrency-code'); }
1047 var multicurrency_up = parseFloat($(
'option:selected',
this).attr(
'data-multicurrency-unitprice'));
1048 if (isNaN(multicurrency_up)) { multicurrency_up = parseFloat(jQuery(
'#idprodfournprice').attr(
'data-multicurrency-unitprice')); }
1050 if (multicurrency_code == object_multicurrency_code) {
1051 has_multicurrency_up =
true;
1052 jQuery(
"#multicurrency_price_ht").val(multicurrency_up);
1055 console.log(
"objectline_create.tpl Multicurrency values : object_multicurrency_code = "+object_multicurrency_code+
", multicurrency_code = "+multicurrency_code+
", multicurrency_up = "+multicurrency_up);
1060 console.log(
"objectline_create.tpl We find supplier price : up = "+up+
", up_locale = "+up_locale+
", has_multicurrency_up = "+has_multicurrency_up+
", supplier_ref = "+supplier_ref+
" qty = "+qty+
", tva_tx = "+tva_tx+
", default_vat_code = "+default_vat_code+
", stringforvatrateselection="+stringforvatrateselection+
", discount = "+discount+
" for product supplier ref id = "+jQuery(
'#idprodfournprice').val());
1062 if (has_multicurrency_up ===
false) {
1063 if (typeof up_locale ===
'undefined') {
1064 jQuery(
"#price_ht").val(up);
1066 jQuery(
"#price_ht").val(up_locale);
1071 $(
'#fourn_ref').val(supplier_ref);
1073 $(
'#tva_tx').val(tva_tx);
1076 $(
'#tva_tx option').removeAttr(
'selected');
1077 console.log(
"stringforvatrateselection="+stringforvatrateselection+
" -> value of option label for this key="+$(
'#tva_tx option[value="'+stringforvatrateselection+
'"]').val());
1078 $(
'#tva_tx option[value="'+stringforvatrateselection+
'"]').prop(
'selected',
true);
1080 if (jQuery(
"#qty").val() < qty) {
1081 jQuery(
"#qty").val(qty);
1083 if (jQuery(
"#remise_percent").val() < discount) {
1084 jQuery(
"#remise_percent").val(discount);
1090 var
description = $(
'option:selected',
this).attr(
'data-description');
1091 if (typeof
description ==
'undefined') {
description = jQuery(
'#idprodfournprice').attr(
'data-description'); }
1093 console.log(
"Load desciption into text area : "+
description);
1095 if (!empty($conf->global->FCKEDITOR_ENABLE_DETAILS)) {
1097 if (typeof CKEDITOR ==
"object" && typeof CKEDITOR.instances !=
"undefined")
1099 var editor = CKEDITOR.instances[
'dp_desc'];
1112 }
else if (jQuery(
'#idprodfournprice').length > 0) {
1113 console.log(
"objectline_create.tpl #idprodfournprice is not an int but is a string so we set only few properties into page");
1115 var tva_tx = parseFloat($(
'option:selected',
this).attr(
'data-tvatx'));
1116 if (isNaN(tva_tx)) { tva_tx = parseFloat(jQuery(
'#idprodfournprice').attr(
'data-tvatx'));}
1118 var default_vat_code = $(
'option:selected',
this).attr(
'data-default-vat-code');
1119 if (typeof default_vat_code ===
'undefined') { default_vat_code = jQuery(
'#idprodfournprice').attr(
'data-default-vat-code');}
1121 var stringforvatrateselection = tva_tx;
1122 if (typeof default_vat_code !=
'undefined' && default_vat_code !=
null && default_vat_code !=
'') {
1123 stringforvatrateselection = stringforvatrateselection+
' ('+default_vat_code+
')';
1126 console.log(
"objectline_create.tpl We find data for price : tva_tx = "+tva_tx+
", default_vat_code = "+default_vat_code+
", stringforvatrateselection="+stringforvatrateselection+
" for product id = "+jQuery(
'#idprodfournprice').val());
1129 $(
'#tva_tx').val(tva_tx);
1132 $(
'#tva_tx option').removeAttr(
'selected');
1133 console.log(
"stringforvatrateselection="+stringforvatrateselection+
" -> value of option label for this key="+$(
'#tva_tx option[value="'+stringforvatrateselection+
'"]').val());
1134 $(
'#tva_tx option[value="'+stringforvatrateselection+
'"]').prop(
'selected',
true);
1137 if (!empty($conf->global->FCKEDITOR_ENABLE_DETAILS)) {
1139 if (typeof CKEDITOR ==
"object" && typeof CKEDITOR.instances !=
"undefined")
1141 var editor = CKEDITOR.instances[
'dp_desc'];
1149 jQuery(
'#dp_desc').text(
'');
1158 if (jQuery(
'#idprod').val() > 0 || jQuery(
'#idprodfournprice').val() > 0)
1161 jQuery(
'#dp_desc').focus();
1163 if (typeof CKEDITOR ==
"object" && typeof CKEDITOR.instances !=
"undefined")
1165 var editor = CKEDITOR.instances[
'dp_desc'];
1166 if (editor) { editor.focus(); }
1171 <?php
if (
GETPOST(
'prod_entry_mode') ==
'predef') {
1177 function setforfree() {
1178 console.log(
"objectline_create.tpl::setforfree. We show most fields");
1179 jQuery(
"#idprodfournprice").val(
'0');
1180 jQuery(
"#prod_entry_mode_free").prop(
'checked',
true).change();
1181 jQuery(
"#prod_entry_mode_predef").prop(
'checked',
false).change();
1182 jQuery(
"#search_idprod, #idprod, #search_idprodfournprice, #buying_price").val(
'');
1183 jQuery(
"#price_ht, #multicurrency_price_ht, #price_ttc, #multicurrency_price_ttc, #fourn_ref, #tva_tx, #buying_price, #title_fourn_ref, #title_vat, #title_up_ht, #title_up_ht_currency, #title_up_ttc, #title_up_ttc_currency").show();
1184 jQuery(
"#np_marginRate, #np_markRate, .np_marginRate, .np_markRate, #units, #title_units").show();
1185 jQuery(
"#fournprice_predef").hide();
1188 function setforpredef() {
1189 console.log(
"objectline_create.tpl::setforpredef We hide some fields, show dates");
1190 jQuery(
"#select_type").val(-1);
1191 jQuery(
"#prod_entry_mode_free").prop(
'checked',
false).change();
1192 jQuery(
"#prod_entry_mode_predef").prop(
'checked',
true).change();
1193 <?php
if (empty($conf->global->MAIN_DISABLE_EDIT_PREDEF_PRICEHT)) { ?>
1194 jQuery(
"#price_ht").val(
'').show();
1195 jQuery(
"#multicurrency_price_ht").val(
'').show();
1196 jQuery(
"#title_up_ht, #title_up_ht_currency").show();
1199 jQuery(
"#multicurrency_price_ht").val(
'').hide();
1200 jQuery(
"#title_up_ht, #title_up_ht_currency").hide();
1202 <?php
if (empty($conf->global->MAIN_DISABLE_EDIT_PREDEF_PRICETTC)) { ?>
1203 jQuery(
"#price_ttc").val(
'').show();
1204 jQuery(
"#multicurrency_price_ttc").val(
'').show();
1205 jQuery(
"#title_up_ttc, #title_up_ttc_currency").show();
1207 jQuery(
"#price_ttc").val(
'').hide();
1208 jQuery(
"#multicurrency_price_ttc").val(
'').hide();
1209 jQuery(
"#title_up_ttc, #title_up_ttc_currency").hide();
1213 jQuery(
"#np_marginRate, #np_markRate, .np_marginRate, .np_markRate, #units, #title_units").hide();
1214 jQuery(
"#buying_price").show();
1215 jQuery(
'#trlinefordates, .divlinefordates').show();
1222print
"<!-- END PHP TEMPLATE objectline_create.tpl.php -->\n";
Class to manage line orders.
Class to manage lines of contracts.
Class to manage a WYSIWYG editor.
Class to manage supplier invoice lines of templates.
Class to manage invoice lines.
Class to manage invoice lines of templates.
Class to manage order lines.
const TYPE_SERVICE
Service.
Class to manage commercial proposal lines.
Class to manage line invoices.
Class to manage supplier_proposal lines.
print $script_file $mode $langs defaultlang(is_numeric($duration_value) ? " delay=". $duration_value :"").(is_numeric($duration_value2) ? " after cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
price2numjs(amount)
Function similar to PHP price2num()
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
$conf db name
Only used if Module[ID]Name translation string is not found.