+sub test_credit_note_two_items_19_7_tax_tax_not_included() {
+ reset_state() if $ALWAYS_RESET;
+
+ my $item1 = create_invoice_item(part => $parts[0], qty => 5);
+ my $item2 = create_invoice_item(part => $parts[1], qty => 3);
+ my $invoice = create_credit_note(
+ invnumber => 'cn1',
+ taxincluded => 0,
+ invoiceitems => [ $item1, $item2 ],
+ );
+
+ # default values
+ my %params = ( chart_id => $bank_account->chart_id,
+ transdate => DateTime->today_local->to_kivitendo,
+ );
+
+ $params{amount} = $invoice->amount,
+
+ $invoice->pay_invoice( %params );
+
+ my ($number_of_payments, $paid_amount) = number_of_payments($invoice);
+ my $total = total_amount($invoice);
+
+ my $title = 'credit_note, two items, 19/7%, tax not included';
+
+ is($invoice->netamount, -40.84, "${title}: netamount");
+ is($invoice->amount, -45.10, "${title}: amount");
+ is($paid_amount, 45.10, "${title}: paid amount according to acc_trans is positive (Haben)");
+ is($invoice->paid, -45.10, "${title}: paid");
+ is($number_of_payments, 1, "${title}: 1 AR_paid bookings");
+ is($total, 0, "${title}: even balance");
+}
+