]> wagnertech.de Git - mfinanz.git/blobdiff - SL/Form.pm
rdbo models: Parts nach 066fbb38f
[mfinanz.git] / SL / Form.pm
index f873458e7bc56f361c13a19fc5f2106bb4280880..38d87ad01a22f81a9ba102cd2f8de923b994961d 100644 (file)
@@ -2890,12 +2890,14 @@ sub lastname_used {
                     "a.department_id"         => "department_id",
                     "d.description"           => "department",
                     "ct.name"                 => $table,
+                    "ct.curr"                 => "cv_curr",
                     "current_date + ct.terms" => "duedate",
     );
 
   if ($self->{type} =~ /delivery_order/) {
     $arap  = 'delivery_orders';
     delete $column_map{"a.curr"};
+    delete $column_map{"ct.curr"};
 
   } elsif ($self->{type} =~ /_order/) {
     $arap  = 'oe';
@@ -2931,6 +2933,10 @@ sub lastname_used {
 
   # remove any trailing whitespace
   $self->{currency} =~ s/\s*$// if $self->{currency};
+  $self->{cv_curr} =~ s/\s*$// if $self->{cv_curr};
+
+  # if customer/vendor currency is set use this
+  $self->{currency} = $self->{cv_curr} if $self->{cv_curr};
 
   $main::lxdebug->leave_sub();
 }