From ff87a03f94d352b55271ae2355498f71a8cd938a Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 3 Nov 2020 11:40:57 +0100 Subject: [PATCH] Bug 26172: Replace _result[set] calls Signed-off-by: Jonathan Druart --- Koha/Cash/Register/Action.pm | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Koha/Cash/Register/Action.pm b/Koha/Cash/Register/Action.pm index 157ee7daf6..759bd98ccc 100644 --- a/Koha/Cash/Register/Action.pm +++ b/Koha/Cash/Register/Action.pm @@ -81,16 +81,14 @@ sub cashup_summary { order_by => { '-desc' => [ 'timestamp', 'id' ] }, rows => 1 } - ); - - my $previous = $prior_cashup->single; + )->single; my $conditions = - $previous + $prior_cashup ? { 'date' => { '-between' => - [ $previous->_result->get_column('timestamp'), $self->timestamp ] + [ $prior_cashup->timestamp, $self->timestamp ] } } : { 'date' => { '<' => $self->timestamp } }; @@ -105,7 +103,7 @@ sub cashup_summary { my $income_summary = Koha::Account::Offsets->search( { 'me.credit_id' => - { '-in' => $income_transactions->_resultset->get_column('accountlines_id')->as_query }, + { '-in' => [ $income_transactions->get_column('accountlines_id') ] }, 'me.debit_id' => { '!=' => undef } }, { @@ -120,7 +118,7 @@ sub cashup_summary { my $outgoing_summary = Koha::Account::Offsets->search( { 'me.debit_id' => - { '-in' => $outgoing_transactions->_resultset->get_column('accountlines_id')->as_query }, + { '-in' => [ $outgoing_transactions->get_column('accountlines_id') ] }, 'me.credit_id' => { '!=' => undef } }, { @@ -148,7 +146,7 @@ sub cashup_summary { } $outgoing_summary->as_list; $summary = { - from_date => $previous ? $previous->timestamp : undef, + from_date => $prior_cashup? $prior_cashup->timestamp : undef, to_date => $self->timestamp, income => \@income, outgoing => \@outgoing, -- 2.39.5