From 531bf2d5dc98162aa050d03cba99a71c7ffb47d5 Mon Sep 17 00:00:00 2001
From: admin <admin@admin.com>
Date: 星期三, 23 十月 2024 18:19:37 +0800
Subject: [PATCH] 大连料架优化

---
 _Main/BL/Type_DL_EngineRackCell/StaticMethod_CreateData.qbl |   26 +++++++++++++++++---------
 1 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/_Main/BL/Type_DL_EngineRackCell/StaticMethod_CreateData.qbl b/_Main/BL/Type_DL_EngineRackCell/StaticMethod_CreateData.qbl
index 5df7805..22afbd5 100644
--- a/_Main/BL/Type_DL_EngineRackCell/StaticMethod_CreateData.qbl
+++ b/_Main/BL/Type_DL_EngineRackCell/StaticMethod_CreateData.qbl
@@ -34,7 +34,7 @@
                         and tempLCE.StartDate() <= dlerc.StartDate() and tempLCE.EndDate() >= dlerc.StartDate().StartOfNextMonth() );
                         
         // 鏂欐灦鎴愭湰鍙傛暟
-        lcmr := select( macroPlan, LogisticsCostMaterialRack, tempLCMR, tempLCMR.Factory() = "澶ц繛宸ュ巶" 
+        lcmr := select( macroPlan, LogisticsCostMaterialRack, tempLCMR, tempLCMR.Factory() = "闀挎槬宸ュ巶" 
                         and tempLCMR.StartDate() <= dlerc.StartDate() and tempLCMR.EndDate() >= dlerc.StartDate().StartOfNextMonth() );
                         
         // 杩愯緭鎴愭湰鍙傛暟
@@ -95,11 +95,11 @@
         
         // DL澶栫搴撳叆搴撹垂鐢細鍙戝姩鏈哄叆搴撻噺 / 鍖呰瀹归噺锛堝悜涓婂彇鏁达級* 鏂欐灦鍏ュ簱鍗曚环
         inventoryQuantity := sum( macroPlan, SalesDemand.astype( Forecast ), tempF, 
-                                  tempF.Product_MP().Generation() =  dlerr.Generation()       and
-                                  tempF.Product_MP().MQBMLB()     =  dlerr.MLB_MQB()          and
-                                  tempF.StockingPointID()         =  "澶ц繛澶栫搴�"             and
-                                  tempF.StartDate().Year()        = dlerc.StartDate().Year()  and
-                                  tempF.StartDate().Month()       = dlerc.StartDate().Month(),
+                                  tempF.Product_MP().Generation()         =  dlerr.Generation()       and
+                                  tempF.Product_MP().MQBMLB()             =  dlerr.MLB_MQB()          and
+                                  tempF.StockingPointID()                 =  "澶ц繛澶栫搴�"             and
+                                  ( tempF.StartDate() - 2 ).Year()        = dlerc.StartDate().Year()  and
+                                  ( tempF.StartDate() - 2 ).Month()       = dlerc.StartDate().Month(),
                                   tempF.FulfilledQuantity() );
     //                   info( "鏃堕棿锛�", dlerc.StartDate().Format( "Y-M2-D2" ), "    鍏ュ簱鏁伴噺锛�", inventoryQuantity, "    鍖呰瀹归噺锛�", guard( lce.PackagingCapacity(), 0 ),
     //                         "    瑁呰浇瀹归噺锛�", guard( lct1.LoadingCapacity(), 0 ) ); // 娴嬭瘯杈撳嚭
@@ -109,7 +109,7 @@
         outboundQuantity := sum( macroPlan, Product_MP.ProductInStockingPoint_MP.ProductInStockingPointInPeriodPlanning.astype( ProductInStockingPointInPeriodPlanningLeaf ), tempPISPIPPL,
                                  tempPISPIPPL.ProductInStockingPoint_MP().Product_MP().Generation() = dlerr.Generation()  and
                                  tempPISPIPPL.ProductInStockingPoint_MP().Product_MP().MQBMLB()     = dlerr.MLB_MQB()     and
-                                 tempPISPIPPL.ProductInStockingPoint_MP().StockingPointID()         = "澶ц繛澶栫搴�"        and
+                                 tempPISPIPPL.ProductInStockingPoint_MP().StockingPointID()         = "澶ц繛鍦哄唴搴�"        and
                                  tempPISPIPPL.Start().Date()                                        >= dlerc.StartDate()  and
                                  tempPISPIPPL.End().Date()                                          <= lastDayOfThisMonth,
                                  tempPISPIPPL.NewSupplyQuantity() );
@@ -130,14 +130,22 @@
                                   tempPISPIP.PlannedInventoryLevelEnd() );
         cell.DLRentalWarehouseStorageFees( [Number] ( guard( ( cell.TotalQuantityOfMaterialRacks() - plannedInventory1 ) / lce.PackagingCapacity(), 0 ) * guard( lcmr.StoragePrice(), 1 ) ) );
         
