Revision c103dedd
Von Philip Reetz vor etwa 19 Jahren hinzugefügt
bin/mozilla/io.pl | ||
---|---|---|
199 | 199 |
|
200 | 200 |
# undo formatting |
201 | 201 |
map { |
202 |
$form->{"${_}_$i"} = $form->parse_amount(\%myconfig, $form->{"${_}_$i"}) |
|
202 |
$form->{"${_}_$i"} = |
|
203 |
$form->parse_amount(\%myconfig, $form->{"${_}_$i"}) |
|
203 | 204 |
} qw(qty ship discount sellprice); |
204 | 205 |
|
205 | 206 |
($dec) = ($form->{"sellprice_$i"} =~ /\.(\d+)/); |
... | ... | |
643 | 644 |
&{"$form->{display_form}"}; |
644 | 645 |
exit; |
645 | 646 |
} |
647 |
if ( $form->{print_and_post} |
|
648 |
&& $form->{second_run} |
|
649 |
&& ($form->{action} eq "display_form")) { |
|
650 |
for (keys %$form) { $old_form->{$_} = $form->{$_} } |
|
651 |
$old_form->{rowcount}++; |
|
646 | 652 |
|
653 |
#$form->{rowcount}--; |
|
654 |
#$form->{rowcount}--; |
|
655 |
|
|
656 |
$form->{print_and_post} = 0; |
|
657 |
|
|
658 |
&print_form($old_form); |
|
659 |
exit; |
|
660 |
} |
|
661 |
|
|
662 |
$form->{action} = ""; |
|
663 |
$form->{resubmit} = 0; |
|
664 |
|
|
665 |
if ($form->{print_and_post} && !$form->{second_run}) { |
|
666 |
$form->{second_run} = 1; |
|
667 |
$form->{action} = "display_form"; |
|
668 |
$form->{rowcount}--; |
|
669 |
|
|
670 |
$form->{resubmit} = 1; |
|
671 |
|
|
672 |
} |
|
647 | 673 |
&form_header; |
648 | 674 |
|
649 | 675 |
$numrows = ++$form->{rowcount}; |
... | ... | |
672 | 698 |
|
673 | 699 |
&form_footer; |
674 | 700 |
|
701 |
# if ($form->{print_and_post}) { |
|
702 |
# &display_form; |
|
703 |
# } |
|
704 |
|
|
675 | 705 |
$lxdebug->leave_sub(); |
676 | 706 |
} |
677 | 707 |
|
... | ... | |
680 | 710 |
|
681 | 711 |
my @a = (); |
682 | 712 |
my $count = 0; |
683 |
my @flds = ( |
|
713 |
my @flds = (
|
|
684 | 714 |
qw(id partnumber description qty ship sellprice unit discount inventory_accno income_accno expense_accno listprice taxaccounts bin assembly weight projectnumber project_id oldprojectnumber runningnumber serialnumber partsgroup) |
685 | 715 |
); |
686 | 716 |
|
... | ... | |
1323 | 1353 |
# $locale->text('Quotation Date missing!') |
1324 | 1354 |
|
1325 | 1355 |
# assign number |
1326 |
if (!$form->{"${inv}number"}) { |
|
1356 |
if (!$form->{"${inv}number"} && !$form->{preview}) {
|
|
1327 | 1357 |
$form->{"${inv}number"} = $form->update_defaults(\%myconfig, $numberfld); |
1328 | 1358 |
if ($form->{media} ne 'email') { |
1329 | 1359 |
$form->{rowcount}--; |
... | ... | |
1513 | 1543 |
? $locale->text('sent to printer') |
1514 | 1544 |
: $locale->text('emailed to') . " $form->{email}"; |
1515 | 1545 |
$form->redirect(qq|$form->{label} $form->{"${inv}number"} $msg|); |
1546 |
} else { |
|
1547 |
&{"$display_form"}; |
|
1516 | 1548 |
} |
1517 | 1549 |
|
1518 | 1550 |
$lxdebug->leave_sub(); |
... | ... | |
1553 | 1585 |
map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) } |
1554 | 1586 |
qw(exchangerate creditlimit creditremaining); |
1555 | 1587 |
$form_id = $form->{id}; |
1588 |
|
|
1556 | 1589 |
# get details for name |
1557 | 1590 |
&{"$form->{vc}_details"}; |
1558 | 1591 |
$form->{id} = $form_id; |
... | ... | |
1579 | 1612 |
<table> |
1580 | 1613 |
<tr class=listheading> |
1581 | 1614 |
<th class=listheading colspan=2 width=50%>| |
1582 |
. $locale->text('Billing Address') |
|
1583 |
. qq|</th> |
|
1615 |
. $locale->text('Billing Address') . qq|</th> |
|
1584 | 1616 |
<th class=listheading width=50%>| |
1585 |
. $locale->text('Shipping Address') |
|
1586 |
. qq|</th> |
|
1617 |
. $locale->text('Shipping Address') . qq|</th> |
|
1587 | 1618 |
</tr> |
1588 | 1619 |
<tr height="5"></tr> |
1589 | 1620 |
<tr> |
bin/mozilla/is.pl | ||
---|---|---|
315 | 315 |
$button1 = qq| |
316 | 316 |
<td><input name=invdate id=invdate size=11 title="$myconfig{dateformat}" value=$form->{invdate}></td> |
317 | 317 |
<td><input type=button name=invdate id="trigger1" value=| |
318 |
. $locale->text('button') |
|
319 |
. qq|></td> |
|
318 |
. $locale->text('button') . qq|></td> |
|
320 | 319 |
|; |
321 | 320 |
$button2 = qq| |
322 | 321 |
<td width="13"><input name=duedate id=duedate size=11 title="$myconfig{dateformat}" value=$form->{duedate}></td> |
323 | 322 |
<td width="4"><input type=button name=duedate id="trigger2" value=| |
324 |
. $locale->text('button') |
|
325 |
. qq|></td></td> |
|
323 |
. $locale->text('button') . qq|></td></td> |
|
326 | 324 |
|; |
327 | 325 |
|
328 | 326 |
#write Trigger |
... | ... | |
337 | 335 |
$button2 = |
338 | 336 |
qq|<td width="13"><input name=duedate size=11 title="$myconfig{dateformat}" value=$form->{duedate}></td>|; |
339 | 337 |
} |
340 |
|
|
338 |
if ($form->{resubmit}) { |
|
339 |
$onload = "document.invoice.submit()"; |
|
340 |
} else { |
|
341 |
$onload = "fokus()"; |
|
342 |
} |
|
341 | 343 |
$form->header; |
342 | 344 |
|
343 | 345 |
print qq| |
344 |
<body onLoad="fokus()">
|
|
346 |
<body onLoad="$onload">
|
|
345 | 347 |
|
346 | 348 |
<form method=post name="invoice" action=$form->{script}> |
347 | 349 |
|
348 | 350 |
|
349 | 351 |
<input type=hidden name=id value=$form->{id}> |
352 |
<input type=hidden name=action value=$form->{action}> |
|
350 | 353 |
|
351 | 354 |
<input type=hidden name=type value=$form->{type}> |
352 | 355 |
<input type=hidden name=media value=$form->{media}> |
... | ... | |
389 | 392 |
<input type=hidden name=customer_id value=$form->{customer_id}> |
390 | 393 |
<input type=hidden name=oldcustomer value="$form->{oldcustomer}"> |
391 | 394 |
<th align=richt nowrap>| |
392 |
. $locale->text('Contact Person') |
|
393 |
. qq|</th> |
|
395 |
. $locale->text('Contact Person') . qq|</th> |
|
394 | 396 |
<td colspan=3>$contact</td> |
395 | 397 |
</tr> |
396 | 398 |
<tr> |
... | ... | |
533 | 535 |
if ($form->{taxaccounts}) { |
534 | 536 |
$taxincluded = qq| |
535 | 537 |
<input name=taxincluded class=checkbox type=checkbox value=1 $form->{taxincluded}> <b>| |
536 |
. $locale->text('Tax Included') |
|
537 |
. qq|</b><br><br>|; |
|
538 |
. $locale->text('Tax Included') . qq|</b><br><br>|; |
|
538 | 539 |
} |
539 | 540 |
|
540 | 541 |
if (!$form->{taxincluded}) { |
... | ... | |
673 | 674 |
<table width=100%> |
674 | 675 |
<tr class=listheading> |
675 | 676 |
<th colspan=6 class=listheading>| |
676 |
. $locale->text('Incoming Payments') |
|
677 |
. qq|</th> |
|
677 |
. $locale->text('Incoming Payments') . qq|</th> |
|
678 | 678 |
</tr> |
679 | 679 |
|; |
680 | 680 |
|
... | ... | |
753 | 753 |
<input type=hidden name=selectAR_paid value="$form->{selectAR_paid}"> |
754 | 754 |
<input type=hidden name=oldinvtotal value=$form->{oldinvtotal}> |
755 | 755 |
<input type=hidden name=oldtotalpaid value=$totalpaid> |
756 |
</table> |
|
756 |
<input type=hidden name=print_and_post value=$form->{print_and_post}> |
|
757 |
<input type=hidden name=second_run value=$form->{second_run}> |
|
758 |
</table> |
|
757 | 759 |
</td> |
758 | 760 |
</tr> |
759 | 761 |
<tr> |
... | ... | |
813 | 815 |
<input class=submit type=submit name=action value="| |
814 | 816 |
. $locale->text('Ship to') . qq|"> |
815 | 817 |
<input class=submit type=submit name=action value="| |
816 |
. $locale->text('Print') . qq|">
|
|
818 |
. $locale->text('Preview') . qq|">
|
|
817 | 819 |
<input class=submit type=submit name=action value="| |
818 | 820 |
. $locale->text('E-mail') . qq|"> |
821 |
<input class=submit type=submit name=action value="| |
|
822 |
. $locale->text('Print and Post') . qq|"> |
|
819 | 823 |
<input class=submit type=submit name=action value="| |
820 | 824 |
. $locale->text('Post') . qq|">|; |
821 | 825 |
} |
... | ... | |
1047 | 1051 |
|
1048 | 1052 |
$form->{invnumber} = $form->update_defaults(\%myconfig, "invnumber") |
1049 | 1053 |
unless $form->{invnumber}; |
1050 |
|
|
1051 |
$form->redirect( |
|
1054 |
if ($print_post) { |
|
1055 |
if (!(IS->post_invoice(\%myconfig, \%$form))) { |
|
1056 |
$form->error($locale->text('Cannot post invoice!')); |
|
1057 |
} |
|
1058 |
} else { |
|
1059 |
$form->redirect( |
|
1052 | 1060 |
$form->{label} . " $form->{invnumber} " . $locale->text('posted!')) |
1053 |
if (IS->post_invoice(\%myconfig, \%$form)); |
|
1054 |
$form->error($locale->text('Cannot post invoice!')); |
|
1061 |
if (IS->post_invoice(\%myconfig, \%$form)); |
|
1062 |
$form->error($locale->text('Cannot post invoice!')); |
|
1063 |
} |
|
1055 | 1064 |
|
1056 | 1065 |
$lxdebug->leave_sub(); |
1057 | 1066 |
} |
1058 | 1067 |
|
1068 |
sub print_and_post { |
|
1069 |
$lxdebug->enter_sub(); |
|
1070 |
|
|
1071 |
$old_form = new Form; |
|
1072 |
$print_post = 1; |
|
1073 |
$form->{print_and_post} = 1; |
|
1074 |
&post(); |
|
1075 |
&display_form(); |
|
1076 |
$lxdebug->leave_sub(); |
|
1077 |
|
|
1078 |
} |
|
1079 |
|
|
1080 |
sub preview { |
|
1081 |
$lxdebug->enter_sub(); |
|
1082 |
|
|
1083 |
$form->{preview} = 1; |
|
1084 |
$old_form = new Form; |
|
1085 |
for (keys %$form) { $old_form->{$_} = $form->{$_} } |
|
1086 |
$old_form->{rowcount}++; |
|
1087 |
|
|
1088 |
&print_form($old_form); |
|
1089 |
$lxdebug->leave_sub(); |
|
1090 |
|
|
1091 |
} |
|
1092 |
|
|
1059 | 1093 |
sub delete { |
1060 | 1094 |
$lxdebug->enter_sub(); |
1061 | 1095 |
|
Auch abrufbar als: Unified diff
Funktion fuer Druckvorschau und Drucken+Buchen zu Verkaufsrechnungen hinzugefuegt