require "bin/mozilla/common.pl";
+use strict;
+
# any custom scripts for this one
if (-f "bin/mozilla/custom_invoice_io.pl") {
eval { require "bin/mozilla/custom_ivvoice_io.pl"; };
}
-if (-f "bin/mozilla/$form->{login}_invoice_io.pl") {
- eval { require "bin/mozilla/$form->{login}_invoice_io.pl"; };
+if (-f "bin/mozilla/$main::form->{login}_invoice_io.pl") {
+ eval { require "bin/mozilla/$main::form->{login}_invoice_io.pl"; };
}
1;
# neue Optik im Rechnungsformular #
########################################
#sub display_row {
-# $lxdebug->enter_sub();
+# $main::lxdebug->enter_sub();
# my $numrows = shift;
#
# my $is_sales =
# $qty_dec = length $qty_dec;
#
# $column_data{qty} =
-# qq|<td align="right"><input name="qty_$i" size="5" value="|
+# qq|<td align="right" nowrap><input name="qty_$i" size="5" value="|
# . $form->format_amount(\%myconfig, $form->{"qty_$i"}, $qty_dec) .qq|">|;
# if ($form->{"formel_$i"}) {
# $column_data{qty} .= qq|<button type="button" onclick="calculate_qty_selection_window('qty_$i','alu_$i', 'formel_$i', $i)">| . $locale->text('*/') . qq|</button>|
# # for last row
# $column_data{sellprice_pg} = qq|<td align="right"> </td>|;
# }
-#
+#
# $column_data{sellprice} =
# qq|<td><input name="sellprice_$i" size="10" onBlur=\"check_right_number_format(this)\" value="|
# . $form->format_amount(\%myconfig, $form->{"sellprice_$i"},
# $form->{marge_percent} = ($form->{sellprice_total} - $form->{lastcost_total}) / $form->{sellprice_total} * 100;
# }
#
-# $lxdebug->leave_sub();
+# $main::lxdebug->leave_sub();
#}
sub set_pricegroup {
- $lxdebug->enter_sub();
+ $main::lxdebug->enter_sub();
+
+ my $form = $main::form;
+ my %myconfig = %main::myconfig;
+ my $locale = $main::locale;
+
my $rowcount = shift;
- for $j (1 .. $rowcount) {
- my $pricegroup_old = $form->{"pricegroup_old_$i"};
+ for my $j (1 .. $rowcount) {
+ my $pricegroup_old = $form->{"pricegroup_old_$j"};
if ($form->{PRICES}{$j}) {
- $len = 0;
- $prices = '<option value="--">' . $locale->text("none (pricegroup)") . '</option>';
- $price = 0;
- foreach $item (@{ $form->{PRICES}{$j} }) {
+ my $len = 0;
+ my $prices = '<option value="--">' . $locale->text("none (pricegroup)") . '</option>';
+ my $price = 0;
+ foreach my $item (@{ $form->{PRICES}{$j} }) {
#$price = $form->round_amount($myconfig, $item->{price}, 5);
#$price = $form->format_amount($myconfig, $item->{price}, 2);
- $price = $item->{price};
- $pricegroup_id = $item->{pricegroup_id};
- $pricegroup = $item->{pricegroup};
+ my $price = $item->{price};
+ my $pricegroup_id = $item->{pricegroup_id};
+ my $pricegroup = $item->{pricegroup};
# build drop down list for pricegroups
$prices .=
$form->{"prices_$j"} = $prices;
}
}
- $lxdebug->leave_sub();
+ $main::lxdebug->leave_sub();
}
sub display_form {
- $lxdebug->enter_sub();
+ $main::lxdebug->enter_sub();
- $auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' .
- 'request_quotation_edit | sales_quotation_edit | purchase_order_edit');
+ my $form = $main::form;
+ my %myconfig = %main::myconfig;
+
+ $main::auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' .
+ 'request_quotation_edit | sales_quotation_edit | purchase_order_edit | '.
+ 'purchase_delivery_order_edit | sales_delivery_order_edit');
relink_accounts();
retrieve_partunits() if ($form->{type} =~ /_delivery_order$/);
exit;
}
- Common::webdav_folder($form) if ($webdav);
+ Common::webdav_folder($form) if ($main::webdav);
# if ( $form->{print_and_post}
# && $form->{second_run}
# }
&form_header;
- $numrows = ++$form->{rowcount};
- $subroutine = "display_row";
+ {
+ no strict 'refs';
- if ($form->{item} eq 'part') {
+ my $numrows = ++$form->{rowcount};
+ my $subroutine = "display_row";
- #set preisgruppenanzahl
- $numrows = $form->{price_rows};
- $subroutine = "price_row";
+ if ($form->{item} eq 'part') {
- &{$subroutine}($numrows);
+ #set preisgruppenanzahl
+ $numrows = $form->{price_rows};
+ $subroutine = "price_row";
- $numrows = 0;
- }
- if ($form->{item} eq 'assembly') {
- $numrows = $form->{price_rows};
- $subroutine = "price_row";
+ &{$subroutine}($numrows);
- &{$subroutine}($numrows);
+ $numrows = ++$form->{makemodel_rows};
+ $subroutine = "makemodel_row";
+ }
+ if ($form->{item} eq 'assembly') {
+ $numrows = $form->{price_rows};
+ $subroutine = "price_row";
- $numrows = ++$form->{makemodel_rows};
- $subroutine = "makemodel_row";
+ &{$subroutine}($numrows);
- # create makemodel rows
- &{$subroutine}($numrows);
+ $numrows = ++$form->{makemodel_rows};
+ $subroutine = "makemodel_row";
- $numrows = ++$form->{assembly_rows};
- $subroutine = "assembly_row";
- }
- if ($form->{item} eq 'service') {
- $numrows = $form->{price_rows};
- $subroutine = "price_row";
+ # create makemodel rows
+ &{$subroutine}($numrows);
- &{$subroutine}($numrows);
+ $numrows = ++$form->{assembly_rows};
+ $subroutine = "assembly_row";
+ }
+ if ($form->{item} eq 'service') {
+ $numrows = $form->{price_rows};
+ $subroutine = "price_row";
- $numrows = 0;
- }
+ &{$subroutine}($numrows);
- # create rows
- &{$subroutine}($numrows) if $numrows;
+ $numrows = 0;
+ }
+
+ # create rows
+ &{$subroutine}($numrows) if $numrows;
+ }
&form_footer;
- $lxdebug->leave_sub();
+ $main::lxdebug->leave_sub();
}