| | |
| | | traverse( owner, Unit.Lane.LaneLeg, laneleg ){ |
| | | originspid := laneleg.OriginStockingPointID(); |
| | | destinationspid := laneleg.DestinationStockingPointID(); |
| | | //CC to DL 长春厂内库到大连外租库 |
| | | iscctodl := originspid.EndsWith( '厂内库' ) and ( originspid.StartsWith( '长春' ) or originspid.StartsWith( 'CC' ) ) and destinationspid = '大连外租库'; |
| | | //CC to DL 长春工厂到大连工厂 |
| | | iscctodl := ( originspid.StartsWith( '长春' ) or originspid.StartsWith( 'CC' ) ) and ( destinationspid.StartsWith( '大连' ) or destinationspid.StartsWith( 'DL' ) ); |
| | | //DL to CC 大连厂内库到大连发动机的长春外租库 |
| | | isdltocc := originspid.EndsWith( '厂内库' ) and ( originspid.StartsWith( '大连' ) or originspid.StartsWith( 'DL' ) ) and destinationspid = '大连发动机的长春外租库'; |
| | | if( iscctodl and isdltocc ){ |
| | | traverse( table, Column, column){//, column.StartDate().Month() = 1 |
| | | alltrips := selectset( laneleg, Trip, trip, ( trip.Arrival().Date() < column.StartDate().StartOfNextMonth() and trip.Arrival().Date() >= column.StartDate() ) |
| | | or ( trip.Departure().Date() < column.StartDate().StartOfNextMonth() and trip.Departure().Date() >= column.StartDate() ) ); |
| | | if( iscctodl or isdltocc ){ |
| | | // info( '------iscctodl------', originspid, destinationspid, iscctodl ); |
| | | traverse( table, Column, column ){//, column.StartDate().Month() = 1 |
| | | alltrips := selectset( laneleg, Trip, trip, trip.Arrival().Date() = column.StartDate() |
| | | or trip.Departure().Date() = column.StartDate() ); |
| | | producttrips := selectuniquevalues( alltrips, Elements.ProductInTrip, pit, pit.Quantity() <> 0 and exists( pit.Product_MP().GetAllParent(), Elements, e, e.ID() = productparent ), pit.ProductID() ); |
| | | traverse( producttrips, Elements, producttrip ){//, producttrip = '6912' |
| | | // info( '---------Column----------', alltrips.Size(), producttrips.Size(), column.StartDate() ); |
| | | traverse( producttrips, Elements, producttrip ){//, producttrip = '06K103011CP' |
| | | row := table.GetRow( producttrip ); |
| | | product := selectobject( owner, Product_MP, product, product.ID() = producttrip ); |
| | | products.Add( product ); |
| | | departureqty := sum( alltrips, Elements.ProductInTrip, pit, ( pit.Trip().Departure().Date() < column.StartDate().StartOfNextMonth() and pit.Trip().Departure().Date() >= column.StartDate() ) and pit.Product_MP() = product, pit.Quantity() ); |
| | | arrivalqty := sum( alltrips, Elements.ProductInTrip, pit, ( pit.Trip().Arrival().Date() < column.StartDate().StartOfNextMonth() and pit.Trip().Arrival().Date() >= column.StartDate() ) and pit.Product_MP() = product, pit.Quantity() ); |
| | | departureqty := sum( alltrips, Elements.ProductInTrip, pit, pit.Trip().Departure().Date() = column.StartDate() and pit.Product_MP() = product, pit.Quantity() ); |
| | | arrivalqty := sum( alltrips, Elements.ProductInTrip, pit, pit.Trip().Arrival().Date() = column.StartDate() and pit.Product_MP() = product, pit.Quantity() ); |
| | | // info( '---------***************8---------', departureqty, arrivalqty, column.StartDate() ); |
| | | row.SetDepartureAndArrivalValue( column, iscctodl, departureqty, arrivalqty ); |
| | | } |
| | | } |