$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} });
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);
$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->{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>$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|">
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!'));
$datepaid = $form->datetonum($form->{"datepaid_$i"}, \%myconfig);
$form->isblank("datepaid_$i", $locale->text('Payment date missing!'));
$datepaid = $form->datetonum($form->{"datepaid_$i"}, \%myconfig);
$form->isblank("datepaid_$i", $locale->text('Payment date missing!'));
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!'));