From fa55a671f97d901ab03bc7a258cf3da8c4f9c0de Mon Sep 17 00:00:00 2001
From: lazhen <17772815105@139.com>
Date: 星期四, 31 十月 2024 18:59:59 +0800
Subject: [PATCH] Merge branch 'dev' of http://47.101.211.7:10101/r/VWED into dev-zlg

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

diff --git a/_Main/BL/Type_DL_EngineRackCell/StaticMethod_CreateData.qbl b/_Main/BL/Type_DL_EngineRackCell/StaticMethod_CreateData.qbl
index 14c6378..731bea9 100644
--- a/_Main/BL/Type_DL_EngineRackCell/StaticMethod_CreateData.qbl
+++ b/_Main/BL/Type_DL_EngineRackCell/StaticMethod_CreateData.qbl
@@ -60,7 +60,9 @@
                            tempMRTCell.MaterialRackTotalRow().Generation() = dlerr.Generation()        and
                            tempMRTCell.MaterialRackTotalRow().MLB_MQB()    = dlerr.MLB_MQB()           and
                            tempMRTCell.MaterialRackColumn().Month()        = dlerc.StartDate().Month() );
-        cell.TotalQuantityOfMaterialRacks( mrtcell.Quantity() );
+        if ( dlerr.Generation() = "350bar" and dlerr.MLB_MQB() = "MQB" ) {
+          cell.TotalQuantityOfMaterialRacks( mrtcell.Quantity() );
+        }
        
         // 澶ц繛澶栫搴撶┖鏂欐灦鏁伴噺锛氥��350bar MQB鏂欐灦鎬绘暟閲� - 鎵�鏈�350bar MQB鎬诲簱瀛� / 鍖呰瀹归噺 - 瀹㈡埛搴撴枡鏋舵暟閲忋��* 澶ц繛澶栫搴撶┖鏂欐灦姣斾緥
         plannedInventory := sum( macroPlan, Product_MP.ProductInStockingPoint_MP.ProductInStockingPointInPeriod, tempPISPIP,
@@ -84,8 +86,8 @@
                                         tempF.StartDate().Year()        = dlerc.StartDate().Year()  and
                                         tempF.StartDate().Month()       = dlerc.StartDate().Month(),
                                         tempF.FulfilledQuantity() );
-        info( "鏃堕棿锛�", dlerc.StartDate().Format( "Y-M2-D2" ), "    鍏ュ簱鏁伴噺锛�", transportationQuantity1, "    鍖呰瀹归噺锛�", guard( lce.PackagingCapacity(), 0 ),
-              "    鍏ュ簱鍗曚环锛�", guard( lcmrCC.WarehousingPrice(), 0 ) ); // 娴嬭瘯杈撳嚭
+    //    info( "鏃堕棿锛�", dlerc.StartDate().Format( "Y-M2-D2" ), "    鍏ュ簱鏁伴噺锛�", transportationQuantity1, "    鍖呰瀹归噺锛�", guard( lce.PackagingCapacity(), 0 ),
+    //          "    鍏ュ簱鍗曚环锛�", guard( lcmrCC.WarehousingPrice(), 0 ) ); // 娴嬭瘯杈撳嚭
         cell.CCStorageFeesForRentedWarehouses( [Number] ( guard( transportationQuantity1 / lce.PackagingCapacity(), 0 ) * lcmrCC.WarehousingPrice() ) );
         
         // CC澶栫搴撳嚭搴撹垂鐢細鍙戝姩鏈洪攢閲� / 鍖呰瀹归噺锛堝悜涓婂彇鏁达級* 鏂欐灦鍑哄簱鍗曚环
