+# check ar without tax
+my $invoice = _ar(customer => $customer,
+ amount => 100,
+ with_payment => 1,
+ notes => 'ar without tax',
+ );
+
+# for testing load a fresh instance of the invoice from the database
+my $inv = SL::DB::Invoice->new(id => $invoice->id)->load;
+if ( $inv ) {
+ my $number_of_acc_trans = scalar @{ $inv->transactions };
+ is($::form->round_amount($inv->amount) , 100 , "invoice_amount = 100");
+ is($number_of_acc_trans , 5 , "number of transactions");
+ is($inv->datepaid->to_kivitendo , DateTime->today->to_kivitendo , "datepaid");
+ is($inv->amount - $inv->paid , 0 , "paid = amount ");
+ is($inv->gldate->to_kivitendo, $inv->transactions->[0]->gldate->to_kivitendo, "gldate matches in ar and acc_trans");
+} else {
+ ok 0, "couldn't find first invoice";
+}