X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FReconciliation.pm;h=76127b1c1c93ebc1b65c563f03926e9080120036;hb=bc89ebf428c7bde2205b31c5c9abb66879e673e4;hp=1bfd3905df43ba5db0d9228555034c87b3da775f;hpb=5eaed5899d7c965d54fa932f37a168f450bd4002;p=kivitendo-erp.git diff --git a/SL/Controller/Reconciliation.pm b/SL/Controller/Reconciliation.pm index 1bfd3905d..76127b1c1 100644 --- a/SL/Controller/Reconciliation.pm +++ b/SL/Controller/Reconciliation.pm @@ -29,6 +29,7 @@ __PACKAGE__->run_before('_bank_account'); sub action_search { my ($self) = @_; + $self->setup_search_action_bar; $self->render('reconciliation/search'); } @@ -41,6 +42,7 @@ sub action_reconciliation { $self->_get_balances; + $self->setup_reconciliation_action_bar; $self->render('reconciliation/form', ui_tab => scalar(@{$self->{PROPOSALS}}) > 0?1:0, title => t8('Reconciliation')); @@ -86,7 +88,7 @@ sub action_update_reconciliation_table { my $output = $self->render('reconciliation/assigning_table', { output => 0 }, bt_sum => $::form->format_amount(\%::myconfig, $self->{bt_sum}, 2), bb_sum => $::form->format_amount(\%::myconfig, -1 * $self->{bb_sum}, 2), - show_button => !@errors + errors => @errors, ); my %result = ( html => $output ); @@ -342,7 +344,7 @@ sub _get_elements_and_validate { } if ($::form->round_amount($bt_sum + $bb_sum, 2) != 0) { - push @errors, t8('Out of balance!'); + push @errors, t8('Out of balance!'), t8('Sum of bank #1 and sum of bookings #2',$bt_sum, $bb_sum); } $self->{ELEMENTS} = \@elements; @@ -358,7 +360,9 @@ sub _reconcile { # 1. step: set AccTrans and BankTransactions to 'cleared' foreach my $element (@{ $self->{ELEMENTS} }) { $element->cleared('1'); - $element->invoice_amount($element->amount) if $element->isa('SL::DB::BankTransaction'); + # veto either invoice_amount is fully assigned or not! No state tricks in later workflow! + # invoice_amount should be a distinct sign, that some bookings were really made from a bank transaction + # $element->invoice_amount($element->amount) if $element->isa('SL::DB::BankTransaction'); $element->save; } @@ -620,4 +624,32 @@ sub init_BANK_ACCOUNTS { SL::DB::Manager::BankAccount->get_all_sorted( query => [ obsolete => 0 ] ); } +sub setup_search_action_bar { + my ($self, %params) = @_; + + for my $bar ($::request->layout->get('actionbar')) { + $bar->add( + action => [ + t8('Show'), + submit => [ '#search_form', { action => 'Reconciliation/reconciliation' } ], + accesskey => 'enter', + ], + ); + } +} + +sub setup_reconciliation_action_bar { + my ($self, %params) = @_; + + for my $bar ($::request->layout->get('actionbar')) { + $bar->add( + action => [ + t8('Filter'), + call => [ 'filter_table' ], + accesskey => 'enter', + ], + ); + } +} + 1;