1 namespace('kivi.DeliveryOrder', function(ns) {
2 ns.check_cv = function() {
3 if ($('#type').val() == 'sales_delivery_order') {
4 if ($('#order_customer_id').val() === '') {
5 alert(kivi.t8('Please select a customer.'));
9 if ($('#order_vendor_id').val() === '') {
10 alert(kivi.t8('Please select a vendor.'));
17 ns.check_duplicate_parts = function(question) {
18 var id_arr = $('[name="order.orderitems[].parts_id"]').map(function() { return this.value; }).get();
20 var i, obj = {}, pos = [];
22 for (i = 0; i < id_arr.length; i++) {
24 if (obj.hasOwnProperty(id)) {
31 question = question || kivi.t8("Do you really want to continue?");
32 return confirm(kivi.t8("There are duplicate parts at positions") + "\n"
33 + pos.join(', ') + "\n"
39 ns.check_valid_reqdate = function() {
40 if ($('#order_reqdate_as_date').val() === '') {
41 alert(kivi.t8('Please select a delivery date.'));
48 ns.save = function(action, warn_on_duplicates, warn_on_reqdate) {
49 if (!ns.check_cv()) return;
50 if (warn_on_duplicates && !ns.check_duplicate_parts()) return;
51 if (warn_on_reqdate && !ns.check_valid_reqdate()) return;
53 var data = $('#order_form').serializeArray();
54 data.push({ name: 'action', value: 'DeliveryOrder/' + action });
56 $.post("controller.pl", data, kivi.eval_json_result);
59 ns.delete_order = function() {
60 var data = $('#order_form').serializeArray();
61 data.push({ name: 'action', value: 'DeliveryOrder/delete' });
63 $.post("controller.pl", data, kivi.eval_json_result);
66 ns.show_print_options = function(warn_on_duplicates, warn_on_reqdate) {
67 if (!ns.check_cv()) return;
68 if (warn_on_duplicates && !ns.check_duplicate_parts(kivi.t8("Do you really want to print?"))) return;
69 if (warn_on_reqdate && !ns.check_valid_reqdate()) return;
74 title: kivi.t8('Print options'),
81 ns.open_stock_in_out_dialog = function(clicked, in_out) {
82 var $row = $(clicked).parents("tbody").first();
83 var id = $row.find('[name="orderitem_ids[+]"]').val();
88 url: "controller.pl?action=DeliveryOrder/stock_in_out_dialog",
91 type: $("#type").val(),
92 parts_id: $row.find("[name$=parts_id]").val(),
93 unit: $row.find("[name$=unit]").val(),
94 qty_as_number: $("qty_" + id).val(),
95 stock: $("stock_" + id).val(),
99 dialog: { title: kivi.t8('Transfer stock') }
103 ns.print = function() {
104 $('#print_options').dialog('close');
106 var data = $('#order_form').serializeArray();
107 data = data.concat($('#print_options_form').serializeArray());
108 data.push({ name: 'action', value: 'DeliveryOrder/print' });
110 $.post("controller.pl", data, kivi.eval_json_result);
115 ns.setup_send_email_dialog = function() {
116 kivi.SalesPurchase.show_all_print_options_elements();
117 kivi.SalesPurchase.show_print_options_elements([ 'sendmode', 'media', 'copies', 'remove_draft' ], false);
119 $('#print_options_form table').first().remove().appendTo('#email_form_print_options');
121 var to_focus = $('#email_form_to').val() === '' ? 'to' : 'subject';
122 $('#email_form_' + to_focus).focus();
125 ns.finish_send_email_dialog = function() {
126 kivi.SalesPurchase.show_all_print_options_elements();
128 $('#email_form_print_options table').first().remove().prependTo('#print_options_form');
132 ns.show_email_dialog = function(html) {
133 var id = 'send_email_dialog';
134 var dialog_params = {
138 title: kivi.t8('Send email'),
140 beforeClose: kivi.DeliveryOrder.finish_send_email_dialog,
141 close: function(event, ui) {
142 email_dialog.remove();
146 $('#' + id).remove();
148 email_dialog = $('<div style="display:none" id="' + id + '"></div>').appendTo('body');
149 email_dialog.html(html);
150 email_dialog.dialog(dialog_params);
152 kivi.DeliveryOrder.setup_send_email_dialog();
154 $('.cancel').click(ns.close_email_dialog);
159 ns.send_email = function() {
160 // push button only once -> slow response from mail server
161 ns.email_dialog_disable_send();
163 var data = $('#order_form').serializeArray();
164 data = data.concat($('[name^="email_form."]').serializeArray());
165 data = data.concat($('[name^="print_options."]').serializeArray());
166 data.push({ name: 'action', value: 'DeliveryOrder/send_email' });
167 $.post("controller.pl", data, kivi.eval_json_result);
170 ns.email_dialog_disable_send = function() {
171 // disable mail send event to prevent
172 // impatient users to send multiple times
173 $('#send_email').prop('disabled', true);
176 ns.close_email_dialog = function() {
177 email_dialog.dialog("close");
180 ns.set_number_in_title = function(elt) {
181 $('#nr_in_title').html($(elt).val());
184 ns.reload_cv_dependent_selections = function() {
185 $('#order_shipto_id').val('');
186 var data = $('#order_form').serializeArray();
187 data.push({ name: 'action', value: 'DeliveryOrder/customer_vendor_changed' });
189 $.post("controller.pl", data, kivi.eval_json_result);
192 ns.reformat_number = function(event) {
193 $(event.target).val(kivi.format_amount(kivi.parse_amount($(event.target).val()), -2));
196 ns.reformat_number_as_null_number = function(event) {
197 if ($(event.target).val() === '') {
200 ns.reformat_number(event);
203 ns.update_exchangerate = function(event) {
204 if (!ns.check_cv()) {
205 $('#order_currency_id').val($('#old_currency_id').val());
209 var rate_input = $('#order_exchangerate_as_null_number');
210 // unset exchangerate if currency changed
211 if ($('#order_currency_id').val() !== $('#old_currency_id').val()) {
215 // only set exchangerate if unset
216 if (rate_input.val() !== '') {
220 var data = $('#order_form').serializeArray();
221 data.push({ name: 'action', value: 'DeliveryOrder/update_exchangerate' });
224 url: 'controller.pl',
228 success: function(data){
229 if (!data.is_standard) {
230 $('#currency_name').text(data.currency_name);
231 if (data.exchangerate) {
232 rate_input.val(data.exchangerate);
236 $('#exchangerate_settings').show();
239 $('#exchangerate_settings').hide();
241 if ($('#order_currency_id').val() != $('#old_currency_id').val() ||
242 !data.is_standard && data.exchangerate != $('#old_exchangerate').val()) {
243 kivi.display_flash('warning', kivi.t8('You have changed the currency or exchange rate. Please check prices.'));
245 $('#old_currency_id').val($('#order_currency_id').val());
246 $('#old_exchangerate').val(data.exchangerate);
251 ns.exchangerate_changed = function(event) {
252 if (kivi.parse_amount($('#order_exchangerate_as_null_number').val()) != kivi.parse_amount($('#old_exchangerate').val())) {
253 kivi.display_flash('warning', kivi.t8('You have changed the currency or exchange rate. Please check prices.'));
254 $('#old_exchangerate').val($('#order_exchangerate_as_null_number').val());
258 ns.unit_change = function(event) {
259 var row = $(event.target).parents("tbody").first();
260 var item_id_dom = $(row).find('[name="orderitem_ids[+]"]');
261 var sellprice_dom = $(row).find('[name="order.orderitems[].sellprice_as_number"]');
262 var select_elt = $(row).find('[name="order.orderitems[].unit"]');
264 var oldval = $(select_elt).data('oldval');
265 $(select_elt).data('oldval', $(select_elt).val());
267 var data = $('#order_form').serializeArray();
268 data.push({ name: 'action', value: 'DeliveryOrder/unit_changed' },
269 { name: 'item_id', value: item_id_dom.val() },
270 { name: 'old_unit', value: oldval },
271 { name: 'sellprice_dom_id', value: sellprice_dom.attr('id') });
273 $.post("controller.pl", data, kivi.eval_json_result);
276 ns.update_sellprice = function(item_id, price_str) {
277 var row = $('#item_' + item_id).parents("tbody").first();
278 var price_elt = $(row).find('[name="order.orderitems[].sellprice_as_number"]');
279 var html_elt = $(row).find('[name="sellprice_text"]');
280 price_elt.val(price_str);
281 html_elt.html(price_str);
284 ns.load_second_row = function(row) {
285 var item_id_dom = $(row).find('[name="orderitem_ids[+]"]');
286 var div_elt = $(row).find('[name="second_row"]');
288 if ($(div_elt).data('loaded') == 1) {
291 var data = $('#order_form').serializeArray();
292 data.push({ name: 'action', value: 'DeliveryOrder/load_second_rows' },
293 { name: 'item_ids[]', value: item_id_dom.val() });
295 $.post("controller.pl", data, kivi.eval_json_result);
298 ns.load_all_second_rows = function() {
299 var rows = $('.row_entry').filter(function(idx, elt) {
300 return $(elt).find('[name="second_row"]').data('loaded') != 1;
303 var item_ids = $.map(rows, function(elt) {
304 var item_id = $(elt).find('[name="orderitem_ids[+]"]').val();
305 return { name: 'item_ids[]', value: item_id };
308 if (item_ids.length == 0) {
312 var data = $('#order_form').serializeArray();
313 data.push({ name: 'action', value: 'DeliveryOrder/load_second_rows' });
314 data = data.concat(item_ids);
316 $.post("controller.pl", data, kivi.eval_json_result);
319 ns.hide_second_row = function(row) {
320 $(row).children().not(':first').hide();
321 $(row).data('expanded', 0);
322 var elt = $(row).find('.expand');
323 elt.attr('src', "image/expand.svg");
324 elt.attr('alt', kivi.t8('Show details'));
325 elt.attr('title', kivi.t8('Show details'));
328 ns.show_second_row = function(row) {
329 $(row).children().not(':first').show();
330 $(row).data('expanded', 1);
331 var elt = $(row).find('.expand');
332 elt.attr('src', "image/collapse.svg");
333 elt.attr('alt', kivi.t8('Hide details'));
334 elt.attr('title', kivi.t8('Hide details'));
337 ns.toggle_second_row = function(row) {
338 if ($(row).data('expanded') == 1) {
339 ns.hide_second_row(row);
341 ns.show_second_row(row);
345 ns.init_row_handlers = function() {
346 kivi.run_once_for('.reformat_number', 'on_change_reformat', function(elt) {
347 $(elt).change(ns.reformat_number);
350 kivi.run_once_for('.unitselect', 'on_change_unit_with_oldval', function(elt) {
351 $(elt).data('oldval', $(elt).val());
352 $(elt).change(ns.unit_change);
355 kivi.run_once_for('.row_entry', 'on_kbd_click_show_hide', function(elt) {
356 $(elt).keydown(function(event) {
358 if (event.keyCode == 40 && event.shiftKey === true) {
360 event.preventDefault();
361 row = $(event.target).parents(".row_entry").first();
362 ns.load_second_row(row);
363 ns.show_second_row(row);
366 if (event.keyCode == 38 && event.shiftKey === true) {
368 event.preventDefault();
369 row = $(event.target).parents(".row_entry").first();
370 ns.hide_second_row(row);
376 kivi.run_once_for('.expand', 'expand_second_row', function(elt) {
377 $(elt).click(function(event) {
378 event.preventDefault();
379 var row = $(event.target).parents(".row_entry").first();
380 ns.load_second_row(row);
381 ns.toggle_second_row(row);
388 ns.redisplay_line_values = function(is_sales, data) {
389 $('.row_entry').each(function(idx, elt) {
390 $(elt).find('[name="linetotal"]').html(data[idx][0]);
391 if (is_sales && $(elt).find('[name="second_row"]').data('loaded') == 1) {
392 var mt = data[idx][1];
393 var mp = data[idx][2];
395 if (mt[0] === '-') h += ' class="plus0"';
396 h += '>' + mt + ' ' + mp + '%';
398 $(elt).find('[name="linemargin"]').html(h);
403 ns.redisplay_cvpartnumbers = function(data) {
404 $('.row_entry').each(function(idx, elt) {
405 $(elt).find('[name="cvpartnumber"]').html(data[idx][0]);
409 ns.renumber_positions = function() {
410 $('.row_entry [name="position"]').each(function(idx, elt) {
413 $('.row_entry').each(function(idx, elt) {
414 $(elt).data("position", idx+1);
418 ns.reorder_items = function(order_by) {
419 var dir = $('#' + order_by + '_header_id a img').attr("data-sort-dir");
420 $('#row_table_id thead a img').remove();
425 src = "image/up.png";
428 src = "image/down.png";
431 $('#' + order_by + '_header_id a').append('<img border=0 data-sort-dir=' + dir + ' src=' + src + ' alt="' + kivi.t8('sort items') + '">');
433 var data = $('#order_form').serializeArray();
434 data.push({ name: 'action', value: 'DeliveryOrder/reorder_items' },
435 { name: 'order_by', value: order_by },
436 { name: 'sort_dir', value: dir });
438 $.post("controller.pl", data, kivi.eval_json_result);
441 ns.redisplay_items = function(data) {
442 var old_rows = $('.row_entry').detach();
444 $(data).each(function(idx, elt) {
445 new_rows.push(old_rows[elt.old_pos - 1]);
447 $(new_rows).appendTo($('#row_table_id'));
448 ns.renumber_positions();
451 ns.get_insert_before_item_id = function(wanted_pos) {
452 if (wanted_pos === '') return;
454 var insert_before_item_id;
455 // selection by data does not seem to work if data is changed at runtime
456 // var elt = $('.row_entry [data-position="' + wanted_pos + '"]');
457 $('.row_entry').each(function(idx, elt) {
458 if ($(elt).data("position") == wanted_pos) {
459 insert_before_item_id = $(elt).find('[name="orderitem_ids[+]"]').val();
464 return insert_before_item_id;
467 ns.add_item = function() {
468 if ($('#add_item_parts_id').val() === '') return;
469 if (!ns.check_cv()) return;
471 $('#row_table_id thead a img').remove();
473 var insert_before_item_id = ns.get_insert_before_item_id($('#add_item_position').val());
475 var data = $('#order_form').serializeArray();
476 data.push({ name: 'action', value: 'DeliveryOrder/add_item' },
477 { name: 'insert_before_item_id', value: insert_before_item_id });
479 $.post("controller.pl", data, kivi.eval_json_result);
482 ns.open_multi_items_dialog = function() {
483 if (!ns.check_cv()) return;
485 var pp = $("#add_item_parts_id").data("part_picker");
490 ns.add_multi_items = function(data) {
491 var insert_before_item_id = ns.get_insert_before_item_id($('#multi_items_position').val());
492 data = data.concat($('#order_form').serializeArray());
493 data.push({ name: 'action', value: 'DeliveryOrder/add_multi_items' },
494 { name: 'insert_before_item_id', value: insert_before_item_id });
495 $.post("controller.pl", data, kivi.eval_json_result);
498 ns.delete_order_item_row = function(clicked) {
499 var row = $(clicked).parents("tbody").first();
502 ns.renumber_positions();
505 ns.row_table_scroll_down = function() {
506 $('#row_table_scroll_id').scrollTop($('#row_table_scroll_id')[0].scrollHeight);
509 ns.show_longdescription_dialog = function(clicked) {
510 var row = $(clicked).parents("tbody").first();
511 var position = $(row).find('[name="position"]').html();
512 var partnumber = $(row).find('[name="partnumber"]').html();
513 var description_elt = $(row).find('[name="order.orderitems[].description"]');
514 var longdescription_elt = $(row).find('[name="order.orderitems[].longdescription"]');
517 runningnumber: position,
518 partnumber: partnumber,
519 description: description_elt.val(),
520 default_longdescription: longdescription_elt.val(),
521 set_function: function(val) {
522 longdescription_elt.val(val);
526 kivi.SalesPurchase.edit_longdescription_with_params(params);
529 ns.price_chooser_item_row = function(clicked) {
530 if (!ns.check_cv()) return;
531 var row = $(clicked).parents("tbody").first();
532 var item_id_dom = $(row).find('[name="orderitem_ids[+]"]');
534 var data = $('#order_form').serializeArray();
535 data.push({ name: 'action', value: 'DeliveryOrder/price_popup' },
536 { name: 'item_id', value: item_id_dom.val() });
538 $.post("controller.pl", data, kivi.eval_json_result);
541 ns.show_vc_details_dialog = function() {
542 if (!ns.check_cv()) return;
546 if ($('#order_customer_id').val()) {
548 vc_id = $('#order_customer_id').val();
549 title = kivi.t8('Customer details');
552 vc_id = $('#order_vendor_id').val();
553 title = kivi.t8('Vendor details');
557 url: 'controller.pl',
558 data: { action: 'DeliveryOrder/show_customer_vendor_details_dialog',
559 type : $('#type').val(),
563 id: 'jq_customer_vendor_details_dialog',
573 ns.update_row_from_master_data = function(clicked) {
574 var row = $(clicked).parents("tbody").first();
575 var item_id_dom = $(row).find('[name="orderitem_ids[+]"]');
577 var data = $('#order_form').serializeArray();
578 data.push({ name: 'action', value: 'DeliveryOrder/update_row_from_master_data' });
579 data.push({ name: 'item_ids[]', value: item_id_dom.val() });
581 $.post("controller.pl", data, kivi.eval_json_result);
584 ns.update_all_rows_from_master_data = function() {
585 var item_ids = $.map($('.row_entry'), function(elt) {
586 var item_id = $(elt).find('[name="orderitem_ids[+]"]').val();
587 return { name: 'item_ids[]', value: item_id };
590 if (item_ids.length == 0) {
594 var data = $('#order_form').serializeArray();
595 data.push({ name: 'action', value: 'DeliveryOrder/update_row_from_master_data' });
596 data = data.concat(item_ids);
598 $.post("controller.pl", data, kivi.eval_json_result);
601 ns.show_calculate_qty_dialog = function(clicked) {
602 var row = $(clicked).parents("tbody").first();
603 var input_id = $(row).find('[name="order.orderitems[].qty_as_number"]').attr('id');
604 var formula_id = $(row).find('[name="formula[+]"]').attr('id');
606 calculate_qty_selection_dialog("", input_id, "", formula_id);
610 ns.edit_custom_shipto = function() {
611 if (!ns.check_cv()) return;
613 kivi.SalesPurchase.edit_custom_shipto();
616 ns.purchase_order_check_for_direct_delivery = function() {
617 if ($('#type').val() != 'sales_order') {
618 kivi.submit_form_with_action($('#order_form'), 'DeliveryOrder/purchase_order');
623 if ($('#order_shipto_id').val() !== '') {
625 shipto = $('#order_shipto_id option:selected').text();
627 $('#shipto_inputs [id^="shipto"]').each(function(idx, elt) {
628 if (!empty) return true;
629 if (/^shipto_to_copy/.test($(elt).prop('id'))) return true;
630 if (/^shiptocp_gender/.test($(elt).prop('id'))) return true;
631 if (/^shiptocvar_/.test($(elt).prop('id'))) return true;
632 if ($(elt).val() !== '') {
637 var shipto_elements = [];
638 $([$('#shiptoname').val(), $('#shiptostreet').val(), $('#shiptozipcode').val(), $('#shiptocity').val()]).each(function(idx, elt) {
639 if (elt !== '') shipto_elements.push(elt);
641 shipto = shipto_elements.join('; ');
646 ns.direct_delivery_dialog(shipto);
648 kivi.submit_form_with_action($('#order_form'), 'DeliveryOrder/purchase_order');
652 ns.direct_delivery_callback = function(accepted) {
653 $('#direct-delivery-dialog').dialog('close');
656 $('<input type="hidden" name="use_shipto">').appendTo('#order_form').val('1');
659 kivi.submit_form_with_action($('#order_form'), 'DeliveryOrder/purchase_order');
662 ns.direct_delivery_dialog = function(shipto) {
663 $('#direct-delivery-dialog').remove();
665 var text1 = kivi.t8('You have entered or selected the following shipping address for this customer:');
666 var text2 = kivi.t8('Do you want to carry this shipping address over to the new purchase order so that the vendor can deliver the goods directly to your customer?');
667 var html = '<div id="direct-delivery-dialog"><p>' + text1 + '</p><p>' + shipto + '</p><p>' + text2 + '</p>';
668 html = html + '<hr><p>';
669 html = html + '<input type="button" value="' + kivi.t8('Yes') + '" size="30" onclick="kivi.DeliveryOrder.direct_delivery_callback(true)">';
670 html = html + ' ';
671 html = html + '<input type="button" value="' + kivi.t8('No') + '" size="30" onclick="kivi.DeliveryOrder.direct_delivery_callback(false)">';
672 html = html + '</p></div>';
673 $(html).hide().appendTo('#order_form');
675 kivi.popup_dialog({id: 'direct-delivery-dialog',
676 dialog: {title: kivi.t8('Carry over shipping address'),
681 ns.follow_up_window = function() {
682 var id = $('#id').val();
683 var type = $('#type').val();
685 var number_info = '';
686 if ($('#type').val() == 'sales_order' || $('#type').val() == 'purchase_order') {
687 number_info = $('#order_ordnumber').val();
688 } else if ($('#type').val() == 'sales_quotation' || $('#type').val() == 'request_quotation') {
689 number_info = $('#order_quonumber').val();
693 if ($('#type').val() == 'sales_order' || $('#type').val() == 'sales_quotation') {
694 name_info = $('#order_customer_id_name').val();
695 } else if ($('#type').val() == 'purchase_order' || $('#type').val() == 'request_quotation') {
696 name_info = $('#order_vendor_id_name').val();
700 if (number_info !== '') { info += ' (' + number_info + ')' }
701 if (name_info !== '') { info += ' (' + name_info + ')' }
703 if (!$('#follow_up_rowcount').lenght) {
704 $('<input type="hidden" name="follow_up_rowcount" id="follow_up_rowcount">').appendTo('#order_form');
705 $('<input type="hidden" name="follow_up_trans_id_1" id="follow_up_trans_id_1">').appendTo('#order_form');
706 $('<input type="hidden" name="follow_up_trans_type_1" id="follow_up_trans_type_1">').appendTo('#order_form');
707 $('<input type="hidden" name="follow_up_trans_info_1" id="follow_up_trans_info_1">').appendTo('#order_form');
708 $('<input type="hidden" name="follow_up_trans_subject_1" id="follow_up_trans_subject_1">').appendTo('#order_form');
710 $('#follow_up_rowcount').val(1);
711 $('#follow_up_trans_id_1').val(id);
712 $('#follow_up_trans_type_1').val(type);
713 $('#follow_up_trans_info_1').val(info);
714 $('#follow_up_trans_subject_1').val($('#order_transaction_description').val());
719 ns.create_part = function() {
720 var data = $('#order_form').serializeArray();
721 data.push({ name: 'action', value: 'DeliveryOrder/create_part' });
723 $.post("controller.pl", data, kivi.eval_json_result);
729 $('#order_customer_id').change(kivi.DeliveryOrder.reload_cv_dependent_selections);
730 $('#order_vendor_id').change(kivi.DeliveryOrder.reload_cv_dependent_selections);
732 $('#order_currency_id').change(kivi.DeliveryOrder.update_exchangerate);
733 $('#order_transdate_as_date').change(kivi.DeliveryOrder.update_exchangerate);
734 $('#order_exchangerate_as_null_number').change(kivi.DeliveryOrder.exchangerate_changed);
736 $('#add_item_parts_id').on('set_item:PartPicker', function(e,o) { $('#add_item_description').val(o.description) });
737 $('#add_item_parts_id').on('set_item:PartPicker', function(e,o) { $('#add_item_unit').val(o.unit) });
739 $('.add_item_input').keydown(function(event) {
740 if (event.keyCode == 13) {
741 event.preventDefault();
742 kivi.DeliveryOrder.add_item();
747 kivi.DeliveryOrder.init_row_handlers();
749 $('#row_table_id').on('sortstop', function(event, ui) {
750 $('#row_table_id thead a img').remove();
751 kivi.DeliveryOrder.renumber_positions();
754 $('#expand_all').on('click', function(event) {
755 event.preventDefault();
756 if ($('#expand_all').data('expanded') == 1) {
757 $('#expand_all').data('expanded', 0);
758 $('#expand_all').attr('src', 'image/expand.svg');
759 $('#expand_all').attr('alt', kivi.t8('Show all details'));
760 $('#expand_all').attr('title', kivi.t8('Show all details'));
761 $('.row_entry').each(function(idx, elt) {
762 kivi.DeliveryOrder.hide_second_row(elt);
765 $('#expand_all').data('expanded', 1);
766 $('#expand_all').attr('src', "image/collapse.svg");
767 $('#expand_all').attr('alt', kivi.t8('Hide all details'));
768 $('#expand_all').attr('title', kivi.t8('Hide all details'));
769 kivi.DeliveryOrder.load_all_second_rows();
770 $('.row_entry').each(function(idx, elt) {
771 kivi.DeliveryOrder.show_second_row(elt);
777 $('.reformat_number_as_null_number').change(kivi.DeliveryOrder.reformat_number_as_null_number);