From 9d701cfffa9c41690aca461d91a79ff3eb060c05 Mon Sep 17 00:00:00 2001
From: admin <admin@admin.com>
Date: 星期五, 08 十一月 2024 11:53:26 +0800
Subject: [PATCH] 物流报表bug修复
---
_Main/BL/Type_MachineLogisticsCostReportCell/StaticMethod_CreateData.qbl | 25 +++++++++++++++++--------
_Main/BL/Type_DL_EngineRackCell/StaticMethod_CreateData.qbl | 6 ++++++
2 files changed, 23 insertions(+), 8 deletions(-)
diff --git a/_Main/BL/Type_DL_EngineRackCell/StaticMethod_CreateData.qbl b/_Main/BL/Type_DL_EngineRackCell/StaticMethod_CreateData.qbl
index 25bb40e..1cf5d6b 100644
--- a/_Main/BL/Type_DL_EngineRackCell/StaticMethod_CreateData.qbl
+++ b/_Main/BL/Type_DL_EngineRackCell/StaticMethod_CreateData.qbl
@@ -201,6 +201,9 @@
cell.DLExternalRentalWarehouseTransportationCosts( sum( dlerc, DL_EngineRackCell, tempDLERCell, tempDLERCell.DL_EngineRackRow().Generation() <> "SUM", tempDLERCell.DLExternalRentalWarehouseTransportationCosts() ) );
cell.DLRentalWarehouseStorageFees( sum( dlerc, DL_EngineRackCell, tempDLERCell, tempDLERCell.DL_EngineRackRow().Generation() <> "SUM", tempDLERCell.DLRentalWarehouseStorageFees() ) );
cell.CleaningCost( sum( dlerc, DL_EngineRackCell, tempDLERCell, tempDLERCell.DL_EngineRackRow().Generation() <> "SUM", tempDLERCell.CleaningCost() ) );
+ cell.CCCleaningCost( sum( dlerc, DL_EngineRackCell, tempDLERCell, tempDLERCell.DL_EngineRackRow().Generation() <> "SUM", tempDLERCell.CCCleaningCost() ) ); // CC澶栫搴撴竻娲楄垂鐢�
+ cell.DLRentalWarehouseMaterialRackCost( sum( dlerc, DL_EngineRackCell, tempDLERCell, tempDLERCell.DL_EngineRackRow().Generation() <> "SUM", tempDLERCell.DLRentalWarehouseMaterialRackCost() ) ); // 澶ц繛澶栫搴撴枡鏋惰垂鐢�
+ cell.CCExternalRentalWarehouseDLMaterialRackCost( sum( dlerc, DL_EngineRackCell, tempDLERCell, tempDLERCell.DL_EngineRackRow().Generation() <> "SUM", tempDLERCell.CCExternalRentalWarehouseDLMaterialRackCost() ) ); // CC澶栫搴揇L鏂欐灦璐圭敤
cell.EstimatedTotalCost( sum( dlerc, DL_EngineRackCell, tempDLERCell, tempDLERCell.DL_EngineRackRow().Generation() <> "SUM", tempDLERCell.EstimatedTotalCost() ) );
cell.Coefficient( 1.05 );
cell.TotalCost( sum( dlerc, DL_EngineRackCell, tempDLERCell, tempDLERCell.DL_EngineRackRow().Generation() <> "SUM", tempDLERCell.TotalCost() ) );
@@ -224,6 +227,9 @@
cell.DLExternalRentalWarehouseTransportationCosts( sum( dlerr, DL_EngineRackCell, tempDLERCell, not tempDLERCell.DL_EngineRackColumn().StartDate().IsMaxInfinity(), tempDLERCell.DLExternalRentalWarehouseTransportationCosts() ) );
cell.DLRentalWarehouseStorageFees( sum( dlerr, DL_EngineRackCell, tempDLERCell, not tempDLERCell.DL_EngineRackColumn().StartDate().IsMaxInfinity(), tempDLERCell.DLRentalWarehouseStorageFees() ) );
cell.CleaningCost( sum( dlerr, DL_EngineRackCell, tempDLERCell, not tempDLERCell.DL_EngineRackColumn().StartDate().IsMaxInfinity(), tempDLERCell.CleaningCost() ) );
+ cell.CCCleaningCost( sum( dlerr, DL_EngineRackCell, tempDLERCell, not tempDLERCell.DL_EngineRackColumn().StartDate().IsMaxInfinity(), tempDLERCell.CCCleaningCost() ) ); // CC澶栫搴撴竻娲楄垂鐢�
+ cell.DLRentalWarehouseMaterialRackCost( sum( dlerr, DL_EngineRackCell, tempDLERCell, not tempDLERCell.DL_EngineRackColumn().StartDate().IsMaxInfinity(), tempDLERCell.DLRentalWarehouseMaterialRackCost() ) ); // 澶ц繛澶栫搴撴枡鏋惰垂鐢�
+ cell.CCExternalRentalWarehouseDLMaterialRackCost( sum( dlerr, DL_EngineRackCell, tempDLERCell, not tempDLERCell.DL_EngineRackColumn().StartDate().IsMaxInfinity(), tempDLERCell.CCExternalRentalWarehouseDLMaterialRackCost() ) ); // CC澶栫搴揇L鏂欐灦璐圭敤
cell.EstimatedTotalCost( sum( dlerr, DL_EngineRackCell, tempDLERCell, not tempDLERCell.DL_EngineRackColumn().StartDate().IsMaxInfinity(), tempDLERCell.EstimatedTotalCost() ) );
cell.Coefficient( 1.05 );
cell.TotalCost( sum( dlerr, DL_EngineRackCell, tempDLERCell, not tempDLERCell.DL_EngineRackColumn().StartDate().IsMaxInfinity(), tempDLERCell.TotalCost() ) );
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