From a6161998f4ec82462646ca5471d31cdfa4af4b5e Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 5 Jun 2009 12:45:49 +0000 Subject: [PATCH] =?utf8?q?=C3=9Cbernahme=20einiger=20weiterer=20Felder=20a?= =?utf8?q?us=20Auftr=C3=A4gen=20in=20Lieferscheinen=20und=20von=20dort=20i?= =?utf8?q?n=20Rechnungen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 | 6 ++++-- bin/mozilla/do.pl | 2 -- .../delivery_orders_fields_for_invoices.sql | 10 ++++++++++ templates/webpages/do/form_header_de.html | 4 ++++ templates/webpages/do/form_header_master.html | 4 ++++ 5 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 sql/Pg-upgrade2/delivery_orders_fields_for_invoices.sql diff --git a/SL/DO.pm b/SL/DO.pm index 40b2c409c..9bc76a15e 100644 --- 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) diff --git a/bin/mozilla/do.pl b/bin/mozilla/do.pl index 11e3a4daa..5b730a5d3 100644 --- a/bin/mozilla/do.pl +++ b/bin/mozilla/do.pl @@ -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 index 000000000..5c9a2f534 --- /dev/null +++ b/sql/Pg-upgrade2/delivery_orders_fields_for_invoices.sql @@ -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; + diff --git a/templates/webpages/do/form_header_de.html b/templates/webpages/do/form_header_de.html index 20f59ea64..a29e0e969 100644 --- a/templates/webpages/do/form_header_de.html +++ b/templates/webpages/do/form_header_de.html @@ -61,6 +61,7 @@ + @@ -88,6 +89,9 @@ + + + diff --git a/templates/webpages/do/form_header_master.html b/templates/webpages/do/form_header_master.html index 4f54ecdef..ce7f57a30 100644 --- a/templates/webpages/do/form_header_master.html +++ b/templates/webpages/do/form_header_master.html @@ -61,6 +61,7 @@ + @@ -88,6 +89,9 @@ + + + -- 2.20.1