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;
$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);
$lxdebug->leave_sub();
}
+sub yes {
+ call_sub($form->{yes_nextsub});
+}
+
+sub no {
+ call_sub($form->{no_nextsub});
+}
'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',
'Display' => 'Anzeigen',
'Display file' => 'Datei anzeigen',
'Do you want to <b>limit</b> your search?' => 'Wollen Sie Ihre Suche <b>spezialisieren</b>?',
+ '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.',
'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.',
'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',
'name_selected' => 'name_selected',
'new_item' => 'new_item',
'new_license' => 'new_license',
+ 'no' => 'no',
'order' => 'order',
'order_links' => 'order_links',
'orders' => 'orders',
'löschen' => 'delete',
'email' => 'e_mail',
'rechnung' => 'invoice',
+ 'nein' => 'no',
'auftrag' => 'order',
'drucken' => 'print',
'lieferantenauftrag' => 'purchase_order',
--- /dev/null
+<body>
+
+ <div class="listtop" width="100%">Lieferadresse übernehmen</div>
+
+ <p>Sie haben die folgende Lieferadresse eingegeben oder ausgewählt:</p>
+
+ <p>
+ <table>
+ <tr>
+ <th align="right" valign="top">Name:</th>
+ <td valign="top"><TMPL_VAR CFDD_shiptoname ESCAPE=HTML></td>
+ </tr>
+
+ <tr>
+ <th align="right" valign="top">Abteilung:</th>
+ <td valign="top"><TMPL_VAR CFDD_shiptodepartment_1 ESCAPE=HTML></td>
+ </tr>
+
+ <tr>
+ <th align="right" valign="top"> </th>
+ <td valign="top"><TMPL_VAR CFDD_shiptodepartment_2 ESCAPE=HTML></td>
+ </tr>
+
+ <tr>
+ <th align="right" valign="top">Straße:</th>
+ <td valign="top"><TMPL_VAR CFDD_shiptostreet ESCAPE=HTML></td>
+ </tr>
+
+ <tr>
+ <th align="right" valign="top">PLZ:</th>
+ <td valign="top"><TMPL_VAR CFDD_shiptozipcode ESCAPE=HTML></td>
+ </tr>
+
+ <tr>
+ <th align="right" valign="top">Stadt:</th>
+ <td valign="top"><TMPL_VAR CFDD_shiptocity ESCAPE=HTML></td>
+ </tr>
+
+ <tr>
+ <th align="right" valign="top">Land:</th>
+ <td valign="top"><TMPL_VAR CFDD_shiptocountry ESCAPE=HTML></td>
+ </tr>
+
+ <tr>
+ <th align="right" valign="top">Kontakt:</th>
+ <td valign="top"><TMPL_VAR CFDD_shiptocontact ESCAPE=HTML></td>
+ </tr>
+
+ <tr>
+ <th align="right" valign="top">Telefon:</th>
+ <td valign="top"><TMPL_VAR CFDD_shiptophone ESCAPE=HTML></td>
+ </tr>
+
+ <tr>
+ <th align="right" valign="top">Fax:</th>
+ <td valign="top"><TMPL_VAR CFDD_shiptofax ESCAPE=HTML></td>
+ </tr>
+
+ <tr>
+ <th align="right" valign="top">eMail:</th>
+ <td valign="top"><TMPL_VAR CFDD_shiptoemail ESCAPE=HTML></td>
+ </tr>
+ </table>
+ </p>
+
+ Wollen Sie diese Lieferadresse in den neuen Lieferantenauftrag übernehmen, damit der Händler die Waren direkt an Ihren Kunden liefern kann?
+ </p>
+
+ <form method="post" action="oe.pl">
+
+ <p>
+ <input type="submit" name="action" value="Ja">
+ <input type="submit" name="action" value="Nein">
+ </p>
+
+ <input type="hidden" name="yes_nextsub" value="check_for_direct_delivery_yes">
+ <input type="hidden" name="no_nextsub" value="check_for_direct_delivery_no">
+
+ <TMPL_LOOP VARIABLES>
+ <input type="hidden" name="<TMPL_VAR key ESCAPE=HTML>" value="<TMPL_VAR value ESCAPE=HTML>"></TMPL_LOOP>
+
+ </form>
+
+</body>
+</html>
--- /dev/null
+<body>
+
+ <div class="listtop" width="100%"><translate>Carry over shipping address</translate></div>
+
+ <p><translate>You have entered or selected the following shipping address for this customer:</translate></p>
+
+ <p>
+ <table>
+ <tr>
+ <th align="right" valign="top"><translate>Name</translate>:</th>
+ <td valign="top"><TMPL_VAR CFDD_shiptoname ESCAPE=HTML></td>
+ </tr>
+
+ <tr>
+ <th align="right" valign="top"><translate>Department</translate>:</th>
+ <td valign="top"><TMPL_VAR CFDD_shiptodepartment_1 ESCAPE=HTML></td>
+ </tr>
+
+ <tr>
+ <th align="right" valign="top"> </th>
+ <td valign="top"><TMPL_VAR CFDD_shiptodepartment_2 ESCAPE=HTML></td>
+ </tr>
+
+ <tr>
+ <th align="right" valign="top"><translate>Street</translate>:</th>
+ <td valign="top"><TMPL_VAR CFDD_shiptostreet ESCAPE=HTML></td>
+ </tr>
+
+ <tr>
+ <th align="right" valign="top"><translate>Zipcode</translate>:</th>
+ <td valign="top"><TMPL_VAR CFDD_shiptozipcode ESCAPE=HTML></td>
+ </tr>
+
+ <tr>
+ <th align="right" valign="top"><translate>City</translate>:</th>
+ <td valign="top"><TMPL_VAR CFDD_shiptocity ESCAPE=HTML></td>
+ </tr>
+
+ <tr>
+ <th align="right" valign="top"><translate>Country</translate>:</th>
+ <td valign="top"><TMPL_VAR CFDD_shiptocountry ESCAPE=HTML></td>
+ </tr>
+
+ <tr>
+ <th align="right" valign="top"><translate>Contact</translate>:</th>
+ <td valign="top"><TMPL_VAR CFDD_shiptocontact ESCAPE=HTML></td>
+ </tr>
+
+ <tr>
+ <th align="right" valign="top"><translate>Phone</translate>:</th>
+ <td valign="top"><TMPL_VAR CFDD_shiptophone ESCAPE=HTML></td>
+ </tr>
+
+ <tr>
+ <th align="right" valign="top"><translate>Fax</translate>:</th>
+ <td valign="top"><TMPL_VAR CFDD_shiptofax ESCAPE=HTML></td>
+ </tr>
+
+ <tr>
+ <th align="right" valign="top"><translate>E-mail</translate>:</th>
+ <td valign="top"><TMPL_VAR CFDD_shiptoemail ESCAPE=HTML></td>
+ </tr>
+ </table>
+ </p>
+
+ <translate>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?</translate>
+ </p>
+
+ <form method="post" action="oe.pl">
+
+ <p>
+ <input type="submit" name="action" value="<translate>Yes</translate>">
+ <input type="submit" name="action" value="<translate>No</translate>">
+ </p>
+
+ <input type="hidden" name="yes_nextsub" value="check_for_direct_delivery_yes">
+ <input type="hidden" name="no_nextsub" value="check_for_direct_delivery_no">
+
+ <TMPL_LOOP VARIABLES>
+ <input type="hidden" name="<TMPL_VAR key ESCAPE=HTML>" value="<TMPL_VAR value ESCAPE=HTML>"></TMPL_LOOP>
+
+ </form>
+
+</body>
+</html>