From: Moritz Bunkus Date: Tue, 3 Jul 2007 15:45:33 +0000 (+0000) Subject: Beim Stornieren von Einkaufs- und Verkaufsrechnung auch die storno_id mit speichern... X-Git-Tag: release-2.4.3^2~53 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=077ebb6c7e6b6ba243da85dbede70ff57927db01;p=kivitendo-erp.git Beim Stornieren von Einkaufs- und Verkaufsrechnung auch die storno_id mit speichern (analog zu AR.pm/AP.pm), damit später eine Unterscheidung zwischen Stornorechnung und stornierter Rechnung möglich ist. --- diff --git a/SL/IR.pm b/SL/IR.pm index 22c1a2866..690c20d84 100644 --- a/SL/IR.pm +++ b/SL/IR.pm @@ -553,6 +553,7 @@ sub post_invoice { curr = ?, department_id = ?, storno = ?, + storno_id = ?, globalproject_id = ?, cp_id = ?, employee_id = ? @@ -564,7 +565,7 @@ sub post_invoice { conv_date($form->{duedate}), $taxzone_id, $form->{taxincluded} ? 't' : 'f', $form->{notes}, $form->{intnotes}, $form->{currency}, conv_i($form->{department_id}), - $form->{storno} ? 't' : 'f', + $form->{storno} ? 't' : 'f', conv_i($form->{storno_id}), conv_i($form->{globalproject_id}), conv_i($form->{cp_id}), conv_i($form->{employee_id}), conv_i($form->{id})); diff --git a/SL/IS.pm b/SL/IS.pm index 34015e03e..3cae60e67 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -992,6 +992,7 @@ Message: $form->{message}\r| if $form->{message}; employee_id = ?, salesman_id = ?, storno = ?, + storno_id = ?, globalproject_id = ?, cp_id = ?, transaction_description = ?, @@ -1009,7 +1010,7 @@ Message: $form->{message}\r| if $form->{message}; conv_i($form->{"shipto_id"}), conv_i($form->{"delivery_customer_id"}), conv_i($form->{"delivery_vendor_id"}), conv_i($form->{"employee_id"}), conv_i($form->{"salesman_id"}), - $form->{"storno"} ? 't' : 'f', conv_i($form->{"globalproject_id"}), + $form->{"storno"} ? 't' : 'f', conv_i($form->{storno_id}), conv_i($form->{"globalproject_id"}), conv_i($form->{"cp_id"}), $form->{transaction_description}, $form->{marge_total}, $form->{marge_percent}, conv_i($form->{"id"})); @@ -2162,9 +2163,9 @@ sub has_storno { sub is_storno { $main::lxdebug->enter_sub(); - my ($self, $myconfig, $form, $table) = @_; + my ($self, $myconfig, $form, $table, $id) = @_; - $main::lxdebug->leave_sub() and return 0 unless ($form->{id}); + $main::lxdebug->leave_sub() and return 0 unless ($id); # make sure there's no funny stuff in $table # ToDO: die when this happens and throw an error @@ -2173,7 +2174,7 @@ sub is_storno { my $dbh = $form->dbconnect($myconfig); my $query = qq|SELECT storno FROM $table WHERE id = ?|; - my ($result) = selectrow_query($form, $dbh, $query, $form->{id}); + my ($result) = selectrow_query($form, $dbh, $query, $id); $dbh->disconnect();