-        //娓呮礂璐圭敤锛氬彂鍔ㄦ満鍏ュ簱閲� / 鍖呰瀹归噺 * 鏂欐灦娓呮礂鍗曚环銆傚彂鍔ㄦ満鍏ュ簱閲忓彇鍙戝姩鏈洪攢閲忥紝鍖呰瀹归噺鍙栬嚜鍙戝姩鏈烘垚鏈〃銆傛枡鏋舵竻娲楀崟浠峰彇鏂欐灦鎴愭湰琛ㄣ��
-        cell.CleaningCost( [Number] ( guard( inventoryQuantity / lce.PackagingCapacity(), 0 ) * guard( lcmr.CleanPrice(), 1 ) ) );
+        // DL澶栫搴撴竻娲楄垂鐢細鍙戝姩鏈哄叆搴撻噺 / 鍖呰瀹归噺 * 鏂欐灦娓呮礂鍗曚环銆傚彂鍔ㄦ満鍏ュ簱閲忓彇鍙戝姩鏈洪攢閲忥紝鍖呰瀹归噺鍙栬嚜鍙戝姩鏈烘垚鏈〃銆傛枡鏋舵竻娲楀崟浠峰彇鏂欐灦鎴愭湰琛ㄣ��
+        cell.CleaningCost( [Number] ( guard( outboundQuantity / lce.PackagingCapacity(), 0 ) * guard( lcmr.CleanPrice(), 1 ) ) );
         
         // 棰勮鎬昏垂鐢�
         cell.EstimatedTotalCost( cell.CCStorageFeesForRentedWarehouses() + cell.CCOutboundExpensesForRentedWarehouses() + cell.CCRentalWarehouseStorageFees() + cell.CCLineHaulCost() + 
                                  cell.CCShortDistanceTransportationCosts() + cell.DLStorageFeesForRentedWarehouses() + cell.DLOutboundExpensesForRentedWarehouses() +
                                  cell.DLExternalRentalWarehouseTransportationCosts() + cell.DLRentalWarehouseStorageFees() + cell.CleaningCost() );
         
+        // 澶ц繛澶栫搴撴枡鏋惰垂鐢�
+        cell.DLRentalWarehouseMaterialRackCost( cell.DLStorageFeesForRentedWarehouses() + cell.DLOutboundExpensesForRentedWarehouses() +
+                                                cell.DLExternalRentalWarehouseTransportationCosts() );
+        
+        // CC澶栫搴揇L鏂欐灦璐圭敤
+        cell.CCExternalRentalWarehouseDLMaterialRackCost( cell.CCStorageFeesForRentedWarehouses() + cell.CCOutboundExpensesForRentedWarehouses() +
+                                                          cell.CCRentalWarehouseStorageFees() + cell.CCShortDistanceTransportationCosts() );
+        
         // 绯绘暟
         cell.Coefficient( 1.05 );
         

--
Gitblit v1.9.3