}
};
+ if ($form->{parts_partnumber}) {
+ $where .= <<SQL;
+ AND EXISTS (
+ SELECT invoice.trans_id
+ FROM invoice
+ LEFT JOIN parts ON (invoice.parts_id = parts.id)
+ WHERE (invoice.trans_id = a.id)
+ AND (parts.partnumber ILIKE ?)
+ LIMIT 1
+ )
+SQL
+ push @values, like($form->{parts_partnumber});
+ }
+
+ if ($form->{parts_description}) {
+ $where .= <<SQL;
+ AND EXISTS (
+ SELECT invoice.trans_id
+ FROM invoice
+ WHERE (invoice.trans_id = a.id)
+ AND (invoice.description ILIKE ?)
+ LIMIT 1
+ )
+SQL
+ push @values, like($form->{parts_description});
+ }
+
my ($cvar_where, @cvar_values) = CVar->build_filter_query('module' => 'CT',
'trans_id_field' => 'c.id',
'filter' => $form,
push @columns, map { "cvar_$_->{name}" } @ct_includeable_custom_variables;
my @hidden_variables = map { "l_${_}" } @columns;
- push @hidden_variables, "l_subtotal", qw(open closed customer invnumber ordnumber cusordnumber transaction_description notes project_id transdatefrom transdateto duedatefrom duedateto employee_id salesman_id business_id);
+ push @hidden_variables, "l_subtotal", qw(open closed customer invnumber ordnumber cusordnumber transaction_description notes project_id transdatefrom transdateto duedatefrom duedateto
+ employee_id salesman_id business_id parts_partnumber parts_description);
push @hidden_variables, map { "cvar_$_->{name}" } @ct_searchable_custom_variables;
$href = build_std_url('action=ar_transactions', grep { $form->{$_} } @hidden_variables);
if ($form->{transaction_description}) {
push @options, $locale->text('Transaction description') . " : $form->{transaction_description}";
}
+ if ($form->{parts_partnumber}) {
+ push @options, $locale->text('Part Number') . " : $form->{parts_partnumber}";
+ }
+ if ($form->{parts_description}) {
+ push @options, $locale->text('Part Description') . " : $form->{parts_description}";
+ }
if ($form->{transdatefrom}) {
push @options, $locale->text('From') . " " . $locale->date(\%myconfig, $form->{transdatefrom}, 1);
}
</tr>
<tr>
<th align=right nowrap>[% 'Transaction description' | $T8 %]</th>
- <td colspan=3><input name=transaction_description id=transaction_description size=40></td>
+ <td><input name=transaction_description id=transaction_description size=20></td>
+ <th align="right">[% 'Part Description' | $T8 %]</th>
+ <td><input name="parts_description" size="20"></td>
</tr>
<tr>
<th align=right nowrap>[% 'Notes' | $T8 %]</th>
- <td colspan=3><input name=notes id=notes size=40></td>
+ <td><input name=notes id=notes size=20></td>
+ <th align="right">[% 'Part Number' | $T8 %]</th>
+ <td><input name="parts_partnumber" size="20"></td>
</tr>
<tr>
<th align="right">[% 'Project Number' | $T8 %]</th>