use SL::IS;
use SL::PE;
+use Data::Dumper;
require "$form->{path}/io.pl";
require "$form->{path}/arap.pl";
sub edit {
$lxdebug->enter_sub();
-
+print STDERR "is.pl-edit\n";
$form->{title} = $locale->text('Edit Sales Invoice');
if ($myconfig{acs} =~ "AR--Add Sales Invoice" || $myconfig{acs} =~ "AR--AR")
sub invoice_links {
$lxdebug->enter_sub();
-
+print STDERR "is.pl-invoice_links\n";
$form->{vc} = 'customer';
# create links
sub prepare_invoice {
$lxdebug->enter_sub();
-
+print STDERR "is.pl-prepare_invoice\n";
$form->{type} = "invoice";
$form->{formname} = "invoice";
$form->{format} = "html";
map { $form->{$_} =~ s/\"/"/g }
qw(invnumber ordnumber quonumber shippingpoint shipvia notes intnotes);
+# # get pricegroups for parts
+# IS->get_pricegroups_for_parts(\%myconfig, \%$form);
+
foreach $ref (@{ $form->{invoice_details} }) {
$i++;
map { $form->{"${_}_$i"} = $ref->{$_} } keys %{$ref};
$form->{"discount_$i"} =
$form->format_amount(\%myconfig, $form->{"discount_$i"} * 100);
-
($dec) = ($form->{"sellprice_$i"} =~ /\.(\d+)/);
$dec = length $dec;
$decimalplaces = ($dec > 2) ? $dec : 2;
map { $form->{"${_}_$i"} =~ s/\"/"/g }
qw(partnumber description unit partnotes);
$form->{rowcount} = $i;
+
+# # build up html code for prices_$i
+# print STDERR "set_pricegroup aus is.pl-prepare_invoice\n";
+# set_pricegroup();
}
}
$lxdebug->leave_sub();
sub form_header {
$lxdebug->enter_sub();
-
+print STDERR "is.pl-form_header\n";
# set option selected
foreach $item (qw(AR customer currency department employee contact)) {
$form->{"select$item"} =~ s/ selected//;
<tr>
<th align=right nowrap>| . $locale->text('Customer') . qq|</th>
<td colspan=3>$customer</td>
+ <input type=hidden name=customer_klass value=$form->{customer_klass}>
<input type=hidden name=customer_id value=$form->{customer_id}>
<input type=hidden name=oldcustomer value="$form->{oldcustomer}">
<th align=richt nowrap>|
sub form_footer {
$lxdebug->enter_sub();
-
+print STDERR "is.pl-form_footer\n";
$form->{invtotal} = $form->{invsubtotal};
if (($rows = $form->numtextrows($form->{notes}, 26, 8)) < 2) {
sub update {
$lxdebug->enter_sub();
-
+print STDERR "is.pl-update\n";
map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) }
qw(exchangerate creditlimit creditremaining);
} else {
$sellprice = $form->format_amount(\%myconfig, $form->{"sellprice_$i"});
-
+#print STDERR " SELLPRICE-111- $sellprice\n";
map { $form->{item_list}[$i]{$_} =~ s/\"/"/g }
qw(partnumber description unit);
map { $form->{"${_}_$i"} = $form->{item_list}[0]{$_} }
}
}
+ # get pricegroups for parts
+ IS->get_pricegroups_for_parts(\%myconfig, \%$form, "new");
+
+ # build up html code for prices_$i
+ set_pricegroup();
}
&display_form;
sub post {
$lxdebug->enter_sub();
-
+print STDERR "is.pl-post\n";
$form->isblank("invdate", $locale->text('Invoice Date missing!'));
$form->isblank("customer", $locale->text('Customer missing!'));