Berichte OE: Bestellnummer des Kunden anzeigen/danach filtern
[kivitendo-erp.git] / js / kivi.SalesPurchase.js
1 namespace('kivi.SalesPurchase', function(ns) {
2   this.edit_longdescription = function(row) {
3     var $edit    = $('#popup_edit_longdescription_input');
4     var $element = $('#longdescription_' + row);
5
6     if (!$element.length) {
7       console.error("kivi.SalesPurchase.edit_longdescription: Element #longdescription_" + row + " not found");
8       return;
9     }
10
11     $edit.data('element', $element);
12     $edit.val($element.val());
13
14     $('#popup_edit_longdescription_runningnumber').html(row);
15     $('#popup_edit_longdescription_partnumber').html($('#partnumber_' + row).val() || '');
16
17     var description = ($('#description_' + row).val() || '').replace(/[\n\r]+/, '');
18     if (description.length >= 50)
19       description = description.substring(0, 50) + "…";
20     $('#popup_edit_longdescription_description').html(description);
21
22     kivi.popup_dialog({
23       id:    'edit_longdescription_dialog',
24       dialog: {
25         title: kivi.t8('Enter longdescription')
26       }
27     });
28   };
29
30   this.set_longdescription = function() {
31     var $edit    = $('#popup_edit_longdescription_input');
32     var $element = $edit.data('element');
33
34     $element.val($edit.val());
35     $('#edit_longdescription_dialog').dialog('close');
36   };
37 });