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
--- /dev/null
+-- @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);