lazhen
2025-01-09 8afe90b633046db39042aada36b88193062f8cff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
Quintiq file version 2.0
#parent: #root
StaticMethod CreateData (
  MacroPlan macroPlan
)
{
  TextBody:
  [*
    macroPlan.DL_EngineRackRow( relflush );
    macroPlan.DL_EngineRackColumn( relflush );
    
    // 创建行
    genrations := selectuniquevalues( macroPlan, Product_MP, tempPMP, tempPMP.Generation().TrimBoth() <> "", tempPMP.Generation() );
    mqbmlbs    := selectuniquevalues( macroPlan, Product_MP, tempPMP, tempPMP.MQBMLB().TrimBoth() <> "", tempPMP.MQBMLB() );
    traverse ( genrations, Elements, g, g = "350bar" ) {
      traverse ( mqbmlbs, Elements, m, m = "MQB" ) {
        macroPlan.DL_EngineRackRow( relnew, Generation := g, MLB_MQB := m );
      }
    }
    
    // 创建列
    indexDate := macroPlan.StartOfPlanning().Date().StartOfMonth();
    for ( i := 0; i < 12; i++ ) {
      macroPlan.DL_EngineRackColumn( relnew, StartDate := indexDate );
      indexDate := indexDate.StartOfNextMonth();
    }
    
    // 创建单元格
    traverse ( macroPlan, DL_EngineRackRow, dlerr ) { // 循环行
      info( "当前遍历的行:", dlerr.Generation(), " ", dlerr.MLB_MQB() );
      traverse ( macroPlan, DL_EngineRackColumn, dlerc ) { // 循环列
        // 发动机成本参数
        lce    := select( macroPlan, LogisticsCostEngine, tempLCE, tempLCE.Generation() = dlerr.Generation() and tempLCE.MLB_MQB() = dlerr.MLB_MQB() and tempLCE.Factory() = "大连工厂" 
                        and tempLCE.StartDate() <= dlerc.StartDate() and tempLCE.EndDate() >= dlerc.StartDate().StartOfNextMonth() );
                        
        // 料架成本参数
        lcmrDL := select( macroPlan, LogisticsCostMaterialRack, tempLCMR, tempLCMR.Factory() = "大连工厂" 
                        and tempLCMR.StartDate() <= dlerc.StartDate() and tempLCMR.EndDate() >= dlerc.StartDate().StartOfNextMonth() );
        lcmrCC := select( macroPlan, LogisticsCostMaterialRack, tempLCMR, tempLCMR.Factory() = "长春工厂" 
                        and tempLCMR.StartDate() <= dlerc.StartDate() and tempLCMR.EndDate() >= dlerc.StartDate().StartOfNextMonth() );
                                      
        // 运输成本参数
        lct1   := select( macroPlan, LogisticsCostTransport, tempLCT, tempLCT.Product() = "发动机料架" and tempLCT.Origin() = "大连发动机的长春外租库" and tempLCT.Destination() = "大连厂内库" );
        lct2   := select( macroPlan, LogisticsCostTransport, tempLCT, tempLCT.Product() = "发动机料架" and tempLCT.Origin() = "大连外租库" and tempLCT.Destination() = "大连厂内库" );
        lct3   := select( macroPlan, LogisticsCostTransport, tempLCT, tempLCT.Product() = "发动机料架" and tempLCT.Origin() = "CC 客户库" and tempLCT.Destination() = "CC 外租库" );
        
        // 空料架比例
        mrpc   := select( macroPlan, MaterialRackProportionRow.MaterialRackProportionCell, tempMRPCell, tempMRPCell.MaterialRackProportionRow().Generation() = "大连外租库" and tempMRPCell.MaterialRackColumn().Month() = dlerc.StartDate().Month() );
        
        // 客户库料架总数量
        mrcc   := select( macroPlan, MaterialRackCustomRow.MaterialRackCustomCell, tempMRCCell, tempMRCCell.MaterialRackCustomRow().Generation() = dlerr.Generation() and tempMRCCell.MaterialRackCustomRow().MLB_MQB() = dlerr.MLB_MQB() and tempMRCCell.MaterialRackColumn().Month() = dlerc.StartDate().Month() );
        
        // 当前月末最后一天日期                
        lastDayOfThisMonth := dlerc.StartDate().StartOfNextMonth() - 1; 
        
        cell := dlerr.DL_EngineRackCell( relnew );
        
        // 料架总数量
        mrtcell := select( macroPlan, MaterialRackTotalRow.MaterialRackTotalCell, tempMRTCell, 
                           tempMRTCell.MaterialRackTotalRow().Generation() = dlerr.Generation()        and
                           tempMRTCell.MaterialRackTotalRow().MLB_MQB()    = dlerr.MLB_MQB()           and
                           tempMRTCell.MaterialRackColumn().Month()        = dlerc.StartDate().Month() );
        if ( dlerr.Generation() = "350bar" and dlerr.MLB_MQB() = "MQB" ) {
          cell.TotalQuantityOfMaterialRacks( guard( mrtcell.Quantity(), 0 ) );
        }
       
        // 大连外租库空料架数量:【350bar MQB料架总数量 - 所有350bar MQB总库存 / 包装容量 - 客户库料架数量】* 大连外租库空料架比例
        plannedInventory := sum( macroPlan, Product_MP.ProductInStockingPoint_MP.ProductInStockingPointInPeriod, tempPISPIP,
                                 tempPISPIP.ProductInStockingPoint_MP().Product_MP().IsLeaf()                                                                       and
                                 exists( tempPISPIP.ProductInStockingPoint_MP().Product_MP(), AllParent.AsParent, tempPMP, tempPMP.ID() = "发动机" )                and
                                 //tempPISPIP.ProductInStockingPoint_MP().StockingPointID()                                             = "大连发动机的长春外租库"  and
                                 tempPISPIP.ProductInStockingPoint_MP().Product_MP().Generation()                                       = dlerr.Generation()        and
                                 tempPISPIP.ProductInStockingPoint_MP().Product_MP().MQBMLB()                                           = dlerr.MLB_MQB()           and
                                 tempPISPIP.Start().Date().Year()                                                                       = dlerc.StartDate().Year()  and 
                                 tempPISPIP.Start().Date().Month()                                                                      = dlerc.StartDate().Month(),
                                 tempPISPIP.PlannedInventoryLevelEnd() ) / ( dlerc.StartDate().StartOfNextMonth() - dlerc.StartDate() );
        cell.PackagingCapacity( guard( lce.PackagingCapacity(), 1 ) );
        cell.PlannedInventory( plannedInventory );
        cell.NumberOfEmptyShelves( [Number] guard( ( cell.TotalQuantityOfMaterialRacks() - guard( cell.PlannedInventory() / cell.PackagingCapacity(), 0 ) - guard( mrcc.Quantity(), 0 ) ) * guard( mrpc.Quantity(), 1 ), 0 ) );
        
        // CC外租库入库费用:发动机销量 / 包装容量(向上取整)* 料架入库单价
        transportationQuantity1 := 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.FulfilledQuantity() );
    //    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外租库出库费用:发动机销量 / 包装容量(向上取整)* 料架出库单价
        cell.CCOutboundExpensesForRentedWarehouses( [Number] ( guard( transportationQuantity1 / lce.PackagingCapacity(), 0 ) * lcmrCC.OutboundPrice() ) );
        
        // CC外租库仓储费用:料架总数量 - 发动机库存 / 包装容量(向上取整) * 料架仓储单价
        cell.CCRentalWarehouseStorageFees( [Number] ( ( cell.TotalQuantityOfMaterialRacks() - guard( plannedInventory / lce.PackagingCapacity(), 0 ) ) * lcmrCC.StoragePrice() ) );
        
        // 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().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( ceil( ceil( transportationQuantity2 / lce.PackagingCapacity() ) / lct1.LoadingCapacity() ), 0 ) * guard( lct1.TransportPrice(), 1 ) ) );
        
        // CC短途运输费用:调拨数量 / 包装容量 / 装载容量 * 料架运输单价
        cell.CCShortDistanceTransportationCosts( [Number] ( guard( transportationQuantity1 / lce.PackagingCapacity() / lct3.LoadingCapacity(), 0 ) * guard( lct3.TransportPrice(), 1 ) ) )
        
        // 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()                       >= ( dlerc.StartDate() - 2 )  and
                                  tempF.StartDate()                       <= ( lastDayOfThisMonth - 2 ),
                                  tempF.FulfilledQuantity() );
    //                   info( "时间:", dlerc.StartDate().Format( "Y-M2-D2" ), "  时间区域:", ( dlerc.StartDate() - 2 ).Format( "Y-M2-D2" ), "    ", ( lastDayOfThisMonth - 2 ).Format( "Y-M2-D2" ),
    //                         "    入库数量:", inventoryQuantity, "    包装容量:", guard( lce.PackagingCapacity(), 0 ),
    //                         "    入库单价:", guard( lcmrDL.WarehousingPrice(), 0 ) ); // 测试输出
        cell.DLStorageFeesForRentedWarehouses( [Number] ( guard( inventoryQuantity / lce.PackagingCapacity(), 0 ) * guard( lcmrDL.WarehousingPrice(), 1 ) ) );
        
        // DL外租库出库费用:发动机出库量 / 料架容量(向上取整)* 料架出库单价
        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.Start().Date()                                        >= dlerc.StartDate()  and
                                 tempPISPIPPL.End().Date()                                          <= lastDayOfThisMonth,
                                 tempPISPIPPL.NewSupplyQuantity() );
    //    info( "数量:", outboundQuantity, "    包装容量:", guard( lce.PackagingCapacity(), 0 ), "    出库单价:", guard( lcmr.OutboundPrice(), 0 ) );
        cell.DLOutboundExpensesForRentedWarehouses( [Number] ( guard( outboundQuantity / lce.PackagingCapacity(), 0 ) * guard( lcmrDL.OutboundPrice(), 1 ) ) );
        
        // DL外租库运输费用:发动机运输量 / 包装容量 / 装载容量(向上取整)* 料架运输单价
        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().Year()                                 = dlerc.StartDate().Year()  and
                                 tempPISPIPPL.Start().Date().Month()                                = dlerc.StartDate().Month(),
                                 tempPISPIPPL.NewSupplyQuantity() );
    //    info( "数量:", outboundQuantity1, "    包装容量:", guard( lce.PackagingCapacity(), 0 ), "    装载容量:", guard( lct2.LoadingCapacity(), 0 ), "    运输单价:", guard( lct2.TransportPrice(), 1 ) );
        cell.DLExternalRentalWarehouseTransportationCosts( [Number] ( guard( ceil( ceil( outboundQuantity1 / lce.PackagingCapacity() ) / lct2.LoadingCapacity() ), 0 ) * guard( lct2.TransportPrice(), 1 ) ) );
        
        // 大连外租库仓储费用:【350bar MQB料架总数量-所有350bar MQB总库存/包装容量-客户库料架数量】*大连外租库空料架比例
        // DL外租库仓储费用:料架总数量 - 发动机库存 / 包装容量(向上取整)* 空料架仓储单价
    //    info( "空料架数量:", cell.TotalQuantityOfMaterialRacks(), "    库存:", cell.PlannedInventory(), "    天数:", dlerc.StartDate().StartOfNextMonth() - dlerc.StartDate(), 
    //          "    包装容量:", guard( lce.PackagingCapacity(), 0 ) );
        cell.DLRentalWarehouseStorageFees( [Number] guard( ( cell.TotalQuantityOfMaterialRacks() - ceil( guard( cell.PlannedInventory() / lce.PackagingCapacity(), 0 ) ) - guard( mrcc.Quantity(), 0 ) ) * guard( mrpc.Quantity(), 1 ) * guard( lcmrDL.StoragePrice(), 1 ) * ( dlerc.StartDate().StartOfNextMonth() - dlerc.StartDate() ), 0 ) );
        
        // CC外租库清洗费用:发动机入库量 / 包装容量 * 料架清洗单价。发动机入库量取发动机销量,包装容量取自发动机成本表。料架清洗单价取料架成本表。
    //    info( "数量:", transportationQuantity1, "    包装容量:", guard( lce.PackagingCapacity(), 0 ), "    清洗单价:", guard( lcmrCC.CleanPrice(), 0 ) );
        cell.CCCleaningCost( [Number] ( guard( transportationQuantity1 / lce.PackagingCapacity(), 0 ) * guard( lcmrCC.CleanPrice(), 1 ) ) );
        
        // DL外租库清洗费用:发动机入库量 / 包装容量 * 料架清洗单价。发动机入库量取发动机销量,包装容量取自发动机成本表。料架清洗单价取料架成本表。
        cell.CleaningCost( [Number] ( guard( outboundQuantity / lce.PackagingCapacity(), 0 ) * guard( lcmrDL.CleanPrice(), 1 ) ) );
          
        // 大连外租库料架费用
        cell.DLRentalWarehouseMaterialRackCost( cell.DLStorageFeesForRentedWarehouses() + cell.DLOutboundExpensesForRentedWarehouses() +
                                                cell.DLExternalRentalWarehouseTransportationCosts() + cell.DLRentalWarehouseStorageFees() + cell.CleaningCost() );
        
        // CC外租库DL料架费用
        cell.CCExternalRentalWarehouseDLMaterialRackCost( cell.CCStorageFeesForRentedWarehouses() + cell.CCOutboundExpensesForRentedWarehouses() +
                                                          cell.CCShortDistanceTransportationCosts() + cell.CCCleaningCost() );
        
        // 预计总费用
        cell.EstimatedTotalCost( cell.CCStorageFeesForRentedWarehouses() + cell.CCOutboundExpensesForRentedWarehouses() + cell.CCLineHaulCost() + cell.CCCleaningCost() +
                                 cell.CCShortDistanceTransportationCosts() + cell.DLStorageFeesForRentedWarehouses() + cell.DLOutboundExpensesForRentedWarehouses() +
                                 cell.DLExternalRentalWarehouseTransportationCosts() + cell.DLRentalWarehouseStorageFees() + cell.CleaningCost() );
        
        // 系数
        cell.Coefficient( 1.05 );
        
        // 总费用
        cell.TotalCost( [Number] ( cell.EstimatedTotalCost() * cell.Coefficient() ) );
                
        cell.DL_EngineRackColumn( relset, dlerc );
      }
    }
    
    // 创建SUM行
    sumR   := macroPlan.DL_EngineRackRow( relnew, Generation := "SUM", MLB_MQB := "", Index := 2 );
    traverse ( macroPlan, DL_EngineRackColumn, dlerc ) {
      cell := sumR.DL_EngineRackCell( relnew );
      cell.DL_EngineRackColumn( relset, dlerc );
      
      cell.TotalQuantityOfMaterialRacks( sum( dlerc, DL_EngineRackCell, tempDLERCell, tempDLERCell.DL_EngineRackRow().Generation() <> "SUM", tempDLERCell.TotalQuantityOfMaterialRacks() ) );
      cell.NumberOfEmptyShelves( sum( dlerc, DL_EngineRackCell, tempDLERCell, tempDLERCell.DL_EngineRackRow().Generation() <> "SUM", tempDLERCell.NumberOfEmptyShelves() ) );
      cell.CCStorageFeesForRentedWarehouses( sum( dlerc, DL_EngineRackCell, tempDLERCell, tempDLERCell.DL_EngineRackRow().Generation() <> "SUM", tempDLERCell.CCStorageFeesForRentedWarehouses() ) );
      cell.CCOutboundExpensesForRentedWarehouses( sum( dlerc, DL_EngineRackCell, tempDLERCell, tempDLERCell.DL_EngineRackRow().Generation() <> "SUM", tempDLERCell.CCOutboundExpensesForRentedWarehouses() ) );
      cell.CCRentalWarehouseStorageFees( sum( dlerc, DL_EngineRackCell, tempDLERCell, tempDLERCell.DL_EngineRackRow().Generation() <> "SUM", tempDLERCell.CCRentalWarehouseStorageFees() ) );
      cell.CCLineHaulCost( sum( dlerc, DL_EngineRackCell, tempDLERCell, tempDLERCell.DL_EngineRackRow().Generation() <> "SUM", tempDLERCell.CCLineHaulCost() ) );
      cell.CCShortDistanceTransportationCosts( sum( dlerc, DL_EngineRackCell, tempDLERCell, tempDLERCell.DL_EngineRackRow().Generation() <> "SUM", tempDLERCell.CCShortDistanceTransportationCosts() ) );
      cell.DLStorageFeesForRentedWarehouses( sum( dlerc, DL_EngineRackCell, tempDLERCell, tempDLERCell.DL_EngineRackRow().Generation() <> "SUM", tempDLERCell.DLStorageFeesForRentedWarehouses() ) );
      cell.DLOutboundExpensesForRentedWarehouses( sum( dlerc, DL_EngineRackCell, tempDLERCell, tempDLERCell.DL_EngineRackRow().Generation() <> "SUM", tempDLERCell.DLOutboundExpensesForRentedWarehouses() ) );
      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外租库DL料架费用
      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() ) );
    }
    
    // 创建SUM列
    sumC   := macroPlan.DL_EngineRackColumn( relnew, StartDate := Date::MaxDate() );
    traverse ( macroPlan, DL_EngineRackRow, dlerr ) {
      cell := dlerr.DL_EngineRackCell( relnew );
      cell.DL_EngineRackColumn( relset, sumC );
      
      cell.TotalQuantityOfMaterialRacks( sum( dlerr, DL_EngineRackCell, tempDLERCell, not tempDLERCell.DL_EngineRackColumn().StartDate().IsMaxInfinity(), tempDLERCell.TotalQuantityOfMaterialRacks() ) );
      cell.NumberOfEmptyShelves( sum( dlerr, DL_EngineRackCell, tempDLERCell, not tempDLERCell.DL_EngineRackColumn().StartDate().IsMaxInfinity(), tempDLERCell.NumberOfEmptyShelves() ) );
      cell.CCStorageFeesForRentedWarehouses( sum( dlerr, DL_EngineRackCell, tempDLERCell, not tempDLERCell.DL_EngineRackColumn().StartDate().IsMaxInfinity(), tempDLERCell.CCStorageFeesForRentedWarehouses() ) );    
      cell.CCOutboundExpensesForRentedWarehouses( sum( dlerr, DL_EngineRackCell, tempDLERCell, not tempDLERCell.DL_EngineRackColumn().StartDate().IsMaxInfinity(), tempDLERCell.CCOutboundExpensesForRentedWarehouses() ) );    
      cell.CCRentalWarehouseStorageFees( sum( dlerr, DL_EngineRackCell, tempDLERCell, not tempDLERCell.DL_EngineRackColumn().StartDate().IsMaxInfinity(), tempDLERCell.CCRentalWarehouseStorageFees() ) );    
      cell.CCLineHaulCost( sum( dlerr, DL_EngineRackCell, tempDLERCell, not tempDLERCell.DL_EngineRackColumn().StartDate().IsMaxInfinity(), tempDLERCell.CCLineHaulCost() ) );    
      cell.CCShortDistanceTransportationCosts( sum( dlerr, DL_EngineRackCell, tempDLERCell, not tempDLERCell.DL_EngineRackColumn().StartDate().IsMaxInfinity(), tempDLERCell.CCShortDistanceTransportationCosts() ) );    
      cell.DLStorageFeesForRentedWarehouses( sum( dlerr, DL_EngineRackCell, tempDLERCell, not tempDLERCell.DL_EngineRackColumn().StartDate().IsMaxInfinity(), tempDLERCell.DLStorageFeesForRentedWarehouses() ) );    
      cell.DLOutboundExpensesForRentedWarehouses( sum( dlerr, DL_EngineRackCell, tempDLERCell, not tempDLERCell.DL_EngineRackColumn().StartDate().IsMaxInfinity(), tempDLERCell.DLOutboundExpensesForRentedWarehouses() ) );    
      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外租库DL料架费用
      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() ) );                        
    }
  *]
}