# # get pricegroups for parts
# IS->get_pricegroups_for_parts(\%myconfig, \%$form);
# # get pricegroups for parts
# IS->get_pricegroups_for_parts(\%myconfig, \%$form);
map { $form->{"${_}_$i"} = $ref->{$_} } keys %{$ref};
$form->{"discount_$i"} =
$form->format_amount(\%myconfig, $form->{"discount_$i"} * 100);
map { $form->{"${_}_$i"} = $ref->{$_} } keys %{$ref};
$form->{"discount_$i"} =
$form->format_amount(\%myconfig, $form->{"discount_$i"} * 100);
$payment = qq|<option value=""></option>|;
foreach $item (@{ $form->{payment_terms} }) {
if ($form->{payment_id} eq $item->{id}) {
$payment = qq|<option value=""></option>|;
foreach $item (@{ $form->{payment_terms} }) {
if ($form->{payment_id} eq $item->{id}) {
if (@{ $form->{TAXZONE} }) {
$form->{selecttaxzone} = "";
foreach $item (@{ $form->{TAXZONE} }) {
if ($item->{id} == $form->{taxzone_id}) {
$form->{selecttaxzone} .=
if (@{ $form->{TAXZONE} }) {
$form->{selecttaxzone} = "";
foreach $item (@{ $form->{TAXZONE} }) {
if ($item->{id} == $form->{taxzone_id}) {
$form->{selecttaxzone} .=
$customer =
($form->{selectcustomer})
? qq|<select name=customer>$form->{selectcustomer}</select>\n<input type=hidden name="selectcustomer" value="$form->{selectcustomer}">|
: qq|<input name=customer value="$form->{customer}" size=35>|;
$customer =
($form->{selectcustomer})
? qq|<select name=customer>$form->{selectcustomer}</select>\n<input type=hidden name="selectcustomer" value="$form->{selectcustomer}">|
: qq|<input name=customer value="$form->{customer}" size=35>|;
- $form->{"paid_$i"} =
- $form->format_amount(\%myconfig, $form->{"paid_$i"}, 2);
+ if ($form->{"paid_$i"}) {
+ $form->{"paid_$i"} =
+ $form->format_amount(\%myconfig, $form->{"paid_$i"}, 2);
+ }
$form->{"exchangerate_$i"} =
$form->format_amount(\%myconfig, $form->{"exchangerate_$i"});
$form->{"exchangerate_$i"} =
$form->format_amount(\%myconfig, $form->{"exchangerate_$i"});
IS->retrieve_item(\%myconfig, \%$form);
$rows = scalar @{ $form->{item_list} };
IS->retrieve_item(\%myconfig, \%$form);
$rows = scalar @{ $form->{item_list} };
($form->{AR}) = split /--/, $form->{AR};
($form->{AR_paid}) = split /--/, $form->{AR_paid};
($form->{AR}) = split /--/, $form->{AR};
($form->{AR_paid}) = split /--/, $form->{AR_paid};
$form->redirect($locale->text(' Payment posted!'))
if (IS->post_payment(\%myconfig, \%$form));
$form->error($locale->text('Cannot post payment!'));
$form->redirect($locale->text(' Payment posted!'))
if (IS->post_payment(\%myconfig, \%$form));
$form->error($locale->text('Cannot post payment!'));
if ($print_post) {
if (!(IS->post_invoice(\%myconfig, \%$form))) {
$form->error($locale->text('Cannot post invoice!'));
if ($print_post) {
if (!(IS->post_invoice(\%myconfig, \%$form))) {
$form->error($locale->text('Cannot post invoice!'));