|
Lines 129-135
subtest fill_holds_at_checkout => sub {
Link Here
|
| 129 |
|
129 |
|
| 130 |
subtest "FeePayment->pay tests" => sub { |
130 |
subtest "FeePayment->pay tests" => sub { |
| 131 |
|
131 |
|
| 132 |
plan tests => 5; |
132 |
plan tests => 6; |
|
|
133 |
|
| 134 |
my $inst_id = $builder->build_object( { class => 'Koha::Libraries' } )->id; |
| 133 |
|
135 |
|
| 134 |
# Create a borrower and add some outstanding debts to their account |
136 |
# Create a borrower and add some outstanding debts to their account |
| 135 |
my $patron = $builder->build( { source => 'Borrower' } ); |
137 |
my $patron = $builder->build( { source => 'Borrower' } ); |
|
Lines 152-158
subtest "FeePayment->pay tests" => sub {
Link Here
|
| 152 |
my $pay_type = '00'; # 00 - Cash, 01 - VISA, 02 - Creditcard |
154 |
my $pay_type = '00'; # 00 - Cash, 01 - VISA, 02 - Creditcard |
| 153 |
my $ok = $trans->pay( |
155 |
my $ok = $trans->pay( |
| 154 |
$patron->{borrowernumber}, 100, $pay_type, $debt1->id, 0, |
156 |
$patron->{borrowernumber}, 100, $pay_type, $debt1->id, 0, |
| 155 |
0 |
157 |
0, undef, $inst_id |
| 156 |
); |
158 |
); |
| 157 |
ok( $ok, "FeePayment transaction succeeded" ); |
159 |
ok( $ok, "FeePayment transaction succeeded" ); |
| 158 |
$debt1->discard_changes; |
160 |
$debt1->discard_changes; |
|
Lines 163-169
subtest "FeePayment->pay tests" => sub {
Link Here
|
| 163 |
my $offsets = Koha::Account::Offsets->search( { debit_id => $debt1->id, credit_id => { '!=' => undef } } ); |
165 |
my $offsets = Koha::Account::Offsets->search( { debit_id => $debt1->id, credit_id => { '!=' => undef } } ); |
| 164 |
is( $offsets->count, 1, "FeePayment produced an offset line correctly" ); |
166 |
is( $offsets->count, 1, "FeePayment produced an offset line correctly" ); |
| 165 |
my $credit = $offsets->next->credit; |
167 |
my $credit = $offsets->next->credit; |
| 166 |
is( $credit->payment_type, 'SIP00', "Payment type was set correctly" ); |
168 |
is( $credit->payment_type, 'SIP00', "Payment type was set correctly" ); |
|
|
169 |
is( $credit->branchcode, $inst_id, "Branchcode was set correctly" ); |
| 167 |
}; |
170 |
}; |
| 168 |
|
171 |
|
| 169 |
subtest cancel_hold => sub { |
172 |
subtest cancel_hold => sub { |
| 170 |
- |
|
|