Übernahme einiger weiterer Felder aus Aufträgen in Lieferscheinen und von dort in...
authorMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 5 Jun 2009 12:45:49 +0000 (12:45 +0000)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 5 Jun 2009 12:45:49 +0000 (12:45 +0000)
Einige Felder wie "Steuer im Preis inbegriffen", "Steuersatz",
"Zahlungsbedingungen" und "Währung" wurden bei Lieferscheinen nicht
gespeichert. Dementsprechend gingen sie bei der Umwandlung von Auftrag
in Lieferschein und daraus in Rechnungen verloren.

Fix für Bug 1035.

SL/DO.pm
bin/mozilla/do.pl
sql/Pg-upgrade2/delivery_orders_fields_for_invoices.sql [new file with mode: 0644]
templates/webpages/do/form_header_de.html
templates/webpages/do/form_header_master.html

index 40b2c40..9bc76a1 100644 (file)
--- a/SL/DO.pm
+++ b/SL/DO.pm
@@ -316,7 +316,7 @@ sub save {
          shippingpoint = ?, shipvia = ?, notes = ?, intnotes = ?, closed = ?,
          delivered = ?, department_id = ?, language_id = ?, shipto_id = ?,
          globalproject_id = ?, employee_id = ?, salesman_id = ?, cp_id = ?, transaction_description = ?,
-         is_sales = ?
+         is_sales = ?, taxzone_id = ?, taxincluded = ?, terms = ?, curr = ?
        WHERE id = ?|;
 
   @values = ($form->{donumber}, $form->{ordnumber},
@@ -330,6 +330,7 @@ sub save {
              conv_i($form->{salesman_id}), conv_i($form->{cp_id}),
              $form->{transaction_description},
              $form->{type} =~ /^sales/ ? 't' : 'f',
+             conv_i($form->{taxzone_id}), $form->{taxincluded} ? 't' : 'f', conv_i($form->{terms}), $form->{curr},
              conv_i($form->{id}));
   do_query($form, $dbh, $query, @values);
 
@@ -575,7 +576,8 @@ sub retrieve {
          dord.closed, dord.reqdate, dord.department_id, dord.cusordnumber,
          d.description AS department, dord.language_id,
          dord.shipto_id,
-         dord.globalproject_id, dord.delivered, dord.transaction_description
+         dord.globalproject_id, dord.delivered, dord.transaction_description,
+         dort.taxzone_id, dord.taxincluded, dord.terms, dord.curr
        FROM delivery_orders dord
        JOIN ${vc} cv ON (dord.${vc}_id = cv.id)
        LEFT JOIN employee e ON (dord.employee_id = e.id)
index 11e3a4d..5b730a5 100644 (file)
@@ -182,8 +182,6 @@ sub order_links {
   ($form->{ $form->{vc} })  = split /--/, $form->{ $form->{vc} };
   $form->{"old$form->{vc}"} = qq|$form->{$form->{vc}}--$form->{"$form->{vc}_id"}|;
 
-  $form->{taxincluded} = $taxincluded if ($form->{id});
-
   $form->{employee} = "$form->{employee}--$form->{employee_id}";
 
   $form->{salesman_id} = $salesman_id if ($editing);
diff --git a/sql/Pg-upgrade2/delivery_orders_fields_for_invoices.sql b/sql/Pg-upgrade2/delivery_orders_fields_for_invoices.sql
new file mode 100644 (file)
index 0000000..5c9a2f5
--- /dev/null
@@ -0,0 +1,10 @@
+-- @tag: delivery_orders_fields_for_invoices
+-- @description: Spalten in Lieferscheintabellen, um einige Werte von Aufträgen zu Rechnungen zu übernehmen
+-- @depends: release_2_6_0
+ALTER TABLE delivery_orders ADD COLUMN taxzone_id integer;
+ALTER TABLE delivery_orders ADD COLUMN taxincluded boolean;
+ALTER TABLE delivery_orders ADD COLUMN terms integer;
+ALTER TABLE delivery_orders ADD COLUMN curr char(3);
+
+UPDATE delivery_orders SET taxincluded = FALSE;
+
index 20f59ea..a29e0e9 100644 (file)
@@ -61,6 +61,7 @@
   <input type="hidden" name="cc" value="[% HTML.escape(cc) %]">
   <input type="hidden" name="closed" value="[% HTML.escape(closed) %]">
   <input type="hidden" name="convert_from_oe_ids" value="[% HTML.escape(convert_from_oe_ids) %]">
+  <input type="hidden" name="curr" value="[% HTML.escape(curr) %]">
   <input type="hidden" name="customer_klass" value="[% HTML.escape(customer_klass) %]">
   <input type="hidden" name="discount" value="[% HTML.escape(discount) %]">
   <input type="hidden" name="dunning_amount" value="[% HTML.escape(dunning_amount) %]">
@@ -88,6 +89,9 @@
   <input type="hidden" name="shiptostreet" value="[% HTML.escape(shiptostreet) %]">
   <input type="hidden" name="shiptozipcode" value="[% HTML.escape(shiptozipcode) %]">
   <input type="hidden" name="subject" value="[% HTML.escape(subject) %]">
+  <input type="hidden" name="taxincluded" value="[% HTML.escape(taxincluded) %]">
+  <input type="hidden" name="taxzone_id" value="[% HTML.escape(taxzone_id) %]">
+  <input type="hidden" name="terms" value="[% HTML.escape(terms) %]">
   <input type="hidden" name="title" value="[% HTML.escape(title) %]">
   <input type="hidden" name="type" value="[% HTML.escape(type) %]">
   <input type="hidden" name="vc" value="[% HTML.escape(vc) %]">
index 4f54ecd..ce7f57a 100644 (file)
@@ -61,6 +61,7 @@
   <input type="hidden" name="cc" value="[% HTML.escape(cc) %]">
   <input type="hidden" name="closed" value="[% HTML.escape(closed) %]">
   <input type="hidden" name="convert_from_oe_ids" value="[% HTML.escape(convert_from_oe_ids) %]">
+  <input type="hidden" name="curr" value="[% HTML.escape(curr) %]">
   <input type="hidden" name="customer_klass" value="[% HTML.escape(customer_klass) %]">
   <input type="hidden" name="discount" value="[% HTML.escape(discount) %]">
   <input type="hidden" name="dunning_amount" value="[% HTML.escape(dunning_amount) %]">
@@ -88,6 +89,9 @@
   <input type="hidden" name="shiptostreet" value="[% HTML.escape(shiptostreet) %]">
   <input type="hidden" name="shiptozipcode" value="[% HTML.escape(shiptozipcode) %]">
   <input type="hidden" name="subject" value="[% HTML.escape(subject) %]">
+  <input type="hidden" name="taxincluded" value="[% HTML.escape(taxincluded) %]">
+  <input type="hidden" name="taxzone_id" value="[% HTML.escape(taxzone_id) %]">
+  <input type="hidden" name="terms" value="[% HTML.escape(terms) %]">
   <input type="hidden" name="title" value="[% HTML.escape(title) %]">
   <input type="hidden" name="type" value="[% HTML.escape(type) %]">
   <input type="hidden" name="vc" value="[% HTML.escape(vc) %]">