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

---
 _Main/BL/Type_MachineLogisticsCostReportCell/StaticMethod_CreateData.qbl |   25 +++++++++++++++++--------
 1 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/_Main/BL/Type_MachineLogisticsCostReportCell/StaticMethod_CreateData.qbl b/_Main/BL/Type_MachineLogisticsCostReportCell/StaticMethod_CreateData.qbl
index 8e153df..c5b9fec 100644
--- a/_Main/BL/Type_MachineLogisticsCostReportCell/StaticMethod_CreateData.qbl
+++ b/_Main/BL/Type_MachineLogisticsCostReportCell/StaticMethod_CreateData.qbl
@@ -26,19 +26,27 @@
     }
     
     // 鍒涘缓鍗曞厓鏍�
-    traverse ( macroPlan, MachineLogisticsCostReportRow, mlcrr ) { // 寰幆琛�
+    traverse ( macroPlan, MachineLogisticsCostReportRow, mlcrr
+    //           , mlcrr.Factory() = "闀挎槬宸ュ巶"
+              ) { // 寰幆琛�
       info( "褰撳墠閬嶅巻鐨勮锛�", mlcrr.Factory(), " ", mlcrr.Category() );
       traverse ( macroPlan, MachineLogisticsCostReportColumn, mlcrc ) { // 寰幆鍒�
       
         // 鏈哄姞鎴愭湰鍙傛暟
-        lcm  := select( macroPlan, LogisticsCostMachining, tempLCM, tempLCM.Factory() = mlcrr.Factory() and tempLCM.Product() = mlcrr.Category()
-                        and tempLCM.StartDate() <= mlcrc.StartDate() and tempLCM.EndDate() >= mlcrc.StartDate().StartOfNextMonth() );
+        lcm   := select( macroPlan, LogisticsCostMachining, tempLCM, tempLCM.Factory() = mlcrr.Factory() and tempLCM.Product() = mlcrr.Category()
+                         and tempLCM.StartDate() <= mlcrc.StartDate() and tempLCM.EndDate() >= mlcrc.StartDate().StartOfNextMonth() );
         
         // 杩愯緭鎴愭湰鍙傛暟
-        lct  := select( macroPlan, LogisticsCostTransport, tempLCT, 
-                        tempLCT.Product()     = mlcrr.Category()                                                                                                                         and
-                        tempLCT.Origin()      = ifexpr( mlcrr.Category() = "AGW", "DL AGW", ifexpr( mlcrr.Factory() = "澶ц繛宸ュ巶", "DL", "CC" ) + " " + mlcrr.Category() + "澶栫搴�" )     and
-                        tempLCT.Destination() = ifexpr( mlcrr.Category() = "AGW", "CC AGW搴撴埧", ifexpr( mlcrr.Factory() = "澶ц繛宸ュ巶", "DL", "CC" ) + " " + mlcrr.Category() + "绾胯竟搴�" ) );
+        lct   := select( macroPlan, LogisticsCostTransport, tempLCT, 
+                         tempLCT.Product()     = mlcrr.Category()                                                                                                                         and
+                         tempLCT.Origin()      = ifexpr( mlcrr.Category() = "AGW", "DL AGW", ifexpr( mlcrr.Factory() = "澶ц繛宸ュ巶", "DL", "CC" ) + " " + mlcrr.Category() + "澶栫搴�" )     and
+                         tempLCT.Destination() = ifexpr( mlcrr.Category() = "AGW", "CC AGW搴撴埧", ifexpr( mlcrr.Factory() = "澶ц繛宸ュ巶", "DL", "CC" ) + " " + mlcrr.Category() + "绾胯竟搴�" ) );
+    
+        // 杩愯緭鎴愭湰鍙傛暟锛堣皟鎷ㄨ垂鐢級
+        lct1  := select( macroPlan, LogisticsCostTransport, tempLCT, 
+                         tempLCT.Product()     = mlcrr.Category()                                                                                                                         and
+                         tempLCT.Origin()      = ifexpr( mlcrr.Category() = "AGW", "DL AGW", ifexpr( mlcrr.Factory() = "澶ц繛宸ュ巶", "CC", "DL" ) + " " + mlcrr.Category() )                and
+                         tempLCT.Destination() = ifexpr( mlcrr.Category() = "AGW", "CC AGW搴撴埧", ifexpr( mlcrr.Factory() = "澶ц繛宸ュ巶", "DL", "CC" ) + " " + mlcrr.Category() + "澶栫搴�" ) );
     
          // 褰撳墠鏈堟湯鏈�鍚庝竴澶╂棩鏈�
         lastDayOfThisMonth := mlcrc.StartDate().StartOfNextMonth() - 1;
@@ -76,7 +84,8 @@
                                  guard( tempTPC.TransferPlanColumn().ColumnDate().Year()   = mlcrc.StartDate().Year(), false )                              and
                                  guard(  tempTPC.TransferPlanColumn().ColumnDate().Month() = mlcrc.StartDate().Month(), false ),
                                  [Number]tempTPC.Value() );
-        cell.TransferCost( [Number] ( [Number] ( transferQuantity / guard( lcm.PackagingCapacity(), 1 ) ) / guard( lct.LoadingCapacity(), 1 ) ) * guard( lct.TransportPrice(), 1 ) );
+    //    info( "璋冩嫧鏁伴噺锛�", transferQuantity, "    鍖呰瀹归噺锛�", guard( lcm.PackagingCapacity(), 1 ), "    瑁呰浇瀹归噺锛�", guard( lct1.LoadingCapacity(), 1 ), "    杩愯緭鍗曚环锛�",guard( lct1.TransportPrice(), 1 )  );
+        cell.TransferCost( [Number] ( ceil( ceil( transferQuantity / guard( lcm.PackagingCapacity(), 1 ) ) / guard( lct1.LoadingCapacity(), 1 ) ) * guard( lct1.TransportPrice(), 1 ) ) );
     
         // 澶栫搴撳叆搴撹垂鐢紙鍏ュ簱閲廩鍖呰閲廬 / 鍖呰瀹归噺 * 鍏ュ簱鍗曚环锛�
         cell.StorageFeesForRentedWarehouses( packageQuantity / guard( lcm.PackagingCapacity(), 1 ) * guard( lcm.WarehousingPrice(), 1 ) );

--
Gitblit v1.9.3