Merge branch 'berichte-bestellnummer-des-kunden'
authorMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 4 Mar 2014 12:35:06 +0000 (13:35 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 4 Mar 2014 12:35:06 +0000 (13:35 +0100)
SL/AR.pm
SL/OE.pm
bin/mozilla/ar.pl
bin/mozilla/oe.pl
templates/webpages/ar/search.html
templates/webpages/do/search.html
templates/webpages/oe/search.html

index 3da550d..a842b9d 100644 (file)
--- a/SL/AR.pm
+++ b/SL/AR.pm
@@ -488,7 +488,7 @@ sub ar_transactions {
   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, | .
@@ -550,7 +550,7 @@ sub ar_transactions {
     $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}));
@@ -603,7 +603,7 @@ sub ar_transactions {
   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";
   }
 
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 e0ed1e7..fcd9e83 100644 (file)
@@ -902,12 +902,12 @@ sub ar_transactions {
   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);
 
@@ -917,6 +917,7 @@ sub ar_transactions {
     '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'), },
@@ -943,7 +944,7 @@ sub ar_transactions {
     '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";
   }
@@ -977,6 +978,9 @@ sub ar_transactions {
   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}";
   }
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 a1f9034..467d4b2 100644 (file)
       <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>
index 95a2c8b..7483f8e 100644 (file)
      <td colspan="3"><input name="ordnumber" class="fixed_width"></td>
     </tr>
 
+    <tr>
+     <th align="right">[% 'Customer Order Number' | $T8 %]</th>
+     <td colspan="3"><input name="cusordnumber" class="fixed_width"></td>
+    </tr>
+
     [%- IF ALL_DEPARTMENTS.size %]
     <tr>
      <th align="right" nowrap>[% 'Department' | $T8 %]</th>
      <td colspan="3"><input name="transaction_description" class="fixed_width"></td>
     </tr>
 
-    <tr>
-     <th align="right">[% 'Customer Order Number' | $T8 %]</th>
-     <td colspan="3"><input name="cusordnumber" class="fixed_width"></td>
-    </tr>
-
     <tr>
      <th align="right">[% 'Project Number' | $T8 %]</th>
      <td colspan="3">
         </td>
 
         <td>
-         <input name="l_cusordnumber" id="l_cusordnumber" class="checkbox" type="checkbox" value="Y">
+         <input name="l_cusordnumber" id="l_cusordnumber" class="checkbox" type="checkbox" value="Y" checked>
          <label for="l_cusordnumber">[% 'Customer Order Number' | $T8 %]</label>
         </td>
        </tr>
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>