Zeiterfassung: Konvertierung: base_qty in Einheit des Artikels umwandeln
authorBernd Bleßmann <bernd@kivitendo-premium.de>
Mon, 3 May 2021 11:23:47 +0000 (13:23 +0200)
committerBernd Bleßmann <bernd@kivitendo-premium.de>
Wed, 5 May 2021 15:25:03 +0000 (17:25 +0200)
SL/DB/DeliveryOrder.pm

index 6068b13..30db8e6 100644 (file)
@@ -250,9 +250,9 @@ sub new_from_time_recordings {
       parts_id        => $part_by_part_id{$key}->id,
       description     => $part_by_part_id{$key}->description,
       qty             => $qty,
-      base_qty        => $qty,
+      base_qty        => $h_unit->convert_to($qty, $part_by_part_id{$key}->unit_obj),
       unit_obj        => $h_unit,
-      sellprice       => $part_by_part_id{$key}->sellprice,
+      sellprice       => $part_by_part_id{$key}->sellprice, # Todo: use price rules to get sellprice
       longdescription => $longdescription,
     );