Revision aa2fcd58
Von Tamino Steinert vor mehr als 1 Jahr hinzugefügt
SL/Controller/DeliveryOrder.pm | ||
---|---|---|
$order = SL::DB::DeliveryOrder->new(
|
||
orderitems => [],
|
||
currency_id => $::instance_conf->get_currency_id(),
|
||
record_type => $self->type_data->validate
|
||
record_type => $self->type
|
||
);
|
||
}
|
||
|
SL/Controller/Order.pm | ||
---|---|---|
);
|
||
}
|
||
|
||
# save the order and redirect to the frontend subroutine for a new
|
||
# delivery order
|
||
sub action_save_and_delivery_order {
|
||
my ($self) = @_;
|
||
|
||
my %params;
|
||
|
||
if ($::form->{convert_to_purchase_delivery_order_selected_items_only}) {
|
||
$params{only_items} = join(',', @{ $::form->{purchase_delivery_order_item_selection_indexes} || [] });
|
||
}
|
||
|
||
$self->save_and_redirect_to(
|
||
controller => 'oe.pl',
|
||
action => 'oe_delivery_order_from_order',
|
||
%params,
|
||
);
|
||
}
|
||
|
||
# save the order and redirect to the frontend subroutine for a new
|
||
# invoice
|
||
sub action_save_and_invoice {
|
||
... | ... | |
disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
|
||
],
|
||
action => [
|
||
t8('Save and Delivery Order'),
|
||
t8('Save and Sales Delivery Order'),
|
||
call => [ 'kivi.Order.save', {
|
||
action => 'save_and_delivery_order',
|
||
action => 'save_and_new_record',
|
||
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts,
|
||
warn_on_reqdate => $::instance_conf->get_order_warn_no_deliverydate,
|
||
form_params => [
|
||
{ name => 'to_type', value => SALES_DELIVERY_ORDER_TYPE() },
|
||
],
|
||
}],
|
||
checks => [ 'kivi.Order.check_save_active_periodic_invoices',
|
||
@req_trans_cost_art, @req_cusordnumber,
|
||
],
|
||
only_if => $self->type_data->show_menu('save_and_delivery_order'),
|
||
only_if => $self->type_data->show_menu('save_and_sales_delivery_order'),
|
||
disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
|
||
],
|
||
action => [
|
||
t8('Save and Delivery Order with item selection'),
|
||
call => [ 'kivi.Order.convert_to_purchase_delivery_order_select_items',
|
||
{ action => 'save_and_delivery_order',
|
||
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts,
|
||
warn_on_reqdate => $::instance_conf->get_order_warn_no_deliverydate },
|
||
],
|
||
t8('Save and Purchase Delivery Order'),
|
||
call => [ 'kivi.Order.save', {
|
||
action => 'save_and_new_record',
|
||
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts,
|
||
warn_on_reqdate => $::instance_conf->get_order_warn_no_deliverydate,
|
||
form_params => [
|
||
{ name => 'to_type', value => PURCHASE_DELIVERY_ORDER_TYPE() },
|
||
],
|
||
}],
|
||
checks => [ 'kivi.Order.check_save_active_periodic_invoices',
|
||
@req_trans_cost_art, @req_cusordnumber,
|
||
],
|
||
only_if => $self->type_data->show_menu('save_and_purchase_delivery_order'),
|
||
disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
|
||
],
|
||
action => [
|
||
t8('Save and Purchase Delivery Order with item selection'),
|
||
call => [
|
||
'kivi.Order.show_purchase_delivery_order_select_items', {
|
||
action => 'save_and_new_record',
|
||
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts,
|
||
warn_on_reqdate => $::instance_conf->get_order_warn_no_deliverydate,
|
||
form_params => [
|
||
{ name => 'to_type', value => PURCHASE_DELIVERY_ORDER_TYPE() },
|
||
],
|
||
}],
|
||
checks => [ @req_trans_cost_art, @req_cusordnumber ],
|
||
only_if => (any { $self->type eq $_ } (PURCHASE_ORDER_TYPE())),
|
||
disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
|
SL/DB/Order/TypeData.pm | ||
---|---|---|
save_and_sales_order_intake => 0,
|
||
save_and_sales_order => 0,
|
||
save_and_purchase_order => 1,
|
||
save_and_delivery_order => 1,
|
||
save_and_sales_delivery_order => 1,
|
||
save_and_purchase_delivery_order => 0,
|
||
save_and_supplier_delivery_order => 0,
|
||
save_and_reclamation => 1,
|
||
save_and_invoice_for_advance_payment => 1,
|
||
... | ... | |
save_and_sales_order_intake => 0,
|
||
save_and_sales_order => 1,
|
||
save_and_purchase_order => 0,
|
||
save_and_delivery_order => 1,
|
||
save_and_sales_delivery_order => 0,
|
||
save_and_purchase_delivery_order => 1,
|
||
save_and_supplier_delivery_order => 1,
|
||
save_and_reclamation => 1,
|
||
save_and_invoice_for_advance_payment => 0,
|
||
... | ... | |
save_and_sales_order_intake => 1,
|
||
save_and_sales_order => 1,
|
||
save_and_purchase_order => 0,
|
||
save_and_delivery_order => 0,
|
||
save_and_sales_delivery_order => 0,
|
||
save_and_purchase_delivery_order => 0,
|
||
save_and_supplier_delivery_order => 0,
|
||
save_and_reclamation => 0,
|
||
save_and_invoice_for_advance_payment => 0,
|
||
... | ... | |
save_and_sales_order_intake => 0,
|
||
save_and_sales_order => 1,
|
||
save_and_purchase_order => 1,
|
||
save_and_delivery_order => 0,
|
||
save_and_sales_delivery_order => 0,
|
||
save_and_purchase_delivery_order => 0,
|
||
save_and_supplier_delivery_order => 0,
|
||
save_and_reclamation => 0,
|
||
save_and_invoice_for_advance_payment => 0,
|
||
... | ... | |
save_and_sales_order_intake => 0,
|
||
save_and_sales_order => 1,
|
||
save_and_purchase_order => 1,
|
||
save_and_delivery_order => 0,
|
||
save_and_sales_delivery_order => 0,
|
||
save_and_purchase_delivery_order => 0,
|
||
save_and_supplier_delivery_order => 0,
|
||
save_and_reclamation => 0,
|
||
save_and_invoice_for_advance_payment => 0,
|
||
... | ... | |
save_and_sales_order_intake => 0,
|
||
save_and_sales_order => 1,
|
||
save_and_purchase_order => 1,
|
||
save_and_delivery_order => 0,
|
||
save_and_sales_delivery_order => 0,
|
||
save_and_purchase_delivery_order => 0,
|
||
save_and_supplier_delivery_order => 0,
|
||
save_and_reclamation => 0,
|
||
save_and_invoice_for_advance_payment => 0,
|
js/kivi.Order.js | ||
---|---|---|
window.open("controller.pl?action=CustomerVendor/edit&db=" + encodeURIComponent(db) + "&id=" + encodeURIComponent($(id_selector).val()), '_blank');
|
||
};
|
||
|
||
ns.convert_to_purchase_delivery_order_select_items = function(params) {
|
||
ns.show_purchase_delivery_order_select_items = function(params) {
|
||
var data = $('#order_form').serializeArray();
|
||
data.push({ name: 'action', value: 'Order/show_conversion_to_purchase_delivery_order_item_selection' });
|
||
|
||
... | ... | |
});
|
||
};
|
||
|
||
ns.convert_to_purchase_delivery_order = function() {
|
||
var params = $("body").data("convert_to_purchase_delivery_order_item_selection_params");
|
||
params.form_params.convert_to_purchase_delivery_order_selected_items_only = 1;
|
||
ns.convert_to_purchase_delivery_order_item_selection = function() {
|
||
let params = $("body").data("convert_to_purchase_delivery_order_item_selection_params");
|
||
|
||
var $dlg = $("#convert_to_purchase_delivery_order_item_selection");
|
||
params.data = $dlg.find("tbody input").serializeArray();
|
||
let $dialog = $("#convert_to_purchase_delivery_order_item_selection");
|
||
let selected_items = $dialog.find("tbody input.item_selection_checkall").serializeArray();
|
||
params.data = selected_items;
|
||
|
||
$dlg.dialog('close');
|
||
$dlg.remove();
|
||
additional_param = { name: 'only_selected_items', value: 1 };
|
||
if (params.form_params) {
|
||
if (Array.isArray(params.form_params)) {
|
||
params.form_params.push(additional_param);
|
||
} else {
|
||
params.form_params = [params.form_params];
|
||
params.form_params.push(additional_param);
|
||
}
|
||
} else {
|
||
params.form_params = [additional_param];
|
||
}
|
||
|
||
$dialog.dialog('close');
|
||
$dialog.remove();
|
||
|
||
kivi.Order.save(params);
|
||
};
|
locale/de/all | ||
---|---|---|
'Save and AR Transaction' => 'Speichern und Debitorenbuchung erfassen',
|
||
'Save and Close' => 'Speichern und schließen',
|
||
'Save and Credit Note' => 'Speichern und Gutschrift erfassen',
|
||
'Save and Delivery Order' => 'Speichern und Lieferschein',
|
||
'Save and Delivery Order with item selection' => 'Speichern und Lieferschein mit Positionsauswahl',
|
||
'Save and E-mail' => 'Speichern und E-Mail',
|
||
'Save and Final Invoice' => 'Speichern und Schlussrechnung',
|
||
'Save and Further Invoice for Advance Payment' => 'Speichern und weitere Anzahlungsrechnung',
|
||
'Save and Invoice' => 'Speichern und Rechnung erfassen',
|
||
'Save and Invoice for Advance Payment' => 'Speichern und Anzahlungsrechnung',
|
||
'Save and Order' => 'Speichern und Auftrag erfassen',
|
||
'Save and Purchase Delivery Order' => 'Speichern und Lieferschein (Einkauf)',
|
||
'Save and Purchase Delivery Order with item selection' => 'Speichern und Lieferschein (Einkauf) mit Artikelauswahl',
|
||
'Save and Purchase Order' => 'Speichern und Lieferantenauftrag',
|
||
'Save and Purchase Quotation Intake' => 'Speichern und Angebotseingang',
|
||
'Save and Purchase Reclamation' => 'Speichern und Einkaufsreklamation',
|
||
... | ... | |
'Save and RFQ' => 'Speichern und Lieferantenanfrage',
|
||
'Save and RMA Delivery Order' => 'Speichern und Retourenlieferschein',
|
||
'Save and Reclamation' => 'Speichern und Reklamation',
|
||
'Save and Sales Delivery Order' => 'Speichern und Lieferschein (Verkauf)',
|
||
'Save and Sales Order Confirmation' => 'Speichern und Auftragsbestätigung',
|
||
'Save and Sales Order Intake' => 'Speichern und Auftragseingang',
|
||
'Save and Sales Reclamation' => 'Speichern und Verkaufsreklamation',
|
locale/en/all | ||
---|---|---|
'Save and AR Transaction' => '',
|
||
'Save and Close' => '',
|
||
'Save and Credit Note' => '',
|
||
'Save and Delivery Order' => '',
|
||
'Save and Delivery Order with item selection' => '',
|
||
'Save and E-mail' => '',
|
||
'Save and Final Invoice' => '',
|
||
'Save and Further Invoice for Advance Payment' => '',
|
||
'Save and Invoice' => '',
|
||
'Save and Invoice for Advance Payment' => '',
|
||
'Save and Order' => '',
|
||
'Save and Purchase Delivery Order' => '',
|
||
'Save and Purchase Delivery Order with item selection' => '',
|
||
'Save and Purchase Order' => '',
|
||
'Save and Purchase Quotation Intake' => '',
|
||
'Save and Purchase Reclamation' => '',
|
||
... | ... | |
'Save and RFQ' => '',
|
||
'Save and RMA Delivery Order' => '',
|
||
'Save and Reclamation' => '',
|
||
'Save and Sales Delivery Order' => '',
|
||
'Save and Sales Order Confirmation' => '',
|
||
'Save and Sales Order Intake' => '',
|
||
'Save and Sales Reclamation' => '',
|
templates/design40_webpages/order/tabs/_purchase_delivery_order_item_selection.html | ||
---|---|---|
[%- USE LxERP -%][%- USE L -%][%- USE HTML -%]
|
||
<div class="wrapper">
|
||
[% L.button_tag("kivi.Order.convert_to_purchase_delivery_order()", LxERP.t8("Create delivery order")) %]
|
||
[% L.button_tag("kivi.Order.convert_to_purchase_delivery_order_item_selection()", LxERP.t8("Create delivery order")) %]
|
||
</div>
|
||
|
||
<div class="wrapper">
|
||
<table class="tbl-list">
|
||
<thead>
|
||
<tr class="listheading">
|
||
<th>[% L.checkbox_tag("purchase_delivery_order_item_selection_checkall", checkall="input.purchase_delivery_order_item_selection_checkall") %]</th>
|
||
<th>[% L.checkbox_tag("item_selection_checkall", checkall="input.item_selection_checkall") %]</th>
|
||
<th>[% LxERP.t8("Position") %]</th>
|
||
<th>[% LxERP.t8("Partnumber") %]</th>
|
||
<th>[% LxERP.t8("Vendor Part Number") %]</th>
|
||
... | ... | |
</tr>
|
||
</thead>
|
||
|
||
<tbody id="convert_to_purchase_delivery_order_item_selection_items" class="row_entry listrow">
|
||
<tbody id="item_selection" class="row_entry listrow">
|
||
[% FOREACH item = ITEMS %]
|
||
<tr class="listrow">
|
||
<td>[% L.checkbox_tag("purchase_delivery_order_item_selection_indexes[+]", class="purchase_delivery_order_item_selection_checkall", value=loop.count, checked="checked") %]</td>
|
||
<td>[% L.checkbox_tag("selected_items[+]", class="item_selection_checkall", value=item.id, checked="checked") %]</td>
|
||
<td class="numeric">[% loop.count %]</td>
|
||
<td>[% HTML.escape(item.partnumber) %]</td>
|
||
<td>[% HTML.escape(item.vendor_partnumber) %]</td>
|
templates/webpages/order/tabs/_purchase_delivery_order_item_selection.html | ||
---|---|---|
[%- USE LxERP -%][%- USE L -%][%- USE HTML -%]
|
||
<div>
|
||
[% L.button_tag("kivi.Order.convert_to_purchase_delivery_order()", LxERP.t8("Create delivery order")) %]
|
||
[% L.button_tag("kivi.Order.convert_to_purchase_delivery_order_item_selection()", LxERP.t8("Create delivery order")) %]
|
||
</div>
|
||
|
||
<div>
|
||
<table>
|
||
<thead>
|
||
<tr class="listheading">
|
||
<th>[% L.checkbox_tag("purchase_delivery_order_item_selection_checkall", checkall="input.purchase_delivery_order_item_selection_checkall", checked="checked") %]</th>
|
||
<th>[% L.checkbox_tag("item_selection_checkall", checkall="input.item_selection_checkall") %]</th>
|
||
<th>[% LxERP.t8("Position") %]</th>
|
||
<th>[% LxERP.t8("Partnumber") %]</th>
|
||
<th>[% LxERP.t8("Vendor Part Number") %]</th>
|
||
... | ... | |
</tr>
|
||
</thead>
|
||
|
||
<tbody>
|
||
<tbody id="item_selection" class="row_entry listrow">
|
||
[% FOREACH item = ITEMS %]
|
||
<tr class="listrow">
|
||
<td>[% L.checkbox_tag("purchase_delivery_order_item_selection_indexes[+]", class="purchase_delivery_order_item_selection_checkall", value=loop.count, checked="checked") %]</td>
|
||
<td>[% L.checkbox_tag("selected_items[+]", class="item_selection_checkall", value=item.id, checked="checked") %]</td>
|
||
<td align="right">[% loop.count %]</td>
|
||
<td>[% HTML.escape(item.partnumber) %]</td>
|
||
<td>[% HTML.escape(item.vendor_partnumber) %]</td>
|
Auch abrufbar als: Unified diff
Workflow Auftrag → Lieferschein auf neuen Controller umgestellt