|
Lines 44-60
subtest 'total_outstanding() tests' => sub {
Link Here
|
| 44 |
my $amount_5 = 500; |
44 |
my $amount_5 = 500; |
| 45 |
|
45 |
|
| 46 |
my $offset_1 = Koha::Account::Offset->new( |
46 |
my $offset_1 = Koha::Account::Offset->new( |
| 47 |
{ type => 'Fine', amount => $amount_1, credit_id => $line->id } )->store; |
47 |
{ type => 'OVERDUE', amount => $amount_1, credit_id => $line->id } )->store; |
| 48 |
my $offset_2 = Koha::Account::Offset->new( |
48 |
my $offset_2 = Koha::Account::Offset->new( |
| 49 |
{ type => 'Fine', amount => $amount_2, credit_id => $line->id } )->store; |
49 |
{ type => 'OVERDUE', amount => $amount_2, credit_id => $line->id } )->store; |
| 50 |
my $offset_3 = Koha::Account::Offset->new( |
50 |
my $offset_3 = Koha::Account::Offset->new( |
| 51 |
{ type => 'Payment', amount => $amount_3, credit_id => $line->id } )->store; |
51 |
{ type => 'Payment', amount => $amount_3, credit_id => $line->id } )->store; |
| 52 |
my $offset_4 = Koha::Account::Offset->new( |
52 |
my $offset_4 = Koha::Account::Offset->new( |
| 53 |
{ type => 'Payment', amount => $amount_4, credit_id => $line->id } )->store; |
53 |
{ type => 'Payment', amount => $amount_4, credit_id => $line->id } )->store; |
| 54 |
my $offset_5 = Koha::Account::Offset->new( |
54 |
my $offset_5 = Koha::Account::Offset->new( |
| 55 |
{ type => 'Fine', amount => $amount_5, credit_id => $line->id } )->store; |
55 |
{ type => 'OVERDUE', amount => $amount_5, credit_id => $line->id } )->store; |
| 56 |
|
56 |
|
| 57 |
my $debits = Koha::Account::Offsets->search( { type => 'Fine', credit_id => $line->id } ); |
57 |
my $debits = Koha::Account::Offsets->search( { type => 'OVERDUE', credit_id => $line->id } ); |
| 58 |
is( $debits->total, $amount_1 + $amount_2 + $amount_5 ); |
58 |
is( $debits->total, $amount_1 + $amount_2 + $amount_5 ); |
| 59 |
|
59 |
|
| 60 |
my $credits = Koha::Account::Offsets->search( { type => 'Payment', credit_id => $line->id } ); |
60 |
my $credits = Koha::Account::Offsets->search( { type => 'Payment', credit_id => $line->id } ); |
| 61 |
- |
|
|