- $bar->add_actions([ t8('Update'),
- submit => [ '#form', { action_update => 1 } ],
- id => 'update_button',
- accesskey => 'enter',
- ]);
-
- $bar->add_actions("combobox");
- $bar->actions->[-1]->add_actions([ t8('Save'),
- submit => [ '#form', { action_save => 1 } ],
- checks => [ @req_trans_desc, @warn_p_invoice ],
- confirm => t8('Missing transport cost: #1 Are you sure?', $tpca_remainder),
- ]);
- $bar->actions->[-1]->add_actions([ t8('Save as new'),
- submit => [ '#form', { action_save_as_new => 1 } ],
- checks => [ @req_trans_desc ],
- disabled => !$form->{id} ? t8('This record has not been saved yet.') : undef,
- ]);
- $bar->actions->[-1]->add_actions([ t8('Save and Close'),
- submit => [ '#form', { action_save_and_close => 1 } ],
- checks => [ @req_trans_desc, @warn_p_invoice ],
- confirm => t8('Missing transport cost: #1 Are you sure?', $tpca_remainder),
- ]);
- $bar->add_actions([ t8('Delete'),
- submit => [ '#form', { action_delete => 1 } ],
- confirm => t8('Do you really want to delete this object?'),
- disabled => !$form->{id} ? t8('This record has not been saved yet.')
- : ( ($params{is_sales_ord} && !$::instance_conf->get_sales_order_show_delete)
- || ($params{is_pur_ord} && !$::instance_conf->get_purchase_order_show_delete)) ? t8('Deleting this type of record has been disabled in the configuration.')
- : undef,
- ]);
+ $bar->add(
+ action => [
+ t8('Update'),
+ submit => [ '#form', { action => "update" } ],
+ id => 'update_button',
+ accesskey => 'enter',
+ ],
+
+ combobox => [
+ action => [
+ t8('Save'),
+ submit => [ '#form', { action => "save" } ],
+ checks => [ @req_trans_desc, @req_trans_cost_art, @warn_p_invoice ],
+ ],
+ action => [
+ t8('Save as new'),
+ submit => [ '#form', { action => "save_as_new" } ],
+ checks => [ @req_trans_desc, @req_trans_cost_art ],
+ disabled => !$form->{id} ? t8('This record has not been saved yet.') : undef,
+ ],
+ action => [
+ t8('Save and Close'),
+ submit => [ '#form', { action => "save_and_close" } ],
+ checks => [ @req_trans_desc, @req_trans_cost_art, @warn_p_invoice ],
+ ],
+ action => [
+ t8('Delete'),
+ submit => [ '#form', { action => "delete" } ],
+ confirm => t8('Do you really want to delete this object?'),
+ disabled => !$form->{id} ? t8('This record has not been saved yet.')
+ : ( ($params{is_sales_ord} && !$::instance_conf->get_sales_order_show_delete)
+ || ($params{is_pur_ord} && !$::instance_conf->get_purchase_order_show_delete)) ? t8('Deleting this type of record has been disabled in the configuration.')
+ : undef,
+ ],
+ ], # end of combobox "Save"
+
+ 'separator',
+
+ combobox => [
+ action => [ t8('Workflow') ],
+ (action => [
+ t8('Sales Order'),
+ submit => [ '#form', { action => "sales_order" } ],
+ disabled => !$form->{id} ? t8('This record has not been saved yet.') : undef,
+ ]) x !!$params{is_sales_quo},
+ (action => [
+ t8('Purchase Order'),
+ submit => [ '#form', { action => "sales_order" } ],
+ disabled => !$form->{id} ? t8('This record has not been saved yet.') : undef,
+ ]) x !!$params{is_req_quo},
+ (action => [
+ t8('Delivery Order'),
+ submit => [ '#form', { action => "delivery_order" } ],
+ disabled => !$form->{id} ? t8('This record has not been saved yet.') : undef,
+ ]) x ($params{is_sales_ord} || $params{is_pur_ord}),
+ (action => [
+ t8('Invoice'),
+ submit => [ '#form', { action => "invoice" } ],
+ disabled => !$form->{id} ? t8('This record has not been saved yet.') : undef,
+ ]) x !!$allow_invoice,
+ action => [
+ t8('Quotation'),
+ submit => [ '#form', { action => "quotation" } ],
+ disabled => !$form->{id} ? t8('This record has not been saved yet.') : undef,
+ ],
+ action => [
+ t8('Request for Quotation'),
+ submit => [ '#form', { action => "reqest_for_quotation" } ],
+ disabled => !$form->{id} ? t8('This record has not been saved yet.') : undef,
+ ],
+ ], # end of combobox "Workflow"
+
+ combobox => [
+ action => [ t8('Export') ],
+ action => [
+ t8('Print'),
+ call => [ 'kivi.SalesPurchase.show_print_dialog' ],
+ checks => [ @req_trans_desc ],
+ ],
+ action => [
+ t8('E Mail'),
+ call => [ 'kivi.SalesPurchase.show_email_dialog' ],
+ checks => [ @req_trans_desc ],
+ ],
+ ], #end of combobox "Export"
+
+ combobox => [
+ action => [ t8('more') ],
+ action => [
+ t8('History'),
+ call => [ 'set_history_window', $form->{id} * 1, 'id' ],
+ disabled => !$form->{id} ? t8('This record has not been saved yet.') : undef,
+ ],
+ action => [
+ t8('Follow-Up'),
+ call => [ 'follow_up_window' ],
+ disabled => !$form->{id} ? t8('This record has not been saved yet.') : undef,
+ ],
+ ], # end of combobox "more"
+ );
+ }
+}