| | |
| | | // 运输成本参数 |
| | | lct := select( macroPlan, LogisticsCostTransport, tempLCT, |
| | | tempLCT.Product() = mlcrr.Category() and |
| | | tempLCT.Origin() = mlcrr.Factory() + " " + mlcrr.Category() + "外租库" and |
| | | tempLCT.Destination() = mlcrr.Factory() + " " + mlcrr.Category() + "线边库" ); |
| | | lct1 := select( macroPlan, LogisticsCostTransport, tempLCT, |
| | | tempLCT.Product() = mlcrr.Category() and |
| | | tempLCT.Origin() = ifexpr( mlcrr.Factory() = "大连工厂", "大连厂内库", "CC 厂内库" ) and |
| | | tempLCT.Destination() = ifexpr( mlcrr.Factory() = "大连工厂", "大连外租库", "长春外租库" ) ); |
| | | 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() + "线边库" ) ); |
| | | |
| | | // 当前月末最后一天日期 |
| | | 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( transferQuantity / guard( lcm.PackagingCapacity(), 1 ) / guard( lct.LoadingCapacity(), 1 ) * guard( lct.TransportPrice(), 1 ) ); |
| | | cell.TransferCost( [Number] ( [Number] ( transferQuantity / guard( lcm.PackagingCapacity(), 1 ) ) / guard( lct.LoadingCapacity(), 1 ) ) * guard( lct.TransportPrice(), 1 ) ); |
| | | |
| | | // 外租库入库费用(入库量[包装量] / 包装容量 * 入库单价) |
| | | cell.StorageFeesForRentedWarehouses( packageQuantity / guard( lcm.PackagingCapacity(), 1 ) * guard( lcm.WarehousingPrice(), 1 ) ); |
| | |
| | | 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() = "CC 厂内库" and |
| | | tempPIT.Trip().LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP().ID() = "长春外租库", |
| | | 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( transportationQuantity / guard( lcm.PackagingCapacity(), 1 ) / guard( lct1.LoadingCapacity(), 1 ) * guard( lct1.TransportPrice(), 1 ) ); |
| | | 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( 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().ParentID() = mlcrr.Category() and |
| | | tempPISPIP.Start().Date() >= mlcrc.StartDate() and |
| | | tempPISPIP.End().Date() <= lastDayOfThisMonth and |
| | | tempPISPIP.ProductInStockingPoint_MP().StockingPointID() = ifexpr( mlcrr.Factory() = "大连工厂", "大连外租库", "长春外租库" ), |
| | | tempPISPIP.ProductInStockingPoint_MP().StockingPointID() = ifexpr( mlcrr.Factory() = "大连工厂", "DL", "CC" ) + " " + mlcrr.Category() + "外租库", |
| | | tempPISPIP.PlannedInventoryLevelEnd() ); |
| | | cell.RentalWarehouseStorageFees( plannedInventory / guard( lcm.PackagingCapacity(), 1 ) * guard( lcm.StoragePrice(), 1 ) ); |
| | | |
| | | // 预计总费用 |
| | | 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( cell.EstimatedTotalCost() * cell.Coefficient() ); |
| | | |
| | | cell.MachineLogisticsCostReportColumn( relset, mlcrc ); |
| | | } |
| | | } |