| | |
| | | ccunit := FinancialSalesReport::GetDefaultCCUnit(); |
| | | dlunit := FinancialSalesReport::GetDefaultDLUnit(); |
| | | ccsalessegment := FinancialSalesReport::GetSalesSegmentCC(); |
| | | //tjsalessegment := FinancialSalesReport::GetSalesSegmentTJ(); |
| | | //fssalessegment := FinancialSalesReport::GetSalesSegmentFS(); |
| | | tjsalessegment := FinancialSalesReport::GetSalesSegmentTJ(); |
| | | fssalessegment := FinancialSalesReport::GetSalesSegmentFS(); |
| | | //ccspline := FinancialSalesReport::GetStockingPointCCLine(); |
| | | //dlspline := FinancialSalesReport::GetStockingPointDLLine(); |
| | | //ccrent := FinancialSalesReport::GetStockingPointCCRent(); |
| | |
| | | //是否属于长春 |
| | | iscc := salessegment.Name().StartsWith( ccsalessegment ) or exists( parentsalessegments, Elements, psalessegment, psalessegment.Name().StartsWith( ccsalessegment ) ); |
| | | isccrent := iscc and stockingpoint.EndsWith( '外租库' ) and ( stockingpoint.StartsWith( 'CC' ) or stockingpoint.StartsWith( '长春' ) ); |
| | | isdl := salessegment.Name().StartsWith( tjsalessegment ) or salessegment.Name().StartsWith( fssalessegment ) |
| | | or exists( parentsalessegments, Elements, psalessegment, psalessegment.Name().StartsWith( tjsalessegment ) ) |
| | | or exists( parentsalessegments, Elements, psalessegment, psalessegment.Name().StartsWith( fssalessegment ) ); |
| | | //Forecast的Sales Segment为长春,识别出MLB的所有产品汇总 |
| | | //大连财务销量:首先在forecast界面查找Sales Segment是天津和佛山的所有需求,每个产品按月汇总需求数量 and forecast.Product_MP().MQBMLB() = 'MLB' ) |
| | | if( ( iscc and product.MQBMLB() = 'MLB' ) or ( isccrent and product.MQBMLB() = 'MQB' ) ){ |
| | | if( ( iscc and product.MQBMLB() = 'MLB' ) or ( isccrent and product.MQBMLB() = 'MQB' ) or isdl ){ |
| | | |
| | | //获取合计行 |
| | | allrow := table.GetRow( allunit, product ); |
| | | //获取工厂行 |
| | | factoryrow := table.GetRow( ccunit, product ); |
| | | factoryrow := table.GetRow( ifexpr( isdl, dlunit, ccunit ), product ); |
| | | |
| | | products.Add( product ); |
| | | traverse( forecast, PlanningSalesDemandInPeriod, psdip, psdip.Quantity() <> 0 ){ |
| | |
| | | startofyear := startofplanning.StartOfYear(); |
| | | startofnextyear := startofplanning.StartOfNextYear(); |
| | | |
| | | search := owner.InventorySummarySearch( relnew, Unit := allunit, Generation := allunit, MqbMlb := allunit, Power := allunit, StartDate := Date::MinDate(), EndDate := Date::MaxDate() ); |
| | | search := owner.InventorySummarySearch( relnew, Unit := allunit, Generation := allunit, MqbMlb := allunit, Power := allunit, Category := Translations::MP_GlobalParameters_Day(), StartDate := Date::MinDate(), EndDate := Date::MaxDate() ); |
| | | |
| | | table.GenerateColumn( owner, 'All', startofyear, startofnextyear ); |
| | | //info( '-----------------------------------', table.InventorySummaryColumn( relsize ) ); |
| | | //库存数量为Actual inventories里面的点Planned inventories字段库存量加总 |
| | | //traverse( owner, StockingPoint_MP, stockingpoint ){ |
| | | traverse( owner, StockingPoint_MP, stockingpoint, stockingpoint.ID().EndsWith( '厂内库' ) ){ |
| | | traverse( owner, StockingPoint_MP, stockingpoint ){ |
| | | //traverse( owner, StockingPoint_MP, stockingpoint, stockingpoint.ID().EndsWith( '厂内库' ) ){ |
| | | // unit := stockingpoint.Unit(); |
| | | // parentunits := unit.GetAllParent(); |
| | | //是否属于长春工厂 |
| | | iscc := stockingpoint.ID().StartsWith( 'CC' );//unit.ID() = ccalineunit or unit.ID() = ccmplineunit or exists( parentunits, Elements, punit, punit.ID() = ccalineunit or punit.ID() = ccmplineunit ); |
| | | iscc := stockingpoint.ID().StartsWith( 'CC' ) or stockingpoint.ID() = '长春' ;//unit.ID() = ccalineunit or unit.ID() = ccmplineunit or exists( parentunits, Elements, punit, punit.ID() = ccalineunit or punit.ID() = ccmplineunit ); |
| | | // iscc := stockingpoint.ID().StartsWith( 'CC' ) or unit.ID().StartsWith( 'CC' ) or exists( parentunits, Elements, punit, punit.ID().StartsWith( 'CC' ) ); |
| | | //是否属于大连工厂 |
| | | isdl := stockingpoint.ID().StartsWith( '大连' );//unit.ID() = dlalienunit or unit.ID() = dlmplineunit or exists( parentunits, Elements, punit, punit.ID() = dlalienunit or punit.ID() = dlmplineunit ); |
| | |
| | | { |
| | | Body: |
| | | [* |
| | | FinancialSalesSource::Initialize( MacroPlan ); |
| | | FinancialSalesSource::InitializeNew( MacroPlan ); |
| | | |
| | | table := selectobject( MacroPlan, FinancialSalesSource.FinancialSalesReport, table, not table.IsImport() and table.IsShow() ); |
| | | |