Lines 1071-1077
subtest "payout() tests" => sub {
Link Here
|
1071 |
|
1071 |
|
1072 |
subtest "reduce() tests" => sub { |
1072 |
subtest "reduce() tests" => sub { |
1073 |
|
1073 |
|
1074 |
plan tests => 34; |
1074 |
plan tests => 35; |
1075 |
|
1075 |
|
1076 |
$schema->storage->txn_begin; |
1076 |
$schema->storage->txn_begin; |
1077 |
|
1077 |
|
Lines 1254-1259
subtest "reduce() tests" => sub {
Link Here
|
1254 |
'Koha::Exceptions::Account::IsNotDebit', |
1254 |
'Koha::Exceptions::Account::IsNotDebit', |
1255 |
'->reduce() cannot be used on a payout debit'; |
1255 |
'->reduce() cannot be used on a payout debit'; |
1256 |
|
1256 |
|
|
|
1257 |
# Throw exception if attempting to reduce a voided debt |
1258 |
my $payment = Koha::Account::Line->new( |
1259 |
{ |
1260 |
borrowernumber => $borrower->borrowernumber, |
1261 |
amount => -20, |
1262 |
amountoutstanding => -20, |
1263 |
interface => 'commandline', |
1264 |
credit_type_code => 'CREDIT' |
1265 |
} |
1266 |
)->store(); |
1267 |
my $void = $payment->void( |
1268 |
{ |
1269 |
interface => 'intranet', |
1270 |
staff_id => $staff->borrowernumber, |
1271 |
branch => $branchcode, |
1272 |
} |
1273 |
); |
1274 |
throws_ok { |
1275 |
$void->reduce($reduce_params); |
1276 |
} |
1277 |
'Koha::Exceptions::Account::IsNotDebit', |
1278 |
'->reduce() cannot be used on a void debit'; |
1279 |
|
1257 |
$schema->storage->txn_rollback; |
1280 |
$schema->storage->txn_rollback; |
1258 |
}; |
1281 |
}; |
1259 |
|
1282 |
|
1260 |
- |
|
|