Revision 4d86fbb2
Von Sven Schöling vor mehr als 17 Jahren hinzugefügt
bin/mozilla/cp.pl | ||
---|---|---|
36 | 36 |
use SL::IS; |
37 | 37 |
use SL::IR; |
38 | 38 |
|
39 |
use strict ("vars", "subs"); |
|
40 |
#use warnings; |
|
41 |
|
|
39 | 42 |
require "bin/mozilla/arap.pl"; |
40 | 43 |
require "bin/mozilla/common.pl"; |
41 | 44 |
|
45 |
our ($form, %myconfig, $lxdebug, $locale); |
|
46 |
|
|
42 | 47 |
1; |
43 | 48 |
|
44 | 49 |
# end of main |
... | ... | |
46 | 51 |
sub payment { |
47 | 52 |
$lxdebug->enter_sub(); |
48 | 53 |
|
54 |
my (@curr); |
|
55 |
|
|
49 | 56 |
$form->{ARAP} = ($form->{type} eq 'receipt') ? "AR" : "AP"; |
50 | 57 |
$form->{arap} = lc $form->{ARAP}; |
51 | 58 |
|
... | ... | |
107 | 114 |
sub form_header { |
108 | 115 |
$lxdebug->enter_sub(); |
109 | 116 |
|
117 |
my ($vc, $vclabel, $allvc, $arap, $department, $exchangerate); |
|
118 |
my ($jsscript, $button1, $button2, $onload); |
|
119 |
|
|
110 | 120 |
$vclabel = ucfirst $form->{vc}; |
111 | 121 |
$vclabel = $locale->text($vclabel); |
112 | 122 |
|
... | ... | |
146 | 156 |
} |
147 | 157 |
} |
148 | 158 |
|
149 |
foreach $item ($form->{vc}, account, currency, $form->{ARAP}, department) {
|
|
159 |
foreach my $item ($form->{vc}, "account", "currency", $form->{ARAP}, "department") {
|
|
150 | 160 |
$form->{"select$item"} =~ s/ selected//; |
151 | 161 |
$form->{"select$item"} =~ |
152 | 162 |
s/option>\Q$form->{$item}\E/option selected>$form->{$item}/; |
... | ... | |
320 | 330 |
sub list_invoices { |
321 | 331 |
$lxdebug->enter_sub(); |
322 | 332 |
|
333 |
my (@column_index, %column_data, $colspan, $invoice); |
|
334 |
my ($totalamount, $totaldue, $totalpaid); |
|
335 |
|
|
323 | 336 |
@column_index = qw(invnumber transdate amount due checked paid); |
324 | 337 |
|
325 | 338 |
$colspan = $#column_index + 1; |
... | ... | |
357 | 370 |
</tr> |
358 | 371 |
|; |
359 | 372 |
|
360 |
for $i (1 .. $form->{rowcount}) { |
|
373 |
for my $i (1 .. $form->{rowcount}) { |
|
374 |
|
|
375 |
my $j = 0; |
|
361 | 376 |
|
362 | 377 |
map { |
363 | 378 |
$form->{"${_}_$i"} = |
... | ... | |
434 | 449 |
sub form_footer { |
435 | 450 |
$lxdebug->enter_sub(); |
436 | 451 |
|
452 |
my ($media, $format, $latex_templates); |
|
453 |
|
|
437 | 454 |
$form->{DF}{ $form->{format} } = "selected"; |
438 | 455 |
$form->{OP}{ $form->{media} } = "selected"; |
439 | 456 |
|
... | ... | |
494 | 511 |
|
495 | 512 |
my ($new_name_selected) = @_; |
496 | 513 |
|
514 |
my ($buysell, $newvc, $updated, $exchangerate, $amount); |
|
515 |
|
|
497 | 516 |
if ($form->{vc} eq 'customer') { |
498 | 517 |
$buysell = "buy"; |
499 | 518 |
} else { |
... | ... | |
568 | 587 |
|
569 | 588 |
$form->{queued} = ""; |
570 | 589 |
|
571 |
$i = 0; |
|
572 |
foreach $ref (@{ $form->{PR} }) { |
|
590 |
my $i = 0;
|
|
591 |
foreach my $ref (@{ $form->{PR} }) {
|
|
573 | 592 |
$i++; |
574 | 593 |
$form->{"id_$i"} = $ref->{id}; |
575 | 594 |
$form->{"invnumber_$i"} = $ref->{invnumber}; |
... | ... | |
596 | 615 |
# Modified from $amount = $form->{amount} by J.Zach to update amount to total |
597 | 616 |
# payment amount in Zahlungsausgang |
598 | 617 |
$amount = 0; |
599 |
for $i (1 .. $form->{rowcount}) { |
|
618 |
for my $i (1 .. $form->{rowcount}) {
|
|
600 | 619 |
|
601 | 620 |
map { |
602 | 621 |
$form->{"${_}_$i"} = |
... | ... | |
644 | 663 |
unless $form->{exchangerate}; |
645 | 664 |
} |
646 | 665 |
|
647 |
$msg1 = "$form->{origtitle} posted!"; |
|
648 |
$msg2 = "Cannot post $form->{origtitle}!"; |
|
666 |
my $msg1 = "$form->{origtitle} posted!";
|
|
667 |
my $msg2 = "Cannot post $form->{origtitle}!";
|
|
649 | 668 |
|
650 | 669 |
# $locale->text('Payment posted!') |
651 | 670 |
# $locale->text('Receipt posted!') |
... | ... | |
662 | 681 |
sub print { |
663 | 682 |
$lxdebug->enter_sub(); |
664 | 683 |
|
684 |
my ($whole, $check, %queued, $spool, $filename, $userspath); |
|
685 |
|
|
665 | 686 |
&check_form; |
666 | 687 |
|
667 | 688 |
($whole, $form->{decimal}) = split(/\./, $form->{amount}); |
... | ... | |
734 | 755 |
sub check_form { |
735 | 756 |
$lxdebug->enter_sub(); |
736 | 757 |
|
758 |
my ($closedto, $datepaid, $amount); |
|
759 |
|
|
737 | 760 |
&check_name($form->{vc}); |
738 | 761 |
|
739 | 762 |
if ($form->{currency} ne $form->{oldcurrency}) { |
... | ... | |
753 | 776 |
$amount = $form->parse_amount(\%myconfig, $form->{amount}); |
754 | 777 |
$form->{amount} = $amount; |
755 | 778 |
|
756 |
for $i (1 .. $form->{rowcount}) { |
|
779 |
for my $i (1 .. $form->{rowcount}) {
|
|
757 | 780 |
if ($form->parse_amount(\%myconfig, $form->{"paid_$i"})) { |
758 |
$amount -= $form->parse_amount($myconfig, $form->{"paid_$i"});
|
|
781 |
$amount -= $form->parse_amount(\%myconfig, $form->{"paid_$i"});
|
|
759 | 782 |
|
760 | 783 |
push(@{ $form->{paid} }, $form->{"paid_$i"}); |
761 | 784 |
push(@{ $form->{due} }, $form->{"due_$i"}); |
Auch abrufbar als: Unified diff
cp auf use strict (compile time) gebracht