}
}
+ 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});
+ }
+
if ($where) {
substr($where, 0, 4, " WHERE ");
$query .= $where;
vendornumber country ustid taxzone payment_terms charts direct_debit);
my @hidden_variables = map { "l_${_}" } @columns;
- push @hidden_variables, "l_subtotal", qw(open closed vendor invnumber ordnumber transaction_description notes project_id transdatefrom transdateto department);
+ push @hidden_variables, "l_subtotal", qw(open closed vendor invnumber ordnumber transaction_description notes project_id transdatefrom transdateto department
+ parts_partnumber parts_description);
my $href = build_std_url('action=ap_transactions', grep { $form->{$_} } @hidden_variables);
push @options, $locale->text('Order Number') . " : $form->{ordnumber}" if ($form->{ordnumber});
push @options, $locale->text('Notes') . " : $form->{notes}" if ($form->{notes});
push @options, $locale->text('Transaction description') . " : $form->{transaction_description}" if ($form->{transaction_description});
+ push @options, $locale->text('Part Description') . " : $form->{parts_description}" if $form->{parts_description};
+ push @options, $locale->text('Part Number') . " : $form->{parts_partnumber}" if $form->{parts_partnumber};
push @options, $locale->text('From') . " " . $locale->date(\%myconfig, $form->{transdatefrom}, 1) if ($form->{transdatefrom});
push @options, $locale->text('Bis') . " " . $locale->date(\%myconfig, $form->{transdateto}, 1) if ($form->{transdateto});
push @options, $locale->text('Open') if ($form->{open});
</tr>
<tr>
<th align=right nowrap>[% 'Notes' | $T8 %]</th>
- <td colspan=3><input name=notes size=40></td>
+ <td><input name=notes size=20></td>
+ <th align="right">[% 'Part Description' | $T8 %]</th>
+ <td><input name="parts_description" size="20"></td>
</tr>
<tr>
<th align="right">[% 'Project Number' | $T8 %]</th>
- <td colspan="3">
+ <td>
[%- INCLUDE 'generic/multibox.html'
name = 'project_id',
style = "width: 250px",
allow_textbox = 0,
-%]
</td>
+ <th align="right">[% 'Part Number' | $T8 %]</th>
+ <td><input name="parts_partnumber" size="20"></td>
</tr>
<tr>
<th align=right nowrap>[% 'From' | $T8 %]</th>