Revision 4836a949
Von Tamino Steinert vor fast 2 Jahren hinzugefügt
SL/Controller/DeliveryOrder.pm | ||
---|---|---|
action => [
|
||
t8('Save'),
|
||
id => 'save_action',
|
||
call => [ 'kivi.DeliveryOrder.save', { action => 'save',
|
||
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts,
|
||
warn_on_reqdate => $::instance_conf->get_order_warn_no_deliverydate },
|
||
],
|
||
call => [ 'kivi.DeliveryOrder.save', {
|
||
action => 'save',
|
||
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts,
|
||
warn_on_reqdate => $::instance_conf->get_order_warn_no_deliverydate,
|
||
}],
|
||
disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.')
|
||
: $self->order->delivered ? t8('This record has already been delivered.')
|
||
: undef,
|
||
],
|
||
action => [
|
||
t8('Save as new'),
|
||
call => [ 'kivi.DeliveryOrder.save', { action => 'save_as_new',
|
||
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts },
|
||
],
|
||
call => [ 'kivi.DeliveryOrder.save', {
|
||
action => 'save_as_new',
|
||
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts,
|
||
}],
|
||
disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.')
|
||
: $self->type eq 'supplier_delivery_order' ? t8('Need a workflow for Supplier Delivery Order')
|
||
: $self->type eq 'rma_delivery_order' ? t8('Need a workflow for RMA Delivery Order.')
|
||
... | ... | |
],
|
||
action => [
|
||
t8('Save and Delivery Order'),
|
||
call => [ 'kivi.DeliveryOrder.save', { 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 },
|
||
],
|
||
call => [ 'kivi.DeliveryOrder.save', {
|
||
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,
|
||
}],
|
||
only_if => $self->type_data->show_menu("save_and_delivery_order"),
|
||
disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
|
||
],
|
||
action => [
|
||
t8('Save and Invoice'),
|
||
call => [ 'kivi.DeliveryOrder.save', { action => 'save_and_invoice',
|
||
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts },
|
||
],
|
||
call => [ 'kivi.DeliveryOrder.save', {
|
||
action => 'save_and_invoice',
|
||
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts,
|
||
}],
|
||
only_if => $self->type_data->show_menu("save_and_invoice"),
|
||
disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
|
||
],
|
||
action => [
|
||
t8('Save and AP Transaction'),
|
||
call => [ 'kivi.DeliveryOrder.save', { action => 'save_and_ap_transaction',
|
||
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts },
|
||
],
|
||
call => [ 'kivi.DeliveryOrder.save', {
|
||
action => 'save_and_ap_transaction',
|
||
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts,
|
||
}],
|
||
only_if => $self->type_data->show_menu("save_and_ap_transaction"),
|
||
disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
|
||
],
|
||
... | ... | |
],
|
||
action => [
|
||
t8('Save and preview PDF'),
|
||
call => [ 'kivi.DeliveryOrder.save', { action => 'preview_pdf',
|
||
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts,
|
||
warn_on_reqdate => $::instance_conf->get_order_warn_no_deliverydate },
|
||
],
|
||
call => [ 'kivi.DeliveryOrder.save', {
|
||
action => 'preview_pdf',
|
||
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts,
|
||
warn_on_reqdate => $::instance_conf->get_order_warn_no_deliverydate,
|
||
}],
|
||
disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
|
||
],
|
||
action => [
|
||
... | ... | |
action => [
|
||
t8('Save and E-mail'),
|
||
id => 'save_and_email_action',
|
||
call => [ 'kivi.DeliveryOrder.save', { action => 'save_and_show_email_dialog',
|
||
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts,
|
||
warn_on_reqdate => $::instance_conf->get_order_warn_no_deliverydate },
|
||
],
|
||
call => [ 'kivi.DeliveryOrder.save', {
|
||
action => 'save_and_show_email_dialog',
|
||
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts,
|
||
warn_on_reqdate => $::instance_conf->get_order_warn_no_deliverydate,
|
||
}],
|
||
disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.')
|
||
: !$self->order->id ? t8('This object has not been saved yet.')
|
||
: undef,
|
||
... | ... | |
action => [
|
||
t8('Transfer out'),
|
||
id => 'transfer_out_action',
|
||
call => [ 'kivi.DeliveryOrder.save', { action => 'transfer_stock' } ],
|
||
call => [ 'kivi.DeliveryOrder.save', {
|
||
action => 'transfer_stock',
|
||
}],
|
||
disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.')
|
||
: !$self->order->id ? t8('This object has not been saved yet.')
|
||
: $self->order->delivered ? t8('The parts for this order have already been transferred')
|
||
... | ... | |
action => [
|
||
t8('Transfer in'),
|
||
id => 'transfer_in_action',
|
||
call => [ 'kivi.DeliveryOrder.save', { action => 'transfer_stock' } ],
|
||
call => [ 'kivi.DeliveryOrder.save', {
|
||
action => 'transfer_stock',
|
||
}],
|
||
disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.')
|
||
: !$self->order->id ? t8('This object has not been saved yet.')
|
||
: $self->order->delivered ? t8('The parts for this order have already been transferred')
|
||
... | ... | |
action => [
|
||
t8('Undo Transfer'),
|
||
id => 'undo_transfer_action',
|
||
call => [ 'kivi.DeliveryOrder.save', { action => 'undo_transfers' } ],
|
||
call => [ 'kivi.DeliveryOrder.save', {
|
||
action => 'undo_transfers',
|
||
}],
|
||
disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.')
|
||
: !$self->order->id ? t8('This object has not been saved yet.')
|
||
: undef,
|
SL/Controller/Order.pm | ||
---|---|---|
use SL::DB::Helper::Record qw(get_object_name_from_type get_class_from_type);
|
||
use SL::Model::Record;
|
||
use SL::DB::Order::TypeData qw(:types);
|
||
use SL::DB::DeliveryOrder::TypeData qw(:types);
|
||
use SL::DB::Reclamation::TypeData qw(:types);
|
||
|
||
use SL::Helper::CreatePDF qw(:all);
|
||
... | ... | |
combobox => [
|
||
action => [
|
||
t8('Save'),
|
||
call => [ 'kivi.Order.save', { action => 'save',
|
||
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts,
|
||
warn_on_reqdate => $::instance_conf->get_order_warn_no_deliverydate },
|
||
],
|
||
call => [ 'kivi.Order.save', {
|
||
action => 'save',
|
||
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts,
|
||
warn_on_reqdate => $::instance_conf->get_order_warn_no_deliverydate,
|
||
}],
|
||
checks => [ 'kivi.Order.check_save_active_periodic_invoices', ['kivi.validate_form','#order_form'],
|
||
@req_trans_cost_art, @req_cusordnumber,
|
||
],
|
||
... | ... | |
],
|
||
action => [
|
||
t8('Save and Close'),
|
||
call => [ 'kivi.Order.save', { action => 'save',
|
||
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts,
|
||
warn_on_reqdate => $::instance_conf->get_order_warn_no_deliverydate,
|
||
back_to_caller => 1 },
|
||
],
|
||
call => [ 'kivi.Order.save', {
|
||
action => 'save',
|
||
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts,
|
||
warn_on_reqdate => $::instance_conf->get_order_warn_no_deliverydate,
|
||
form_params => [
|
||
{ name => 'back_to_caller', value => 1 },
|
||
],
|
||
}],
|
||
checks => [ 'kivi.Order.check_save_active_periodic_invoices', ['kivi.validate_form','#order_form'],
|
||
@req_trans_cost_art, @req_cusordnumber,
|
||
],
|
||
... | ... | |
],
|
||
action => [
|
||
t8('Create Sub-Version'),
|
||
call => [ 'kivi.Order.save', { action => 'add_subversion' }, ],
|
||
call => [ 'kivi.Order.save', { action => 'add_subversion' } ],
|
||
only_if => $::instance_conf->get_lock_oe_subversions,
|
||
disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.')
|
||
: !$is_final_version ? t8('This sub-version is not yet finalized')
|
||
... | ... | |
],
|
||
action => [
|
||
t8('Save as new'),
|
||
call => [ 'kivi.Order.save', { action => 'save_as_new',
|
||
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts },
|
||
],
|
||
call => [ 'kivi.Order.save', {
|
||
action => 'save_as_new',
|
||
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts,
|
||
}],
|
||
checks => [ 'kivi.Order.check_save_active_periodic_invoices',
|
||
@req_trans_cost_art, @req_cusordnumber,
|
||
],
|
||
... | ... | |
],
|
||
action => [
|
||
t8('Save and Delivery Order'),
|
||
call => [ 'kivi.Order.save', { 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 },
|
||
],
|
||
call => [ 'kivi.Order.save', {
|
||
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,
|
||
}],
|
||
checks => [ 'kivi.Order.check_save_active_periodic_invoices',
|
||
@req_trans_cost_art, @req_cusordnumber,
|
||
],
|
||
... | ... | |
],
|
||
action => [
|
||
t8('Save and Supplier Delivery Order'),
|
||
call => [ 'kivi.Order.save', { action => 'save_and_supplier_delivery_order',
|
||
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts,
|
||
warn_on_reqdate => $::instance_conf->get_order_warn_no_deliverydate },
|
||
],
|
||
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 => SUPPLIER_DELIVERY_ORDER_TYPE() },
|
||
],
|
||
}],
|
||
checks => [ 'kivi.Order.check_save_active_periodic_invoices',
|
||
@req_trans_cost_art, @req_cusordnumber,
|
||
],
|
||
... | ... | |
],
|
||
action => [
|
||
t8('Save and Reclamation'),
|
||
call => [ 'kivi.Order.save', { action => 'save_and_reclamation',
|
||
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts },
|
||
],
|
||
call => [ 'kivi.Order.save', {
|
||
action => 'save_and_new_record',
|
||
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts,
|
||
form_params => [
|
||
{ name => 'to_type',
|
||
value => $self->order->is_sales ? SALES_RECLAMATION_TYPE()
|
||
: PURCHASE_RECLAMATION_TYPE() },
|
||
],
|
||
}],
|
||
only_if =>$self->type_data->show_menu('save_and_reclamation')
|
||
],
|
||
action => [
|
||
t8('Save and Invoice'),
|
||
call => [ 'kivi.Order.save', { action => 'save_and_invoice',
|
||
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts },
|
||
],
|
||
call => [ 'kivi.Order.save', {
|
||
action => 'save_and_invoice',
|
||
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts,
|
||
}],
|
||
checks => [ 'kivi.Order.check_save_active_periodic_invoices',
|
||
@req_trans_cost_art, @req_cusordnumber,
|
||
],
|
||
... | ... | |
],
|
||
action => [
|
||
($has_invoice_for_advance_payment ? t8('Save and Further Invoice for Advance Payment') : t8('Save and Invoice for Advance Payment')),
|
||
call => [ 'kivi.Order.save', { action => 'save_and_invoice_for_advance_payment',
|
||
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts },
|
||
],
|
||
call => [ 'kivi.Order.save', {
|
||
action => 'save_and_invoice_for_advance_payment',
|
||
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts,
|
||
}],
|
||
checks => [ 'kivi.Order.check_save_active_periodic_invoices',
|
||
@req_trans_cost_art, @req_cusordnumber,
|
||
],
|
||
... | ... | |
],
|
||
action => [
|
||
t8('Save and Final Invoice'),
|
||
call => [ 'kivi.Order.save', { action => 'save_and_final_invoice',
|
||
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts },
|
||
],
|
||
call => [ 'kivi.Order.save', {
|
||
action => 'save_and_final_invoice',
|
||
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts,
|
||
}],
|
||
checks => [ 'kivi.Order.check_save_active_periodic_invoices',
|
||
@req_trans_cost_art, @req_cusordnumber,
|
||
],
|
||
... | ... | |
],
|
||
action => [
|
||
t8('Save and AP Transaction'),
|
||
call => [ 'kivi.Order.save', { action => 'save_and_ap_transaction',
|
||
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts },
|
||
],
|
||
call => [ 'kivi.Order.save', {
|
||
action => 'save_and_ap_transaction',
|
||
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts,
|
||
}],
|
||
only_if => $self->type_data->show_menu('save_and_ap_transaction'),
|
||
disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.') : undef,
|
||
],
|
||
... | ... | |
],
|
||
action => [
|
||
t8('Save and preview PDF'),
|
||
call => [ 'kivi.Order.save', { action => 'preview_pdf',
|
||
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts,
|
||
warn_on_reqdate => $::instance_conf->get_order_warn_no_deliverydate },
|
||
],
|
||
call => [ 'kivi.Order.save', {
|
||
action => 'preview_pdf',
|
||
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts,
|
||
warn_on_reqdate => $::instance_conf->get_order_warn_no_deliverydate,
|
||
}],
|
||
checks => [ @req_trans_cost_art, @req_cusordnumber ],
|
||
disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.')
|
||
: $is_final_version ? t8('This record is the final version. Please create a new sub-version') : undef,
|
||
... | ... | |
action => [
|
||
($is_final_version ? t8('E-mail') : t8('Save and E-mail')),
|
||
id => 'save_and_email_action',
|
||
call => [ 'kivi.Order.save', { action => 'save_and_show_email_dialog',
|
||
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts,
|
||
warn_on_reqdate => $::instance_conf->get_order_warn_no_deliverydate },
|
||
],
|
||
call => [ 'kivi.Order.save', {
|
||
action => 'save_and_show_email_dialog',
|
||
warn_on_duplicates => $::instance_conf->get_order_warn_duplicate_parts,
|
||
warn_on_reqdate => $::instance_conf->get_order_warn_no_deliverydate,
|
||
}],
|
||
disabled => !$may_edit_create ? t8('You do not have the permissions to access this function.')
|
||
: !$self->order->id ? t8('This object has not been saved yet.')
|
||
: undef,
|
SL/Controller/Reclamation.pm | ||
---|---|---|
use SL::DB::Invoice;
|
||
use SL::Model::Record;
|
||
use SL::DB::Order::TypeData qw(:types);
|
||
use SL::DB::DeliveryOrder::TypeData qw(:types);
|
||
use SL::DB::Reclamation::TypeData qw(:types);
|
||
|
||
use List::Util qw(first sum0);
|
||
... | ... | |
combobox => [
|
||
action => [
|
||
t8('Save'),
|
||
call => [
|
||
'kivi.Reclamation.save', 'save',
|
||
$::instance_conf->get_reclamation_warn_duplicate_parts,
|
||
$::instance_conf->get_reclamation_warn_no_reqdate,
|
||
],
|
||
call => [ 'kivi.Reclamation.save', {
|
||
action => 'save',
|
||
warn_on_duplicates => $::instance_conf->get_reclamation_warn_duplicate_parts,
|
||
warn_on_reqdate => $::instance_conf->get_reclamation_warn_no_reqdate,
|
||
}],
|
||
checks => [
|
||
['kivi.validate_form','#reclamation_form'],
|
||
],
|
||
],
|
||
action => [
|
||
t8('Save as new'),
|
||
call => [
|
||
'kivi.Reclamation.save', 'save_as_new',
|
||
$::instance_conf->get_reclamation_warn_duplicate_parts,
|
||
],
|
||
call => [ 'kivi.Reclamation.save', {
|
||
action => 'save_as_new',
|
||
warn_on_duplicates => $::instance_conf->get_reclamation_warn_duplicate_parts,
|
||
}],
|
||
disabled => !$self->reclamation->id ? t8('This object has not been saved yet.') : undef,
|
||
],
|
||
], # end of combobox "Save"
|
||
... | ... | |
],
|
||
action => [
|
||
t8('Save and Sales Reclamation'),
|
||
call => [
|
||
'kivi.Reclamation.save', 'save_and_sales_reclamation',
|
||
$::instance_conf->get_reclamation_warn_duplicate_parts,
|
||
$::instance_conf->get_reclamation_warn_no_reqdate,
|
||
],
|
||
call => [ 'kivi.Reclamation.save', {
|
||
action => 'save_and_new_record',
|
||
warn_on_duplicates => $::instance_conf->get_reclamation_warn_duplicate_parts,
|
||
warn_on_reqdate => $::instance_conf->get_reclamation_warn_no_reqdate,
|
||
form_params => [
|
||
{ name => 'to_type', value => SALES_RECLAMATION_TYPE() },
|
||
],
|
||
}],
|
||
only_if => $self->type_data->show_menu('save_and_sales_reclamation'),
|
||
],
|
||
action => [
|
||
t8('Save and Purchase Reclamation'),
|
||
call => [ 'kivi.Reclamation.purchase_reclamation_check_for_direct_delivery' ],
|
||
call => [ 'kivi.Reclamation.purchase_reclamation_check_for_direct_delivery', {
|
||
action => 'save_and_new_record',
|
||
warn_on_duplicates => $::instance_conf->get_reclamation_warn_duplicate_parts,
|
||
warn_on_reqdate => $::instance_conf->get_reclamation_warn_no_reqdate,
|
||
form_params => [
|
||
{ name => 'to_type', value => PURCHASE_RECLAMATION_TYPE() },
|
||
],
|
||
}
|
||
],
|
||
only_if => $self->type_data->show_menu('save_and_purchase_reclamation'),
|
||
],
|
||
action => [
|
||
t8('Save and Order'),
|
||
call => [
|
||
'kivi.Reclamation.save', 'save_and_order',
|
||
$::instance_conf->get_reclamation_warn_duplicate_parts,
|
||
$::instance_conf->get_reclamation_warn_no_reqdate,
|
||
],
|
||
call => [ 'kivi.Reclamation.save', {
|
||
action => 'save_and_new_record',
|
||
warn_on_duplicates => $::instance_conf->get_reclamation_warn_duplicate_parts,
|
||
warn_on_reqdate => $::instance_conf->get_reclamation_warn_no_reqdate,
|
||
form_params => [
|
||
{ name => 'to_type',
|
||
value => $self->reclamation->is_sales ? SALES_ORDER_TYPE()
|
||
: PURCHASE_ORDER_TYPE() },
|
||
],
|
||
}],
|
||
],
|
||
action => [
|
||
t8('Save and RMA Delivery Order'),
|
||
call => [
|
||
'kivi.Reclamation.save', 'save_and_delivery_order',
|
||
$::instance_conf->get_reclamation_warn_duplicate_parts,
|
||
$::instance_conf->get_reclamation_warn_no_reqdate,
|
||
],
|
||
call => [ 'kivi.Reclamation.save', {
|
||
action => 'save_and_new_record',
|
||
warn_on_duplicates => $::instance_conf->get_reclamation_warn_duplicate_parts,
|
||
warn_on_reqdate => $::instance_conf->get_reclamation_warn_no_reqdate,
|
||
form_params => [
|
||
{ name => 'to_type', value => RMA_DELIVERY_ORDER_TYPE() },
|
||
],
|
||
}],
|
||
only_if => $self->type_data->show_menu('save_and_rma_delivery_order'),
|
||
],
|
||
action => [
|
||
t8('Save and Supplier Delivery Order'),
|
||
call => [
|
||
'kivi.Reclamation.save', 'save_and_delivery_order',
|
||
$::instance_conf->get_reclamation_warn_duplicate_parts,
|
||
$::instance_conf->get_reclamation_warn_no_reqdate,
|
||
],
|
||
call => [ 'kivi.Reclamation.save', {
|
||
action => 'save_and_new_record',
|
||
warn_on_duplicates => $::instance_conf->get_reclamation_warn_duplicate_parts,
|
||
warn_on_reqdate => $::instance_conf->get_reclamation_warn_no_reqdate,
|
||
form_params => [
|
||
{ name => 'to_type', value => SUPPLIER_DELIVERY_ORDER_TYPE() },
|
||
],
|
||
}],
|
||
only_if => $self->type_data->show_menu('save_and_supplier_delivery_order'),
|
||
],
|
||
action => [
|
||
t8('Save and Credit Note'),
|
||
call => [
|
||
'kivi.Reclamation.save', 'save_and_credit_note',
|
||
$::instance_conf->get_reclamation_warn_duplicate_parts,
|
||
$::instance_conf->get_reclamation_warn_no_reqdate,
|
||
],
|
||
call => [ 'kivi.Reclamation.save', {
|
||
action => 'save_and_credit_note',
|
||
warn_on_duplicates => $::instance_conf->get_reclamation_warn_duplicate_parts,
|
||
warn_on_reqdate => $::instance_conf->get_reclamation_warn_no_reqdate,
|
||
form_params => [
|
||
{ name => 'to_type', value => 'credit_note' },
|
||
],
|
||
}],
|
||
only_if => $self->type_data->show_menu('save_and_credit_note'),
|
||
],
|
||
], # end of combobox "Workflow"
|
||
... | ... | |
],
|
||
action => [
|
||
t8('Save and preview PDF'),
|
||
call => [
|
||
'kivi.Reclamation.save', 'preview_pdf',
|
||
$::instance_conf->get_reclamation_warn_duplicate_parts,
|
||
$::instance_conf->get_reclamation_warn_no_reqdate,
|
||
],
|
||
call => [ 'kivi.Reclamation.save', {
|
||
action => 'preview_pdf',
|
||
warn_on_duplicates => $::instance_conf->get_reclamation_warn_duplicate_parts,
|
||
warn_on_reqdate => $::instance_conf->get_reclamation_warn_no_reqdate,
|
||
}],
|
||
],
|
||
action => [
|
||
t8('Save and print'),
|
||
... | ... | |
action => [
|
||
t8('Save and E-mail'),
|
||
id => 'save_and_email_action',
|
||
call => [
|
||
'kivi.Reclamation.save', 'save_and_show_email_dialog',
|
||
$::instance_conf->get_reclamation_warn_duplicate_parts,
|
||
$::instance_conf->get_reclamation_warn_no_reqdate,
|
||
],
|
||
call => [ 'kivi.Reclamation.save', {
|
||
action => 'save_and_show_email_dialog',
|
||
warn_on_duplicates => $::instance_conf->get_reclamation_warn_duplicate_parts,
|
||
warn_on_reqdate => $::instance_conf->get_reclamation_warn_no_reqdate,
|
||
}],
|
||
disabled => !$self->reclamation->id ? t8('This object has not been saved yet.') : undef,
|
||
],
|
||
action => [
|
js/kivi.DeliveryOrder.js | ||
---|---|---|
const action = params.action;
|
||
const warn_on_duplicates = params.warn_on_duplicates;
|
||
const warn_on_reqdate = params.warn_on_reqdate;
|
||
const form_params = params.form_params;
|
||
|
||
if (warn_on_duplicates && !ns.check_duplicate_parts()) return;
|
||
if (warn_on_reqdate && !ns.check_valid_reqdate()) return;
|
||
... | ... | |
var data = $('#order_form').serializeArray();
|
||
data.push({ name: 'action', value: 'DeliveryOrder/' + action });
|
||
|
||
if (form_params) {
|
||
if (Array.isArray(form_params)) {
|
||
form_params.forEach(function(item) {
|
||
data.push(item);
|
||
});
|
||
} else {
|
||
data.push(form_params);
|
||
}
|
||
}
|
||
|
||
$.post("controller.pl", data, kivi.eval_json_result);
|
||
};
|
||
|
js/kivi.Order.js | ||
---|---|---|
const action = params.action;
|
||
const warn_on_duplicates = params.warn_on_duplicates;
|
||
const warn_on_reqdate = params.warn_on_reqdate;
|
||
const back_to_caller = params.back_to_caller;
|
||
const form_params = params.form_params;
|
||
|
||
if (warn_on_duplicates && !ns.check_duplicate_parts()) return;
|
||
if (warn_on_reqdate && !ns.check_valid_reqdate()) return;
|
||
... | ... | |
var data = $('#order_form').serializeArray();
|
||
data.push({ name: 'action', value: 'Order/' + action });
|
||
|
||
if (back_to_caller) data.push({ name: 'back_to_caller', value: '1' });
|
||
if (form_params) {
|
||
if (Array.isArray(form_params)) {
|
||
form_params.forEach(function(item) {
|
||
data.push(item);
|
||
});
|
||
} else {
|
||
data.push(form_params);
|
||
}
|
||
}
|
||
|
||
$.post("controller.pl", data, kivi.eval_json_result);
|
||
};
|
js/kivi.Reclamation.js | ||
---|---|---|
}
|
||
};
|
||
|
||
ns.save = function(action, warn_on_duplicates, warn_on_reqdate) {
|
||
ns.save = function(params) {
|
||
if (!ns.check_cv()) return;
|
||
|
||
const action = params.action;
|
||
const warn_on_duplicates = params.warn_on_duplicates;
|
||
const warn_on_reqdate = params.warn_on_reqdate;
|
||
const form_params = params.form_params;
|
||
|
||
if (warn_on_duplicates && !ns.check_duplicate_parts()) return;
|
||
if (warn_on_reqdate && !ns.check_valid_reqdate()) return;
|
||
if (!ns.check_valid_reasons()) return;
|
||
|
||
var data = $('#reclamation_form').serializeArray();
|
||
data.push({ name: 'action', value: 'Reclamation/' + action });
|
||
if (form_params) {
|
||
if (Array.isArray(form_params)) {
|
||
form_params.forEach(function(item) {
|
||
data.push(item);
|
||
});
|
||
} else {
|
||
data.push(form_params);
|
||
}
|
||
}
|
||
|
||
$.post("controller.pl", data, kivi.eval_json_result);
|
||
};
|
||
... | ... | |
kivi.SalesPurchase.edit_custom_shipto();
|
||
};
|
||
|
||
ns.purchase_reclamation_check_for_direct_delivery = function() {
|
||
ns.purchase_reclamation_check_for_direct_delivery = function(save_params) {
|
||
if ($('#type').val() != 'sales_reclamation') {
|
||
return alert(kivi.t8("Error: This is not a sales reclamation."));
|
||
}
|
||
... | ... | |
empty = false;
|
||
shipto = $('#reclamation_shipto_id option:selected').text();
|
||
} else {
|
||
$('#shipto_inputs [id^="shipto"]').each(function(idx, elt) {
|
||
$('#shipto_inputs [id^="shipto"]').each(function(_idx, elt) {
|
||
if (!empty) return;
|
||
if (/^shipto_to_copy/.test($(elt).prop('id'))) return;
|
||
if (/^shiptocp_gender/.test($(elt).prop('id'))) return;
|
||
... | ... | |
}
|
||
});
|
||
var shipto_elements = [];
|
||
$([$('#shiptoname').val(), $('#shiptostreet').val(), $('#shiptozipcode').val(), $('#shiptocity').val()]).each(function(idx, elt) {
|
||
$([$('#shiptoname').val(), $('#shiptostreet').val(), $('#shiptozipcode').val(), $('#shiptocity').val()]).each(function(_idx, elt) {
|
||
if (elt !== '') shipto_elements.push(elt);
|
||
});
|
||
shipto = shipto_elements.join('; ');
|
||
}
|
||
|
||
if (!empty) {
|
||
ns.direct_delivery_dialog(shipto);
|
||
ns.direct_delivery_dialog(shipto, save_params);
|
||
} else {
|
||
ns.save('save_and_purchase_reclamation');
|
||
ns.save(save_params);
|
||
}
|
||
};
|
||
|
||
ns.direct_delivery_callback = function(accepted) {
|
||
ns.direct_delivery_callback = function(accepted, save_params) {
|
||
$('#direct-delivery-dialog').dialog('close');
|
||
|
||
if (accepted) {
|
||
$('<input type="hidden" name="use_shipto">').appendTo('#reclamation_form').val('1');
|
||
}
|
||
|
||
ns.save('save_and_purchase_reclamation');
|
||
ns.save(save_params);
|
||
};
|
||
|
||
ns.direct_delivery_dialog = function(shipto) {
|
||
ns.direct_delivery_dialog = function(shipto, save_params) {
|
||
$('#direct-delivery-dialog').remove();
|
||
|
||
var save_params_string = '{';
|
||
if (save_params) {
|
||
const action = save_params.action;
|
||
const warn_on_duplicates = save_params.warn_on_duplicates;
|
||
const warn_on_reqdate = save_params.warn_on_reqdate;
|
||
const form_params = save_params.form_params;
|
||
|
||
|
||
console.log(form_params)
|
||
console.log(Array.isArray(form_params))
|
||
if (action)
|
||
save_params_string += `'action':'${action}',`;
|
||
if (warn_on_duplicates)
|
||
save_params_string += `'warn_on_duplicates':'${warn_on_duplicates}',`;
|
||
if (warn_on_reqdate)
|
||
save_params_string += `'warn_on_reqdate':'${warn_on_reqdate}',`;
|
||
if (Array.isArray(form_params)) {
|
||
save_params_string += 'form_params:['
|
||
form_params.forEach(function(item) {
|
||
save_params_string += `{'name':'${item.name}','value':'${item.value}'},`;
|
||
});
|
||
save_params_string += ']';
|
||
} else {
|
||
save_params_string += `'form_params':{'name':'${form_params.name}','value':'${form_params.value}'}`;
|
||
}
|
||
}
|
||
save_params_string += '}';
|
||
|
||
console.log(save_params_string);
|
||
|
||
var text1 = kivi.t8('You have entered or selected the following shipping address for this customer:');
|
||
var text2 = kivi.t8('Do you want to carry this shipping address over to the new purchase reclamation so that the vendor can deliver the goods directly to your customer?');
|
||
var html = '<div id="direct-delivery-dialog"><p>' + text1 + '</p><p>' + shipto + '</p><p>' + text2 + '</p>';
|
||
html = html + '<hr><p>';
|
||
html = html + '<input type="button" value="' + kivi.t8('Yes') + '" size="30" onclick="kivi.Reclamation.direct_delivery_callback(true)">';
|
||
html = html + '<input type="button" value="' + kivi.t8('Yes') + '" size="30" onclick="kivi.Reclamation.direct_delivery_callback(true,' + save_params_string + ')">';
|
||
html = html + ' ';
|
||
html = html + '<input type="button" value="' + kivi.t8('No') + '" size="30" onclick="kivi.Reclamation.direct_delivery_callback(false)">';
|
||
html = html + '<input type="button" value="' + kivi.t8('No') + '" size="30" onclick="kivi.Reclamation.direct_delivery_callback(false,' + save_params_string + ')">';
|
||
html = html + '</p></div>';
|
||
$(html).hide().appendTo('#reclamation_form');
|
||
|
Auch abrufbar als: Unified diff
Records: js-save Aufrufe angepasst und vereinheitlicht