WebshopApi: Dokumentation Installations und UPGRADE für Trigram(trgm_pg)
[kivitendo-erp.git] / t / ar / ar.t
index 79fcc0a..a936761 100644 (file)
--- a/t/ar/ar.t
+++ b/t/ar/ar.t
@@ -72,7 +72,7 @@ sub ar {
 
   my $db = $invoice->db;
 
-  $db->do_transaction( sub {
+  $db->with_transaction( sub {
 
   my $tax = SL::DB::Manager::Tax->find_by(taxkey => 0, rate => 0);
 
@@ -91,6 +91,8 @@ sub ar {
 
   _save_and_pay_and_check(invoice => $invoice, bank => $bank, pay => 1, check => 1);
 
+  1;
+
   }) || die "something went wrong: " . $db->error;
   return $invoice->invnumber;
 };
@@ -119,7 +121,7 @@ sub ar_with_tax {
 
   my $db = $invoice->db;
 
-  $db->do_transaction( sub {
+  $db->with_transaction( sub {
 
   # TODO: check for currency and exchange rate
 
@@ -140,6 +142,7 @@ sub ar_with_tax {
   $invoice->create_ar_row( chart => $ar_chart );
   _save_and_pay_and_check(invoice => $invoice, bank => $bank, pay => 1, check => 1);
 
+  1;
   }) || die "something went wrong: " . $db->error;
   return $invoice->invnumber;
 };
@@ -192,13 +195,12 @@ sub _save_and_pay_and_check {
 
   if ($datev_check) {
     my $datev = SL::DATEV->new(
-      exporttype => DATEV_ET_BUCHUNGEN,
-      format     => DATEV_FORMAT_KNE,
       dbh        => $invoice->db->dbh,
       trans_id   => $invoice->id,
     );
 
-    $datev->export;
+    $datev->generate_datev_data;
+
     if ($datev->errors) {
       $invoice->db->dbh->rollback;
       die join "\n", $::locale->text('DATEV check returned errors:'), $datev->errors;