Mehr als eine SelfTest-Modul prüfen
[kivitendo-erp.git] / SL / AM.pm
index a172867..e0caa82 100644 (file)
--- a/SL/AM.pm
+++ b/SL/AM.pm
@@ -25,7 +25,8 @@
 # GNU General Public License for more details.
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1335, USA.
 #======================================================================
 #
 # Administration module
@@ -498,7 +499,8 @@ sub delete_lead {
   SL::DB->client->with_transaction(sub {
     $query = qq|DELETE FROM leads WHERE id = ?|;
     do_query($form, SL::DB->client->dbh, $query, $form->{id});
-  });
+    1;
+  }) or do { die SL::DB->client->error };
 
   $main::lxdebug->leave_sub();
 }
@@ -606,7 +608,8 @@ sub save_language {
         ") VALUES (?, ?, ?, ?, ?, ?)";
     }
     do_query($form, $dbh, $query, @values);
-  });
+    1;
+  }) or do { die SL::DB->client->error };
 
   $main::lxdebug->leave_sub();
 }
@@ -627,7 +630,8 @@ sub delete_language {
 
     $query = "DELETE FROM language WHERE id = ?";
     do_query($form, $dbh, $query, $form->{"id"});
-  });
+    1;
+  }) or do { die SL::DB->client->error };
 
   $main::lxdebug->leave_sub();
 }
@@ -796,7 +800,8 @@ sub closebooks {
 
     # set close in defaults
     do_query($form, $dbh, $query, @values);
-  });
+    1;
+  }) or do { die SL::DB->client->error };
 
   $main::lxdebug->leave_sub();
 }
@@ -1097,7 +1102,8 @@ sub add_unit {
       }
       $sth->finish();
     }
-  });
+    1;
+  }) or do { die SL::DB->client->error };
 
   $main::lxdebug->leave_sub();
 }
@@ -1375,7 +1381,8 @@ sub delete_tax {
   SL::DB->client->with_transaction(sub {
     $query = qq|DELETE FROM tax WHERE id = ?|;
     do_query($form, SL::DB->client->dbh, $query, $form->{id});
-  });
+    1;
+  }) or do { die SL::DB->client->error };
 
   $main::lxdebug->leave_sub();
 }
@@ -1400,7 +1407,8 @@ sub save_price_factor {
     }
 
     do_query($form, $dbh, $query, @values);
-  });
+    1;
+  }) or do { die SL::DB->client->error };
 
   $main::lxdebug->leave_sub();
 }
@@ -1443,7 +1451,8 @@ sub delete_price_factor {
 
   SL::DB->client->with_transaction(sub {
     do_query($form, SL::DB->client->dbh, qq|DELETE FROM price_factors WHERE id = ?|, conv_i($form->{id}));
-  });
+    1;
+  }) or do { die SL::DB->client->error };
 
   $main::lxdebug->leave_sub();
 }
@@ -1480,7 +1489,8 @@ sub save_warehouse {
 
       $sth->finish();
     }
-  });
+    1;
+  }) or do { die SL::DB->client->error };
 
   $main::lxdebug->leave_sub();
 }
@@ -1512,7 +1522,8 @@ sub save_bins {
     }
 
     $sth->finish();
-  });
+    1;
+  }) or do { die SL::DB->client->error };
 
   $main::lxdebug->leave_sub();
 }