From 6d706ec6d9f553a9940a3954ae20c302c28dceff Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Fri, 25 May 2007 13:46:51 +0000 Subject: [PATCH] storno_id spalte in ap, und die dazugehoerigen aenderungen in AP->post_transaction --- SL/AP.pm | 21 ++++++--------------- sql/Pg-upgrade2/ap_storno.sql | 5 +++++ 2 files changed, 11 insertions(+), 15 deletions(-) create mode 100644 sql/Pg-upgrade2/ap_storno.sql diff --git a/SL/AP.pm b/SL/AP.pm index 3f1818bdc..a3b7d1e26 100644 --- 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 index 000000000..62edbd319 --- /dev/null +++ b/sql/Pg-upgrade2/ap_storno.sql @@ -0,0 +1,5 @@ +-- @tag: ap_storno +-- @description: Spalten für Kreditorenbuchen zum Speichern fü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); -- 2.20.1