Erfassungsdatum bei Auträgen.
authorBernd Bleßmann <bernd@kivitendo-premium.de>
Mon, 30 Sep 2013 11:09:59 +0000 (13:09 +0200)
committerBernd Bleßmann <bernd@kivitendo-premium.de>
Thu, 23 Apr 2015 15:41:51 +0000 (17:41 +0200)
In der Maske anzeigen; im Bericht anzeigen und danach filtern.

Conflicts:

SL/OE.pm
bin/mozilla/oe.pl
locale/de/all
templates/webpages/oe/search.html

Übernahme aus Kundenprojekt.

SL/OE.pm
bin/mozilla/oe.pl
locale/de/all
locale/en/all
templates/webpages/oe/form_header.html
templates/webpages/oe/search.html

index cfb48b5..8702154 100644 (file)
--- a/SL/OE.pm
+++ b/SL/OE.pm
@@ -109,6 +109,7 @@ sub transactions {
     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|  o.itime::DATE AS insertdate, | .
     qq|  ex.$rate AS exchangerate, | .
     qq|  pr.projectnumber AS globalprojectnumber, | .
     qq|  e.name AS employee, s.name AS salesman, | .
@@ -230,6 +231,16 @@ SQL
     push(@values, conv_date($form->{reqdateto}));
   }
 
