| | |
| | | // çå
°é¸½ Oct-12-2024 (created) |
| | | //å¹´æ±æ» |
| | | yearcolumn := this.FinancialProductionColumn( relnew, Name := 'æ±æ»', Period := this.FinancialProductionSource().MacroPlan().StartOfPlanning().StartOfNextYear().Date() ); |
| | | sumrow := this.FinancialProductionRow( relnew, Name := factory.Format( 'S(Len(10))' ).Concat( 'SUM' ), Unit := factory ); |
| | | sumrow := this.FinancialProductionRow( relnew, Name := factory.Format( 'S(Len(10))' ).Concat( 'SUM' ), Factory := factory ); |
| | | sumyearcell := yearcolumn.FinancialProductionCell( relnew, Quantity := 0 ); |
| | | sumrow.FinancialProductionCell( relinsert, sumyearcell ); |
| | | traverse( table, FinancialProductionRow, row, row.Unit() = factory ){ |
| | |
| | | productid.Add( row.Name() ); |
| | | |
| | | if( productids.ContainsAll( productid ) ){ |
| | | showrow := this.FinancialProductionRow( relnew, Name := factory.Format( 'S(Len(10))' ).Concat( row.Name() ), Unit := row.Unit() ); |
| | | showrow := this.FinancialProductionRow( relnew, Name := factory.Format( 'S(Len(10))' ).Concat( row.Name() ), Unit := row.Unit(), Factory := factory ); |
| | | row.Product_MP().FinancialProductionRow( relinsert, showrow ); |
| | | yearcell := yearcolumn.FinancialProductionCell( relnew, Quantity := 0 ); |
| | | showrow.FinancialProductionCell( relinsert, yearcell ); |
| | | traverse( row, FinancialProductionCell, cell, not cell.FinancialProductionColumn().IsDay() ){ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute Factory |
| | | { |
| | | #keys: '3[415136.0.1226310164][415136.0.1226310163][415136.0.1226310165]' |
| | | ValueType: String |
| | | } |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod Download ( |
| | | MacroPlan macroPlan, |
| | | Factorys factorys, |
| | | ProductGenerations generations, |
| | | ProductPowers powers, |
| | | ProductMLBMQBs mlbmqls |
| | | MacroPlan macroPlan |
| | | ) as BinaryValue |
| | | { |
| | | Description: 'ä¸è½½è´¢å¡æ¥è¡¨æ°æ®' |
| | |
| | | xmlDOM := xmlDOMI.CreateDocumentFromString( '<?xml version="1.0" encoding="UTF-16"?><table><name>' + table.Name() + '</name></table>' ); |
| | | |
| | | tableElement := xmlDOM.GetElementByTagName( "table", 0 ); |
| | | //Search |
| | | searchcolumnelement := xmlDOM.CreateElement( "column" ); |
| | | searchnameelement := xmlDOM.CreateElement( "name" ); |
| | | searchtypeelement := xmlDOM.CreateElement( "type" ); |
| | | searchnameelement.TextContent( 'Search' ); |
| | | searchtypeelement.TextContent( "String" ); |
| | | searchcolumnelement.AppendChild( searchnameelement ); |
| | | searchcolumnelement.AppendChild( searchtypeelement ); |
| | | //Factory |
| | | searchunitcolumn := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, 'Unit' ); |
| | | //Generation |
| | | generationcolumn := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, 'Generation' ); |
| | | //Power |
| | | powercolumn := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, 'Power' ); |
| | | //MLBMQBS |
| | | mlbmqbcolumn := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, 'MLBMQB' ); |
| | | //Product |
| | | productcolumnelement := xmlDOM.CreateElement( "column" ); |
| | | productnameelement := xmlDOM.CreateElement( "name" ); |
| | | producttypeelement := xmlDOM.CreateElement( "type" ); |
| | | productnameelement.TextContent( 'Product' ); |
| | | producttypeelement.TextContent( "String" ); |
| | | productcolumnelement.AppendChild( productnameelement ); |
| | | productcolumnelement.AppendChild( producttypeelement ); |
| | | productcolumnelement := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, 'Product' ); |
| | | //Unit |
| | | unitcolumnelement := xmlDOM.CreateElement( "column" ); |
| | | unitnameelement := xmlDOM.CreateElement( "name" ); |
| | | unittypeelement := xmlDOM.CreateElement( "type" ); |
| | | unitnameelement.TextContent( 'Unit' ); |
| | | unittypeelement.TextContent( "String" ); |
| | | unitcolumnelement.AppendChild( unitnameelement ); |
| | | unitcolumnelement.AppendChild( unittypeelement ); |
| | | |
| | | tableElement.AppendChild( searchcolumnelement ); |
| | | tableElement.AppendChild( productcolumnelement ); |
| | | tableElement.AppendChild( unitcolumnelement ); |
| | | searchtotal := factorys.Size() + generations.Size() + powers.Size() + mlbmqls.Size() + 4 ; |
| | | searchunitElement := xmlDOM.CreateElement( "cell" ); |
| | | searchunitElement.SetAttribute( "value", 'Unit' ); |
| | | searchcolumnelement.AppendChild( searchunitElement ); |
| | | traverse( factorys, Elements, factory ){ |
| | | searchunitcellElement := xmlDOM.CreateElement( "cell" ); |
| | | searchunitcellElement.SetAttribute( "value", factory.Name() ); |
| | | searchcolumnelement.AppendChild( searchunitcellElement ); |
| | | } |
| | | searchgenerationElement := xmlDOM.CreateElement( "cell" ); |
| | | searchgenerationElement.SetAttribute( "value", 'Generation' ); |
| | | searchcolumnelement.AppendChild( searchgenerationElement ); |
| | | traverse( generations, Elements, generation ){ |
| | | generationcellElement := xmlDOM.CreateElement( "cell" ); |
| | | generationcellElement.SetAttribute( "value", generation.Generation() ); |
| | | searchcolumnelement.AppendChild( generationcellElement ); |
| | | } |
| | | searchpowerElement := xmlDOM.CreateElement( "cell" ); |
| | | searchpowerElement.SetAttribute( "value", 'Power' ); |
| | | searchcolumnelement.AppendChild( searchpowerElement ); |
| | | traverse( powers, Elements, power ){ |
| | | searchpowercellElement := xmlDOM.CreateElement( "cell" ); |
| | | searchpowercellElement.SetAttribute( "value", power.Power() ); |
| | | searchcolumnelement.AppendChild( searchpowercellElement ); |
| | | } |
| | | searchmlbmqlElement := xmlDOM.CreateElement( "cell" ); |
| | | searchmlbmqlElement.SetAttribute( "value", 'MQBMLB' ); |
| | | searchcolumnelement.AppendChild( searchmlbmqlElement ); |
| | | traverse( mlbmqls, Elements, mlbmql ){ |
| | | searchmlbmqlcellElement := xmlDOM.CreateElement( "cell" ); |
| | | searchmlbmqlcellElement.SetAttribute( "value", mlbmql.MLBMQB() ); |
| | | searchcolumnelement.AppendChild( searchmlbmqlcellElement ); |
| | | } |
| | | |
| | | for( i := searchtotal; i < table.FinancialProductionRow( relsize ); i := i + 1 ){ |
| | | searchcellElement := xmlDOM.CreateElement( "cell" ); |
| | | searchcellElement.SetAttribute( "value", '' ); |
| | | searchcolumnelement.AppendChild( searchcellElement ); |
| | | } |
| | | unitcolumnelement := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, 'Unit' ); |
| | | |
| | | minindex := min( table, FinancialProductionColumn, column, not column.IsDay(), column.Index() ); |
| | | traverse ( table, FinancialProductionColumn, column, not column.IsDay() ) { |
| | | columnelement := xmlDOM.CreateElement( "column" ); |
| | | nameelement := xmlDOM.CreateElement( "name" ); |
| | | typeelement := xmlDOM.CreateElement( "type" ); |
| | | nameelement.TextContent( column.Name() ); |
| | | typeelement.TextContent( "String" ); |
| | | columnelement.AppendChild( nameelement ); |
| | | columnelement.AppendChild( typeelement ); |
| | | columnelement := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, column.Name() ); |
| | | |
| | | cells := selectsortedset( column, FinancialProductionCell, cell, cell.FinancialProductionRow().RowNr() ); |
| | | |
| | | traverse ( cells, Elements, c ) { |
| | | if( column.Index() = minindex ){ |
| | | row := c.FinancialProductionRow(); |
| | | //Factory |
| | | InventorySummarySource::CreateCellElement( xmlDOM, searchunitcolumn, row.Factory() ); |
| | | //Generation |
| | | InventorySummarySource::CreateCellElement( xmlDOM, generationcolumn, row.Product_MP().Generation() ); |
| | | //Power |
| | | InventorySummarySource::CreateCellElement( xmlDOM, powercolumn, row.Product_MP().Power() ); |
| | | //MLBMQBS |
| | | InventorySummarySource::CreateCellElement( xmlDOM, mlbmqbcolumn, row.Product_MP().MQBMLB() ); |
| | | //Product |
| | | productcellElement := xmlDOM.CreateElement( "cell" ); |
| | | productcellElement.SetAttribute( "value", row.Name() ); |
| | | productcolumnelement.AppendChild( productcellElement ); |
| | | InventorySummarySource::CreateCellElement( xmlDOM, productcolumnelement, row.Name() ); |
| | | //Unit |
| | | unitcellElement := xmlDOM.CreateElement( "cell" ); |
| | | unitcellElement.SetAttribute( "value", row.Unit() ); |
| | | unitcolumnelement.AppendChild( unitcellElement ); |
| | | InventorySummarySource::CreateCellElement( xmlDOM, unitcolumnelement, row.Unit() ); |
| | | } |
| | | cellElement := xmlDOM.CreateElement( "cell" ); |
| | | cellElement.SetAttribute( "value", c.Value() ); |
| | | columnelement.AppendChild( cellElement ); |
| | | } |
| | | for( i := cells.Size(); i < searchtotal; i := i + 1 ){ |
| | | searchcellElement := xmlDOM.CreateElement( "cell" ); |
| | | searchcellElement.SetAttribute( "value", '' ); |
| | | columnelement.AppendChild( searchcellElement ); |
| | | |
| | | if( column.Index() = minindex ){ |
| | | productcellElement := xmlDOM.CreateElement( "cell" ); |
| | | productcellElement.SetAttribute( "value", '' ); |
| | | productcolumnelement.AppendChild( productcellElement ); |
| | | //Unit |
| | | unitcellElement := xmlDOM.CreateElement( "cell" ); |
| | | unitcellElement.SetAttribute( "value", '' ); |
| | | unitcolumnelement.AppendChild( unitcellElement ); |
| | | } |
| | | InventorySummarySource::CreateCellElement( xmlDOM, columnelement, c.Value() ); |
| | | } |
| | | tableElement.AppendChild( columnelement ); |
| | | } |
| | |
| | | TextBody: |
| | | [* |
| | | // çå
°é¸½ Jun-25-2024 (created) |
| | | table := selectobject( this, FinancialSalesSource.FinancialSalesReport, report, not report.IsShow() ); |
| | | table := selectobject( this, FinancialSalesSource.FinancialSalesReport, report, not report.IsShow() ); |
| | | //æ¸
空ä¹ååå¨çæ¾ç¤ºæ°æ® |
| | | this.Clear(); |
| | | traverse( factorys, Elements, factory ){ |
| | |
| | | i := 0; |
| | | traverse( rows, Elements, e ){ |
| | | e.RowNr( i ); |
| | | i := i + 1; |
| | | i := i + 1; |
| | | } |
| | | *] |
| | | } |
| | |
| | | [* |
| | | // çå
°é¸½ Oct-12-2024 (created) |
| | | //å¹´æ±æ» |
| | | yearcolumn := this.FinancialSalesColumn( relnew, Name := 'æ±æ»', Period := this.FinancialSalesSource().MacroPlan().StartOfPlanning().StartOfNextYear().Date() ); |
| | | sumrow := this.FinancialSalesRow( relnew, Name := factory.Format( 'S(Len(10))' ).Concat( 'SUM' ), Unit := factory, RowNr := table.FinancialSalesRow( relsize ) ); |
| | | sumyearcell := yearcolumn.FinancialSalesCell( relnew, Value := '0' ); |
| | | yearcolumn := this.FinancialSalesColumn( relnew, Name := 'æ±æ»', Period := this.FinancialSalesSource().MacroPlan().StartOfPlanning().StartOfNextYear().Date() ); |
| | | sumrow := this.FinancialSalesRow( relnew, Name := factory.Format( 'S(Len(10))' ).Concat( 'SUM' ), Factory := factory ); |
| | | sumyearcell := yearcolumn.FinancialSalesCell( relnew, Value := '0' ); |
| | | sumrow.FinancialSalesCell( relinsert, sumyearcell ); |
| | | traverse( table, FinancialSalesRow, row, row.Unit() = factory ){ |
| | | productid := construct( Strings ); |
| | | productid := construct( Strings ); |
| | | productid.Add( row.Name() ); |
| | | |
| | | if( productids.ContainsAll( productid ) ){ |
| | | showrow := this.FinancialSalesRow( relnew, Name := factory.Format( 'S(Len(10))' ).Concat( row.Name() ), Unit := row.Unit(), RowNr := row.RowNr() ); |
| | | yearcell := yearcolumn.FinancialSalesCell( relnew, Value := '0' ); |
| | | showrow := this.FinancialSalesRow( relnew, Name := factory.Format( 'S(Len(10))' ).Concat( row.Name() ), Unit := row.Unit() ); |
| | | row.Product_MP().FinancialSalesRow( relinsert, showrow ); |
| | | yearcell := yearcolumn.FinancialSalesCell( relnew, Value := '0' ); |
| | | showrow.FinancialSalesCell( relinsert, yearcell ); |
| | | |
| | | traverse( row, FinancialSalesCell, cell, not cell.FinancialSalesColumn().IsDay() ){ |
| | | column := selectobject( this, FinancialSalesColumn, column, column.Name() = cell.FinancialSalesColumn().Name() and not column.IsDay()); |
| | | column := selectobject( this, FinancialSalesColumn, column, column.Name() = cell.FinancialSalesColumn().Name() and not column.IsDay()); |
| | | |
| | | sumcell := selectobject( column, FinancialSalesCell, c, c.FinancialSalesRow() = sumrow ); |
| | | sumcell := selectobject( column, FinancialSalesCell, c, c.FinancialSalesRow() = sumrow ); |
| | | if( isnull( sumcell ) ){ |
| | | sumcell := column.FinancialSalesCell( relnew, Value := '0' ); |
| | | sumcell := column.FinancialSalesCell( relnew, Value := '0' ); |
| | | sumrow.FinancialSalesCell( relinsert, sumcell ); |
| | | } |
| | | |
| | | showcell := column.FinancialSalesCell( relnew, Value := cell.Value(), IsUpdate := cell.IsUpdate() ); |
| | | showcell := column.FinancialSalesCell( relnew, Value := cell.Value(), IsUpdate := cell.IsUpdate() ); |
| | | showrow.FinancialSalesCell( relinsert, showcell ); |
| | | yearcell.Value( [String]( [Real]yearcell.Value() + [Real]cell.Value() ) ); |
| | | sumyearcell.Value( [String]( [Real]sumyearcell.Value() + [Real]cell.Value() ) ); |
| | | value := [Real]cell.Value() + [Real]sumcell.Value(); |
| | | value := [Real]cell.Value() + [Real]sumcell.Value(); |
| | | sumcell.Value( [String]value ); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute Factory |
| | | { |
| | | #keys: '3[415136.0.1226310174][415136.0.1226310173][415136.0.1226310175]' |
| | | ValueType: String |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | DefaultValue |
| | | { |
| | | TargetAttribute: Factory |
| | | } |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod Download ( |
| | | MacroPlan macroPlan, |
| | | Factorys factorys, |
| | | ProductGenerations generations, |
| | | ProductPowers powers, |
| | | ProductMLBMQBs mlbmqls |
| | | MacroPlan macroPlan |
| | | ) as BinaryValue |
| | | { |
| | | Description: 'ä¸è½½è´¢å¡æ¥è¡¨æ°æ®' |
| | |
| | | xmlDOM := xmlDOMI.CreateDocumentFromString( '<?xml version="1.0" encoding="UTF-16"?><table><name>' + table.Name() + '</name></table>' ); |
| | | |
| | | tableElement := xmlDOM.GetElementByTagName( "table", 0 ); |
| | | //Search |
| | | searchcolumnelement := xmlDOM.CreateElement( "column" ); |
| | | searchnameelement := xmlDOM.CreateElement( "name" ); |
| | | searchtypeelement := xmlDOM.CreateElement( "type" ); |
| | | searchnameelement.TextContent( 'Search' ); |
| | | searchtypeelement.TextContent( "String" ); |
| | | searchcolumnelement.AppendChild( searchnameelement ); |
| | | searchcolumnelement.AppendChild( searchtypeelement ); |
| | | //Factory |
| | | searchunitcolumn := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, 'Unit' ); |
| | | //Generation |
| | | generationcolumn := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, 'Generation' ); |
| | | //Power |
| | | powercolumn := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, 'Power' ); |
| | | //MLBMQBS |
| | | mlbmqbcolumn := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, 'MLBMQB' ); |
| | | //Product |
| | | productcolumnelement := xmlDOM.CreateElement( "column" ); |
| | | productnameelement := xmlDOM.CreateElement( "name" ); |
| | | producttypeelement := xmlDOM.CreateElement( "type" ); |
| | | productnameelement.TextContent( 'Product' ); |
| | | producttypeelement.TextContent( "String" ); |
| | | productcolumnelement.AppendChild( productnameelement ); |
| | | productcolumnelement.AppendChild( producttypeelement ); |
| | | productcolumnelement := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, 'Product' ); |
| | | //Unit |
| | | unitcolumnelement := xmlDOM.CreateElement( "column" ); |
| | | unitnameelement := xmlDOM.CreateElement( "name" ); |
| | | unittypeelement := xmlDOM.CreateElement( "type" ); |
| | | unitnameelement.TextContent( 'Unit' ); |
| | | unittypeelement.TextContent( "String" ); |
| | | unitcolumnelement.AppendChild( unitnameelement ); |
| | | unitcolumnelement.AppendChild( unittypeelement ); |
| | | unitcolumnelement := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, 'Unit' ); |
| | | |
| | | tableElement.AppendChild( searchcolumnelement ); |
| | | tableElement.AppendChild( productcolumnelement ); |
| | | tableElement.AppendChild( unitcolumnelement ); |
| | | searchtotal := factorys.Size() + generations.Size() + powers.Size() + mlbmqls.Size() + 4 ; |
| | | searchunitElement := xmlDOM.CreateElement( "cell" ); |
| | | searchunitElement.SetAttribute( "value", 'Unit' ); |
| | | searchcolumnelement.AppendChild( searchunitElement ); |
| | | traverse( factorys, Elements, factory ){ |
| | | searchunitcellElement := xmlDOM.CreateElement( "cell" ); |
| | | searchunitcellElement.SetAttribute( "value", factory.Name() ); |
| | | searchcolumnelement.AppendChild( searchunitcellElement ); |
| | | } |
| | | searchgenerationElement := xmlDOM.CreateElement( "cell" ); |
| | | searchgenerationElement.SetAttribute( "value", 'Generation' ); |
| | | searchcolumnelement.AppendChild( searchgenerationElement ); |
| | | traverse( generations, Elements, generation ){ |
| | | generationcellElement := xmlDOM.CreateElement( "cell" ); |
| | | generationcellElement.SetAttribute( "value", generation.Generation() ); |
| | | searchcolumnelement.AppendChild( generationcellElement ); |
| | | } |
| | | searchpowerElement := xmlDOM.CreateElement( "cell" ); |
| | | searchpowerElement.SetAttribute( "value", 'Power' ); |
| | | searchcolumnelement.AppendChild( searchpowerElement ); |
| | | traverse( powers, Elements, power ){ |
| | | searchpowercellElement := xmlDOM.CreateElement( "cell" ); |
| | | searchpowercellElement.SetAttribute( "value", power.Power() ); |
| | | searchcolumnelement.AppendChild( searchpowercellElement ); |
| | | } |
| | | searchmlbmqlElement := xmlDOM.CreateElement( "cell" ); |
| | | searchmlbmqlElement.SetAttribute( "value", 'MQBMLB' ); |
| | | searchcolumnelement.AppendChild( searchmlbmqlElement ); |
| | | traverse( mlbmqls, Elements, mlbmql ){ |
| | | searchmlbmqlcellElement := xmlDOM.CreateElement( "cell" ); |
| | | searchmlbmqlcellElement.SetAttribute( "value", mlbmql.MLBMQB() ); |
| | | searchcolumnelement.AppendChild( searchmlbmqlcellElement ); |
| | | } |
| | | |
| | | for( i := searchtotal; i < table.FinancialSalesRow( relsize ); i := i + 1 ){ |
| | | searchcellElement := xmlDOM.CreateElement( "cell" ); |
| | | searchcellElement.SetAttribute( "value", '' ); |
| | | searchcolumnelement.AppendChild( searchcellElement ); |
| | | } |
| | | |
| | | minindex := min( table, FinancialSalesColumn, column, not column.IsDay(), column.Index() ); |
| | | minindex := min( table, FinancialSalesColumn, column, not column.IsDay(), column.Index() ); |
| | | traverse ( table, FinancialSalesColumn, column, not column.IsDay() ) { |
| | | columnelement := xmlDOM.CreateElement( "column" ); |
| | | nameelement := xmlDOM.CreateElement( "name" ); |
| | | typeelement := xmlDOM.CreateElement( "type" ); |
| | | nameelement.TextContent( column.Name() ); |
| | | typeelement.TextContent( "String" ); |
| | | columnelement.AppendChild( nameelement ); |
| | | columnelement.AppendChild( typeelement ); |
| | | columnelement := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, column.Name() ); |
| | | |
| | | cells := selectsortedset( column, FinancialSalesCell, cell, cell.FinancialSalesRow().RowNr() ); |
| | | |
| | | traverse ( cells, Elements, c ) { |
| | | if( column.Index() = minindex ){ |
| | | row := c.FinancialSalesRow(); |
| | | //Factory |
| | | InventorySummarySource::CreateCellElement( xmlDOM, searchunitcolumn, row.Factory() ); |
| | | //Generation |
| | | InventorySummarySource::CreateCellElement( xmlDOM, generationcolumn, row.Product_MP().Generation() ); |
| | | //Power |
| | | InventorySummarySource::CreateCellElement( xmlDOM, powercolumn, row.Product_MP().Power() ); |
| | | //MLBMQBS |
| | | InventorySummarySource::CreateCellElement( xmlDOM, mlbmqbcolumn, row.Product_MP().MQBMLB() ); |
| | | //Product |
| | | productcellElement := xmlDOM.CreateElement( "cell" ); |
| | | productcellElement.SetAttribute( "value", row.Name() ); |
| | | productcolumnelement.AppendChild( productcellElement ); |
| | | InventorySummarySource::CreateCellElement( xmlDOM, productcolumnelement, row.Name() ); |
| | | //Unit |
| | | unitcellElement := xmlDOM.CreateElement( "cell" ); |
| | | unitcellElement.SetAttribute( "value", row.Unit() ); |
| | | unitcolumnelement.AppendChild( unitcellElement ); |
| | | if( cells.Size() > searchtotal ){ |
| | | for( i := searchtotal; i < cells.Size(); i := i + 1 ){ |
| | | searchcellElement1 := xmlDOM.CreateElement( "cell" ); |
| | | searchcellElement1.SetAttribute( "value", '' ); |
| | | searchcolumnelement.AppendChild( searchcellElement1 ); |
| | | } |
| | | } |
| | | InventorySummarySource::CreateCellElement( xmlDOM, unitcolumnelement, row.Unit() ); |
| | | } |
| | | cellElement := xmlDOM.CreateElement( "cell" ); |
| | | cellElement.SetAttribute( "value", c.Value() ); |
| | | columnelement.AppendChild( cellElement ); |
| | | } |
| | | for( i := cells.Size(); i < searchtotal; i := i + 1 ){ |
| | | searchcellElement := xmlDOM.CreateElement( "cell" ); |
| | | searchcellElement.SetAttribute( "value", '' ); |
| | | columnelement.AppendChild( searchcellElement ); |
| | | |
| | | if( column.Index() = minindex ){ |
| | | productcellElement := xmlDOM.CreateElement( "cell" ); |
| | | productcellElement.SetAttribute( "value", '' ); |
| | | productcolumnelement.AppendChild( productcellElement ); |
| | | //Unit |
| | | unitcellElement := xmlDOM.CreateElement( "cell" ); |
| | | unitcellElement.SetAttribute( "value", '' ); |
| | | unitcolumnelement.AppendChild( unitcellElement ); |
| | | } |
| | | InventorySummarySource::CreateCellElement( xmlDOM, columnelement, c.Value() ); |
| | | } |
| | | tableElement.AppendChild( columnelement ); |
| | | } |
| | |
| | | InventorySummaryReport table, |
| | | Date start, |
| | | Date end, |
| | | String productid, |
| | | Product_MP product, |
| | | String allunit, |
| | | String ccunit, |
| | | String dlunit |
| | |
| | | [* |
| | | // çå
°é¸½ Jul-3-2024 (created) |
| | | //All |
| | | alldetails := selectset( selections, Elements.InventoryInterfaceDataDetail, detail, detail.PartNumber() = productid and detail.Date() >= start and detail.Date() <= end ); |
| | | alldetails := selectset( selections, Elements.InventoryInterfaceDataDetail, detail, detail.PartNumber() = product.ID() and detail.Date() >= start and detail.Date() <= end ); |
| | | if( alldetails.Size() > 0 ){ |
| | | allrow := table.GetRow( allunit, productid ); |
| | | allrow := table.GetRow( allunit, product ); |
| | | allvalue := sum( alldetails, Elements, e, [Number]e.Quantity() ); |
| | | allrow.SetCellValue( this, allvalue ); |
| | | //é¿æ¥ |
| | | ccdetails := selectset( alldetails, Elements, detail, ccstockingpointids.Find( detail.InventoryPointSelection().StockpoingPoint() ) >= 0 ); |
| | | if( ccdetails.Size() > 0 ){ |
| | | ccrow := table.GetRow( ccunit, productid ); |
| | | ccrow := table.GetRow( ccunit, product ); |
| | | value := sum( ccdetails, Elements, e, [Number]e.Quantity() ); |
| | | ccrow.SetCellValue( this, value ); |
| | | } |
| | | //å¤§è¿ |
| | | dldetails := selectset( alldetails, Elements, detail, dlstockingpointids.Find( detail.InventoryPointSelection().StockpoingPoint() ) >= 0 ); |
| | | if( dldetails.Size() > 0 ){ |
| | | dlrow := table.GetRow( dlunit, productid ); |
| | | dlrow := table.GetRow( dlunit, product ); |
| | | value := sum( dldetails, Elements, e, [Number]e.Quantity() ); |
| | | dlrow.SetCellValue( this, value ); |
| | | } |
| | |
| | | TextBody: |
| | | [* |
| | | // çå
°é¸½ Oct-12-2024 (created) |
| | | sumrow := this.InventroySummaryRow( relnew, Name := factory.Format( 'S(Len(10))' ).Concat( 'SUM' ), Unit := factory ); |
| | | sumrow := this.InventroySummaryRow( relnew, Name := factory.Format( 'S(Len(10))' ).Concat( 'SUM' ), Factory := factory ); |
| | | sumrow.InitializeCell( this ); |
| | | traverse( table, InventroySummaryRow, row, row.Unit() = factory ){ |
| | | productid := construct( Strings ); |
| | | productid.Add( row.Name() ); |
| | | |
| | | if( productids.ContainsAll( productid ) ){ |
| | | showrow := this.InventroySummaryRow( relnew, Name := factory.Format( 'S(Len(10))' ).Concat( row.Name() ), Unit := row.Unit(), RowNr := row.RowNr() ); |
| | | showrow := this.InventroySummaryRow( relnew, Name := factory.Format( 'S(Len(10))' ).Concat( row.Name() ), Generation := row.Generation(), Power := row.Power(), MLBMQB := row.MLBMQB(), Unit := row.Unit(), Factory := factory, RowNr := row.RowNr() ); |
| | | traverse( this, InventorySummaryColumn, column ){ |
| | | sumcell := selectobject( column, InventorySummaryCell, c, c.InventroySummaryRow() = sumrow ); |
| | | daycells := selectset( row, InventorySummaryCell, cell, cell.InventorySummaryColumn().TimeUnit() = Translations::MP_GlobalParameters_Day() and |
| | |
| | | #parent: #root |
| | | Method GetRow ( |
| | | String unit, |
| | | String product |
| | | Product_MP product |
| | | ) as InventroySummaryRow |
| | | { |
| | | TextBody: |
| | | [* |
| | | // çå
°é¸½ Jun-28-2024 (created) |
| | | row := selectobject( this, InventroySummaryRow, row, row.Name() = product and row.Unit() = unit ); |
| | | row := selectobject( this, InventroySummaryRow, row, row.Name() = product.ID() and row.Unit() = unit ); |
| | | |
| | | if( isnull( row ) ){ |
| | | row := this.InventroySummaryRow( relnew, Name := product, Unit := unit ); |
| | | row := this.InventroySummaryRow( relnew, Name := product.ID(), Generation := product.Generation(), Power := product.Power(), MLBMQB := product.MQBMLB(), Unit := unit ); |
| | | //åå§ååå
æ ¼ |
| | | row.InitializeCell( this ); |
| | | } |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod Download ( |
| | | MacroPlan macroPlan, |
| | | Factorys factorys, |
| | | ProductGenerations generations, |
| | | ProductPowers powers, |
| | | ProductMLBMQBs mlbmqls, |
| | | InventorySummarySearch search |
| | | MacroPlan macroPlan |
| | | ) as BinaryValue |
| | | { |
| | | Description: 'ä¸è½½è´¢å¡æ¥è¡¨æ°æ®' |
| | | TextBody: |
| | | [* |
| | | //è·åæ¥è¯¢è¡æ° |
| | | searchrowsize := InventorySummarySource::GetSearchRows( factorys, generations, powers, mlbmqls ); |
| | | table := selectobject( macroPlan, InventorySummarySource.InventorySummaryReport, table, table.IsShow() ); |
| | | |
| | | xmlDOMI := XMLDOMImplementation::Create(); |
| | | xmlDOM := xmlDOMI.CreateDocumentFromString( '<?xml version="1.0" encoding="UTF-16"?><table><name>' + table.Name() + '</name></table>' ); |
| | | |
| | | tableElement := xmlDOM.GetElementByTagName( "table", 0 ); |
| | | //Product/Unit |
| | | factoryvalues := selectuniquevalues( factorys, Elements, factory, factory.Name() ); |
| | | productcolumnelement := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, factoryvalues, 'Unit', searchrowsize ); |
| | | InventorySummarySource::CreateCellElement( xmlDOM, productcolumnelement, 'Product' ); |
| | | //Unit/Generation |
| | | generationvalues := selectuniquevalues( generations, Elements, generation, generation.Generation() ); |
| | | unitcolumnelement := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, generationvalues, 'Generation', searchrowsize ); |
| | | InventorySummarySource::CreateCellElement( xmlDOM, unitcolumnelement, 'Unit' ); |
| | | //Attribute/Power |
| | | powervalues := selectuniquevalues( powers, Elements, power, power.Power() ); |
| | | attricolumnelement := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, powervalues, 'Power', searchrowsize ); |
| | | InventorySummarySource::CreateCellElement( xmlDOM, attricolumnelement, 'Attribute' ); |
| | | //Factory |
| | | searchunitcolumn := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, 'Unit' ); |
| | | //Generation |
| | | generationcolumn := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, 'Generation' ); |
| | | //Power |
| | | powercolumn := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, 'Power' ); |
| | | //MLBMQBS |
| | | mlbmqbvalues := selectuniquevalues( mlbmqls, Elements, mlbmqb, mlbmqb.MLBMQB() ); |
| | | mlbmqlcolumnelement := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, mlbmqbvalues, 'MLBMQB', searchrowsize ); |
| | | //Start date |
| | | startcolumnelement := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, search.StartDate().Format( 'M2/D2/Y' ), 'Start date', searchrowsize ); |
| | | //End date |
| | | endcolumnelement := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, search.EndDate().Format( 'M2/D2/Y' ), 'End date', searchrowsize ); |
| | | //Period |
| | | periodcolumnelement := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, search.Category(), 'Period', searchrowsize ); |
| | | |
| | | searchcolumn := 7 ; |
| | | rowsize := table.InventroySummaryRow( relsize ) * 4; |
| | | for( i := table.InventorySummaryColumn( relsize ); i < searchcolumn - 3; i := i + 1 ){ |
| | | if( i = 0 ){ |
| | | InventorySummarySource::CreateCellElement( xmlDOM, mlbmqlcolumnelement, '', rowsize ); |
| | | }else if( i = 1 ){ |
| | | InventorySummarySource::CreateCellElement( xmlDOM, startcolumnelement, '', rowsize ); |
| | | }else if( i = 2 ){ |
| | | InventorySummarySource::CreateCellElement( xmlDOM, endcolumnelement, '', rowsize ); |
| | | }else if( i = 3 ){ |
| | | InventorySummarySource::CreateCellElement( xmlDOM, periodcolumnelement, '', rowsize ); |
| | | } |
| | | } |
| | | |
| | | mlbmqbcolumn := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, 'MLBMQB' ); |
| | | //Product |
| | | productcolumnelement := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, 'Product' ); |
| | | //Unit |
| | | unitcolumnelement := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, 'Unit' ); |
| | | //Attribute |
| | | attricolumnelement := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, 'Attribute' ); |
| | | traverse ( table, InventorySummaryColumn, column ) { |
| | | columnelement := null( XMLDOMElement ); |
| | | if( column.Index() = 0 ){ |
| | | columnelement := mlbmqlcolumnelement; |
| | | InventorySummarySource::CreateCellElement( xmlDOM, mlbmqlcolumnelement, column.Name() ); |
| | | }else if( column.Index() = 1 ){ |
| | | columnelement := startcolumnelement |
| | | InventorySummarySource::CreateCellElement( xmlDOM, startcolumnelement, column.Name() ); |
| | | }else if( column.Index() = 2 ){ |
| | | columnelement := endcolumnelement; |
| | | InventorySummarySource::CreateCellElement( xmlDOM, endcolumnelement, column.Name() ); |
| | | }else if( column.Index() = 3 ){ |
| | | columnelement := periodcolumnelement; |
| | | InventorySummarySource::CreateCellElement( xmlDOM, periodcolumnelement, column.Name() ); |
| | | }else{ |
| | | columnelement := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, column.Name(), rowsize ); |
| | | } |
| | | columnelement := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, column.Name() ); |
| | | |
| | | cells := selectsortedset( column, InventorySummaryCell, cell, cell.InventroySummaryRow().RowNr() ); |
| | | |
| | | traverse ( cells, Elements, c ) { |
| | | if( column.Index() = 0 ){ |
| | | row := c.InventroySummaryRow(); |
| | | //Factory |
| | | InventorySummarySource::CreateCellElement( xmlDOM, searchunitcolumn, row.Factory() ); |
| | | InventorySummarySource::CreateCellElement( xmlDOM, searchunitcolumn, row.Factory() ); |
| | | InventorySummarySource::CreateCellElement( xmlDOM, searchunitcolumn, row.Factory() ); |
| | | InventorySummarySource::CreateCellElement( xmlDOM, searchunitcolumn, row.Factory() ); |
| | | //Generation |
| | | InventorySummarySource::CreateCellElement( xmlDOM, generationcolumn, row.Generation() ); |
| | | InventorySummarySource::CreateCellElement( xmlDOM, generationcolumn, row.Generation() ); |
| | | InventorySummarySource::CreateCellElement( xmlDOM, generationcolumn, row.Generation() ); |
| | | InventorySummarySource::CreateCellElement( xmlDOM, generationcolumn, row.Generation() ); |
| | | //Power |
| | | InventorySummarySource::CreateCellElement( xmlDOM, powercolumn, row.Power() ); |
| | | InventorySummarySource::CreateCellElement( xmlDOM, powercolumn, row.Power() ); |
| | | InventorySummarySource::CreateCellElement( xmlDOM, powercolumn, row.Power() ); |
| | | InventorySummarySource::CreateCellElement( xmlDOM, powercolumn, row.Power() ); |
| | | //MLBMQBS |
| | | InventorySummarySource::CreateCellElement( xmlDOM, mlbmqbcolumn, row.MLBMQB() ); |
| | | InventorySummarySource::CreateCellElement( xmlDOM, mlbmqbcolumn, row.MLBMQB() ); |
| | | InventorySummarySource::CreateCellElement( xmlDOM, mlbmqbcolumn, row.MLBMQB() ); |
| | | InventorySummarySource::CreateCellElement( xmlDOM, mlbmqbcolumn, row.MLBMQB() ); |
| | | //Product |
| | | InventorySummarySource::CreateCellElement( xmlDOM, productcolumnelement, row.Name() ); |
| | | InventorySummarySource::CreateCellElement( xmlDOM, productcolumnelement, row.Name() ); |
| | |
| | | traverse( stockingpoint, ProductInStockingPoint_MP, pisp, pisp.Product_MP().IsLeaf() ){ |
| | | productids.Add( pisp.ProductID() ); |
| | | //è·åå·¥åè¡ |
| | | factoryrow := table.GetRow( ifexpr( iscc, ccunit, dlunit ), pisp.ProductID() ); |
| | | factoryrow := table.GetRow( ifexpr( iscc, ccunit, dlunit ), pisp.Product_MP() ); |
| | | //è·ååè®¡è¡ |
| | | allrow := table.GetRow( allunit, pisp.ProductID() ); |
| | | allrow := table.GetRow( allunit, pisp.Product_MP() ); |
| | | |
| | | pispips := selectsortedset( pisp, ProductInStockingPointInPeriod, pispip, pispip.Start() < startofnextyear |
| | | and pispip.Period_MP().TimeUnit() = Translations::MP_GlobalParameters_Day(), pispip.Start() ); |
| | |
| | | traverse( table, InventorySummaryColumn, column, column.TimeUnit() = Translations::MP_GlobalParameters_Day() and column.StartDate() < startofplanning.Date() ){ |
| | | traverse( productidset, Elements, productid ){ |
| | | productids.Add( productid ); |
| | | column.GenerateCell( selections, ccsps, dlsps, table, column.StartDate(), column.EndaDate(), productid, allunit, ccunit, dlunit ); |
| | | product := selectobject( owner, Product_MP, product, product.ID() = productid ); |
| | | column.GenerateCell( selections, ccsps, dlsps, table, column.StartDate(), column.EndaDate(), product, allunit, ccunit, dlunit ); |
| | | } |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute Factory |
| | | { |
| | | #keys: '3[415136.0.1226331362][415136.0.1226331361][415136.0.1226331363]' |
| | | ValueType: String |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute Generation |
| | | { |
| | | #keys: '3[415136.0.1226310057][415136.0.1226310056][415136.0.1226310058]' |
| | | ValueType: String |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute MLBMQB |
| | | { |
| | | #keys: '3[415136.0.1226310078][415136.0.1226310077][415136.0.1226310079]' |
| | | ValueType: String |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute Power |
| | | { |
| | | #keys: '3[415136.0.1226310068][415136.0.1226310067][415136.0.1226310069]' |
| | | ValueType: String |
| | | } |
| | |
| | | { |
| | | Body: |
| | | [* |
| | | binaryValue := FinancialProductionSource::Download( MacroPlan, dhFactorys.Data(), dhGenerations.Data(), dhPowers.Data(), dhMQBMLBs.Data() ); |
| | | binaryValue := FinancialProductionSource::Download( MacroPlan ); |
| | | |
| | | Application.Download( FinancialProductionReport::GetDefaultName() + '.xlsx', binaryValue.AsBinaryData() ); |
| | | *] |
| | |
| | | ] |
| | | Properties: |
| | | [ |
| | | FixedSize: true |
| | | Taborder: 0 |
| | | ] |
| | | } |
| | |
| | | { |
| | | Body: |
| | | [* |
| | | binaryValue := FinancialSalesSource::Download( MacroPlan, dhFactorys.Data(), dhGenerations.Data(), dhPowers.Data(), dhMQBMLBs.Data() ); |
| | | binaryValue := FinancialSalesSource::Download( MacroPlan ); |
| | | |
| | | Application.Download( FinancialSalesReport::GetDefaultName() + '.xlsx', binaryValue.AsBinaryData() ); |
| | | //owner.FinancialSalesSource( relflush ); |
| | |
| | | { |
| | | Body: |
| | | [* |
| | | binaryValue := InventorySummarySource::Download( MacroPlan, dhFactorys.Data(), dhGenerations.Data(), dhPowers.Data(), dhMQBMLBs.Data(), dhSearch.Data() ); |
| | | binaryValue := InventorySummarySource::Download( MacroPlan ); |
| | | |
| | | Application.Download( InventorySummaryReport::GetDefaultName() + '.xlsx', binaryValue.AsBinaryData() ); |
| | | *] |