Merge branch 'dev' of http://47.101.211.7:10101/r/VWED into dev
| | |
| | | startofyear := startofplanning.StartOfYear(); |
| | | startofnextyear := startofplanning.StartOfNextYear(); |
| | | |
| | | for( start := startofyear; start < startofnextyear; start := start.StartOfMonth() ){ |
| | | for( start := startofyear; start < startofnextyear; start := start.StartOfNextMonth() ){ |
| | | periodtime := start.Date(); |
| | | periodname := periodtime.Format( "M2/D2/Y" ); |
| | | this.FinancialProductionColumn( relnew, Name := periodname, Period := periodtime ); |
| | |
| | | startofyear := startofplanning.StartOfYear(); |
| | | startofnextyear := startofplanning.StartOfNextYear(); |
| | | |
| | | for( start := startofyear; start < startofnextyear; start := start.StartOfMonth() ){ |
| | | for( start := startofyear; start < startofnextyear; start := start.StartOfNextMonth() ){ |
| | | periodtime := start.Date(); |
| | | periodname := periodtime.Format( "M2/D2/Y" ); |
| | | this.FinancialSalesColumn( relnew, Name := periodname, Period := periodtime ); |
| | |
| | | isccorigin := originspid.StartsWith( '长春' ) or originspid.StartsWith( 'CC' ); |
| | | //起始地是大连 |
| | | isdlorigin := originspid.StartsWith( '大连' ) or originspid.StartsWith( 'DL' ); |
| | | if( isccorigin and isdlorigin ){ |
| | | if( isccorigin or isdlorigin ){ |
| | | traverse( laneleg, Trip, trip, trip.LeadTime().Days() > 1 ){ |
| | | for( transferdate := trip.Departure() + Duration::Days( 1 ); transferdate < trip.Arrival(); transferdate := transferdate + Duration::Days( 1 ) ){ |
| | | daycolumn := selectobject( table, InventorySummaryColumn, column, column.StartDate() = transferdate.Date(), column.TimeUnit() = Translations::MP_GlobalParameters_Day() ); |
| | |
| | | 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 ); |
| | | } |
| | | } |