From 480c67096c7aab3ccfe6b55e8d981975c7f08578 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 21 May 2007 13:21:06 +0000 Subject: [PATCH] =?utf8?q?Beim=20Erstellen=20eines=20Lieferantenauftrages?= =?utf8?q?=20aus=20einem=20Kundenauftrag=20wird=20=C3=BCberpr=C3=BCft,=20o?= =?utf8?q?b=20eine=20Lieferadresse=20ausgew=C3=A4hlt=20oder=20eingegeben?= =?utf8?q?=20war.=20Wenn=20ja,=20so=20wird=20der=20Benutzer=20gefragt,=20o?= =?utf8?q?b=20er=20diese=20Lieferadresse=20beibehalten=20will,=20damit=20d?= =?utf8?q?er=20Lieferant=20direkt=20an=20den=20Kunden=20liefern=20kann.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Common.pm | 19 +++++ bin/mozilla/oe.pl | 59 +++++++++++++ locale/de/all | 3 + locale/de/oe | 5 ++ .../oe/check_for_direct_delivery_de.html | 85 +++++++++++++++++++ .../oe/check_for_direct_delivery_master.html | 85 +++++++++++++++++++ 6 files changed, 256 insertions(+) create mode 100644 templates/webpages/oe/check_for_direct_delivery_de.html create mode 100644 templates/webpages/oe/check_for_direct_delivery_master.html diff --git a/SL/Common.pm b/SL/Common.pm index 4cd1d35ed..fdf2b2808 100644 --- a/SL/Common.pm +++ b/SL/Common.pm @@ -348,4 +348,23 @@ sub get_vc_details { return 1; } +sub get_shipto_by_id { + $main::lxdebug->enter_sub(); + + my ($self, $myconfig, $form, $shipto_id, $prefix) = @_; + + $prefix ||= ""; + + my $dbh = $form->dbconnect($myconfig); + + my $query = qq|SELECT * FROM shipto WHERE shipto_id = ?|; + my $ref = selectfirst_hashref_query($form, $dbh, $query, $shipto_id); + + map { $form->{"${prefix}${_}"} = $ref->{$_} } keys %{ $ref } if $ref; + + $dbh->disconnect(); + + $main::lxdebug->leave_sub(); +} + 1; diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index 899d263f0..a6ea2ee24 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -2496,9 +2496,61 @@ sub save_as_new { $lxdebug->leave_sub(); } +sub check_for_direct_delivery_yes { + $lxdebug->enter_sub(); + + $form->{direct_delivery_checked} = 1; + delete @{$form}{grep /^shipto/, keys %{ $form }}; + map { s/^CFDD_//; $form->{$_} = $form->{"CFDD_${_}"} } grep /^CFDD_/, keys %{ $form }; + $form->{shipto} = 1; + purchase_order(); + $lxdebug->leave_sub(); +} + +sub check_for_direct_delivery_no { + $lxdebug->enter_sub(); + + $form->{direct_delivery_checked} = 1; + delete @{$form}{grep /^shipto/, keys %{ $form }}; + purchase_order(); + + $lxdebug->leave_sub(); +} + +sub check_for_direct_delivery { + $lxdebug->enter_sub(); + + if ($form->{direct_delivery_checked} + || (!$form->{shiptoname} && !$form->{shiptostreet} && !$form->{shipto_id})) { + $lxdebug->leave_sub(); + return; + } + + if ($form->{shipto_id}) { + Common->get_shipto_by_id(\%myconfig, $form, $form->{shipto_id}, "CFDD_"); + + } else { + map { $form->{"CFDD_${_}"} = $form->{$_ } } grep /^shipto/, keys %{ $form }; + } + + delete $form->{action}; + $form->{VARIABLES} = [ map { { "key" => $_, "value" => $form->{$_} } } grep { ref $_ eq "" } keys %{ $form } ]; + + $form->header(); + print $form->parse_html_template("oe/check_for_direct_delivery"); + + $lxdebug->leave_sub(); + + exit 0; +} + sub purchase_order { $lxdebug->enter_sub(); + if ($form->{type} eq 'sales_order') { + check_for_direct_delivery(); + } + if ( $form->{type} eq 'sales_quotation' || $form->{type} eq 'request_quotation') { OE->close_order(\%myconfig, \%$form); @@ -2602,3 +2654,10 @@ sub e_mail { $lxdebug->leave_sub(); } +sub yes { + call_sub($form->{yes_nextsub}); +} + +sub no { + call_sub($form->{no_nextsub}); +} diff --git a/locale/de/all b/locale/de/all index a8cc8e465..d06a9a86b 100644 --- a/locale/de/all +++ b/locale/de/all @@ -239,6 +239,7 @@ aktualisieren wollen?', 'Cannot save preferences!' => 'Benutzereinstellungen können nicht gespeichert werden!', 'Cannot save quotation!' => 'Angebot kann nicht gespeichert werden!', 'Cannot storno storno invoice!' => 'Kann eine Stornorechnung nicht stornieren', + 'Carry over shipping address' => 'Lieferadresse übernehmen', 'Cash' => 'Zahlungsverkehr', 'Cc' => 'Cc', 'Change Admin Password' => 'Administratorpasswort ändern', @@ -374,6 +375,7 @@ aktualisieren wollen?', 'Display' => 'Anzeigen', 'Display file' => 'Datei anzeigen', 'Do you want to limit your search?' => 'Wollen Sie Ihre Suche spezialisieren?', + 'Do you want to carry this shipping address over to the new purchase order so that the vendor can deliver the goods directly to your customer?' => 'Wollen Sie diese Lieferadresse in den neuen Lieferantenauftrag übernehmen, damit der Händler die Waren direkt an Ihren Kunden liefern kann?', 'Done' => 'Fertig', 'Download the backup' => 'Die Sicherungsdatei herunterladen', 'Draft saved.' => 'Entwurf gespeichert.', @@ -1205,6 +1207,7 @@ gestartet', 'You cannot continue before all required modules are installed.' => 'Sie können nicht fortfahren, bevor alle benötigten Pakete installiert sind.', 'You cannot continue until all unknown units have been mapped to known ones.' => 'Sie können nicht fortfahren, bis alle unbekannten Einheiten in neue Einheiten umgewandelt wurden.', 'You did not enter a name!' => 'Sie haben keinen Namen eingegeben!', + 'You have entered or selected the following shipping address for this customer:' => 'Sie haben die folgende Lieferadresse eingegeben oder ausgewählt:', 'You have to chose a dimension unit and a service unit which will then be assigned to those entries.' => 'Sie müssen eine Maß- und eine Dienstleistungseinheit auswählen, die diesen Waren und Dienstleistungen, denen noch keine Einheit zugeordnet ist, zugeordnet wird.', 'You have to chose which unit to save for each of them.' => 'Sie müssen für jeden Artikel die neue Einheit auswählen.', 'You have to create new Buchungsgruppen for all the combinations of inventory, income and expense accounts that have been used already.' => 'Sie müssen neue Buchungsgruppen für alle Kombinationen aus Inventar-, Erlös- und Aufwandskonto, die bereits benutzt wurden.', diff --git a/locale/de/oe b/locale/de/oe index f41e3f03d..c49b06f97 100644 --- a/locale/de/oe +++ b/locale/de/oe @@ -284,6 +284,9 @@ $self->{subs} = { 'build_std_url' => 'build_std_url', 'calculate_qty' => 'calculate_qty', 'call_sub' => 'call_sub', + 'check_for_direct_delivery' => 'check_for_direct_delivery', + 'check_for_direct_delivery_no' => 'check_for_direct_delivery_no', + 'check_for_direct_delivery_yes' => 'check_for_direct_delivery_yes', 'check_form' => 'check_form', 'check_name' => 'check_name', 'check_project' => 'check_project', @@ -308,6 +311,7 @@ $self->{subs} = { 'name_selected' => 'name_selected', 'new_item' => 'new_item', 'new_license' => 'new_license', + 'no' => 'no', 'order' => 'order', 'order_links' => 'order_links', 'orders' => 'orders', @@ -360,6 +364,7 @@ $self->{subs} = { 'löschen' => 'delete', 'email' => 'e_mail', 'rechnung' => 'invoice', + 'nein' => 'no', 'auftrag' => 'order', 'drucken' => 'print', 'lieferantenauftrag' => 'purchase_order', diff --git a/templates/webpages/oe/check_for_direct_delivery_de.html b/templates/webpages/oe/check_for_direct_delivery_de.html new file mode 100644 index 000000000..6a307a847 --- /dev/null +++ b/templates/webpages/oe/check_for_direct_delivery_de.html @@ -0,0 +1,85 @@ + + +
Lieferadresse übernehmen
+ +

Sie haben die folgende Lieferadresse eingegeben oder ausgewählt:

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name:
Abteilung:
 
Straße:
PLZ:
Stadt:
Land:
Kontakt:
Telefon:
Fax:
eMail:
+

+ + Wollen Sie diese Lieferadresse in den neuen Lieferantenauftrag übernehmen, damit der Händler die Waren direkt an Ihren Kunden liefern kann? +

+ +
+ +

+   + +

+ + + + + + + +
+ + + diff --git a/templates/webpages/oe/check_for_direct_delivery_master.html b/templates/webpages/oe/check_for_direct_delivery_master.html new file mode 100644 index 000000000..e9e3d8e3c --- /dev/null +++ b/templates/webpages/oe/check_for_direct_delivery_master.html @@ -0,0 +1,85 @@ + + +
Carry over shipping address
+ +

You have entered or selected the following shipping address for this customer:

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name:
Department:
 
Street:
Zipcode:
City:
Country:
Contact:
Phone:
Fax:
E-mail:
+

+ + Do you want to carry this shipping address over to the new purchase order so that the vendor can deliver the goods directly to your customer? +

+ +
+ +

+   + +

+ + + + + + + +
+ + + -- 2.20.1