]> wagnertech.de Git - mfinanz.git/blobdiff - SL/IS.pm
Zusätzliche Auftragsfelder beim Laden von Rechnungen holen.
[mfinanz.git] / SL / IS.pm
index 483bac745363df4ccfd93f9e605c1cf58f068f98..3b0e15666966670a384a1dd0a4175adc8724ca59 100644 (file)
--- a/SL/IS.pm
+++ b/SL/IS.pm
@@ -1000,11 +1000,11 @@ sub post_invoice {
                 cp_id       = ?, marge_total   = ?, marge_percent = ?,
                 globalproject_id               = ?, delivery_customer_id             = ?,
                 transaction_description        = ?, delivery_vendor_id               = ?,
-               donumber    = ?
+                donumber    = ?
               WHERE id = ?|;
   @values = (          $form->{"invnumber"},           $form->{"ordnumber"},             $form->{"quonumber"},          $form->{"cusordnumber"},
              conv_date($form->{"invdate"}),  conv_date($form->{"orddate"}),    conv_date($form->{"quodate"}),    conv_i($form->{"customer_id"}),
-                       $amount,                        $netamount,                       $form->{"paid"},     conv_date($form->{"datepaid"}),
+                       $amount,                        $netamount,                       $form->{"paid"},
              conv_date($form->{"duedate"}),  conv_date($form->{"deliverydate"}),    '1',                                $form->{"shippingpoint"},
                        $form->{"shipvia"},      conv_i($form->{"terms"}),                $form->{"notes"},              $form->{"intnotes"},
                        $form->{"currency"},     conv_i($form->{"department_id"}), conv_i($form->{"payment_id"}),        $form->{"taxincluded"} ? 't' : 'f',
@@ -1013,7 +1013,7 @@ sub post_invoice {
                 conv_i($form->{"cp_id"}),            1 * $form->{marge_total} ,      1 * $form->{marge_percent},
                 conv_i($form->{"globalproject_id"}),                              conv_i($form->{"delivery_customer_id"}),
                        $form->{transaction_description},                          conv_i($form->{"delivery_vendor_id"}),
-                      $form->{"donumber"}, #das entsprechende feld lieferscheinnummer aus der html-form 12.02.09 jb
+                       $form->{"donumber"}, #das entsprechende feld lieferscheinnummer aus der html-form 12.02.09 jb
                 conv_i($form->{"id"}));
   do_query($form, $dbh, $query, @values);
 
@@ -1954,6 +1954,38 @@ sub retrieve_item {
   $main::lxdebug->leave_sub();
 }
 
+##########################
+# Get data for the submitted order id
+# from database
+#
+sub get_order_data {
+
+  $main::lxdebug->enter_sub();
+
+  my $self      = shift;
+  my $form     = $main::form;
+  my %myconfig = %main::myconfig;
+  my $dbh      = $form->get_standard_dbh();
+
+  my @values = (conv_i($form->{ordnumber}));
+
+  # We query the database for the fields we need using the submitted "ordnumber"
+  my $query = <<SQL;
+    SELECT o.payment_id, o.salesman_id, o.transdate AS orddate, o.taxzone_id, o.quonumber
+    FROM oe o
+    WHERE o.ordnumber = ?;
+SQL
+
+  # Do the actual query and return the results for later processing by our "frontend"
+  my ($result) = selectfirst_hashref_query($form, $dbh, $query, @values);
+
+  $dbh->disconnect;
+
+  $main::lxdebug->leave_sub();
+
+  return $result;
+}
+
 ##########################
 # get pricegroups from database
 # build up selected pricegroup