416 |
416 |
# build html-code for pricegroups in variable $form->{prices_$j}
|
417 |
417 |
|
418 |
418 |
sub set_pricegroup {
|
|
419 |
my $rowcount = shift;
|
419 |
420 |
$lxdebug->enter_sub();
|
420 |
|
print STDERR "io.pl-set_pricegroup-i-$i\n";
|
421 |
|
for $j (1 .. $i) {
|
|
421 |
for $j (1 .. $rowcount) {
|
422 |
422 |
|
423 |
423 |
my $pricegroup_old = $form->{"pricegroup_old_$i"};
|
424 |
424 |
if ($form->{PRICES}{ $j }) {
|
... | ... | |
426 |
426 |
$prices = '';
|
427 |
427 |
$price = 0;
|
428 |
428 |
foreach $item (@{ $form->{PRICES}{ $j } }) {
|
429 |
|
print STDERR "TEST--i--$i--jjj-$j\n";
|
430 |
429 |
# print STDERR "-VOR PREIS--$item->{price}--PREISGRUOP-$item->{pricegroup_id}\n";
|
431 |
430 |
$price = $form->round_amount($myconfig, $item->{price},5);
|
432 |
431 |
$price = $form->format_amount($myconfig, $item->{price},2);
|
... | ... | |
452 |
451 |
}
|
453 |
452 |
}
|
454 |
453 |
}
|
455 |
|
print (STDERR "", Dumper($form->{PRICES}));
|
456 |
454 |
$lxdebug->leave_sub();
|
457 |
455 |
}
|
458 |
456 |
|
... | ... | |
748 |
746 |
|
749 |
747 |
sub display_form {
|
750 |
748 |
$lxdebug->enter_sub();
|
751 |
|
print STDERR "io.pl-display_form\n";
|
|
749 |
|
752 |
750 |
# if we have a display_form
|
753 |
751 |
if ($form->{display_form}) {
|
754 |
752 |
&{"$form->{display_form}"};
|
755 |
|
print STDERR " --------------------- exit\n";
|
756 |
753 |
exit;
|
757 |
754 |
}
|
758 |
755 |
if ( $form->{print_and_post}
|
... | ... | |
777 |
774 |
$form->{second_run} = 1;
|
778 |
775 |
$form->{action} = "display_form";
|
779 |
776 |
$form->{rowcount}--;
|
|
777 |
my $rowcount = $form->{rowcount};
|
|
778 |
# get pricegroups for parts
|
|
779 |
IS->get_pricegroups_for_parts(\%myconfig, \%$form, "new");
|
|
780 |
# build up html code for prices_$i
|
|
781 |
set_pricegroup($rowcount);
|
|
782 |
|
780 |
783 |
|
781 |
784 |
$form->{resubmit} = 1;
|
782 |
785 |
|
... | ... | |
787 |
790 |
$subroutine = "display_row";
|
788 |
791 |
|
789 |
792 |
if ($form->{item} eq 'part') {
|
790 |
|
print STDERR " part\n";
|
791 |
793 |
#set preisgruppenanzahl
|
792 |
794 |
$numrows = $form->{price_rows};
|
793 |
795 |
$subroutine = "price_row";
|
... | ... | |
798 |
800 |
$subroutine = "makemodel_row";
|
799 |
801 |
}
|
800 |
802 |
if ($form->{item} eq 'assembly') {
|
801 |
|
print STDERR " assembly\n";
|
802 |
803 |
$numrows = ++$form->{price_rows};
|
803 |
804 |
$subroutine = "price_row";
|
804 |
805 |
|
... | ... | |
814 |
815 |
$subroutine = "assembly_row";
|
815 |
816 |
}
|
816 |
817 |
if ($form->{item} eq 'service') {
|
817 |
|
print STDERR " service\n";
|
818 |
818 |
$numrows = ++$form->{price_rows};
|
819 |
819 |
$subroutine = "price_row";
|
820 |
820 |
|
... | ... | |
828 |
828 |
|
829 |
829 |
&form_footer;
|
830 |
830 |
|
831 |
|
# if ($form->{print_and_post}) {
|
832 |
|
# &display_form;
|
833 |
|
# }
|
834 |
|
|
835 |
831 |
$lxdebug->leave_sub();
|
836 |
832 |
}
|
837 |
833 |
|
... | ... | |
942 |
938 |
}
|
943 |
939 |
|
944 |
940 |
#sk
|
945 |
|
print STDERR "LEVEL--$form->{level}\n";
|
946 |
|
print STDERR "Type--$form->{type}\n";
|
947 |
941 |
# if pricegroups
|
948 |
942 |
if ($form->{type} =~ (/sales_quotation/) or (($form->{level} =~ /Sales/) and ($form->{type} =~ /invoice/)) or (($form->{level} eq undef) and ($form->{type} =~ /invoice/)) or ($form->{type} =~ /sales_order/)) {
|
949 |
943 |
|
... | ... | |
1017 |
1011 |
|
1018 |
1012 |
sub order {
|
1019 |
1013 |
$lxdebug->enter_sub();
|
1020 |
|
|
|
1014 |
if ($form->{second_run}) {
|
|
1015 |
$form->{print_and_post} = 0;
|
|
1016 |
}
|
1021 |
1017 |
$form->{ordnumber} = $form->{invnumber};
|
1022 |
1018 |
|
1023 |
1019 |
map { delete $form->{$_} } qw(id printed emailed queued);
|
... | ... | |
1070 |
1066 |
|
1071 |
1067 |
sub quotation {
|
1072 |
1068 |
$lxdebug->enter_sub();
|
1073 |
|
|
|
1069 |
if ($form->{second_run}) {
|
|
1070 |
$form->{print_and_post} = 0;
|
|
1071 |
}
|
1074 |
1072 |
map { delete $form->{$_} } qw(id printed emailed queued);
|
1075 |
1073 |
|
1076 |
1074 |
if ($form->{script} eq 'ir.pl' || $form->{type} eq 'purchase_order') {
|
... | ... | |
1122 |
1120 |
|
1123 |
1121 |
sub e_mail {
|
1124 |
1122 |
$lxdebug->enter_sub();
|
1125 |
|
|
|
1123 |
if ($form->{second_run}) {
|
|
1124 |
$form->{print_and_post} = 0;
|
|
1125 |
$form->{resubmit} = 0;
|
|
1126 |
}
|
1126 |
1127 |
if ($myconfig{role} eq 'admin') {
|
1127 |
1128 |
$bcc = qq|
|
1128 |
1129 |
<th align=right nowrap=true>| . $locale->text('Bcc') . qq|</th>
|
... | ... | |
1391 |
1392 |
|
1392 |
1393 |
sub print {
|
1393 |
1394 |
$lxdebug->enter_sub();
|
1394 |
|
print STDERR "io.pl-print\n";
|
|
1395 |
if ($form->{second_run}) {
|
|
1396 |
$form->{print_and_post} = 0;
|
|
1397 |
}
|
1395 |
1398 |
# if this goes to the printer pass through
|
1396 |
1399 |
if ($form->{media} eq 'printer' || $form->{media} eq 'queue') {
|
1397 |
1400 |
$form->error($locale->text('Select postscript or PDF!'))
|
... | ... | |
1409 |
1412 |
sub print_form {
|
1410 |
1413 |
$lxdebug->enter_sub();
|
1411 |
1414 |
my ($old_form) = @_;
|
1412 |
|
print STDERR "io.pl-print_form\n";
|
|
1415 |
|
1413 |
1416 |
$inv = "inv";
|
1414 |
1417 |
$due = "due";
|
1415 |
|
#print (STDERR "", Dumper($form));
|
1416 |
1418 |
$numberfld = "invnumber";
|
1417 |
1419 |
|
1418 |
1420 |
$display_form =
|
... | ... | |
1735 |
1737 |
|
1736 |
1738 |
sub ship_to {
|
1737 |
1739 |
$lxdebug->enter_sub();
|
1738 |
|
print STDERR "io.pl-ship_to\n";
|
|
1740 |
if ($form->{second_run}) {
|
|
1741 |
$form->{print_and_post} = 0;
|
|
1742 |
}
|
|
1743 |
|
1739 |
1744 |
$title = $form->{title};
|
1740 |
1745 |
$form->{title} = $locale->text('Ship to');
|
1741 |
1746 |
|
Fehler bei Drucken und Buchen und Preisgruppen behoben, Preisgruppen Quelltext ein wenig modifiziert