storno_id spalte in ap, und die dazugehoerigen aenderungen in AP->post_transaction
authorSven Schöling <s.schoeling@linet-services.de>
Fri, 25 May 2007 13:46:51 +0000 (13:46 +0000)
committerSven Schöling <s.schoeling@linet-services.de>
Fri, 25 May 2007 13:46:51 +0000 (13:46 +0000)
SL/AP.pm
sql/Pg-upgrade2/ap_storno.sql [new file with mode: 0644]

index 3f1818b..a3b7d1e 100644 (file)
--- a/SL/AP.pm
+++ b/SL/AP.pm
@@ -189,27 +189,18 @@ sub post_transaction {
   my $datepaid = ($form->{invpaid} != 0) ? $form->{datepaid} : undef;
 
   $query = qq|UPDATE ap SET
-              invnumber = ?,
-              transdate = ?,
-              ordnumber = ?,
-              vendor_id = ?,
-              taxincluded = ?,
-              amount = ?,
-              duedate = ?,
-              paid = ?,
-              datepaid = ?,
-              netamount = ?,
-              curr = ?,
-              notes = ?,
-              department_id = ?
-              WHERE id = ?|;
+              invnumber = ?, transdate = ?, ordnumber = ?, vendor_id = ?, taxincluded = ?,
+              amount = ?, duedate = ?, paid = ?, datepaid = ?, netamount = ?,
+              curr = ?, notes = ?, department_id = ?, storno = ?, storno_id = ?
+             WHERE id = ?|;
   my @values = ($form->{invnumber}, conv_date($form->{transdate}),
                 $form->{ordnumber}, conv_i($form->{vendor_id}),
                 $form->{taxincluded} ? 't' : 'f', $form->{invtotal},
                 conv_date($form->{duedate}), $form->{invpaid},
                 conv_date($datepaid), $form->{netamount},
                 $form->{currency}, $form->{notes},
-                conv_i($form->{department_id}), $form->{id});
+                conv_i($form->{department_id}), $form->{storno},
+                $form->{storno_id}, $form->{id});
   do_query($form, $dbh, $query, @values);
 
   # update exchangerate
diff --git a/sql/Pg-upgrade2/ap_storno.sql b/sql/Pg-upgrade2/ap_storno.sql
new file mode 100644 (file)
index 0000000..62edbd3
--- /dev/null
@@ -0,0 +1,5 @@
+-- @tag: ap_storno
+-- @description: Spalten f&uuml;r Kreditorenbuchen zum Speichern f&uuml;r welche andere Buchung diese eine Stornobuchung ist
+-- @depends: release_2_4_2
+ALTER TABLE ap ADD COLUMN storno_id integer;
+ALTER TABLE ap ADD FOREIGN KEY (storno_id) REFERENCES ap (id);