From 5b47ed3efe5f4ef0810096b0f4849047cee54690 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 6 Feb 2007 11:30:23 +0000 Subject: [PATCH] =?utf8?q?Bei=20Einkaufs-=20und=20Verkaufsmasken=20Felder?= =?utf8?q?=20f=C3=BCr=20Angebots-=20und=20Auftragsdatum=20hinzugef=C3=BCgt?= =?utf8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/DBUtils.pm | 11 ++++++++++- SL/IR.pm | 4 ++++ SL/IS.pm | 4 ++++ bin/mozilla/ir.pl | 15 +++++++++++++++ bin/mozilla/is.pl | 15 +++++++++++++++ bin/mozilla/oe.pl | 2 ++ doc/dokumentenvorlagen-und-variablen.html | 8 ++++++++ locale/de/ir | 2 ++ locale/de/is | 2 ++ sql/Pg-upgrade2/ap_ar_orddate_quodate.sql | 7 +++++++ 10 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 sql/Pg-upgrade2/ap_ar_orddate_quodate.sql diff --git a/SL/DBUtils.pm b/SL/DBUtils.pm index 38acf12af..ecb809baf 100644 --- a/SL/DBUtils.pm +++ b/SL/DBUtils.pm @@ -3,7 +3,7 @@ package SL::DBUtils; require Exporter; @ISA = qw(Exporter); -@EXPORT = qw(conv_i conv_date do_query selectrow_query do_statement dump_query); +@EXPORT = qw(conv_i conv_date conv_dateq do_query selectrow_query do_statement dump_query); sub conv_i { my ($value, $default) = @_; @@ -15,6 +15,15 @@ sub conv_date { return (defined($value) && "$value" ne "") ? $value : undef; } +sub conv_dateq { + my ($value) = @_; + if (defined($value) && "$value" ne "") { + $value =~ s/\'/\'\'/g; + return "'$value'"; + } + return "NULL"; +} + sub do_query { my ($form, $dbh, $query) = splice(@_, 0, 3); diff --git a/SL/IR.pm b/SL/IR.pm index d79e0fd5d..2077e6b0e 100644 --- a/SL/IR.pm +++ b/SL/IR.pm @@ -35,6 +35,7 @@ package IR; use SL::AM; +use SL::DBUtils; sub post_invoice { $main::lxdebug->enter_sub(); @@ -624,6 +625,8 @@ sub post_invoice { ordnumber = '$form->{ordnumber}', quonumber = '$form->{quonumber}', transdate = '$form->{invdate}', + orddate = | . conv_dateq($form->{"orddate"}) . qq|, + quodate = | . conv_dateq($form->{"quodate"}) . qq|, vendor_id = $form->{vendor_id}, amount = $amount, netamount = $netamount, @@ -845,6 +848,7 @@ sub retrieve_invoice { # retrieve invoice $query = qq|SELECT a.cp_id, a.invnumber, a.transdate AS invdate, a.duedate, + a.orddate, a.quodate, a.ordnumber, a.quonumber, a.paid, a.taxincluded, a.notes, a.taxzone_id, a.storno, a.gldate, a.intnotes, a.curr AS currency FROM ap a diff --git a/SL/IS.pm b/SL/IS.pm index 615b2eec7..12b5b7c2e 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -36,6 +36,7 @@ package IS; use Data::Dumper; use SL::AM; +use SL::DBUtils; sub invoice_details { $main::lxdebug->enter_sub(); @@ -982,6 +983,8 @@ Message: $form->{message}\r| if $form->{message}; quonumber = '$form->{quonumber}', cusordnumber = '$form->{cusordnumber}', transdate = '$form->{invdate}', + orddate = | . conv_dateq($form->{orddate}) . qq|, + quodate = | . conv_dateq($form->{quodate}) . qq|, customer_id = $form->{customer_id}, amount = $amount, netamount = $netamount, @@ -1484,6 +1487,7 @@ sub retrieve_invoice { # retrieve invoice $query = qq|SELECT a.invnumber, a.ordnumber, a.quonumber, a.cusordnumber, + a.orddate, a.quodate, a.transdate AS invdate, a.deliverydate, a.paid, a.storno, a.gldate, a.shippingpoint, a.shipvia, a.terms, a.notes, a.intnotes, a.taxzone_id, a.duedate, a.taxincluded, a.curr AS currency, a.shipto_id, a.cp_id, diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl index 466d44bd5..3736fbe2c 100644 --- a/bin/mozilla/ir.pl +++ b/bin/mozilla/ir.pl @@ -356,6 +356,11 @@ sub form_header { $form->{"javascript"} .= qq||; + $jsscript .= + $form->write_trigger(\%myconfig, 2, + "orddate", "BL", "trigger_orddate", + "quodate", "BL", "trigger_quodate"); + $form->header; print qq| @@ -448,6 +453,16 @@ sub form_header { + + | . $locale->text('Order Date') . qq| + + + + + | . $locale->text('Quotation Date') . qq| + + + diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 0334843f9..4637f6ba3 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -582,6 +582,11 @@ sub form_header { $form->{"javascript"} .= qq||; + $jsscript .= + $form->write_trigger(\%myconfig, 2, + "orddate", "BL", "trigger_orddate", + "quodate", "BL", "trigger_quodate"); + $form->header; print qq| @@ -748,10 +753,20 @@ print qq| | . $locale->text('Order Number') . qq| + + | . $locale->text('Order Date') . qq| + + + | . $locale->text('Quotation Number') . qq| + + | . $locale->text('Quotation Date') . qq| + + + | . $locale->text('Customer Order Number') . qq| diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index 10e71ac17..f7a52e979 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -2140,10 +2140,12 @@ sub invoice { # also copy deliverydate from the order $form->{deliverydate} = $form->{reqdate} if $form->{reqdate}; + $form->{orddate} = $form->{transdate}; } else { $form->isblank("quonumber", $locale->text('Quotation Number missing!')); $form->isblank("transdate", $locale->text('Quotation Date missing!')); $form->{ordnumber} = ""; + $form->{quodate} = $form->{transdate}; } # if the name changed get new values diff --git a/doc/dokumentenvorlagen-und-variablen.html b/doc/dokumentenvorlagen-und-variablen.html index 0620af35d..d03504429 100644 --- a/doc/dokumentenvorlagen-und-variablen.html +++ b/doc/dokumentenvorlagen-und-variablen.html @@ -507,6 +507,10 @@ td { notes Bemerkungen der Rechnung + + orddate + Auftragsdatum + ordnumber Auftragsnummer, wenn die Rechnung aus einem Auftrag erstellt wurde @@ -515,6 +519,10 @@ td { payment_terms Zahlungskonditionen + + quodate + Angebotsdatum + quonumber Angebotsnummer diff --git a/locale/de/ir b/locale/de/ir index b52163649..2e14867dd 100644 --- a/locale/de/ir +++ b/locale/de/ir @@ -104,6 +104,7 @@ $self->{texts} = { 'Oct' => 'Okt', 'October' => 'Oktober', 'OpenDocument/OASIS' => 'OpenDocument/OASIS', + 'Order Date' => 'Auftragsdatum', 'Order Date missing!' => 'Auftragsdatum fehlt!', 'Order Number' => 'Auftragsnummer', 'Order Number missing!' => 'Auftragsnummer fehlt!', @@ -138,6 +139,7 @@ $self->{texts} = { 'Queue' => 'Warteschlange', 'Queued' => 'In Warteschlange eingereiht.', 'Quotation' => 'Angebot', + 'Quotation Date' => 'Angebotsdatum', 'Quotation Date missing!' => 'Angebotsdatum fehlt!', 'Quotation Number missing!' => 'Angebotsnummer fehlt!', 'RFQ' => 'Anfrage', diff --git a/locale/de/is b/locale/de/is index 2b4da0fc5..cd4ca7f25 100644 --- a/locale/de/is +++ b/locale/de/is @@ -122,6 +122,7 @@ $self->{texts} = { 'October' => 'Oktober', 'OpenDocument/OASIS' => 'OpenDocument/OASIS', 'Order' => 'Auftrag', + 'Order Date' => 'Auftragsdatum', 'Order Date missing!' => 'Auftragsdatum fehlt!', 'Order Number' => 'Auftragsnummer', 'Order Number missing!' => 'Auftragsnummer fehlt!', @@ -160,6 +161,7 @@ $self->{texts} = { 'Queue' => 'Warteschlange', 'Queued' => 'In Warteschlange eingereiht.', 'Quotation' => 'Angebot', + 'Quotation Date' => 'Angebotsdatum', 'Quotation Date missing!' => 'Angebotsdatum fehlt!', 'Quotation Number' => 'Angebotsnummer', 'Quotation Number missing!' => 'Angebotsnummer fehlt!', diff --git a/sql/Pg-upgrade2/ap_ar_orddate_quodate.sql b/sql/Pg-upgrade2/ap_ar_orddate_quodate.sql new file mode 100644 index 000000000..e3e62f5b6 --- /dev/null +++ b/sql/Pg-upgrade2/ap_ar_orddate_quodate.sql @@ -0,0 +1,7 @@ +-- @tag: ap_ar_orddate_quodate +-- @description: Spalten für Angebots- und Auftragsdatum bei Einkaufs- und Verkaufsrechnungen +-- @depends: release_2_4_1 +ALTER TABLE ar ADD COLUMN orddate date; +ALTER TABLE ar ADD COLUMN quodate date; +ALTER TABLE ap ADD COLUMN orddate date; +ALTER TABLE ap ADD COLUMN quodate date; -- 2.20.1