From 54b30ae99f210572c008518d28262db44a49422e Mon Sep 17 00:00:00 2001
From: hongji.li <hongji.a.li@capgemini.com>
Date: 星期四, 14 九月 2023 15:54:45 +0800
Subject: [PATCH] 物料标签同步库存规范优化

---
 _Main/BL/Type_MatAttrSettingAndPlanningStrategy/StaticMethod_SynchronizeInventoryTargets.qbl |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/_Main/BL/Type_MatAttrSettingAndPlanningStrategy/StaticMethod_SynchronizeInventoryTargets.qbl b/_Main/BL/Type_MatAttrSettingAndPlanningStrategy/StaticMethod_SynchronizeInventoryTargets.qbl
index 00a686b..17e144a 100644
--- a/_Main/BL/Type_MatAttrSettingAndPlanningStrategy/StaticMethod_SynchronizeInventoryTargets.qbl
+++ b/_Main/BL/Type_MatAttrSettingAndPlanningStrategy/StaticMethod_SynchronizeInventoryTargets.qbl
@@ -12,6 +12,12 @@
       product_MP := select( macroPlan, Product_MP, tempPMP, tempPMP.ID() = masaps.MatCode() );
       if ( not isnull( product_MP ) ) {
         traverse ( product_MP, ProductInStockingPoint_MP, pispmp ) {
+          targetInventorySpecification := select( product_MP, InventorySpecification, tempIS, tempIS.ProductID() = product_MP.ID() and 
+                                                              tempIS.StockingPointID() = pispmp.StockingPointID() and
+                                                              tempIS.Start()           = macroPlan.StartOfPlanning().Date() );
+          if ( not isnull( targetInventorySpecification ) ) {
+            targetInventorySpecification.Delete();
+          }
           InventorySpecification::Create( product_MP,
                                           pispmp.StockingPoint_MP(),
                                           macroPlan.StartOfPlanning().Date(),

--
Gitblit v1.9.3