Revision da216d13
Von Kivitendo Admin vor fast 8 Jahren hinzugefügt
t/db_helper/payment.t | ||
---|---|---|
1410 | 1410 |
is(total_amount($invoice), 0, "$title: even balance"); |
1411 | 1411 |
}; |
1412 | 1412 |
|
1413 |
sub test_credit_note_two_items_19_7_tax_tax_not_included() { |
|
1414 |
reset_state() if $ALWAYS_RESET; |
|
1415 |
|
|
1416 |
my $item1 = SL::Dev::Record::create_invoice_item(part => $parts[0], qty => 5); |
|
1417 |
my $item2 = SL::Dev::Record::create_invoice_item(part => $parts[1], qty => 3); |
|
1418 |
my $invoice = SL::Dev::Record::create_credit_note( |
|
1419 |
invnumber => 'cn1', |
|
1420 |
taxincluded => 0, |
|
1421 |
invoiceitems => [ $item1, $item2 ], |
|
1422 |
); |
|
1423 |
|
|
1424 |
# default values |
|
1425 |
my %params = ( chart_id => $bank_account->chart_id, |
|
1426 |
transdate => DateTime->today_local->to_kivitendo, |
|
1427 |
); |
|
1428 |
|
|
1429 |
$params{amount} = $invoice->amount, |
|
1430 |
|
|
1431 |
$invoice->pay_invoice( %params ); |
|
1432 |
|
|
1433 |
my ($number_of_payments, $paid_amount) = number_of_payments($invoice); |
|
1434 |
my $total = total_amount($invoice); |
|
1435 |
|
|
1436 |
my $title = 'default invoice, two items, 19/7% tax with_skonto_pt'; |
|
1437 |
|
|
1438 |
is($invoice->netamount, -40.84, "${title}: netamount"); |
|
1439 |
is($invoice->amount, -45.10, "${title}: amount"); |
|
1440 |
is($paid_amount, 45.10, "${title}: paid amount according to acc_trans is positive (Haben)"); |
|
1441 |
is($invoice->paid, -45.10, "${title}: paid"); |
|
1442 |
is($number_of_payments, 1, "${title}: 1 AR_paid bookings"); |
|
1443 |
is($total, 0, "${title}: even balance"); |
|
1444 |
} |
|
1445 |
|
|
1413 | 1446 |
Support::TestSetup::login(); |
1414 | 1447 |
|
1415 | 1448 |
# test cases: without_skonto |
... | ... | |
1421 | 1454 |
test_default_purchase_invoice_two_charts_19_7_without_skonto(); |
1422 | 1455 |
test_default_purchase_invoice_two_charts_19_7_tax_partial_unrounded_payment_without_skonto(); |
1423 | 1456 |
test_default_invoice_one_item_19_without_skonto_overpaid(); |
1457 |
test_credit_note_two_items_19_7_tax_tax_not_included(); |
|
1424 | 1458 |
|
1425 | 1459 |
# test cases: difference_as_skonto |
1426 | 1460 |
test_default_invoice_two_items_19_7_tax_without_skonto_multiple_payments_final_difference_as_skonto(); |
Auch abrufbar als: Unified diff
t/db_helper/payment.t - neuer Test für Gutschrift