+sub setup_sepa_add_transfer_action_bar {
+ my (%params) = @_;
+
+ for my $bar ($::request->layout->get('actionbar')) {
+ $bar->add(
+ action => [
+ t8('Step 2'),
+ submit => [ '#form', { action => "bank_transfer_create" } ],
+ accesskey => 'enter',
+ checks => [ [ 'kivi.check_if_entries_selected', '[name="ids[]"]' ] ],
+ ],
+ );
+ }
+}
+
+sub setup_sepa_create_transfer_action_bar {
+ my (%params) = @_;
+
+ for my $bar ($::request->layout->get('actionbar')) {
+ $bar->add(
+ action => [
+ t8('Create'),
+ submit => [ '#form', { action => "bank_transfer_create" } ],
+ accesskey => 'enter',
+ tooltip => $params{is_vendor} ? t8('Create bank transfer') : t8('Create bank collection'),
+ ],
+ action => [
+ t8('Back'),
+ call => [ 'kivi.history_back' ],
+ ],
+ );
+ }
+}
+
+sub setup_sepa_search_transfer_action_bar {
+ my (%params) = @_;
+
+ for my $bar ($::request->layout->get('actionbar')) {
+ $bar->add(
+ action => [
+ t8('Search'),
+ submit => [ '#form', { action => 'bank_transfer_list' } ],
+ accesskey => 'enter',
+ ],
+ );
+ }
+}
+
+sub setup_sepa_list_transfers_action_bar {
+ my (%params) = @_;
+
+ return unless $params{show_buttons};
+
+ for my $bar ($::request->layout->get('actionbar')) {
+ $bar->add(
+ combobox => [
+ action => [ t8('Actions') ],
+ action => [
+ t8('SEPA XML download'),
+ submit => [ '#form', { action => 'bank_transfer_download_sepa_xml' } ],
+ checks => [ [ 'kivi.check_if_entries_selected', '[name="ids[]"]' ] ],
+ ],
+ action => [
+ t8('Post payments'),
+ submit => [ '#form', { action => 'bank_transfer_edit' } ],
+ checks => [ [ 'kivi.check_if_entries_selected', '[name="ids[]"]' ] ],
+ ],
+ action => [
+ t8('Mark as closed'),
+ submit => [ '#form', { action => 'bank_transfer_mark_as_closed' } ],
+ checks => [ [ 'kivi.check_if_entries_selected', '[name="ids[]"]' ] ],
+ confirm => [ $params{is_vendor} ? t8('Do you really want to close the selected SEPA exports? No payment will be recorded for bank transfers that haven\'t been marked as executed yet.')
+ : t8('Do you really want to close the selected SEPA exports? No payment will be recorded for bank collections that haven\'t been marked as executed yet.') ],
+ ],
+ action => [
+ t8('Undo SEPA exports'),
+ submit => [ '#form', { action => 'bank_transfer_undo_sepa_xml' } ],
+ checks => [ [ 'kivi.check_if_entries_selected', '[name="ids[]"]' ] ],
+ confirm => [ t8('Do you really want to undo the selected SEPA exports? You have to reassign the export again.') ],
+ ],
+ ], # end of combobox "Actions"
+ );
+ }
+}
+
+sub setup_sepa_edit_transfer_action_bar {
+ my (%params) = @_;
+
+ for my $bar ($::request->layout->get('actionbar')) {
+ $bar->add(
+ action => [
+ t8('Post'),
+ submit => [ '#form', { action => 'bank_transfer_post_payments' } ],
+ accesskey => 'enter',
+ tooltip => t8('Post payments for selected invoices'),
+ checks => [ [ 'kivi.check_if_entries_selected', '[name="ids[]"]' ] ],
+ disabled => $params{show_post_payments_button} ? undef : t8('All payments have already been posted.'),
+ ],
+ action => [
+ t8('Payment list'),
+ submit => [ '#form', { action => 'bank_transfer_payment_list_as_pdf' } ],
+ accesskey => 'enter',
+ tooltip => t8('Download list of payments as PDF'),
+ checks => [ [ 'kivi.check_if_entries_selected', '[name="ids[]"]' ] ],
+ disabled => $params{show_post_payments_button} ? t8('All payments must be posted before the payment list can be downloaded.') : undef,
+ ],
+ );
+ }
+}
+