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

(-)a/Koha/Account/Offsets.pm (-1 / +44 lines)
Lines 60-65 sub total { Link Here
60
      : 0;
60
      : 0;
61
}
61
}
62
62
63
=head3 filter_by_non_reversable
64
65
=cut
66
67
sub filter_by_non_reversable {
68
    my ($self) = @_;
69
70
    my $me = $self->_resultset()->current_source_alias;
71
72
    my $where = {
73
        debit_id                  => { '!='      => undef },
74
        credit_id                 => { '!='      => undef },
75
        type                      => 'APPLY',
76
        'credit.credit_type_code' => [ 'WRITEOFF', 'DISCOUNT', 'CANCELLATION' ],
77
        'credit.status'           => [ { '!=' => 'VOID' }, undef ],
78
        $me . '.amount'           => { '<' => 0 }
79
    };
80
    my $attr = { join => 'credit' };
81
82
    return $self->search( $where, $attr );
83
}
84
85
=head3 filter_by_reversable
86
87
=cut
88
89
sub filter_by_reversable {
90
    my ($self) = @_;
91
92
    my $me = $self->_resultset()->current_source_alias;
93
94
    my $where = {
95
        debit_id                  => { '!='      => undef },
96
        credit_id                 => { '!='      => undef },
97
        type                      => 'APPLY',
98
        'credit.credit_type_code' => { -not_in => [ 'WRITEOFF', 'DISCOUNT', 'CANCELLATION' ] },
99
        'credit.status'           => [ { '!=' => 'VOID' }, undef ],
100
        $me . '.amount'           => { '<' => 0 }
101
    };
102
    my $attr = { join => 'credit' };
103
104
    return $self->search( $where, $attr );
105
}
106
63
=head2 Internal methods
107
=head2 Internal methods
64
108
65
=head3 _type
109
=head3 _type
66
- 

Return to bug 29757