]> wagnertech.de Git - kivitendo-erp.git/commitdiff
Lieferdatum, Lieferscheindatum und Liefertermin
authorNiclas Zimmermann <niclas@lx-office-hosting.de>
Mon, 1 Oct 2012 13:09:59 +0000 (15:09 +0200)
committerNiclas Zimmermann <niclas@lx-office-hosting.de>
Mon, 1 Oct 2012 13:37:13 +0000 (15:37 +0200)
Im Workflow Auftrag-Lieferschein-Rechnung gab es Probleme mit dem
Lieferdatum. Beim Auftrag wurde bisher ein Lieferdatum verlangt,
was jetzt in Liefertermin umbenannt wurde, um echtes Lieferdatum
und Lieferfrist zu unterscheiden.

Der Liefertermin wird jetzt auch in der Ansicht vom Lieferschein
angezeigt. Das Lieferscheindatum und das Lieferdatum sind synonym.
Somit wird in der Rechnung als Lieferdatum das Datum vom Liefer-
schein angegeben.

Siehe auch Bug #1958. Dort wird allerdings noch zwischen einem
Lieferdatum und Lieferschein unterschieden, was dieser commit noch
nicht leistet.

SL/DO.pm
locale/de/all
templates/webpages/do/form_header.html
templates/webpages/oe/form_header.html

index c4303f4425089bae4f88251669a8267ce13b17f3..237d523d911c269760562acccaa7b3cd83cf5b8d 100644 (file)
--- a/SL/DO.pm
+++ b/SL/DO.pm
@@ -228,7 +228,7 @@ sub save {
   }
 
   my $project_id;
   }
 
   my $project_id;
-  my $reqdate;
+  my $items_reqdate;
 
   $form->get_lists('price_factors' => 'ALL_PRICE_FACTORS');
   my %price_factors = map { $_->{id} => $_->{factor} } @{ $form->{ALL_PRICE_FACTORS} };
 
   $form->get_lists('price_factors' => 'ALL_PRICE_FACTORS');
   my %price_factors = map { $_->{id} => $_->{factor} } @{ $form->{ALL_PRICE_FACTORS} };
