Beim Stornieren von Einkaufs- und Verkaufsrechnung auch die storno_id mit speichern...
authorMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 3 Jul 2007 15:45:33 +0000 (15:45 +0000)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 3 Jul 2007 15:45:33 +0000 (15:45 +0000)
SL/IR.pm
SL/IS.pm

index 22c1a28..690c20d 100644 (file)
--- 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}));
index 34015e0..3cae60e 100644 (file)
--- 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();