if ($form->{type} eq "credit_note") {
$form->{type} = "credit_note";
$form->{formname} = "credit_note";
if ($form->{type} eq "credit_note") {
$form->{type} = "credit_note";
$form->{formname} = "credit_note";
# # 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);
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} .=
$form->{selectshipto} =~ s/ selected//g;
if ($form->{shipto_id} ne "") {
$form->{selectshipto} =~ s/value=$form->{shipto_id}/value=$form->{shipto_id} selected/;
$form->{selectshipto} =~ s/ selected//g;
if ($form->{shipto_id} ne "") {
$form->{selectshipto} =~ s/value=$form->{shipto_id}/value=$form->{shipto_id} selected/;
- <td><select name=shipto_id style="width:200px;">$form->{selectshipto}</select></td>
- <input type=hidden name=selectshipto value="$form->{selectshipto}">|;
+ <td><select name=shipto_id style="width:200px;">$form->{selectshipto}</select></td>|;
+ $form->{selectshipto} = $form->quote($form->{selectshipto});
+ $shipto .= qq| <input type=hidden name=selectshipto value="$form->{selectshipto}">|;
$form->{paidaccounts}++ if ($form->{"paid_$form->{paidaccounts}"});
for $i (1 .. $form->{paidaccounts}) {
$form->{paidaccounts}++ if ($form->{"paid_$form->{paidaccounts}"});
for $i (1 .. $form->{paidaccounts}) {
- $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"});
$column_data{"AR_paid_$i"} =
qq|<td align=center><select name="AR_paid_$i">$form->{"selectAR_paid_$i"}</select></td>|;
$column_data{"datepaid_$i"} =
$column_data{"AR_paid_$i"} =
qq|<td align=center><select name="AR_paid_$i">$form->{"selectAR_paid_$i"}</select></td>|;
$column_data{"datepaid_$i"} =
$column_data{"source_$i"} =
qq|<td align=center><input name="source_$i" size=11 value="$form->{"source_$i"}"></td>|;
$column_data{"memo_$i"} =
$column_data{"source_$i"} =
qq|<td align=center><input name="source_$i" size=11 value="$form->{"source_$i"}"></td>|;
$column_data{"memo_$i"} =
. $locale->text('Update') . qq|">
<input class=submit type=submit name=action value="|
. $locale->text('Ship to') . qq|">
. $locale->text('Update') . qq|">
<input class=submit type=submit name=action value="|
. $locale->text('Ship to') . qq|">
. $locale->text('Storno') . qq|">| unless ($form->{storno});
print qq|<input class=submit type=submit name=action value="|
. $locale->text('Post Payment') . qq|">
. $locale->text('Storno') . qq|">| unless ($form->{storno});
print qq|<input class=submit type=submit name=action value="|
. $locale->text('Post Payment') . qq|">
. $locale->text('Update') . qq|">
<input class=submit type=submit name=action value="|
. $locale->text('Ship to') . qq|">
. $locale->text('Update') . qq|">
<input class=submit type=submit name=action value="|
. $locale->text('Ship to') . qq|">