View | Details | Raw Unified | Return to bug 26172
Collapse All | Expand All

(-)a/Koha/Cash/Register/Action.pm (-9 / +6 lines)
Lines 81-96 sub cashup_summary { Link Here
81
            order_by => { '-desc' => [ 'timestamp', 'id' ] },
81
            order_by => { '-desc' => [ 'timestamp', 'id' ] },
82
            rows     => 1
82
            rows     => 1
83
        }
83
        }
84
    );
84
    )->single;
85
86
    my $previous = $prior_cashup->single;
87
85
88
    my $conditions =
86
    my $conditions =
89
      $previous
87
      $prior_cashup
90
      ? {
88
      ? {
91
        'date' => {
89
        'date' => {
92
            '-between' =>
90
            '-between' =>
93
              [ $previous->_result->get_column('timestamp'), $self->timestamp ]
91
              [ $prior_cashup->timestamp, $self->timestamp ]
94
        }
92
        }
95
      }
93
      }
96
      : { 'date' => { '<' => $self->timestamp } };
94
      : { 'date' => { '<' => $self->timestamp } };
Lines 105-111 sub cashup_summary { Link Here
105
    my $income_summary = Koha::Account::Offsets->search(
103
    my $income_summary = Koha::Account::Offsets->search(
106
        {
104
        {
107
            'me.credit_id' =>
105
            'me.credit_id' =>
108
              { '-in' => $income_transactions->_resultset->get_column('accountlines_id')->as_query },
106
              { '-in' => [ $income_transactions->get_column('accountlines_id') ] },
109
            'me.debit_id' => { '!=' => undef }
107
            'me.debit_id' => { '!=' => undef }
110
        },
108
        },
111
        {
109
        {
Lines 120-126 sub cashup_summary { Link Here
120
    my $outgoing_summary = Koha::Account::Offsets->search(
118
    my $outgoing_summary = Koha::Account::Offsets->search(
121
        {
119
        {
122
            'me.debit_id' =>
120
            'me.debit_id' =>
123
              { '-in' => $outgoing_transactions->_resultset->get_column('accountlines_id')->as_query },
121
              { '-in' => [ $outgoing_transactions->get_column('accountlines_id') ] },
124
            'me.credit_id' => { '!=' => undef }
122
            'me.credit_id' => { '!=' => undef }
125
        },
123
        },
126
        {
124
        {
Lines 148-154 sub cashup_summary { Link Here
148
    } $outgoing_summary->as_list;
146
    } $outgoing_summary->as_list;
149
147
150
    $summary = {
148
    $summary = {
151
        from_date             => $previous ? $previous->timestamp : undef,
149
        from_date             => $prior_cashup? $prior_cashup->timestamp : undef,
152
        to_date               => $self->timestamp,
150
        to_date               => $self->timestamp,
153
        income                => \@income,
151
        income                => \@income,
154
        outgoing              => \@outgoing,
152
        outgoing              => \@outgoing,
155
- 

Return to bug 26172