Lines 98-112
sub cashup_summary {
Link Here
|
98 |
|
98 |
|
99 |
my $outgoing_transactions = $self->register->accountlines->search( |
99 |
my $outgoing_transactions = $self->register->accountlines->search( |
100 |
{ %{$conditions}, credit_type_code => undef }, |
100 |
{ %{$conditions}, credit_type_code => undef }, |
101 |
{ select => 'accountlines_id' } ); |
101 |
); |
102 |
my $income_transactions = $self->register->accountlines->search( |
102 |
my $income_transactions = $self->register->accountlines->search( |
103 |
{ %{$conditions}, debit_type_code => undef }, |
103 |
{ %{$conditions}, debit_type_code => undef }, |
104 |
{ select => 'accountlines_id' } ); |
104 |
); |
105 |
|
105 |
|
106 |
my $income_summary = Koha::Account::Offsets->search( |
106 |
my $income_summary = Koha::Account::Offsets->search( |
107 |
{ |
107 |
{ |
108 |
'me.credit_id' => |
108 |
'me.credit_id' => |
109 |
{ '-in' => $income_transactions->_resultset->as_query }, |
109 |
{ '-in' => $income_transactions->_resultset->get_column('accountlines_id')->as_query }, |
110 |
'me.debit_id' => { '!=' => undef } |
110 |
'me.debit_id' => { '!=' => undef } |
111 |
}, |
111 |
}, |
112 |
{ |
112 |
{ |
Lines 120-126
sub cashup_summary {
Link Here
|
120 |
my $outgoing_summary = Koha::Account::Offsets->search( |
120 |
my $outgoing_summary = Koha::Account::Offsets->search( |
121 |
{ |
121 |
{ |
122 |
'me.debit_id' => |
122 |
'me.debit_id' => |
123 |
{ '-in' => $outgoing_transactions->_resultset->as_query }, |
123 |
{ '-in' => $outgoing_transactions->_resultset->get_column('accountlines_id')->as_query }, |
124 |
'me.credit_id' => { '!=' => undef } |
124 |
'me.credit_id' => { '!=' => undef } |
125 |
}, |
125 |
}, |
126 |
{ |
126 |
{ |
Lines 145-164
sub cashup_summary {
Link Here
|
145 |
credit_type => { description => $_->get_column('credit_description') } |
145 |
credit_type => { description => $_->get_column('credit_description') } |
146 |
} |
146 |
} |
147 |
} $outgoing_summary->as_list; |
147 |
} $outgoing_summary->as_list; |
|
|
148 |
|
148 |
$summary = { |
149 |
$summary = { |
149 |
from_date => $previous ? $previous->timestamp : undef, |
150 |
from_date => $previous ? $previous->timestamp : undef, |
150 |
to_date => $self->timestamp, |
151 |
to_date => $self->timestamp, |
151 |
income => \@income, |
152 |
income => \@income, |
152 |
outgoing => \@outgoing, |
153 |
outgoing => \@outgoing, |
153 |
total => ( $outgoing_transactions->total * -1 ) + |
154 |
income_transactions => $income_transactions, |
154 |
( $income_transactions->total * -1 ), |
155 |
outgoing_transactions => $outgoing_transactions, |
155 |
bankable => ( |
|
|
156 |
$outgoing_transactions->search( { payment_type => 'CASH' } ) |
157 |
->total * -1 |
158 |
) + ( |
159 |
$income_transactions->search( { payment_type => 'CASH' } )->total * |
160 |
-1 |
161 |
) |
162 |
}; |
156 |
}; |
163 |
|
157 |
|
164 |
return $summary; |
158 |
return $summary; |