From b3721e4e65d62ea30b68b00ac77b4495b1f17337 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Thu, 26 Jan 2006 14:06:33 +0000 Subject: [PATCH] Lieferdatum in Rechnungen. Lieferdatum wird nicht auf automatisch gesetzt und ist zur Zeit auch nicht vom Programm erfordert. Es wird bei der Konvertierung von und in Auftraege beibehalten. --- SL/Form.pm | 36 +++++++++++----------------------- SL/IS.pm | 8 +++++--- SL/OE.pm | 4 ++++ bin/mozilla/is.pl | 14 +++++++++++-- bin/mozilla/oe.pl | 2 ++ sql/Pg-upgrade-2.1.1-2.1.2.sql | 3 +++ sql/lx-office.sql | 1 + 7 files changed, 38 insertions(+), 30 deletions(-) diff --git a/SL/Form.pm b/SL/Form.pm index c70e35ab1..f82a70f66 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -412,14 +412,14 @@ function fokus(){document.$self->{fokus}.focus();} $main::lxdebug->leave_sub(); } -# write Trigger JavaScript-Code ($qty = 1 - only one Trigger) +# write Trigger JavaScript-Code ($qty = quantity of Triggers) +# changed it to accept an arbitrary number of triggers - sschoeling sub write_trigger { $main::lxdebug->enter_sub(); - my ($self, $myconfig, $qty, - $inputField_1, $align_1, $button_1, - $inputField_2, $align_2, $button_2) - = @_; + my $self = shift; + my $myconfig = shift; + my $qty = shift; # set dateform for jsscript # default @@ -448,35 +448,21 @@ sub write_trigger { } } - $trigger_1 = qq| + while ($#_ >= 2) { + push @triggers, qq| Calendar.setup( { - inputField : "$inputField_1", + inputField : "|.(shift).qq|", ifFormat :"$ifFormat", - align : "$align_1", - button : "$button_1" + align : "|.(shift).qq|", + button : "|.(shift).qq|" } ); |; - - if ($qty == 2) { - $trigger_2 = qq| - Calendar.setup( - { - inputField : "$inputField_2", - ifFormat :"$ifFormat", - align : "$align_2", - button : "$button_2" - } - ); - |; } $jsscript = qq| |; diff --git a/SL/IS.pm b/SL/IS.pm index 2958a6fa0..ce6d6be23 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -803,8 +803,9 @@ sub post_invoice { # set values which could be empty to 0 $form->{terms} *= 1; $form->{taxincluded} *= 1; - my $datepaid = ($form->{paid}) ? qq|'$form->{datepaid}'| : "NULL"; - my $duedate = ($form->{duedate}) ? qq|'$form->{duedate}'| : "NULL"; + my $datepaid = ($form->{paid}) ? qq|'$form->{datepaid}'| : "NULL"; + my $duedate = ($form->{duedate}) ? qq|'$form->{duedate}'| : "NULL"; + my $deliverydate = ($form->{deliverydate}) ? qq|'$form->{deliverydate}'| : "NULL"; # fill in subject if there is none $form->{subject} = qq|$form->{label} $form->{invnumber}| @@ -837,6 +838,7 @@ Message: $form->{message}\r| if $form->{message}; paid = $form->{paid}, datepaid = $datepaid, duedate = $duedate, + deliverydate = $deliverydate, invoice = '1', shippingpoint = '$form->{shippingpoint}', shipvia = '$form->{shipvia}', @@ -1162,7 +1164,7 @@ sub retrieve_invoice { # retrieve invoice $query = qq|SELECT a.invnumber, a.ordnumber, a.quonumber, a.cusordnumber, - a.transdate AS invdate, a.paid, + a.transdate AS invdate, a.deliverydate, a.paid, a.shippingpoint, a.shipvia, a.terms, a.notes, a.intnotes, a.duedate, a.taxincluded, a.curr AS currency, a.employee_id, e.name AS employee diff --git a/SL/OE.pm b/SL/OE.pm index 04c7c499d..093e77033 100644 --- a/SL/OE.pm +++ b/SL/OE.pm @@ -633,6 +633,10 @@ sub retrieve { ($form->{currency}) = split /:/, $form->{currencies}; + # set reqdate if this is an invoice->order conversion. If someone knows a better check to ensure + # we come from invoices, feel free. + $form->{reqdate} = $form->{deliverydate} if ($form->{deliverydate} and $form->{callback} =~ /action=ar_transactions/); + if ($form->{id} or @ids) { # retrieve order for single id diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 314f68bc1..3e7704972 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -334,11 +334,17 @@ sub form_header { text('button') . qq|> |; + $button3 = qq| + {deliverydate}> + text('button') . qq|> + |; #write Trigger $jsscript = - Form->write_trigger(\%myconfig, "2", "invdate", "BL", "trigger1", - "duedate", "BL", "trigger2"); + Form->write_trigger(\%myconfig, "3", "invdate", "BL", "trigger1", + "duedate", "BL", "trigger2", + "deliverydate", "BL", "trigger3"); } else { # without JavaScript Calendar @@ -470,6 +476,10 @@ sub form_header { | . $locale->text('Due Date') . qq| $button2 + + | . $locale->text('Delivery Date') . qq| + $button3 + | . $locale->text('Order Number') . qq| diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index f9907cbf2..d05745b8e 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -1809,6 +1809,8 @@ sub invoice { $form->isblank("ordnumber", $locale->text('Order Number missing!')) if ( +{ map { $form->{"ordnumber_$_"}, 1 } ( 1 .. $form->{rowcount}-1 ) }->{''} ); $form->isblank("transdate", $locale->text('Order Date missing!')) if ( +{ map { $form->{"transdate_$_"}, 1 } ( 1 .. $form->{rowcount}-1 ) }->{''} ); + # also copy deliverydate from the order + $form->{deliverydate} = $form->{reqdate} if $form->{reqdate}; } else { $form->isblank("quonumber", $locale->text('Quotation Number missing!')); $form->isblank("transdate", $locale->text('Quotation Date missing!')); diff --git a/sql/Pg-upgrade-2.1.1-2.1.2.sql b/sql/Pg-upgrade-2.1.1-2.1.2.sql index 6946ab202..7cf035580 100644 --- a/sql/Pg-upgrade-2.1.1-2.1.2.sql +++ b/sql/Pg-upgrade-2.1.1-2.1.2.sql @@ -321,5 +321,8 @@ INSERT INTO tax (chart_id, rate, taxnumber, taxkey, taxdescription) VALUES ((SEL -- -- add unqiue constraint to project ALTER TABLE project ADD constraint project_projectnumber_key UNIQUE(projectnumber); +-- +-- add column deliverydate to ar +ALTER TABLE ar ADD COLUMN deliverydate date; update defaults set version = '2.1.2'; diff --git a/sql/lx-office.sql b/sql/lx-office.sql index 76267264b..9caa7bd04 100644 --- a/sql/lx-office.sql +++ b/sql/lx-office.sql @@ -285,6 +285,7 @@ CREATE TABLE "ar" ( "paid" numeric (15,5), "datepaid" date, "duedate" date, + "deliverydate" date, "invoice" boolean DEFAULT 'f', "shippingpoint" text, "terms" smallint DEFAULT 0, -- 2.20.1