@@ -, +, @@ --- Koha/Cash/Register/Action.pm | 28 ++++++++----------- .../prog/en/modules/pos/register.tt | 8 ++++-- 2 files changed, 16 insertions(+), 20 deletions(-) --- a/Koha/Cash/Register/Action.pm +++ a/Koha/Cash/Register/Action.pm @@ -98,15 +98,15 @@ sub cashup_summary { my $outgoing_transactions = $self->register->accountlines->search( { %{$conditions}, credit_type_code => undef }, - { select => 'accountlines_id' } ); + ); my $income_transactions = $self->register->accountlines->search( { %{$conditions}, debit_type_code => undef }, - { select => 'accountlines_id' } ); + ); my $income_summary = Koha::Account::Offsets->search( { 'me.credit_id' => - { '-in' => $income_transactions->_resultset->as_query }, + { '-in' => $income_transactions->_resultset->get_column('accountlines_id')->as_query }, 'me.debit_id' => { '!=' => undef } }, { @@ -120,7 +120,7 @@ sub cashup_summary { my $outgoing_summary = Koha::Account::Offsets->search( { 'me.debit_id' => - { '-in' => $outgoing_transactions->_resultset->as_query }, + { '-in' => $outgoing_transactions->_resultset->get_column('accountlines_id')->as_query }, 'me.credit_id' => { '!=' => undef } }, { @@ -145,20 +145,14 @@ sub cashup_summary { credit_type => { description => $_->get_column('credit_description') } } } $outgoing_summary->as_list; + $summary = { - from_date => $previous ? $previous->timestamp : undef, - to_date => $self->timestamp, - income => \@income, - outgoing => \@outgoing, - total => ( $outgoing_transactions->total * -1 ) + - ( $income_transactions->total * -1 ), - bankable => ( - $outgoing_transactions->search( { payment_type => 'CASH' } ) - ->total * -1 - ) + ( - $income_transactions->search( { payment_type => 'CASH' } )->total * - -1 - ) + from_date => $previous ? $previous->timestamp : undef, + to_date => $self->timestamp, + income => \@income, + outgoing => \@outgoing, + income_transactions => $income_transactions, + outgoing_transactions => $outgoing_transactions, }; return $summary; --- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/register.tt @@ -330,12 +330,14 @@ Total - [% register.last_cashup.cashup_summary.total | $Price %] + [% ( register.last_cashup.cashup_summary.outgoing_transactions.total + register.last_cashup.cashup_summary.income_transactions.total) * -1 | $Price %] + [% FOREACH pt IN payment_types %] - Bankable - [% register.last_cashup.cashup_summary.bankable | $Price %] + [% pt.lib %] + [% ( register.last_cashup.cashup_summary.outgoing_transactions.total( payment_type => pt.authorised_value ) + register.last_cashup.cashup_summary.income_transactions.total( payment_type => pt.authorised_value )) * -1 | $Price %] + [% END %] --