@@ -96,14 +98,15 @@
         
         // CC闀块�旇繍杈撹垂鐢細璋冩嫧鏁伴噺 / 鍖呰瀹归噺 / 瑁呰浇瀹归噺 * 鏂欐灦杩愯緭鍗曚环
         transportationQuantity2 := sum( macroPlan, Unit.Lane.LaneLeg.Trip.ProductInTrip, tempPIT, 
-                                        tempPIT.Product_MP().Generation()                                                =  dlerr.Generation()      and
-                                        tempPIT.Product_MP().MQBMLB()                                                    =  dlerr.MLB_MQB()         and
-                                        tempPIT.Trip().Departure().Date()                                                >= dlerc.StartDate()       and
-                                        tempPIT.Trip().Arrival().Date()                                                  <= lastDayOfThisMonth      and
+                                        tempPIT.Product_MP().Generation()                                                =  dlerr.Generation()       and
+                                        tempPIT.Product_MP().MQBMLB()                                                    =  dlerr.MLB_MQB()          and
+                                        tempPIT.Trip().Departure().Date().Year()                                         = dlerc.StartDate().Year()  and
+                                        tempPIT.Trip().Departure().Date().Month()                                        = dlerc.StartDate().Month() and
                                         tempPIT.Trip().LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP().ID()      = "澶ц繛鍘傚唴搴�"              and
                                         tempPIT.Trip().LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP().ID() = "澶ц繛鍙戝姩鏈虹殑闀挎槬澶栫搴�",
                                         tempPIT.Quantity()
                                        );
+    //    info( "鏁伴噺锛�", transportationQuantity2 );
         cell.CCLineHaulCost( [Number] ( guard( transportationQuantity2 / lce.PackagingCapacity() / lct1.LoadingCapacity(), 0 ) * guard( lct1.TransportPrice(), 1 ) ) );
         
         // CC鐭�旇繍杈撹垂鐢細璋冩嫧鏁伴噺 / 鍖呰瀹归噺 / 瑁呰浇瀹归噺 * 鏂欐灦杩愯緭鍗曚环
@@ -133,7 +136,14 @@
         cell.DLOutboundExpensesForRentedWarehouses( [Number] ( guard( outboundQuantity / lce.PackagingCapacity(), 0 ) * guard( lcmrDL.OutboundPrice(), 1 ) ) );
         
         // DL澶栫搴撹繍杈撹垂鐢細鍙戝姩鏈鸿繍杈撻噺 / 鍖呰瀹归噺 / 瑁呰浇瀹归噺锛堝悜涓婂彇鏁达級* 鏂欐灦杩愯緭鍗曚环
-        cell.DLExternalRentalWarehouseTransportationCosts( [Number] ( guard( inventoryQuantity / lce.PackagingCapacity() / lct2.LoadingCapacity(), 0 ) * guard( lct2.TransportPrice(), 1 ) ) );
+        outboundQuantity1 := 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.Start().Date()                                        >= dlerc.StartDate()  and
+                                 tempPISPIPPL.End().Date()                                          <= lastDayOfThisMonth,
+                                 tempPISPIPPL.NewSupplyQuantity() );
+        cell.DLExternalRentalWarehouseTransportationCosts( [Number] ( guard( outboundQuantity1 / lce.PackagingCapacity() / lct2.LoadingCapacity(), 0 ) * guard( lct2.TransportPrice(), 1 ) ) );
         
         // 澶ц繛澶栫搴撲粨鍌ㄨ垂鐢細銆�350bar MQB鏂欐灦鎬绘暟閲�-鎵�鏈�350bar MQB鎬诲簱瀛�/鍖呰瀹归噺-瀹㈡埛搴撴枡鏋舵暟閲忋��*澶ц繛澶栫搴撶┖鏂欐灦姣斾緥
         // DL澶栫搴撲粨鍌ㄨ垂鐢細鏂欐灦鎬绘暟閲� - 鍙戝姩鏈哄簱瀛� / 鍖呰瀹归噺锛堝悜涓婂彇鏁达級* 绌烘枡鏋朵粨鍌ㄥ崟浠�

--
Gitblit v1.9.3