$query =
qq|SELECT o.id, o.ordnumber, o.transdate, o.reqdate, | .
qq| o.amount, ct.${vc}number, ct.name, o.netamount, o.${vc}_id, o.globalproject_id, | .
- qq| o.closed, o.delivered, o.quonumber, o.shippingpoint, o.shipvia, | .
+ qq| o.closed, o.delivered, o.quonumber, o.cusordnumber, o.shippingpoint, o.shipvia, | .
qq| o.transaction_description, | .
qq| o.marge_total, o.marge_percent, | .
qq| ex.$rate AS exchangerate, | .
push(@values, '%' . $form->{$ordnumber} . '%');
}
+ if ($form->{cusordnumber}) {
+ $query .= qq| AND o.cusordnumber ILIKE ?|;
+ push(@values, '%' . $form->{cusordnumber} . '%');
+ }
+
if($form->{transdatefrom}) {
$query .= qq| AND o.transdate >= ?|;
push(@values, conv_date($form->{transdatefrom}));
"reqdate" => "o.reqdate",
"id" => "o.id",
"ordnumber" => "o.ordnumber",
+ "cusordnumber" => "o.cusordnumber",
"quonumber" => "o.quonumber",
"name" => "ct.name",
"employee" => "e.name",
my @columns = (
"transdate", "reqdate",
"id", $ordnumber,
- "customernumber",
+ "cusordnumber", "customernumber",
"name", "netamount",
"tax", "amount",
"curr", "employee",
my $report = SL::ReportGenerator->new(\%myconfig, $form);
my @hidden_variables = map { "l_${_}" } @columns;
- push @hidden_variables, "l_subtotal", $form->{vc}, qw(l_closed l_notdelivered open closed delivered notdelivered ordnumber quonumber
+ push @hidden_variables, "l_subtotal", $form->{vc}, qw(l_closed l_notdelivered open closed delivered notdelivered ordnumber quonumber cusordnumber
transaction_description transdatefrom transdateto type vc employee_id salesman_id
reqdatefrom reqdateto projectnumber project_id periodic_invoices_active periodic_invoices_inactive
business_id shippingpoint taxzone_id);
'id' => { 'text' => $locale->text('ID'), },
'ordnumber' => { 'text' => $locale->text('Order'), },
'quonumber' => { 'text' => $form->{type} eq "request_quotation" ? $locale->text('RFQ') : $locale->text('Quotation'), },
+ 'cusordnumber' => { 'text' => $locale->text('Customer Order Number'), },
'name' => { 'text' => $form->{vc} eq 'customer' ? $locale->text('Customer') : $locale->text('Vendor'), },
'customernumber' => { 'text' => $locale->text('Customer Number'), },
'netamount' => { 'text' => $locale->text('Amount'), },
'taxzone' => { 'text' => $locale->text('Steuersatz'), },
);
- foreach my $name (qw(id transdate reqdate quonumber ordnumber name employee salesman shipvia transaction_description shippingpoint taxzone)) {
+ foreach my $name (qw(id transdate reqdate quonumber ordnumber cusordnumber name employee salesman shipvia transaction_description shippingpoint taxzone)) {
my $sortdir = $form->{sort} eq $name ? 1 - $form->{sortdir} : $form->{sortdir};
$column_defs{$name}->{link} = $href . "&sort=$name&sortdir=$sortdir";
}
push @options, $locale->text('Vendor') . " : $form->{vendor}" if $form->{vendor};
push @options, $locale->text('Department') . " : $department" if $form->{department};
push @options, $locale->text('Order Number') . " : $form->{ordnumber}" if $form->{ordnumber};
+ push @options, $locale->text('Customer Order Number') . " : $form->{cusordnumber}" if $form->{cusordnumber};
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('Shipping Point') . " : $form->{shippingpoint}" if $form->{shippingpoint};
<th align="right">[% HTML.escape(ordlabel) %]</th>
<td colspan="3"><input name="[% HTML.escape(ordnrname) %]" style="width: 250px"></td>
</tr>
+[% IF is_order %]
+ <tr>
+ <th align="right">[% LxERP.t8("Customer Order Number") %]</th>
+ <td colspan="3">[% L.input_tag("cusordnumber", '', style="width: 250px") %]</td>
+ </tr>
+[% END %]
<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>
<input name="l_[% HTML.escape(ordnrname) %]" id="l_[% HTML.escape(ordnrname) %]" class="checkbox" type="checkbox" value="Y" checked>
<label for="l_[% HTML.escape(ordnrname) %]">[% HTML.escape(ordlabel) %]</label>
</td>
+[% IF is_order %]
+ <td>
+ <input name="l_cusordnumber" id="l_cusordnumber" class="checkbox" type="checkbox" value="Y" checked>
+ <label for="l_cusordnumber">[% LxERP.t8("Customer Order Number") %]</label>
+ </td>
+[% END %]
</tr>
<tr>
<td>