Revision ec9ed803
Von Tamino Steinert vor etwa 1 Jahr hinzugefügt
SL/Controller/DeliveryOrder.pm | ||
---|---|---|
1426 | 1426 |
$order = SL::DB::DeliveryOrder->new( |
1427 | 1427 |
orderitems => [], |
1428 | 1428 |
currency_id => $::instance_conf->get_currency_id(), |
1429 |
record_type => $self->type_data->validate
|
|
1429 |
record_type => $self->type |
|
1430 | 1430 |
); |
1431 | 1431 |
} |
1432 | 1432 |
|
SL/Controller/Order.pm | ||
---|---|---|
797 | 797 |
); |
798 | 798 |
} |
799 | 799 |
|
800 |
# save the order and redirect to the frontend subroutine for a new |
|
801 |
# delivery order |
|
802 |
sub action_save_and_delivery_order { |
|
803 |
my ($self) = @_; |
|
804 |
|
|
805 |
my %params; |
|
806 |
|
|
807 |
if ($::form->{convert_to_purchase_delivery_order_selected_items_only}) { |
|
808 |
$params{only_items} = join(',', @{ $::form->{purchase_delivery_order_item_selection_indexes} || [] }); |
|
809 |
} |
|
810 |
|
|
811 |
$self->save_and_redirect_to( |
|
812 |
controller => 'oe.pl', |
|
813 |
action => 'oe_delivery_order_from_order', |
|
814 |
%params, |
|
815 |
); |
|
816 |
} |
|
817 |
|
|
818 | 800 |
# save the order and redirect to the frontend subroutine for a new |
819 | 801 |
# invoice |
820 | 802 |
sub action_save_and_invoice { |
... | ... | |
2334 | 2316 |
disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef, |
2335 | 2317 |
], |
2336 | 2318 |
action => [ |
2337 |
t8('Save and Delivery Order'), |
|
2319 |
t8('Save and Sales Delivery Order'),
|
|
2338 | 2320 |
call => [ 'kivi.Order.save', { |
2339 |
action => 'save_and_delivery_order',
|
|
2321 |
action => 'save_and_new_record',
|
|
2340 | 2322 |
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts, |
2341 | 2323 |
warn_on_reqdate => $::instance_conf->get_order_warn_no_deliverydate, |
2324 |
form_params => [ |
|
2325 |
{ name => 'to_type', value => SALES_DELIVERY_ORDER_TYPE() }, |
|
2326 |
], |
|
2342 | 2327 |
}], |
2343 | 2328 |
checks => [ 'kivi.Order.check_save_active_periodic_invoices', |
2344 | 2329 |
@req_trans_cost_art, @req_cusordnumber, |
2345 | 2330 |
], |
2346 |
only_if => $self->type_data->show_menu('save_and_delivery_order'), |
|
2331 |
only_if => $self->type_data->show_menu('save_and_sales_delivery_order'),
|
|
2347 | 2332 |
disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef, |
2348 | 2333 |
], |
2349 | 2334 |
action => [ |
2350 |
t8('Save and Delivery Order with item selection'), |
|
2351 |
call => [ 'kivi.Order.convert_to_purchase_delivery_order_select_items', |
|
2352 |
{ action => 'save_and_delivery_order', |
|
2353 |
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts, |
|
2354 |
warn_on_reqdate => $::instance_conf->get_order_warn_no_deliverydate }, |
|
2355 |
], |
|
2335 |
t8('Save and Purchase Delivery Order'), |
|
2336 |
call => [ 'kivi.Order.save', { |
|
2337 |
action => 'save_and_new_record', |
|
2338 |
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts, |
|
2339 |
warn_on_reqdate => $::instance_conf->get_order_warn_no_deliverydate, |
|
2340 |
form_params => [ |
|
2341 |
{ name => 'to_type', value => PURCHASE_DELIVERY_ORDER_TYPE() }, |
|
2342 |
], |
|
2343 |
}], |
|
2344 |
checks => [ 'kivi.Order.check_save_active_periodic_invoices', |
|
2345 |
@req_trans_cost_art, @req_cusordnumber, |
|
2346 |
], |
|
2347 |
only_if => $self->type_data->show_menu('save_and_purchase_delivery_order'), |
|
2348 |
disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef, |
|
2349 |
], |
|
2350 |
action => [ |
|
2351 |
t8('Save and Purchase Delivery Order with item selection'), |
|
2352 |
call => [ |
|
2353 |
'kivi.Order.show_purchase_delivery_order_select_items', { |
|
2354 |
action => 'save_and_new_record', |
|
2355 |
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts, |
|
2356 |
warn_on_reqdate => $::instance_conf->get_order_warn_no_deliverydate, |
|
2357 |
form_params => [ |
|
2358 |
{ name => 'to_type', value => PURCHASE_DELIVERY_ORDER_TYPE() }, |
|
2359 |
], |
|
2360 |
}], |
|
2356 | 2361 |
checks => [ @req_trans_cost_art, @req_cusordnumber ], |
2357 | 2362 |
only_if => (any { $self->type eq $_ } (PURCHASE_ORDER_TYPE())), |
2358 | 2363 |
disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef, |
SL/DB/Order/TypeData.pm | ||
---|---|---|
38 | 38 |
save_and_sales_order_intake => 0, |
39 | 39 |
save_and_sales_order => 0, |
40 | 40 |
save_and_purchase_order => 1, |
41 |
save_and_delivery_order => 1, |
|
41 |
save_and_sales_delivery_order => 1, |
|
42 |
save_and_purchase_delivery_order => 0, |
|
42 | 43 |
save_and_supplier_delivery_order => 0, |
43 | 44 |
save_and_reclamation => 1, |
44 | 45 |
save_and_invoice_for_advance_payment => 1, |
... | ... | |
89 | 90 |
save_and_sales_order_intake => 0, |
90 | 91 |
save_and_sales_order => 1, |
91 | 92 |
save_and_purchase_order => 0, |
92 |
save_and_delivery_order => 1, |
|
93 |
save_and_sales_delivery_order => 0, |
|
94 |
save_and_purchase_delivery_order => 1, |
|
93 | 95 |
save_and_supplier_delivery_order => 1, |
94 | 96 |
save_and_reclamation => 1, |
95 | 97 |
save_and_invoice_for_advance_payment => 0, |
... | ... | |
133 | 135 |
save_and_sales_order_intake => 1, |
134 | 136 |
save_and_sales_order => 1, |
135 | 137 |
save_and_purchase_order => 0, |
136 |
save_and_delivery_order => 0, |
|
138 |
save_and_sales_delivery_order => 0, |
|
139 |
save_and_purchase_delivery_order => 0, |
|
137 | 140 |
save_and_supplier_delivery_order => 0, |
138 | 141 |
save_and_reclamation => 0, |
139 | 142 |
save_and_invoice_for_advance_payment => 0, |
... | ... | |
184 | 187 |
save_and_sales_order_intake => 0, |
185 | 188 |
save_and_sales_order => 1, |
186 | 189 |
save_and_purchase_order => 1, |
187 |
save_and_delivery_order => 0, |
|
190 |
save_and_sales_delivery_order => 0, |
|
191 |
save_and_purchase_delivery_order => 0, |
|
188 | 192 |
save_and_supplier_delivery_order => 0, |
189 | 193 |
save_and_reclamation => 0, |
190 | 194 |
save_and_invoice_for_advance_payment => 0, |
... | ... | |
228 | 232 |
save_and_sales_order_intake => 0, |
229 | 233 |
save_and_sales_order => 1, |
230 | 234 |
save_and_purchase_order => 1, |
231 |
save_and_delivery_order => 0, |
|
235 |
save_and_sales_delivery_order => 0, |
|
236 |
save_and_purchase_delivery_order => 0, |
|
232 | 237 |
save_and_supplier_delivery_order => 0, |
233 | 238 |
save_and_reclamation => 0, |
234 | 239 |
save_and_invoice_for_advance_payment => 0, |
... | ... | |
272 | 277 |
save_and_sales_order_intake => 0, |
273 | 278 |
save_and_sales_order => 1, |
274 | 279 |
save_and_purchase_order => 1, |
275 |
save_and_delivery_order => 0, |
|
280 |
save_and_sales_delivery_order => 0, |
|
281 |
save_and_purchase_delivery_order => 0, |
|
276 | 282 |
save_and_supplier_delivery_order => 0, |
277 | 283 |
save_and_reclamation => 0, |
278 | 284 |
save_and_invoice_for_advance_payment => 0, |
js/kivi.Order.js | ||
---|---|---|
965 | 965 |
window.open("controller.pl?action=CustomerVendor/edit&db=" + encodeURIComponent(db) + "&id=" + encodeURIComponent($(id_selector).val()), '_blank'); |
966 | 966 |
}; |
967 | 967 |
|
968 |
ns.convert_to_purchase_delivery_order_select_items = function(params) {
|
|
968 |
ns.show_purchase_delivery_order_select_items = function(params) {
|
|
969 | 969 |
var data = $('#order_form').serializeArray(); |
970 | 970 |
data.push({ name: 'action', value: 'Order/show_conversion_to_purchase_delivery_order_item_selection' }); |
971 | 971 |
|
... | ... | |
981 | 981 |
}); |
982 | 982 |
}; |
983 | 983 |
|
984 |
ns.convert_to_purchase_delivery_order = function() { |
|
985 |
var params = $("body").data("convert_to_purchase_delivery_order_item_selection_params"); |
|
986 |
params.form_params.convert_to_purchase_delivery_order_selected_items_only = 1; |
|
984 |
ns.convert_to_purchase_delivery_order_item_selection = function() { |
|
985 |
let params = $("body").data("convert_to_purchase_delivery_order_item_selection_params"); |
|
987 | 986 |
|
988 |
var $dlg = $("#convert_to_purchase_delivery_order_item_selection"); |
|
989 |
params.data = $dlg.find("tbody input").serializeArray(); |
|
987 |
let $dialog = $("#convert_to_purchase_delivery_order_item_selection"); |
|
988 |
let selected_items = $dialog.find("tbody input.item_selection_checkall").serializeArray(); |
|
989 |
params.data = selected_items; |
|
990 | 990 |
|
991 |
$dlg.dialog('close'); |
|
992 |
$dlg.remove(); |
|
991 |
additional_param = { name: 'only_selected_items', value: 1 }; |
|
992 |
if (params.form_params) { |
|
993 |
if (Array.isArray(params.form_params)) { |
|
994 |
params.form_params.push(additional_param); |
|
995 |
} else { |
|
996 |
params.form_params = [params.form_params]; |
|
997 |
params.form_params.push(additional_param); |
|
998 |
} |
|
999 |
} else { |
|
1000 |
params.form_params = [additional_param]; |
|
1001 |
} |
|
1002 |
|
|
1003 |
$dialog.dialog('close'); |
|
1004 |
$dialog.remove(); |
|
993 | 1005 |
|
994 | 1006 |
kivi.Order.save(params); |
995 | 1007 |
}; |
locale/de/all | ||
---|---|---|
3324 | 3324 |
'Save and AR Transaction' => 'Speichern und Debitorenbuchung erfassen', |
3325 | 3325 |
'Save and Close' => 'Speichern und schließen', |
3326 | 3326 |
'Save and Credit Note' => 'Speichern und Gutschrift erfassen', |
3327 |
'Save and Delivery Order' => 'Speichern und Lieferschein', |
|
3328 |
'Save and Delivery Order with item selection' => 'Speichern und Lieferschein mit Positionsauswahl', |
|
3329 | 3327 |
'Save and E-mail' => 'Speichern und E-Mail', |
3330 | 3328 |
'Save and Final Invoice' => 'Speichern und Schlussrechnung', |
3331 | 3329 |
'Save and Further Invoice for Advance Payment' => 'Speichern und weitere Anzahlungsrechnung', |
3332 | 3330 |
'Save and Invoice' => 'Speichern und Rechnung erfassen', |
3333 | 3331 |
'Save and Invoice for Advance Payment' => 'Speichern und Anzahlungsrechnung', |
3334 | 3332 |
'Save and Order' => 'Speichern und Auftrag erfassen', |
3333 |
'Save and Purchase Delivery Order' => 'Speichern und Lieferschein (Einkauf)', |
|
3334 |
'Save and Purchase Delivery Order with item selection' => 'Speichern und Lieferschein (Einkauf) mit Artikelauswahl', |
|
3335 | 3335 |
'Save and Purchase Order' => 'Speichern und Lieferantenauftrag', |
3336 | 3336 |
'Save and Purchase Quotation Intake' => 'Speichern und Angebotseingang', |
3337 | 3337 |
'Save and Purchase Reclamation' => 'Speichern und Einkaufsreklamation', |
... | ... | |
3339 | 3339 |
'Save and RFQ' => 'Speichern und Lieferantenanfrage', |
3340 | 3340 |
'Save and RMA Delivery Order' => 'Speichern und Retourenlieferschein', |
3341 | 3341 |
'Save and Reclamation' => 'Speichern und Reklamation', |
3342 |
'Save and Sales Delivery Order' => 'Speichern und Lieferschein (Verkauf)', |
|
3342 | 3343 |
'Save and Sales Order Confirmation' => 'Speichern und Auftragsbestätigung', |
3343 | 3344 |
'Save and Sales Order Intake' => 'Speichern und Auftragseingang', |
3344 | 3345 |
'Save and Sales Reclamation' => 'Speichern und Verkaufsreklamation', |
locale/en/all | ||
---|---|---|
3323 | 3323 |
'Save and AR Transaction' => '', |
3324 | 3324 |
'Save and Close' => '', |
3325 | 3325 |
'Save and Credit Note' => '', |
3326 |
'Save and Delivery Order' => '', |
|
3327 |
'Save and Delivery Order with item selection' => '', |
|
3328 | 3326 |
'Save and E-mail' => '', |
3329 | 3327 |
'Save and Final Invoice' => '', |
3330 | 3328 |
'Save and Further Invoice for Advance Payment' => '', |
3331 | 3329 |
'Save and Invoice' => '', |
3332 | 3330 |
'Save and Invoice for Advance Payment' => '', |
3333 | 3331 |
'Save and Order' => '', |
3332 |
'Save and Purchase Delivery Order' => '', |
|
3333 |
'Save and Purchase Delivery Order with item selection' => '', |
|
3334 | 3334 |
'Save and Purchase Order' => '', |
3335 | 3335 |
'Save and Purchase Quotation Intake' => '', |
3336 | 3336 |
'Save and Purchase Reclamation' => '', |
... | ... | |
3338 | 3338 |
'Save and RFQ' => '', |
3339 | 3339 |
'Save and RMA Delivery Order' => '', |
3340 | 3340 |
'Save and Reclamation' => '', |
3341 |
'Save and Sales Delivery Order' => '', |
|
3341 | 3342 |
'Save and Sales Order Confirmation' => '', |
3342 | 3343 |
'Save and Sales Order Intake' => '', |
3343 | 3344 |
'Save and Sales Reclamation' => '', |
templates/design40_webpages/order/tabs/_purchase_delivery_order_item_selection.html | ||
---|---|---|
1 | 1 |
[%- USE LxERP -%][%- USE L -%][%- USE HTML -%] |
2 | 2 |
<div class="wrapper"> |
3 |
[% L.button_tag("kivi.Order.convert_to_purchase_delivery_order()", LxERP.t8("Create delivery order")) %] |
|
3 |
[% L.button_tag("kivi.Order.convert_to_purchase_delivery_order_item_selection()", LxERP.t8("Create delivery order")) %]
|
|
4 | 4 |
</div> |
5 | 5 |
|
6 | 6 |
<div class="wrapper"> |
7 | 7 |
<table class="tbl-list"> |
8 | 8 |
<thead> |
9 | 9 |
<tr class="listheading"> |
10 |
<th>[% L.checkbox_tag("purchase_delivery_order_item_selection_checkall", checkall="input.purchase_delivery_order_item_selection_checkall") %]</th>
|
|
10 |
<th>[% L.checkbox_tag("item_selection_checkall", checkall="input.item_selection_checkall") %]</th>
|
|
11 | 11 |
<th>[% LxERP.t8("Position") %]</th> |
12 | 12 |
<th>[% LxERP.t8("Partnumber") %]</th> |
13 | 13 |
<th>[% LxERP.t8("Vendor Part Number") %]</th> |
... | ... | |
17 | 17 |
</tr> |
18 | 18 |
</thead> |
19 | 19 |
|
20 |
<tbody id="convert_to_purchase_delivery_order_item_selection_items" class="row_entry listrow">
|
|
20 |
<tbody id="item_selection" class="row_entry listrow">
|
|
21 | 21 |
[% FOREACH item = ITEMS %] |
22 | 22 |
<tr class="listrow"> |
23 |
<td>[% L.checkbox_tag("purchase_delivery_order_item_selection_indexes[+]", class="purchase_delivery_order_item_selection_checkall", value=loop.count, checked="checked") %]</td>
|
|
23 |
<td>[% L.checkbox_tag("selected_items[+]", class="item_selection_checkall", value=item.id, checked="checked") %]</td>
|
|
24 | 24 |
<td class="numeric">[% loop.count %]</td> |
25 | 25 |
<td>[% HTML.escape(item.partnumber) %]</td> |
26 | 26 |
<td>[% HTML.escape(item.vendor_partnumber) %]</td> |
templates/webpages/order/tabs/_purchase_delivery_order_item_selection.html | ||
---|---|---|
1 | 1 |
[%- USE LxERP -%][%- USE L -%][%- USE HTML -%] |
2 | 2 |
<div> |
3 |
[% L.button_tag("kivi.Order.convert_to_purchase_delivery_order()", LxERP.t8("Create delivery order")) %] |
|
3 |
[% L.button_tag("kivi.Order.convert_to_purchase_delivery_order_item_selection()", LxERP.t8("Create delivery order")) %]
|
|
4 | 4 |
</div> |
5 | 5 |
|
6 | 6 |
<div> |
7 | 7 |
<table> |
8 | 8 |
<thead> |
9 | 9 |
<tr class="listheading"> |
10 |
<th>[% L.checkbox_tag("purchase_delivery_order_item_selection_checkall", checkall="input.purchase_delivery_order_item_selection_checkall", checked="checked") %]</th>
|
|
10 |
<th>[% L.checkbox_tag("item_selection_checkall", checkall="input.item_selection_checkall") %]</th>
|
|
11 | 11 |
<th>[% LxERP.t8("Position") %]</th> |
12 | 12 |
<th>[% LxERP.t8("Partnumber") %]</th> |
13 | 13 |
<th>[% LxERP.t8("Vendor Part Number") %]</th> |
... | ... | |
17 | 17 |
</tr> |
18 | 18 |
</thead> |
19 | 19 |
|
20 |
<tbody> |
|
20 |
<tbody id="item_selection" class="row_entry listrow">
|
|
21 | 21 |
[% FOREACH item = ITEMS %] |
22 | 22 |
<tr class="listrow"> |
23 |
<td>[% L.checkbox_tag("purchase_delivery_order_item_selection_indexes[+]", class="purchase_delivery_order_item_selection_checkall", value=loop.count, checked="checked") %]</td>
|
|
23 |
<td>[% L.checkbox_tag("selected_items[+]", class="item_selection_checkall", value=item.id, checked="checked") %]</td>
|
|
24 | 24 |
<td align="right">[% loop.count %]</td> |
25 | 25 |
<td>[% HTML.escape(item.partnumber) %]</td> |
26 | 26 |
<td>[% HTML.escape(item.vendor_partnumber) %]</td> |
Auch abrufbar als: Unified diff
Workflow Auftrag → Lieferschein auf neuen Controller umgestellt