storno_id spalte in ar eingefuegt, und die post_transaction angepasst um diese auch...
authorSven Schöling <s.schoeling@linet-services.de>
Thu, 24 May 2007 15:45:58 +0000 (15:45 +0000)
committerSven Schöling <s.schoeling@linet-services.de>
Thu, 24 May 2007 15:45:58 +0000 (15:45 +0000)
SL/AR.pm
sql/Pg-upgrade2/ar_storno.sql [new file with mode: 0644]

index d837f8d..be9a2c4 100644 (file)
--- a/SL/AR.pm
+++ b/SL/AR.pm
@@ -143,11 +143,11 @@ sub post_transaction {
          invnumber = ?, ordnumber = ?, transdate = ?, customer_id = ?,
          taxincluded = ?, amount = ?, duedate = ?, paid = ?, datepaid = ?,
          netamount = ?, curr = ?, notes = ?, department_id = ?,
-         employee_id = ?
+         employee_id = ?, storno = ?, storno_id = ?
        WHERE id = ?|;
   my @values = ($form->{invnumber}, $form->{ordnumber}, conv_date($form->{transdate}), conv_i($form->{customer_id}), $form->{taxincluded} ? 't' : 'f', $form->{amount},
                 conv_date($form->{duedate}), $form->{paid}, conv_date($datepaid), $form->{netamount}, $form->{currency}, $form->{notes}, conv_i($form->{department_id}),
-                conv_i($form->{employee_id}), conv_i($form->{id}));
+                conv_i($form->{employee_id}), $form->{storno} ? 't' : 'f', $form->{storno_id}, conv_i($form->{id}));
   do_query($form, $dbh, $query, @values);
 
   # amount for AR account
diff --git a/sql/Pg-upgrade2/ar_storno.sql b/sql/Pg-upgrade2/ar_storno.sql
new file mode 100644 (file)
index 0000000..90a0209
--- /dev/null
@@ -0,0 +1,5 @@
+-- @tag: ar_storno
+-- @description: Spalten f&uuml;r Debitorenbuchen zum Speichern f&uuml;r welche andere Buchung diese eine Stornobuchung ist
+-- @depends: release_2_4_2
+ALTER TABLE ar ADD COLUMN storno_id integer;
+ALTER TABLE ar ADD FOREIGN KEY (storno_id) REFERENCES ar (id);