Berichte OE: Bestellnummer des Kunden anzeigen/danach filtern
authorMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 18 Feb 2014 14:11:50 +0000 (15:11 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 18 Feb 2014 14:15:44 +0000 (15:15 +0100)
SL/OE.pm
bin/mozilla/oe.pl
templates/webpages/oe/search.html

index 3d92746..a6b9a9c 100644 (file)
--- a/SL/OE.pm
+++ b/SL/OE.pm
@@ -83,7 +83,7 @@ sub transactions {
   $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, | .
@@ -175,6 +175,11 @@ SQL
     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}));
@@ -222,6 +227,7 @@ SQL
     "reqdate"                 => "o.reqdate",
     "id"                      => "o.id",
     "ordnumber"               => "o.ordnumber",
+    "cusordnumber"            => "o.cusordnumber",
     "quonumber"               => "o.quonumber",
     "name"                    => "ct.name",
     "employee"                => "e.name",
index ad6097c..619ae9f 100644 (file)
@@ -787,7 +787,7 @@ sub orders {
   my @columns = (
     "transdate",               "reqdate",
     "id",                      $ordnumber,
-    "customernumber",
+    "cusordnumber",            "customernumber",
     "name",                    "netamount",
     "tax",                     "amount",
     "curr",                    "employee",
@@ -834,7 +834,7 @@ sub orders {
   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);
@@ -851,6 +851,7 @@ sub orders {
     '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'), },
@@ -874,7 +875,7 @@ sub orders {
     '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";
   }
@@ -897,6 +898,7 @@ sub orders {
   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};
index 8d76ecb..66be6b4 100644 (file)
      <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>