Revision 295c1205
Von Tamino Steinert vor fast 2 Jahren hinzugefügt
js/kivi.DeliveryOrder.js | ||
---|---|---|
109 | 109 |
}); |
110 | 110 |
}; |
111 | 111 |
|
112 |
ns.add_stock_in_line_to_dialog = function() { |
|
113 |
console.log("clicked"); |
|
114 |
console.log($("#parts_id")); |
|
115 |
console.log($("#parts_id").val()); |
|
116 |
console.log($("#do_qty")); |
|
117 |
console.log($("#do_qty").val()); |
|
118 |
|
|
119 |
let qty_sum = 0; |
|
120 |
let row_count = 0; |
|
121 |
$("#stock-in-out-table tr.listrow").each((i,row) => { |
|
122 |
let qty = kivi.parse_amount($(row).find(".data-qty").val()); |
|
123 |
|
|
124 |
row_count = row_count + 1; |
|
125 |
if (qty === 0) return; |
|
126 |
if (qty === null) return; |
|
127 |
qty_sum = qty_sum + qty; |
|
128 |
}); |
|
129 |
|
|
130 |
let data = []; |
|
131 |
data.push( |
|
132 |
{ name: 'action', value: 'DeliveryOrder/add_stock_in_line_to_dialog' }, |
|
133 |
{ name: 'type', value: $("#type").val()}, |
|
134 |
{ name: 'qty_sum', value: qty_sum }, |
|
135 |
{ name: 'row_count', value: row_count}, |
|
136 |
{ name: 'parts_id', value: $("#parts_id").val()}, |
|
137 |
{ name: 'do_qty', value: $("#do_qty").val()}, |
|
138 |
); |
|
139 |
|
|
140 |
$.post("controller.pl", data, kivi.eval_json_result); |
|
141 |
}; |
|
142 |
|
|
112 | 143 |
ns.save_updated_stock = function() { |
113 | 144 |
// stock information is saved in DOM as a yaml dump. |
114 | 145 |
// we don't want to do this in javascript so we do a tiny roundtrip to the backend |
... | ... | |
118 | 149 |
let qty = kivi.parse_amount($(row).find(".data-qty").val()); |
119 | 150 |
|
120 | 151 |
if (qty === 0) return; |
152 |
if (qty === null) return; |
|
121 | 153 |
|
122 | 154 |
data.push({ |
123 | 155 |
qty: qty, |
Auch abrufbar als: Unified diff
Controller: DeliveryOrder: stock_dialog um Einlagern erweitert