"discount" => "ct.discount",
"insertdate" => "ct.itime",
"salesman" => "e.name",
- "payment" => "pt.description"
+ "payment" => "pt.description",
+ "pricegroup" => "pg.pricegroup",
);
$form->{sort} ||= "name";
push @values, $form->{addr_zipcode} . '%';
}
+ my $pg_select = $form->{l_pricegroup} ? qq|, pg.pricegroup as pricegroup | : '';
+ my $pg_join = $form->{l_pricegroup} ? qq|LEFT JOIN pricegroup pg ON (ct.klass = pg.id) | : '';
my $query =
qq|SELECT ct.*, ct.itime::DATE AS insertdate, b.description AS business, e.name as salesman, | .
qq| pt.description as payment | .
+ $pg_select .
(qq|, NULL AS invnumber, NULL AS ordnumber, NULL AS quonumber, NULL AS invid, NULL AS module, NULL AS formtype, NULL AS closed | x!! $join_records) .
qq|FROM $cv ct | .
qq|LEFT JOIN business b ON (ct.business_id = b.id) | .
qq|LEFT JOIN employee e ON (ct.salesman_id = e.id) | .
qq|LEFT JOIN payment_terms pt ON (ct.payment_id = pt.id) | .
+ $pg_join .
qq|WHERE $where|;
my @saved_values = @values;
'id', 'name', "$form->{db}number", 'contact', 'phone', 'discount',
'fax', 'email', 'taxnumber', 'street', 'zipcode' , 'city',
'business', 'payment', 'invnumber', 'ordnumber', 'quonumber', 'salesman',
- 'country', 'insertdate'
+ 'country', 'insertdate', 'pricegroup'
);
my @includeable_custom_variables = grep { $_->{includeable} } @{ $cvar_configs };
'discount' => { 'text' => $locale->text('Discount'), },
'payment' => { 'text' => $locale->text('Payment Terms'), },
'insertdate' => { 'text' => $locale->text('Insert Date'), },
+ 'pricegroup' => { 'text' => $locale->text('Pricegroup'), },
%column_defs_cvars,
);
<input name="l_salesman" id="l_salesman" type="checkbox" class="checkbox" value="Y">
<label for="l_salesman">[% 'Salesman' | $T8 %]</label>
</td>
+ </tr>
+ <tr>
+ <td>
+ <input name="l_pricegroup" id="l_pricegroup" type="checkbox" class="checkbox" value="Y">
+ <label for="l_pricegroup">[% 'Pricegroup' | $T8 %]</label>
+ </td>
[% END %]
</tr>