&{"$form->{display_form}"};
exit;
}
- if ( $form->{print_and_post}
- && $form->{second_run}
- && ($form->{action} eq "display_form")) {
- for (keys %$form) { $old_form->{$_} = $form->{$_} }
- $old_form->{rowcount}++;
-
- #$form->{rowcount}--;
- #$form->{rowcount}--;
-
- $form->{print_and_post} = 0;
-
- &print_form($old_form);
- exit;
- }
-
- $form->{action} = "";
- $form->{resubmit} = 0;
-
- if ($form->{print_and_post} && !$form->{second_run}) {
- $form->{second_run} = 1;
- $form->{action} = "display_form";
- $form->{rowcount}--;
- my $rowcount = $form->{rowcount};
-
- # get pricegroups for parts
- IS->get_pricegroups_for_parts(\%myconfig, \%$form);
-
- # build up html code for prices_$i
- set_pricegroup($rowcount);
-
- $form->{resubmit} = 1;
-
- }
+# if ( $form->{print_and_post}
+# && $form->{second_run}
+# && ($form->{action} eq "display_form")) {
+# for (keys %$form) { $old_form->{$_} = $form->{$_} }
+# $old_form->{rowcount}++;
+#
+# #$form->{rowcount}--;
+# #$form->{rowcount}--;
+#
+# $form->{print_and_post} = 0;
+#
+# &print_form($old_form);
+# exit;
+# }
+#
+# $form->{action} = "";
+# $form->{resubmit} = 0;
+#
+# if ($form->{print_and_post} && !$form->{second_run}) {
+# $form->{second_run} = 1;
+# $form->{action} = "display_form";
+# $form->{rowcount}--;
+# my $rowcount = $form->{rowcount};
+#
+# # get pricegroups for parts
+# IS->get_pricegroups_for_parts(\%myconfig, \%$form);
+#
+# # build up html code for prices_$i
+# set_pricegroup($rowcount);
+#
+# $form->{resubmit} = 1;
+#
+# }
&form_header;
$numrows = ++$form->{rowcount};
$form->{copies} = 3 unless $form->{copies};
$form->{PD}{ $form->{formname} } = "selected";
- $form->{DF}{ $form->{format} } = "";
+ $form->{DF}{ $form->{format} } = "selected";
$form->{OP}{ $form->{media} } = "selected";
$form->{SM}{ $form->{sendmode} } = "selected";
-
+ print(STDERR $form->{format} , " Format\n");
if ($form->{type} eq 'purchase_order') {
$type = qq|<select name=formname>
<option value=purchase_order $form->{PD}{purchase_order}>|
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') {
? $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();
{
$form->error("Access Denied");
}
-
&invoice_links;
&prepare_invoice;
+ $form->{format} ="pdf";
+
&display_form;
$lxdebug->leave_sub();
{
$form->error("Access Denied");
}
-
+ if ($form->{print_and_post}) {
+ $form->{action} = "print";
+ $form->{resubmit} = 1;
+ }
&invoice_links;
&prepare_invoice;
&display_form;
$form->{type} = "invoice";
$form->{formname} = "invoice";
- $form->{format} = "html";
$form->{media} = "screen";
if ($form->{id}) {
$button2 =
qq|<td width="13"><input name=duedate size=11 title="$myconfig{dateformat}" value=$form->{duedate}></td>|;
}
- if ($form->{resubmit}) {
- $onload = "document.invoice.submit()";
+ if ($form->{resubmit} && ($form->{format} eq "html")) {
+ $onload = qq|window.open('about:blank','Beleg'); document.invoice.target = 'Beleg';document.invoice.submit()|;
+ } elsif($form->{resubmit}) {
+ $onload = qq|document.invoice.submit()|;
} else {
$onload = "fokus()";
}
<input type=hidden name=selectAR_paid value="$form->{selectAR_paid}">
<input type=hidden name=oldinvtotal value=$form->{oldinvtotal}>
<input type=hidden name=oldtotalpaid value=$totalpaid>
-<input type=hidden name=print_and_post value=$form->{print_and_post}>
-<input type=hidden name=second_run value=$form->{second_run}>
</table>
</td>
</tr>
$form->{print_and_post} = 1;
&post();
- &display_form();
+ &edit();
$lxdebug->leave_sub();
}