admin
2025-01-22 7e31442f0e9b07764e9c6a9680d3d4aeba5fe1de
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
Quintiq file version 2.0
#parent: #root
StaticMethod CreateData (
  MacroPlan macroPlan
)
{
  TextBody:
  [*
    macroPlan.MachineLogisticsCostReportRow( relflush );
    macroPlan.MachineLogisticsCostReportColumn( relflush );
    
    // 创建行
    categories := selectuniquevalues( macroPlan, Product_MP, tempPMP, tempPMP.IsLeaf()                           and
                                      exists( tempPMP, AllParent.AsParent, tempPMP1, tempPMP1.ID() = "机加件" ),  
                                      tempPMP.ParentID() );
    traverse ( categories, Elements, c ) {
      macroPlan.MachineLogisticsCostReportRow( relnew, Factory := "大连工厂", Category := c, Index := 0 );
      macroPlan.MachineLogisticsCostReportRow( relnew, Factory := "长春工厂", Category := c, Index := 0 );
    }
    
    // 创建列
    indexDate := macroPlan.StartOfPlanning().Date().StartOfMonth();
    for ( i := 0; i < 12; i++ ) {
      macroPlan.MachineLogisticsCostReportColumn( relnew, StartDate := indexDate );
      indexDate := indexDate.StartOfNextMonth();
    }
    
    // 创建单元格
    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() );
        
        // 运输成本参数
        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;
    
        cell := mlcrr.MachineLogisticsCostReportCell( relnew );
    
        // 设置包装费用(包装量 * 包装单价)
        packageQuantity := sum( macroPlan, PackagingPlanRow.PackagingPlanCell, tempPPC,
                                tempPPC.PackagingPlanRow().Category()             = mlcrr.Category()          and
                                tempPPC.PackagingPlanRow().Factory()              = mlcrr.Factory()           and
                                tempPPC.PackagingPlanColumn().StartDate().Year()  = mlcrc.StartDate().Year()  and
                                tempPPC.PackagingPlanColumn().StartDate().Month() = mlcrc.StartDate().Month(),
                                tempPPC.Package() );
        cell.PackingCharges( [Number] ( packageQuantity * guard( lcm.PackagePrice(), 1 ) ) );
    
        // 设置拆包费用(拆包量 * 拆包单价)
        unpackingQuantity := sum( macroPlan, PackagingPlanRow.PackagingPlanCell, tempPPC,
                                  tempPPC.PackagingPlanRow().Category()             = mlcrr.Category()          and
                                  tempPPC.PackagingPlanRow().Factory()              = mlcrr.Factory()           and
                                  tempPPC.PackagingPlanColumn().StartDate().Year()  = mlcrc.StartDate().Year()  and
                                  tempPPC.PackagingPlanColumn().StartDate().Month() = mlcrc.StartDate().Month(),
                                  tempPPC.Unpacking() );
        cell.UnpackingCost( [Number] ( unpackingQuantity * guard( lcm.UnpackingPrice(), 1 ) ) );
    
        // 设置缓冲纸费用(包装类 * 缓冲纸单价)
        cell.BufferPaperCost( [Number] ( packageQuantity * guard( lcm.BufferPaperPrice(), 1 ) ) );
    
          // 设置木箱单价
        cell.WoodenCratePriceReal( guard( lcm.WoodenCratePrice(), 1 ) );
    
        // 设置调拨费用(调拨数量 / 包装容量 / 装载容量 * 运输单价)
        transferQuantity := sum( macroPlan, TransferPlanRow.TransferPlanCell, tempTPC,
                                 tempTPC.TransferPlanRow().Category()                      = mlcrr.Category()                                               and
                                 tempTPC.TransferPlanRow().Name()                          = ifexpr( mlcrr.Factory() = "大连工厂", "CC to DL", "DL to CC" ) and
                                 guard( tempTPC.TransferPlanColumn().ColumnDate().Year()   = mlcrc.StartDate().Year(), false )                              and
                                 guard(  tempTPC.TransferPlanColumn().ColumnDate().Month() = mlcrc.StartDate().Month(), false ),
                                 [Number]tempTPC.Value() );
    //    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( [Number] ( packageQuantity / guard( lcm.PackagingCapacity(), 1 ) * guard( lcm.WarehousingPrice(), 1 ) ) );
    
        // 外租库出库费用(出库量[拆包量] / 包装容量 * 出库单价)
        cell.OutboundExpensesForRentedWarehouses( [Number] ( unpackingQuantity / guard( lcm.PackagingCapacity(), 1 ) * guard( lcm.OutboundPrice(), 1 ) ) );
    
        // 外租库运输费用(运输数量 / 包装容量 / 装载容量 * 运输单价)
        transportationQuantity := sum( macroPlan, Unit.Lane.LaneLeg.Trip.ProductInTrip, tempPIT,
                                       tempPIT.Product_MP().ParentID()                                                  =  mlcrr.Category()                                                                       and
                                       tempPIT.Trip().Departure().Date()                                                >= mlcrc.StartDate()                                                                      and
                                       tempPIT.Trip().Arrival().Date()                                                  <= lastDayOfThisMonth                                                                     and
                                       tempPIT.Trip().LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP().ID()      =  ifexpr( mlcrr.Factory() = "大连工厂", "DL", "CC" ) + " " + mlcrr.Category() + "线边库" and
                                       tempPIT.Trip().LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP().ID() =  ifexpr( mlcrr.Factory() = "大连工厂", "DL", "CC" ) + " " + mlcrr.Category() + "外租库",
                                       tempPIT.Quantity()
                                      );
        transportationQuantity := transportationQuantity +
                                  sum( macroPlan, Unit.Lane.LaneLeg.Trip.ProductInTrip, tempPIT,
                                       tempPIT.Product_MP().ParentID()                                                  =  mlcrr.Category()                                                                       and
                                       tempPIT.Trip().Departure().Date()                                                >= mlcrc.StartDate()                                                                      and
                                       tempPIT.Trip().Arrival().Date()                                                  <= lastDayOfThisMonth                                                                     and
                                       tempPIT.Trip().LaneLeg().AsOriginStockingPointLeg().StockingPoint_MP().ID()      =  ifexpr( mlcrr.Factory() = "大连工厂", "DL", "CC" ) + " " + mlcrr.Category() + "外租库" and
                                       tempPIT.Trip().LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP().ID() =  ifexpr( mlcrr.Factory() = "大连工厂", "DL", "CC" ) + " " + mlcrr.Category() + "线边库",
                                       tempPIT.Quantity()
                                      );
        cell.ExternalRentalWarehouseTransportationCosts( [Number] ( transportationQuantity / guard( lcm.PackagingCapacity(), 1 ) / guard( lct.LoadingCapacity(), 1 ) * guard( lct.TransportPrice(), 1 ) ) );
    
        // 外租库仓储费用:仓储数量/包装容量*仓储单价
        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().Product_MP().ParentID()                                         =  mlcrr.Category()   and
                                 tempPISPIP.Start().Date()                                                                              >= mlcrc.StartDate()  and
                                 tempPISPIP.End().Date()                                                                                <= lastDayOfThisMonth and
                                 tempPISPIP.ProductInStockingPoint_MP().StockingPointID()                                               =  ifexpr( mlcrr.Factory() = "大连工厂", "DL", "CC" ) + " " + mlcrr.Category() + "外租库",
                                 tempPISPIP.PlannedInventoryLevelEnd() );
        cell.RentalWarehouseStorageFees( [Number] ( plannedInventory / guard( lcm.PackagingCapacity(), 1 ) * guard( lcm.StoragePrice(), 1 ) ) );
    
        
        
        // 大连工厂(外租库入库费用、外租库出库费用、外租库运输费用、外租库仓储费用)为0
        if ( mlcrr.Factory() = "大连工厂" ) {
          cell.StorageFeesForRentedWarehouses( 0 );
          cell.OutboundExpensesForRentedWarehouses( 0 );
          cell.ExternalRentalWarehouseTransportationCosts( 0 );
          cell.RentalWarehouseStorageFees( 0 );
        }
        
        // 预计总费用
        cell.EstimatedTotalCost( cell.PackingCharges() + cell.UnpackingCost() + cell.BufferPaperCost() + cell.WoodenCrateCost() + cell.TransferCost() +
                                 cell.StorageFeesForRentedWarehouses() + cell.OutboundExpensesForRentedWarehouses() + cell.ExternalRentalWarehouseTransportationCosts() +
                                 cell.RentalWarehouseStorageFees() );
    
        // 系数
        cell.Coefficient( 1.05 );
    
        // 总费用
        cell.TotalCost( [Number] ( cell.EstimatedTotalCost() * cell.Coefficient() ) );
        
        cell.MachineLogisticsCostReportColumn( relset, mlcrc );
      }
    }
    
    // 创建SUM行
    sumR   := macroPlan.MachineLogisticsCostReportRow( relnew,  Category := "SUM", Factory := "大连工厂", Index := 2 );
    traverse ( macroPlan, MachineLogisticsCostReportColumn, mlcrc ) {
      cell := sumR.MachineLogisticsCostReportCell( relnew );
      cell.MachineLogisticsCostReportColumn( relset, mlcrc );
      
      cell.PackingCharges( sum( mlcrc, MachineLogisticsCostReportCell, tempMLCRCell, tempMLCRCell.MachineLogisticsCostReportRow().Category() <> "SUM" and tempMLCRCell.MachineLogisticsCostReportRow().Factory() = sumR.Factory(), tempMLCRCell.PackingCharges() ) );
      cell.UnpackingCost( sum( mlcrc, MachineLogisticsCostReportCell, tempMLCRCell, tempMLCRCell.MachineLogisticsCostReportRow().Category() <> "SUM" and tempMLCRCell.MachineLogisticsCostReportRow().Factory() = sumR.Factory(), tempMLCRCell.UnpackingCost() ) );
      cell.BufferPaperCost( sum( mlcrc, MachineLogisticsCostReportCell, tempMLCRCell, tempMLCRCell.MachineLogisticsCostReportRow().Category() <> "SUM" and tempMLCRCell.MachineLogisticsCostReportRow().Factory() = sumR.Factory(), tempMLCRCell.BufferPaperCost() ) );
      cell.QuantityOfWoodenCrates( sum( mlcrc, MachineLogisticsCostReportCell, tempMLCRCell, tempMLCRCell.MachineLogisticsCostReportRow().Category() <> "SUM" and tempMLCRCell.MachineLogisticsCostReportRow().Factory() = sumR.Factory(), tempMLCRCell.QuantityOfWoodenCrates() ) );
      cell.WoodenCrateCost( sum( mlcrc, MachineLogisticsCostReportCell, tempMLCRCell, tempMLCRCell.MachineLogisticsCostReportRow().Category() <> "SUM" and tempMLCRCell.MachineLogisticsCostReportRow().Factory() = sumR.Factory(), tempMLCRCell.WoodenCrateCost() ) );
      cell.TransferCost( sum( mlcrc, MachineLogisticsCostReportCell, tempMLCRCell, tempMLCRCell.MachineLogisticsCostReportRow().Category() <> "SUM" and tempMLCRCell.MachineLogisticsCostReportRow().Factory() = sumR.Factory(), tempMLCRCell.TransferCost() ) );
      cell.StorageFeesForRentedWarehouses( sum( mlcrc, MachineLogisticsCostReportCell, tempMLCRCell, tempMLCRCell.MachineLogisticsCostReportRow().Category() <> "SUM" and tempMLCRCell.MachineLogisticsCostReportRow().Factory() = sumR.Factory(), tempMLCRCell.StorageFeesForRentedWarehouses() ) );
      cell.OutboundExpensesForRentedWarehouses( sum( mlcrc, MachineLogisticsCostReportCell, tempMLCRCell, tempMLCRCell.MachineLogisticsCostReportRow().Category() <> "SUM" and tempMLCRCell.MachineLogisticsCostReportRow().Factory() = sumR.Factory(), tempMLCRCell.OutboundExpensesForRentedWarehouses() ) );
      cell.ExternalRentalWarehouseTransportationCosts( sum( mlcrc, MachineLogisticsCostReportCell, tempMLCRCell, tempMLCRCell.MachineLogisticsCostReportRow().Category() <> "SUM" and tempMLCRCell.MachineLogisticsCostReportRow().Factory() = sumR.Factory(), tempMLCRCell.ExternalRentalWarehouseTransportationCosts() ) );
      cell.RentalWarehouseStorageFees( sum( mlcrc, MachineLogisticsCostReportCell, tempMLCRCell, tempMLCRCell.MachineLogisticsCostReportRow().Category() <> "SUM" and tempMLCRCell.MachineLogisticsCostReportRow().Factory() = sumR.Factory(), tempMLCRCell.RentalWarehouseStorageFees() ) );
      cell.EstimatedTotalCost( sum( mlcrc, MachineLogisticsCostReportCell, tempMLCRCell, tempMLCRCell.MachineLogisticsCostReportRow().Category() <> "SUM" and tempMLCRCell.MachineLogisticsCostReportRow().Factory() = sumR.Factory(), tempMLCRCell.EstimatedTotalCost() ) );
      cell.Coefficient( 1.05 );
      cell.TotalCost( sum( mlcrc, MachineLogisticsCostReportCell, tempMLCRCell, tempMLCRCell.MachineLogisticsCostReportRow().Category() <> "SUM" and tempMLCRCell.MachineLogisticsCostReportRow().Factory() = sumR.Factory(), tempMLCRCell.TotalCost() ) );
    }
    
    // 创建SUM行
    sumR   := macroPlan.MachineLogisticsCostReportRow( relnew,  Category := "SUM", Factory := "长春工厂", Index := 2 );
    traverse ( macroPlan, MachineLogisticsCostReportColumn, mlcrc ) {
      cell := sumR.MachineLogisticsCostReportCell( relnew );
      cell.MachineLogisticsCostReportColumn( relset, mlcrc );
      
      cell.PackingCharges( sum( mlcrc, MachineLogisticsCostReportCell, tempMLCRCell, tempMLCRCell.MachineLogisticsCostReportRow().Category() <> "SUM" and tempMLCRCell.MachineLogisticsCostReportRow().Factory() = sumR.Factory(), tempMLCRCell.PackingCharges() ) );
      cell.UnpackingCost( sum( mlcrc, MachineLogisticsCostReportCell, tempMLCRCell, tempMLCRCell.MachineLogisticsCostReportRow().Category() <> "SUM" and tempMLCRCell.MachineLogisticsCostReportRow().Factory() = sumR.Factory(), tempMLCRCell.UnpackingCost() ) );
      cell.BufferPaperCost( sum( mlcrc, MachineLogisticsCostReportCell, tempMLCRCell, tempMLCRCell.MachineLogisticsCostReportRow().Category() <> "SUM" and tempMLCRCell.MachineLogisticsCostReportRow().Factory() = sumR.Factory(), tempMLCRCell.BufferPaperCost() ) );
      cell.QuantityOfWoodenCrates( sum( mlcrc, MachineLogisticsCostReportCell, tempMLCRCell, tempMLCRCell.MachineLogisticsCostReportRow().Category() <> "SUM" and tempMLCRCell.MachineLogisticsCostReportRow().Factory() = sumR.Factory(), tempMLCRCell.QuantityOfWoodenCrates() ) );
      cell.WoodenCrateCost( sum( mlcrc, MachineLogisticsCostReportCell, tempMLCRCell, tempMLCRCell.MachineLogisticsCostReportRow().Category() <> "SUM" and tempMLCRCell.MachineLogisticsCostReportRow().Factory() = sumR.Factory(), tempMLCRCell.WoodenCrateCost() ) );
      cell.TransferCost( sum( mlcrc, MachineLogisticsCostReportCell, tempMLCRCell, tempMLCRCell.MachineLogisticsCostReportRow().Category() <> "SUM" and tempMLCRCell.MachineLogisticsCostReportRow().Factory() = sumR.Factory(), tempMLCRCell.TransferCost() ) );
      cell.StorageFeesForRentedWarehouses( sum( mlcrc, MachineLogisticsCostReportCell, tempMLCRCell, tempMLCRCell.MachineLogisticsCostReportRow().Category() <> "SUM" and tempMLCRCell.MachineLogisticsCostReportRow().Factory() = sumR.Factory(), tempMLCRCell.StorageFeesForRentedWarehouses() ) );
      cell.OutboundExpensesForRentedWarehouses( sum( mlcrc, MachineLogisticsCostReportCell, tempMLCRCell, tempMLCRCell.MachineLogisticsCostReportRow().Category() <> "SUM" and tempMLCRCell.MachineLogisticsCostReportRow().Factory() = sumR.Factory(), tempMLCRCell.OutboundExpensesForRentedWarehouses() ) );
      cell.ExternalRentalWarehouseTransportationCosts( sum( mlcrc, MachineLogisticsCostReportCell, tempMLCRCell, tempMLCRCell.MachineLogisticsCostReportRow().Category() <> "SUM" and tempMLCRCell.MachineLogisticsCostReportRow().Factory() = sumR.Factory(), tempMLCRCell.ExternalRentalWarehouseTransportationCosts() ) );
      cell.RentalWarehouseStorageFees( sum( mlcrc, MachineLogisticsCostReportCell, tempMLCRCell, tempMLCRCell.MachineLogisticsCostReportRow().Category() <> "SUM" and tempMLCRCell.MachineLogisticsCostReportRow().Factory() = sumR.Factory(), tempMLCRCell.RentalWarehouseStorageFees() ) );
      cell.EstimatedTotalCost( sum( mlcrc, MachineLogisticsCostReportCell, tempMLCRCell, tempMLCRCell.MachineLogisticsCostReportRow().Category() <> "SUM" and tempMLCRCell.MachineLogisticsCostReportRow().Factory() = sumR.Factory(), tempMLCRCell.EstimatedTotalCost() ) );
      cell.Coefficient( 1.05 );
      cell.TotalCost( sum( mlcrc, MachineLogisticsCostReportCell, tempMLCRCell, tempMLCRCell.MachineLogisticsCostReportRow().Category() <> "SUM" and tempMLCRCell.MachineLogisticsCostReportRow().Factory() = sumR.Factory(), tempMLCRCell.TotalCost() ) );
    }
    
    // 创建SUM列
    sumC   := macroPlan.MachineLogisticsCostReportColumn( relnew, StartDate := Date::MaxDate() );
    traverse ( macroPlan, MachineLogisticsCostReportRow, mlcrr ) {
      cell := mlcrr.MachineLogisticsCostReportCell( relnew );
      cell.MachineLogisticsCostReportColumn( relset, sumC );
      
      cell.PackingCharges( sum( mlcrr, MachineLogisticsCostReportCell, tempMLCRCell, not tempMLCRCell.MachineLogisticsCostReportColumn().StartDate().IsMaxInfinity(), tempMLCRCell.PackingCharges() ) );
      cell.UnpackingCost( sum( mlcrr, MachineLogisticsCostReportCell, tempMLCRCell, not tempMLCRCell.MachineLogisticsCostReportColumn().StartDate().IsMaxInfinity(), tempMLCRCell.UnpackingCost() ) );
      cell.BufferPaperCost( sum( mlcrr, MachineLogisticsCostReportCell, tempMLCRCell, not tempMLCRCell.MachineLogisticsCostReportColumn().StartDate().IsMaxInfinity(), tempMLCRCell.BufferPaperCost() ) );
      cell.QuantityOfWoodenCrates( sum( mlcrr, MachineLogisticsCostReportCell, tempMLCRCell, not tempMLCRCell.MachineLogisticsCostReportColumn().StartDate().IsMaxInfinity(), tempMLCRCell.QuantityOfWoodenCrates() ) );
      cell.WoodenCrateCost( sum( mlcrr, MachineLogisticsCostReportCell, tempMLCRCell, not tempMLCRCell.MachineLogisticsCostReportColumn().StartDate().IsMaxInfinity(), tempMLCRCell.WoodenCrateCost() ) );
      cell.TransferCost( sum( mlcrr, MachineLogisticsCostReportCell, tempMLCRCell, not tempMLCRCell.MachineLogisticsCostReportColumn().StartDate().IsMaxInfinity(), tempMLCRCell.TransferCost() ) );
      cell.StorageFeesForRentedWarehouses( sum( mlcrr, MachineLogisticsCostReportCell, tempMLCRCell, not tempMLCRCell.MachineLogisticsCostReportColumn().StartDate().IsMaxInfinity(), tempMLCRCell.StorageFeesForRentedWarehouses() ) );
      cell.OutboundExpensesForRentedWarehouses( sum( mlcrr, MachineLogisticsCostReportCell, tempMLCRCell, not tempMLCRCell.MachineLogisticsCostReportColumn().StartDate().IsMaxInfinity(), tempMLCRCell.OutboundExpensesForRentedWarehouses() ) );
      cell.ExternalRentalWarehouseTransportationCosts( sum( mlcrr, MachineLogisticsCostReportCell, tempMLCRCell, not tempMLCRCell.MachineLogisticsCostReportColumn().StartDate().IsMaxInfinity(), tempMLCRCell.ExternalRentalWarehouseTransportationCosts() ) );
      cell.RentalWarehouseStorageFees( sum( mlcrr, MachineLogisticsCostReportCell, tempMLCRCell, not tempMLCRCell.MachineLogisticsCostReportColumn().StartDate().IsMaxInfinity(), tempMLCRCell.RentalWarehouseStorageFees() ) );
      cell.EstimatedTotalCost( sum( mlcrr, MachineLogisticsCostReportCell, tempMLCRCell, not tempMLCRCell.MachineLogisticsCostReportColumn().StartDate().IsMaxInfinity(), tempMLCRCell.EstimatedTotalCost() ) );
      cell.Coefficient( 1.05 ); 
      cell.TotalCost( sum( mlcrr, MachineLogisticsCostReportCell, tempMLCRCell, not tempMLCRCell.MachineLogisticsCostReportColumn().StartDate().IsMaxInfinity(), tempMLCRCell.TotalCost() ) );    
    }
  *]
}