#quote all_customer Bug 133
foreach $ref (@{ $form->{all_customer} }) {
$ref->{name} = $form->quote($ref->{name});
#quote all_customer Bug 133
foreach $ref (@{ $form->{all_customer} }) {
$ref->{name} = $form->quote($ref->{name});
$form->{customer} = "$form->{customer}--$form->{customer_id}";
map { $form->{selectcustomer} .= "<option>$_->{name}--$_->{id}\n" }
(@{ $form->{all_customer} });
$form->{customer} = "$form->{customer}--$form->{customer_id}";
map { $form->{selectcustomer} .= "<option>$_->{name}--$_->{id}\n" }
(@{ $form->{all_customer} });
# # 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} .=
if (@{ $form->{SHIPTO} }) {
$form->{selectshipto} = "<option value=0></option>";
foreach $item (@{ $form->{SHIPTO} }) {
if (@{ $form->{SHIPTO} }) {
$form->{selectshipto} = "<option value=0></option>";
foreach $item (@{ $form->{SHIPTO} }) {
- $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!'));