+  if($form->{insertdatefrom}) {
+    $query .= qq| AND o.itime::DATE >= ?|;
+    push(@values, conv_date($form->{insertdatefrom}));
+  }
+
+  if($form->{insertdateto}) {
+    $query .= qq| AND o.itime::DATE <= ?|;
+    push(@values, conv_date($form->{insertdateto}));
+  }
+
   if ($form->{shippingpoint}) {
     $query .= qq| AND o.shippingpoint ILIKE ?|;
     push(@values, '%' . $form->{shippingpoint} . '%');
@@ -285,6 +296,7 @@ SQL
     "shipvia"                 => "o.shipvia",
     "transaction_description" => "o.transaction_description",
     "shippingpoint"           => "o.shippingpoint",
+    "insertdate"              => "o.itime",
     "taxzone"                 => "tz.description",
   );
   if ($form->{sort} && grep($form->{sort}, keys(%allowed_sort_columns))) {
@@ -889,8 +901,8 @@ sub retrieve {
            o.closed, o.reqdate, o.quonumber, o.department_id, o.cusordnumber,
            d.description AS department, o.payment_id, o.language_id, o.taxzone_id,
            o.delivery_customer_id, o.delivery_vendor_id, o.proforma, o.shipto_id,
-           o.globalproject_id, o.delivered, o.transaction_description, o.delivery_term_id
-           , o.order_probability, o.expected_billing_date
+           o.globalproject_id, o.delivered, o.transaction_description, o.delivery_term_id,
+           o.itime::DATE AS insertdate, o.order_probability, o.expected_billing_date
          FROM oe o
          JOIN ${vc} cv ON (o.${vc}_id = cv.id)
          LEFT JOIN employee e ON (o.employee_id = e.id)
index 7b6796b..8075bc6 100644 (file)
@@ -847,7 +847,7 @@ sub orders {
     "marge_total",             "marge_percent",
     "vcnumber",                "ustid",
     "country",                 "shippingpoint",
-    "taxzone",
+    "taxzone",                 "insertdate",
     "order_probability",       "expected_billing_date", "expected_netamount",
   );
 
@@ -889,7 +889,7 @@ sub orders {
   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 reqdate_unset_or_old
+                                                        business_id shippingpoint taxzone_id reqdate_unset_or_old insertdatefrom insertdateto
                                                         order_probability_op order_probability_value expected_billing_date_from expected_billing_date_to);
 
   my   @keys_for_url = grep { $form->{$_} } @hidden_variables;
@@ -928,12 +928,13 @@ sub orders {
     'periodic_invoices'       => { 'text' => $locale->text('Per. Inv.'), },
     'shippingpoint'           => { 'text' => $locale->text('Shipping Point'), },
     'taxzone'                 => { 'text' => $locale->text('Steuersatz'), },
+    'insertdate'              => { 'text' => $locale->text('Insert Date'), },
     'order_probability'       => { 'text' => $locale->text('Order probability'), },
     'expected_billing_date'   => { 'text' => $locale->text('Exp. bill. date'), },
     'expected_netamount'      => { 'text' => $locale->text('Exp. netamount'), },
   );
 
-  foreach my $name (qw(id transdate reqdate quonumber ordnumber cusordnumber 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 insertdate)) {
     my $sortdir                 = $form->{sort} eq $name ? 1 - $form->{sortdir} : $form->{sortdir};
     $column_defs{$name}->{link} = $href . "&sort=$name&sortdir=$sortdir";
   }
@@ -971,6 +972,11 @@ sub orders {
     push @options, $locale->text('From') . " " . $locale->date(\%myconfig, $form->{reqdatefrom}, 1)       if $form->{reqdatefrom};
     push @options, $locale->text('Bis')  . " " . $locale->date(\%myconfig, $form->{reqdateto},   1)       if $form->{reqdateto};
   };
+  if ( $form->{insertdatefrom} or $form->{insertdateto} ) {
+    push @options, $locale->text('Insert Date');
+    push @options, $locale->text('From') . " " . $locale->date(\%myconfig, $form->{insertdatefrom}, 1)    if $form->{insertdatefrom};
+    push @options, $locale->text('Bis')  . " " . $locale->date(\%myconfig, $form->{insertdateto},   1)    if $form->{insertdateto};
+  };
   push @options, $locale->text('Open')                                                                    if $form->{open};
   push @options, $locale->text('Closed')                                                                  if $form->{closed};
   push @options, $locale->text('Delivery Order created')                                                               if $form->{delivered};
index f618bd8..224bc26 100755 (executable)
@@ -1348,6 +1348,7 @@ $self->{texts} = {
   'Information'                 => 'Information',
   'Initial version.'            => 'Initiale Version.',
   'Insert'                      => 'Einfügen',
+  'Insert Date'                 => 'Erfassungsdatum',
   'Insert with new customer/vendor number' => 'Mit neuer Kunden-/Lieferantennummer anlegen',
   'Insert with new database ID' => 'Neu anlegen mit neuer Datenbank-ID',
   'Insert with new part number' => 'Mit neuer Artikelnummer einfügen',
index 76f3009..ede0e2f 100644 (file)
@@ -1142,6 +1142,7 @@ $self->{texts} = {
   'Increase'                    => '',
   'Individual Items'            => '',
   'Information'                 => '',
+  'Insert Date'                 => '',
   'Insert with new customer/vendor number' => '',
   'Insert with new database ID' => '',
   'Insert with new part number' => '',
index 81ed919..773c089 100644 (file)
                       [% L.date_tag('reqdate', reqdate, id='reqdate') %]
                     </td>
                   </tr>
+                  [%- IF is_sales_ord %]
+                  <tr>
+                    <th align="right" nowrap>[% 'Insert Date' | $T8 %]</th>
+                    <td>[% insertdate %]</td>
+                  </tr>
+                  [%- END %]
                   <tr>
                     <th width="70%" align="right" nowrap>[% 'Project Number' | $T8 %]</th>
                     <td>
index 06f1429..c881211 100644 (file)
        [% L.date_tag('reqdateto') %]
      </td>
     </tr>
+
+    [%- IF type == 'sales_order' %]
+    <tr>
+     <th align="right">[% 'Insert Date' | $T8 %] [% 'From' | $T8 %]</th>
+     <td>
+       [% L.date_tag('insertdatefrom') %]
+     </td>
+     <th align="right">[% 'Bis' | $T8 %]</th>
+     <td>
+       [% L.date_tag('insertdateto') %]
+     </td>
+    </tr>
+    [%- END %]
+
 [%- IF type == 'sales_quotation' %]
     <tr>
      <th align="right">[% 'Expected billing date' | $T8 %] [% 'From' | $T8 %]</th>
          <input name="l_reqdate" id="l_reqdate" class="checkbox" type="checkbox" value="Y" checked>
          <label for="l_reqdate">[% IF is_order %][% 'Required by' | $T8 %][% ELSE %][% 'Valid until' | $T8 %][% END %]</label>
         </td>
+        [%- IF type == 'sales_order' %]
+        <td>
+          <input name="l_insertdate" id="l_insertdate" class="checkbox" type="checkbox" value="Y">
+          <label for="l_insertdate">[% 'Insert Date' | $T8 %]</label>
+        </td>
+        [%- END %]
        </tr>
        <tr>
         <td>