| | |
| | | } |
| | | } |
| | | //长春长途运输费用:调拨数量/包装容量/装载容量*运输单价,调拨计划里找到该产品从DL到CC的调拨数量,即起始地大连装配线边库,目的地为长春外租库对应的运输数量,在发动机成本参数表找到对应的包装容量,在运输成本参数表里找到发动机对应运输单价和装载容量,用公式计算得出结果,月度进行汇总 |
| | | traverse( owner, TransferPlanRow, tprow, tprow.SourceStockpoingPointID() = 'DL' and tprow.TargetStockpoingPointID() = 'CC' ){ |
| | | traverse( owner, TransferPlanRow, tprow ){ |
| | | product := selectobject( owner, Product_MP, product, product.ID() = tprow.ProductID() ); |
| | | productparents := product.GetAllParent(); |
| | | if( exists( productparents, Elements, e, e.ID() = produtparent ) ){//查询产品类型是发动机 |
| | |
| | | if( not isnull( enginecost ) and not isnull( transcost ) ){ |
| | | row := table.GetRow( product.ID() ); |
| | | products.Add( product ); |
| | | traverse( tprow,TransferPlanCell, tpcell ){ |
| | | traverse( tprow,TransferPlanCell, tpcell, tpcell.TransferPlanColumn().ColumnDate() <> Date::MinDate() ){ |
| | | periodtime := tpcell.TransferPlanColumn().ColumnDate().StartOfMonth(); |
| | | periodname := periodtime.Format( "M2/D2/Y" ); |
| | | column := selectobject( table, Column, column, column.Name() = periodname and column.StartDate() = periodtime ); |
| | |
| | | originisdl := originsp.ID() = dlunit or originunit.ID() = dlunit or exists( originparentunits, Elements, punit, punit.ID() = dlunit ); |
| | | //目的地是否是长春外租库 |
| | | destisp := selectobject( owner, StockingPoint_MP, sp, sp.ID() = tprow.TargetStockpoingPointID() ); |
| | | destiunit := originsp.Unit(); |
| | | destiunit := destisp.Unit(); |
| | | destiparentunits := destiunit.GetAllParent(); |
| | | destiiscc := destisp.ID() = ccunit or destiunit.ID() = ccunit or exists( destiparentunits, Elements, punit, punit.ID() = ccunit ); |
| | | destiisdl := destisp.ID() = dlunit or destiunit.ID() = dlunit or exists( destiparentunits, Elements, punit, punit.ID() = dlunit ); |
| | | if( ( originiscc and destiisdl ) or ( originisdl and destiiscc ) ){ |
| | | row := selectobject( table, Row, row, row.Name() = tprow.Name() ); |
| | | traverse( tprow, TransferPlanCell, tpcell ){ |
| | | traverse( tprow, TransferPlanCell, tpcell, tpcell.TransferPlanColumn().ColumnDate() <> Date::MinDate() ){ |
| | | //天 |
| | | daycolumn := table.GetColumnByUnit( Translations::MP_GlobalParameters_Day(), tpcell.TransferPlanColumn().ColumnDate() ); |
| | | //周 |