From 6031e3a259a15dff61ef18bfe90f8c1b27cfcb12 Mon Sep 17 00:00:00 2001
From: lazhen <17772815105@139.com>
Date: 星期二, 03 十二月 2024 17:09:27 +0800
Subject: [PATCH] 接口同步过来的库存数据如果属于PL则除4向下取整

---
 _Main/BL/Type_InventoryInterfaceData/StaticMethod_Generate.qbl |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/_Main/BL/Type_InventoryInterfaceData/StaticMethod_Generate.qbl b/_Main/BL/Type_InventoryInterfaceData/StaticMethod_Generate.qbl
index e25faf2..6f4953b 100644
--- a/_Main/BL/Type_InventoryInterfaceData/StaticMethod_Generate.qbl
+++ b/_Main/BL/Type_InventoryInterfaceData/StaticMethod_Generate.qbl
@@ -1,6 +1,7 @@
 Quintiq file version 2.0
 #parent: #root
 StaticMethod Generate (
+  MacroPlan macroplan,
   InterfaceDataset interfaceDataset,
   Date date,
   String partno,
@@ -16,9 +17,15 @@
     if( isnull( iid ) ){
       iid := interfaceDataset.InventoryInterfaceData( relnew, Date := date, PartNumber := partno );
     }
+    product    := selectobject( macroplan, Product_MP, product, product.ID() = partno );
+    if( not isnull( product ) and exists( product.GetAllParent(), Elements, proparent, proparent.ID() = 'PL' ) ){
+      quantitiy   := floor( [Real]quantitiy / 4 );
+    }
     iidl := selectobject( iid, InventoryInterfaceDataDetail, detail, detail.InventoryPoint() = inventory and detail.Fac() = fac );
     if( isnull( iidl ) ){
       iid.InventoryInterfaceDataDetail( relnew, Date := date, PartNumber := partno, InventoryPoint := inventory, Fac := fac, Quantity := quantitiy );
+    }else{
+      iidl.Quantity( );
     }
   *]
 }

--
Gitblit v1.9.3