| | |
| | | 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() ) ); |
| | |
| | | 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() ) ); |
| | |
| | | } |
| | | |
| | | // 创建单元格 |
| | | 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; |
| | |
| | | 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 ) ); |