@@ -284,7 +284,7 @@ sub save {
     $price_factor = $price_factors{ $form->{"price_factor_id_$i"} } || 1;
     my $linetotal    = $form->round_amount($form->{"sellprice_$i"} * $form->{"qty_$i"} / $price_factor, 2);
 
     $price_factor = $price_factors{ $form->{"price_factor_id_$i"} } || 1;
     my $linetotal    = $form->round_amount($form->{"sellprice_$i"} * $form->{"qty_$i"} / $price_factor, 2);
 
-    $reqdate = ($form->{"reqdate_$i"}) ? $form->{"reqdate_$i"} : undef;
+    $items_reqdate = ($form->{"reqdate_$i"}) ? $form->{"reqdate_$i"} : undef;
 
     do_statement($form, $h_item_id, $q_item_id);
     my ($item_id) = $h_item_id->fetchrow_array();
 
     do_statement($form, $h_item_id, $q_item_id);
     my ($item_id) = $h_item_id->fetchrow_array();
@@ -294,7 +294,7 @@ sub save {
                $form->{"description_$i"}, $form->{"longdescription_$i"},
                $form->{"qty_$i"}, $baseqty,
                $form->{"sellprice_$i"}, $form->{"discount_$i"} / 100,
                $form->{"description_$i"}, $form->{"longdescription_$i"},
                $form->{"qty_$i"}, $baseqty,
                $form->{"sellprice_$i"}, $form->{"discount_$i"} / 100,
-               $form->{"unit_$i"}, conv_date($reqdate), conv_i($form->{"project_id_$i"}),
+               $form->{"unit_$i"}, conv_date($items_reqdate), conv_i($form->{"project_id_$i"}),
                $form->{"serialnumber_$i"},
                $form->{"ordnumber_$i"}, conv_date($form->{"transdate_$i"}),
                $form->{"cusordnumber_$i"},
                $form->{"serialnumber_$i"},
                $form->{"ordnumber_$i"}, conv_date($form->{"transdate_$i"}),
                $form->{"cusordnumber_$i"},
@@ -327,6 +327,8 @@ sub save {
   $h_item_stock->finish();
 
 
   $h_item_stock->finish();
 
 
+  # reqdate is last items reqdate (?: old behaviour) if not already set
+  $form->{reqdate} ||= $items_reqdate;
   # save DO record
   $query =
     qq|UPDATE delivery_orders SET
   # save DO record
   $query =
     qq|UPDATE delivery_orders SET
@@ -341,7 +343,7 @@ sub save {
   @values = ($form->{donumber}, $form->{ordnumber},
              $form->{cusordnumber}, conv_date($form->{transdate}),
              conv_i($form->{vendor_id}), conv_i($form->{customer_id}),
   @values = ($form->{donumber}, $form->{ordnumber},
              $form->{cusordnumber}, conv_date($form->{transdate}),
              conv_i($form->{vendor_id}), conv_i($form->{customer_id}),
-             conv_date($reqdate), $form->{shippingpoint}, $form->{shipvia},
+             conv_date($form->{reqdate}), $form->{shippingpoint}, $form->{shipvia},
              $form->{notes}, $form->{intnotes},
              $form->{closed} ? 't' : 'f', $form->{delivered} ? "t" : "f",
              conv_i($form->{department_id}), conv_i($form->{language_id}), conv_i($form->{shipto_id}),
              $form->{notes}, $form->{intnotes},
              $form->{closed} ? 't' : 'f', $form->{delivered} ? "t" : "f",
              conv_i($form->{department_id}), conv_i($form->{language_id}), conv_i($form->{shipto_id}),
@@ -573,9 +575,12 @@ sub retrieve {
   my $mode = !$params{ids} ? 'default' : ref $params{ids} eq 'ARRAY' ? 'multi' : 'single';
 
   if ($mode eq 'default') {
   my $mode = !$params{ids} ? 'default' : ref $params{ids} eq 'ARRAY' ? 'multi' : 'single';
 
   if ($mode eq 'default') {
-    $ref = selectfirst_hashref_query($form, $dbh, qq|SELECT current_date AS transdate, current_date AS reqdate|);
+    $ref = selectfirst_hashref_query($form, $dbh, qq|SELECT current_date AS transdate|);
     map { $form->{$_} = $ref->{$_} } keys %$ref;
 
     map { $form->{$_} = $ref->{$_} } keys %$ref;
 
+    # if reqdate is not set from oe-workflow, set it to transdate (which is current date)
+    $form->{reqdate} ||= $form->{transdate};
+
     # get last name used
     $form->lastname_used($dbh, $myconfig, $vc) unless $form->{"${vc}_id"};
 
     # get last name used
     $form->lastname_used($dbh, $myconfig, $vc) unless $form->{"${vc}_id"};
 
index 9fbd29bbb00c13aaa969e545aea3312cd287659d..78f43c66c408972b829c4eeea2c786861ea5b1e9 100644 (file)
@@ -1553,7 +1553,7 @@ $self->{texts} = {
   'Report for'                  => 'Bericht für',
   'Reports'                     => 'Berichte',
   'Representative'              => 'Vertreter',
   'Report for'                  => 'Bericht für',
   'Reports'                     => 'Berichte',
   'Representative'              => 'Vertreter',
-  'Reqdate'                     => 'Lieferdatum',
+  'Reqdate'                     => 'Liefertermin',
   'Request for Quotation'       => 'Anfrage',
   'Request for Quotations'      => 'Anfragen',
   'Request quotation'           => 'Preisanfrage',
   'Request for Quotation'       => 'Anfrage',
   'Request for Quotations'      => 'Anfragen',
   'Request quotation'           => 'Preisanfrage',
index e12f0da9b798737070a31f6aa61770c0ac63a371..848fa898ea252a699692744f29760b35cccbbe88 100644 (file)
         </td>
        </tr>
 
         </td>
        </tr>
 
+       <tr>
+        <th align="right" nowrap>[% 'Reqdate' | $T8 %]</th>
+        <td nowrap>
+         <input name="reqdate" id="reqdate" size="11" title="[% HTML.escape(myconfig_dateformat) %]" value="[% HTML.escape(reqdate) %]"
+                onBlur="check_right_date_format(this)"[% RO %]>
+         <input type="button" name="b_reqdate" id="reqdate_trigger" value="?">
+        </td>
+       </tr>
+
        <tr>
         <th width="70%" align="right" nowrap>[% 'Project Number' | $T8 %]</th>
         <td>
        <tr>
         <th width="70%" align="right" nowrap>[% 'Project Number' | $T8 %]</th>
         <td>
index dff98c638a11341da986f5545202868f0577b268..76190766ff77508646d867c004704865a2b77967 100644 (file)
                      [%- IF is_sales_quo %]
                       [% 'Valid until' | $T8 %]
                      [%- ELSE %]
                      [%- IF is_sales_quo %]
                       [% 'Valid until' | $T8 %]
                      [%- ELSE %]
-                      [% 'Required by' | $T8 %]
+                      [% 'Reqdate' | $T8 %]
                      [%- END %]
                     </th>
                     <td nowrap>
                      [%- END %]
                     </th>
                     <td nowrap>