From 0ecb31986f567eb0b1e9949978458baba04c0ef9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Thu, 24 May 2007 15:45:58 +0000 Subject: [PATCH] storno_id spalte in ar eingefuegt, und die post_transaction angepasst um diese auch zu nutzen --- SL/AR.pm | 4 ++-- sql/Pg-upgrade2/ar_storno.sql | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 sql/Pg-upgrade2/ar_storno.sql diff --git a/SL/AR.pm b/SL/AR.pm index d837f8daa..be9a2c4e4 100644 --- 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 index 000000000..90a020986 --- /dev/null +++ b/sql/Pg-upgrade2/ar_storno.sql @@ -0,0 +1,5 @@ +-- @tag: ar_storno +-- @description: Spalten für Debitorenbuchen zum Speichern fü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); -- 2.20.1