$type |
- $language
+ | ${language_select} |
$format |
$media |
|;
- if ($myconfig{printer} && $latex && $form->{media} ne 'email') {
+ if ($myconfig{printer} && $latex_templates && $form->{media} ne 'email') {
print qq|
| . $locale->text('Copies') . qq|
{copies}> |
@@ -1398,9 +1429,6 @@ sub print_options {
sub print {
$lxdebug->enter_sub();
- if ($form->{second_run}) {
- $form->{print_and_post} = 0;
- }
# if this goes to the printer pass through
if ($form->{media} eq 'printer' || $form->{media} eq 'queue') {
@@ -1454,6 +1482,8 @@ sub print_form {
$form->{invdate} = $form->{"${inv}date"} = $form->{transdate};
$form->{label} = $locale->text('Packing List');
$order = 1;
+ # set invnumber for template packing_list
+ $form->{invnumber} = $form->{ordnumber};
}
if ($form->{formname} eq 'pick_list') {
$inv = "ord";
@@ -1533,9 +1563,9 @@ sub print_form {
my ($saved_email, $saved_cc, $saved_bcc) =
($form->{"email"}, $form->{"cc"}, $form->{"bcc"});
- $language = $form->{language};
+ $language_saved = $form->{language};
&{"$form->{vc}_details"};
- $form->{language} = $language;
+ $form->{language} = $language_saved;
$form->{"email"} = $saved_email if ($saved_email);
$form->{"cc"} = $saved_cc if ($saved_cc);
@@ -1546,7 +1576,8 @@ sub print_form {
push @a,
("partnumber_$i", "description_$i",
"partsgroup_$i", "serialnumber_$i",
- "bin_$i", "unit_$i");
+ "bin_$i", "unit_$i",
+ "transdate_$i", "ordnumber_$i");
}
map { push @a, "${_}_description" } split / /, $form->{taxaccounts};
@@ -1571,8 +1602,16 @@ sub print_form {
IS->invoice_details(\%myconfig, \%$form, $locale);
}
+ # format global dates
map { $form->{$_} = $locale->date(\%myconfig, $form->{$_}, 1) }
- ("${inv}date", "${due}date", "shippingdate");
+ ("${inv}date", "${due}date", "shippingdate", "deliverydate");
+
+ # format item dates
+ for my $field (qw(transdate_oe deliverydate_oe)) {
+ map {
+ $form->{$field}[$_] = $locale->date(\%myconfig, $form->{$field}[$_], 1);
+ } 0 .. $#{ $form->{$field} };
+ }
@a = qw(name street zipcode city country);
@@ -1600,9 +1639,9 @@ sub print_form {
# some of the stuff could have umlauts so we translate them
push @a,
- qw(shiptoname shiptostreet shiptozipcode shiptocity shiptocountry shiptoemail shippingpoint shipvia company address signature employee contact);
+ qw(shiptoname shiptostreet shiptozipcode shiptocity shiptocountry shiptoemail shippingpoint shipvia company address signature employee contact department_1 department_2);
- push @a, ("${inv}date", "${due}date", email, cc, bcc);
+ push @a, ("${inv}date", "${due}date", "deliverydate", email, cc, bcc);
$form->format_string(@a);
@@ -1708,8 +1747,6 @@ sub print_form {
? $locale->text('sent to printer')
: $locale->text('emailed to') . " $form->{email}";
$form->redirect(qq|$form->{label} $form->{"${inv}number"} $msg|);
- } else {
- &{"$display_form"};
}
$lxdebug->leave_sub();