my @values;
my $query =
- qq|SELECT DISTINCT a.id, a.invnumber, a.ordnumber, a.transdate, | .
+ qq|SELECT DISTINCT a.id, a.invnumber, a.ordnumber, a.cusordnumber, a.transdate, | .
qq| a.duedate, a.netamount, a.amount, a.paid, | .
qq| a.invoice, a.datepaid, a.terms, a.notes, a.shipvia, | .
qq| a.shippingpoint, a.storno, a.storno_id, a.globalproject_id, | .
$where .= " AND d.description ILIKE ?";
push(@values, $department);
}
- foreach my $column (qw(invnumber ordnumber notes transaction_description)) {
+ foreach my $column (qw(invnumber ordnumber cusordnumber notes transaction_description)) {
if ($form->{$column}) {
$where .= " AND a.$column ILIKE ?";
push(@values, $form->like($form->{$column}));
my $sortdir = !defined $form->{sortdir} ? 'ASC' : $form->{sortdir} ? 'ASC' : 'DESC';
my $sortorder = join(', ', map { "$_ $sortdir" } @a);
- if (grep({ $_ eq $form->{sort} } qw(id transdate duedate invnumber ordnumber name datepaid employee shippingpoint shipvia transaction_description))) {
+ if (grep({ $_ eq $form->{sort} } qw(id transdate duedate invnumber ordnumber cusordnumber name datepaid employee shippingpoint shipvia transaction_description))) {
$sortorder = $form->{sort} . " $sortdir";
}
my $report = SL::ReportGenerator->new(\%myconfig, $form);
@columns =
- qw(transdate id type invnumber ordnumber name netamount tax amount paid
+ qw(transdate id type invnumber ordnumber cusordnumber name netamount tax amount paid
datepaid due duedate transaction_description notes salesman employee shippingpoint shipvia
marge_total marge_percent globalprojectnumber customernumber country ustid taxzone payment_terms charts customertype);
my @hidden_variables = map { "l_${_}" } @columns;
- push @hidden_variables, "l_subtotal", qw(open closed customer invnumber ordnumber transaction_description notes project_id transdatefrom transdateto 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 employee_id salesman_id business_id);
$href = build_std_url('action=ar_transactions', grep { $form->{$_} } @hidden_variables);
'type' => { 'text' => $locale->text('Type'), },
'invnumber' => { 'text' => $locale->text('Invoice'), },
'ordnumber' => { 'text' => $locale->text('Order'), },
+ 'cusordnumber' => { 'text' => $locale->text('Customer Order Number'), },
'name' => { 'text' => $locale->text('Customer'), },
'netamount' => { 'text' => $locale->text('Amount'), },
'tax' => { 'text' => $locale->text('Tax'), },
'customertype' => { 'text' => $locale->text('Customer type'), },
);
- foreach my $name (qw(id transdate duedate invnumber ordnumber name datepaid employee shippingpoint shipvia transaction_description)) {
+ foreach my $name (qw(id transdate duedate invnumber ordnumber cusordnumber name datepaid employee shippingpoint shipvia transaction_description)) {
my $sortdir = $form->{sort} eq $name ? 1 - $form->{sortdir} : $form->{sortdir};
$column_defs{$name}->{link} = $href . "&sort=$name&sortdir=$sortdir";
}
if ($form->{ordnumber}) {
push @options, $locale->text('Order Number') . " : $form->{ordnumber}";
}
+ if ($form->{cusordnumber}) {
+ push @options, $locale->text('Customer Order Number') . " : $form->{cusordnumber}";
+ }
if ($form->{notes}) {
push @options, $locale->text('Notes') . " : $form->{notes}";
}
<th align=right nowrap>[% 'Order Number' | $T8 %]</th>
<td colspan=3><input name=ordnumber size=20></td>
</tr>
+ <tr>
+ <th align="right" nowrap>[% 'Customer Order Number' | $T8 %]</th>
+ <td colspan=3><input name="cusordnumber" size="20"></td>
+ </tr>
<tr>
<th align="right">[% 'Employee' | $T8 %]</th>
<td>[% L.select_tag('employee_id', ALL_EMPLOYEES, title_key = 'safe_name', with_empty = 1, style = 'width:250px') %]</td>
<td nowrap>[% 'Invoice Number' | $T8 %]</td>
<td align=right><input name="l_ordnumber" class=checkbox type=checkbox value=Y></td>
<td nowrap>[% 'Order Number' | $T8 %]</td>
- <td align=right><input name="l_transdate" class=checkbox type=checkbox value=Y checked></td>
- <td nowrap>[% 'Invoice Date' | $T8 %]</td>
+ <td align=right><input name="l_cusordnumber" class=checkbox type=checkbox value=Y checked></td>
+ <td nowrap>[% 'Customer Order Number' | $T8 %]</td>
</tr>
<tr>
+ <td align=right><input name="l_transdate" class=checkbox type=checkbox value=Y checked></td>
+ <td nowrap>[% 'Invoice Date' | $T8 %]</td>
<td align=right><input name="l_name" class=checkbox type=checkbox value=Y checked></td>
<td nowrap>[% 'Customer' | $T8 %]</td>
<td align=right><input name="l_customernumber" class=checkbox type=checkbox value=Y></td>