"zipcode" => "ct.zipcode",
"city" => "ct.city",
"country" => "ct.country",
+ "discount" => "ct.discount",
"salesman" => "e.name"
);
}
my $sortdir = !defined $form->{sortdir} ? 'ASC' : $form->{sortdir} ? 'ASC' : 'DESC';
- if ($sortorder !~ /(business|id)/ && !$join_records) {
+ if ($sortorder !~ /(business|id|discount)/ && !$join_records) {
$sortorder = "lower($sortorder) ${sortdir}";
} else {
$sortorder .= " ${sortdir}";
}
my @columns = (
- 'id', 'name', "$form->{db}number", 'contact', 'phone',
+ 'id', 'name', "$form->{db}number", 'contact', 'phone', 'discount',
'fax', 'email', 'taxnumber', 'street', 'zipcode' , 'city',
'business', 'invnumber', 'ordnumber', 'quonumber', 'salesman', 'country'
);
'city' => { 'text' => $locale->text('City'), },
'country' => { 'text' => $locale->text('Country'), },
'salesman' => { 'text' => $locale->text('Salesman'), },
+ 'discount' => { 'text' => $locale->text('Discount'), },
%column_defs_cvars,
);
if ($ref->{id} ne $previous_id) {
$previous_id = $ref->{id};
+ $ref->{discount} = $form->format_amount(\%myconfig, $ref->{discount} * 100.0, 2);
map { $row->{$_}->{data} = $ref->{$_} } @columns;
$row->{name}->{link} = build_std_url('script=controller.pl', 'action=CustomerVendor/edit', 'id=' . E($ref->{id}), 'callback', @hidden_nondefault);
<label for="l_country">[% 'Country' | $T8 %]</label>
</td>
</tr>
- [% IF IS_CUSTOMER %]
<tr>
<td>
- <input name="l_salesman" id="l_salesman" type="checkbox" class="checkbox" value="Y">
- <label for="l_salesman">[% 'Salesman' | $T8 %]</label>
+ <input name="l_discount" id="l_discount" type="checkbox" class="checkbox" value="Y">
+ <label for="l_discount">[% 'Discount' | $T8 %]</label>
</td>
- </tr>
+ [% IF IS_CUSTOMER %]
+ <td>
+ <input name="l_salesman" id="l_salesman" type="checkbox" class="checkbox" value="Y">
+ <label for="l_salesman">[% 'Salesman' | $T8 %]</label>
+ </td>
[% END %]
+ </tr>
[% CUSTOM_VARIABLES_INCLUSION_CODE %]