$cp_id = $form->{cp_id};
IS->get_customer(\%myconfig, \%$form);
+
#quote all_customer Bug 133
foreach $ref (@{ $form->{all_customer} }) {
$ref->{name} = $form->quote($ref->{name});
$form->{oldcustomer} = "$form->{customer}--$form->{customer_id}";
- if ($form->{all_customer}) {
+ if (@{ $form->{all_customer} }) {
$form->{customer} = "$form->{customer}--$form->{customer_id}";
map { $form->{selectcustomer} .= "<option>$_->{name}--$_->{id}\n" }
(@{ $form->{all_customer} });
}
}
+ $form->{radier} =
+ ($form->current_date(\%myconfig) eq $form->{gldate}) ? 1 : 0;
+
$payment = qq|<option value=""></option>|;
foreach $item (@{ $form->{payment_terms} }) {
if ($form->{payment_id} eq $item->{id}) {
if (@{ $form->{SHIPTO} }) {
$form->{selectshipto} = "<option value=0></option>";
foreach $item (@{ $form->{SHIPTO} }) {
- if ($item->{id} == $form->{shipto_id}) {
+ if ($item->{shipto_id} == $form->{shipto_id}) {
$form->{selectshipto} .=
- "<option value=$item->{id} selected>$item->{shiptoname}</option>";
+ "<option value=$item->{shipto_id} selected>$item->{shiptoname} $item->{shiptodepartment_1}</option>";
} else {
$form->{selectshipto} .=
- "<option value=$item->{id}>$item->{shiptoname}</option>";
+ "<option value=$item->{shipto_id}>$item->{shiptoname} $item->{shiptodepartment}</option>";
}
}
$shipto = qq|
<th align=right>| . $locale->text('Shipping Address') . qq|</th>
- <td><select name=shipto_id>$form->{selectshipto}</select></td>
+ <td><select name=shipto_id style="width:200px;">$form->{selectshipto}</select></td>
<input type=hidden name=selectshipto value="$form->{selectshipto}">|;
$dunning
<tr>
<th align=right nowrap>| . $locale->text('Record in') . qq|</th>
- <td colspan=3><select name=AR>$form->{selectAR}</select></td>
+ <td colspan=3><select name=AR style="width:280px;">$form->{selectAR}</select></td>
<input type=hidden name=selectAR value="$form->{selectAR}">
</tr>
$taxzone
. $locale->text('Credit Note') . qq|">
|;
}
+ if ($form->{radier}) {
+ print qq|
+ <input class=submit type=submit name=action value="|
+ . $locale->text('Delete') . qq|">
+|;
+ }
if ($invdate > $closedto) {
} else {
- $form->{"selected_unit_$i"} = $form->{"unit_$i"};
-
IS->retrieve_item(\%myconfig, \%$form);
$rows = scalar @{ $form->{item_list} };
($form->{AR}) = split /--/, $form->{AR};
($form->{AR_paid}) = split /--/, $form->{AR_paid};
+ relink_accounts();
$form->redirect($locale->text(' Payment posted!'))
if (IS->post_payment(\%myconfig, \%$form));
$form->error($locale->text('Cannot post payment!'));
$form->{invnumber} = $form->update_defaults(\%myconfig, "invnumber");
}
}
+ relink_accounts();
if ($print_post) {
if (!(IS->post_invoice(\%myconfig, \%$form))) {
$form->error($locale->text('Cannot post invoice!'));