]> wagnertech.de Git - mfinanz.git/blobdiff - SL/IC.pm
Syntaxfehler behoben
[mfinanz.git] / SL / IC.pm
index 46f0f542cebecac4c7b079fcf6bf20d8c5d25b43..a09d740eabcf46ddda8315f4af12d4ce4fc47c6a 100644 (file)
--- a/SL/IC.pm
+++ b/SL/IC.pm
@@ -272,10 +272,6 @@ sub all_parts {
     insertdate         => 'itime::DATE',
   );
 
-  if ($form->{l_assembly} && $form->{l_lastcost}) {
-    @simple_l_switches = grep { $_ ne 'lastcost' } @simple_l_switches;
-  }
-
   my $make_token_builder = sub {
     my $joins_needed = shift;
     sub {
@@ -402,7 +398,7 @@ sub all_parts {
         FROM assembly a_lc
         LEFT JOIN parts p_lc            ON (a_lc.parts_id        = p_lc.id)
         LEFT JOIN price_factors pfac_lc ON (p_lc.price_factor_id = pfac_lc.id)
-        WHERE (a_lc.id = p.id)) AS lastcost|;
+        WHERE (a_lc.id = p.id)) AS assembly_lastcost|;
   $table_prefix{$q_assembly_lastcost} = ' ';
 
   # special case makemodel search
@@ -744,7 +740,9 @@ sub retrieve_accounts {
     # also use deliverydate for credit notes
     $transdate = $form->{tax_point} || $form->{deliverydate} || $form->{invdate};
   } else {
-    $transdate = $form->{tax_point} || $form->{transdate};
+    my $deliverydate;
+    $deliverydate = $form->{reqdate} if any { $_ eq $form->{type} } qw(sales_order request_quotation purchase_order);
+    $transdate = $form->{tax_point} || $deliverydate || $form->{transdate};
   }
 
   if ($transdate eq "") {