¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Relation FinancialSalesColumn_FinancialSalesCell_FinancialSalesCell_FinancialSalesColumn |
| | | { |
| | | #keys: '1[415136.0.857450656]' |
| | | ProceduralSequenceRelationStrategy |
| | | { |
| | | #keys: '13[0.0.0][415136.0.857450675][415136.0.857450669][415136.0.857450676][415136.0.857450670][415136.0.857450677][415136.0.857450671][415136.0.857450678][415136.0.857450672][415136.0.857450679][415136.0.857450673][415136.0.857450680][415136.0.857450674]' |
| | | SequenceElementSuffix: 'CellInColumn' |
| | | SequenceSuffix: 'CellInColumn' |
| | | } |
| | | RelationSide.LeftSide FinancialSalesCell |
| | | { |
| | | #keys: '3[415136.0.857450658][415136.0.857450657][415136.0.857450659]' |
| | | Cardinality: '1toN' |
| | | ObjectDefinition: FinancialSalesColumn |
| | | OwningSide: 'Owned' |
| | | } |
| | | RelationSide.RightSide FinancialSalesColumn |
| | | { |
| | | #keys: '3[415136.0.857450661][415136.0.857450660][415136.0.857450662]' |
| | | Cardinality: '0to1' |
| | | ObjectDefinition: FinancialSalesCell |
| | | OwningSide: 'Reference' |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Relation FinancialSalesReport_FinancialSalesColumn_FinancialSalesColumn_FinancialSalesReport |
| | | { |
| | | #keys: '1[415136.0.857450615]' |
| | | ProceduralSequenceRelationStrategy |
| | | { |
| | | #keys: '13[0.0.0][415136.0.857450634][415136.0.857450628][415136.0.857450635][415136.0.857450629][415136.0.857450636][415136.0.857450630][415136.0.857450637][415136.0.857450631][415136.0.857450638][415136.0.857450632][415136.0.857450639][415136.0.857450633]' |
| | | SequenceElementSuffix: 'Column' |
| | | SequenceSuffix: 'Column' |
| | | } |
| | | RelationSide.LeftSide FinancialSalesColumn |
| | | { |
| | | #keys: '3[415136.0.857450617][415136.0.857450616][415136.0.857450618]' |
| | | Cardinality: '1toN' |
| | | ObjectDefinition: FinancialSalesReport |
| | | OwningSide: 'Owned' |
| | | } |
| | | RelationSide.RightSide FinancialSalesReport |
| | | { |
| | | #keys: '3[415136.0.857450620][415136.0.857450619][415136.0.857450621]' |
| | | Cardinality: '0to1' |
| | | ObjectDefinition: FinancialSalesColumn |
| | | OwningSide: 'Reference' |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Relation FinancialSalesReport_FinancialSalesSource_FinancialSalesSource_FinancialSalesReport |
| | | { |
| | | #keys: '1[415136.0.857450551]' |
| | | DefaultRelationStrategy |
| | | { |
| | | } |
| | | RelationSide.LeftSide FinancialSalesSource |
| | | { |
| | | #keys: '3[415136.0.857450553][415136.0.857450552][415136.0.857450554]' |
| | | Cardinality: '0to1' |
| | | ObjectDefinition: FinancialSalesReport |
| | | OwningSide: 'Reference' |
| | | } |
| | | RelationSide.RightSide FinancialSalesReport |
| | | { |
| | | #keys: '3[415136.0.857450556][415136.0.857450555][415136.0.857450557]' |
| | | Cardinality: '1toN' |
| | | ObjectDefinition: FinancialSalesSource |
| | | OwningSide: 'Owned' |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Relation FinancialSalesRow_FinancialSalesCell_FinancialSalesCell_FinancialSalesRow |
| | | { |
| | | #keys: '1[415136.0.857450694]' |
| | | DefaultRelationStrategy |
| | | { |
| | | } |
| | | RelationSide.LeftSide FinancialSalesCell |
| | | { |
| | | #keys: '3[415136.0.857450696][415136.0.857450695][415136.0.857450697]' |
| | | Cardinality: '1toN' |
| | | ObjectDefinition: FinancialSalesRow |
| | | OwningSide: 'Reference' |
| | | } |
| | | RelationSide.RightSide FinancialSalesRow |
| | | { |
| | | #keys: '3[415136.0.857450699][415136.0.857450698][415136.0.857450700]' |
| | | Cardinality: '0to1' |
| | | ObjectDefinition: FinancialSalesCell |
| | | OwningSide: 'Reference' |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Relation FinancialSalesRow_FinancialSalesReport_FinancialSalesReport_FinancialSalesRow |
| | | { |
| | | #keys: '1[415136.0.857450585]' |
| | | DefaultRelationStrategy |
| | | { |
| | | } |
| | | RelationSide.LeftSide FinancialSalesReport |
| | | { |
| | | #keys: '3[415136.0.857450587][415136.0.857450586][415136.0.857450588]' |
| | | Cardinality: '0to1' |
| | | ObjectDefinition: FinancialSalesRow |
| | | OwningSide: 'Reference' |
| | | } |
| | | RelationSide.RightSide FinancialSalesRow |
| | | { |
| | | #keys: '3[415136.0.857450590][415136.0.857450589][415136.0.857450591]' |
| | | Cardinality: '1toN' |
| | | ObjectDefinition: FinancialSalesReport |
| | | OwningSide: 'Owned' |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Relation FinancialSalesSearch_FinancialSalesSource_FinancialSalesSource_FinancialSalesSearch |
| | | { |
| | | #keys: '1[415136.0.857450518]' |
| | | DefaultRelationStrategy |
| | | { |
| | | } |
| | | RelationSide.LeftSide FinancialSalesSource |
| | | { |
| | | #keys: '3[415136.0.857450520][415136.0.857450519][415136.0.857450521]' |
| | | Cardinality: '0to1' |
| | | ObjectDefinition: FinancialSalesSearch |
| | | OwningSide: 'Reference' |
| | | } |
| | | RelationSide.RightSide FinancialSalesSearch |
| | | { |
| | | #keys: '3[415136.0.857450523][415136.0.857450522][415136.0.857450524]' |
| | | Cardinality: '1toN' |
| | | ObjectDefinition: FinancialSalesSource |
| | | OwningSide: 'Owned' |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Relation FinancialSalesSource_MacroPlan_MacroPlan_FinancialSalesSource |
| | | { |
| | | #keys: '1[415136.0.857450485]' |
| | | DefaultRelationStrategy |
| | | { |
| | | } |
| | | RelationSide.LeftSide MacroPlan |
| | | { |
| | | #keys: '3[415136.0.857450487][415136.0.857450486][415136.0.857450488]' |
| | | Cardinality: '0to1' |
| | | ObjectDefinition: FinancialSalesSource |
| | | OwningSide: 'Reference' |
| | | } |
| | | RelationSide.RightSide FinancialSalesSource |
| | | { |
| | | #keys: '3[415136.0.857450490][415136.0.857450489][415136.0.857450491]' |
| | | Cardinality: '1toN' |
| | | ObjectDefinition: MacroPlan |
| | | OwningSide: 'Owned' |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute Value |
| | | { |
| | | #keys: '3[415136.0.857450650][415136.0.857450649][415136.0.857450651]' |
| | | ValueType: String |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | DefaultValue |
| | | { |
| | | TargetAttribute: Value |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #root |
| | | #parent: #DomainModel |
| | | Type FinancialSalesCell |
| | | { |
| | | #keys: '5[415136.0.857450647][415136.0.857450645][0.0.0][415136.0.857450646][415136.0.857450648]' |
| | | BaseType: Object |
| | | Description: 'è´¢å¡ééæ¥è¡¨åå
æ ¼' |
| | | StructuredName: 'FinancialSalesCells' |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute Index |
| | | { |
| | | #keys: '3[415136.0.857450603][415136.0.857450602][415136.0.857450604]' |
| | | ValueType: Number |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute Name |
| | | { |
| | | #keys: '3[415136.0.857450606][415136.0.857450605][415136.0.857450607]' |
| | | ValueType: String |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute Period |
| | | { |
| | | #keys: '3[415136.0.857450609][415136.0.857450608][415136.0.857450610]' |
| | | ValueType: Date |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | DefaultValue |
| | | { |
| | | TargetAttribute: Name |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Function CalcIndex |
| | | { |
| | | TextBody: |
| | | [* |
| | | // çå
°é¸½ Jun-21-2024 (created) |
| | | |
| | | value := ifexpr( isnull( this.PreviousColumn() ), 0, this.PreviousColumn().Index() + 1 ); |
| | | |
| | | this.Index( value ); |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #root |
| | | #parent: #DomainModel |
| | | Type FinancialSalesColumn |
| | | { |
| | | #keys: '5[415136.0.857450600][415136.0.857450598][0.0.0][415136.0.857450599][415136.0.857450601]' |
| | | BaseType: Object |
| | | Description: 'è´¢å¡ééå' |
| | | StructuredName: 'FinancialSalesColumns' |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute ID |
| | | { |
| | | #keys: '3[415136.0.857450536][415136.0.857450535][415136.0.857450537]' |
| | | IsReadOnly: true |
| | | ValueType: String |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute IsImport |
| | | { |
| | | #keys: '3[415136.0.857450539][415136.0.857450538][415136.0.857450540]' |
| | | ValueType: Boolean |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute IsShow |
| | | { |
| | | #keys: '3[415136.0.857450542][415136.0.857450541][415136.0.857450543]' |
| | | ValueType: Boolean |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute Name |
| | | { |
| | | #keys: '3[415136.0.857450545][415136.0.857450544][415136.0.857450546]' |
| | | Description: 'åç§°' |
| | | ValueType: String |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | DefaultValue |
| | | { |
| | | TargetAttribute: ID |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | DefaultValue |
| | | { |
| | | TargetAttribute: Name |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method Clear |
| | | { |
| | | TextBody: |
| | | [* |
| | | // çå
°é¸½ Jun-25-2024 (created) |
| | | this.FinancialSalesColumn( relflush ); |
| | | this.FinancialSalesRow( relflush ); |
| | | |
| | | this.GenerateColumn( this.FinancialSalesSource().MacroPlan() ); |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method Generate ( |
| | | FinancialProductionSearch search, |
| | | Product_MPs products |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | // çå
°é¸½ Jun-25-2024 (created) |
| | | table := selectobject( this, FinancialSalesSource.FinancialSalesReport, report, not report.IsShow() ); |
| | | allunit := '<All>'; |
| | | //æ¸
空ä¹ååå¨çæ¾ç¤ºæ°æ® |
| | | this.Clear(); |
| | | //è¿æ»¤åç产åid |
| | | productids := selectuniquevalues( products, Elements, product, ( search.Generation() = allunit or product.Generation() = search.Generation() ) |
| | | and ( search.MqbMlb() = allunit or product.MQBMLB() = search.MqbMlb() ) |
| | | and ( search.Power() = allunit or product.Power() = search.Power() ), product.ID() ); |
| | | sumrow := this.FinancialSalesRow( relnew, Name := 'SUM', Unit := search.Unit(), RowNr := table.FinancialSalesRow( relsize ) ); |
| | | traverse( table, FinancialSalesRow, row, row.Unit() = search.Unit() ){ |
| | | productid := construct( Strings ); |
| | | productid.Add( row.Name() ); |
| | | |
| | | if( productids.ContainsAll( productid ) ){ |
| | | showrow := this.FinancialSalesRow( relnew, Name := row.Name(), Unit := row.Unit(), RowNr := row.RowNr() ); |
| | | |
| | | traverse( row, FinancialSalesCell, cell ){ |
| | | column := selectobject( this, FinancialSalesColumn, column, column.Name() = cell.FinancialSalesColumn().Name() ); |
| | | |
| | | sumcell := selectobject( column, FinancialSalesCell, c, c.FinancialSalesRow() = sumrow ); |
| | | if( isnull( sumcell ) ){ |
| | | sumcell := column.FinancialSalesCell( relnew, Value := '0' ); |
| | | sumrow.FinancialSalesCell( relinsert, sumcell ); |
| | | } |
| | | |
| | | showcell := column.FinancialSalesCell( relnew, Value := cell.Value() ); |
| | | showrow.FinancialSalesCell( relinsert, showcell ); |
| | | value := [Real]cell.Value() + [Real]sumcell.Value(); |
| | | sumcell.Value( [String]value ); |
| | | } |
| | | } |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method GenerateColumn ( |
| | | MacroPlan owner |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | // çå
°é¸½ Jun-25-2024 (created) |
| | | startofplanning := owner.StartOfPlanning(); |
| | | startofyear := startofplanning.StartOfYear(); |
| | | startofnextyear := startofplanning.StartOfNextYear(); |
| | | |
| | | for( start := startofyear; start < startofnextyear; start := start.StartOfNextMonth() ){ |
| | | periodtime := start.Date(); |
| | | periodname := periodtime.Format( "M2/D2/Y" ); |
| | | this.FinancialSalesColumn( relnew, Name := periodname, Period := periodtime ); |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method IdentifyNullValues |
| | | { |
| | | TextBody: |
| | | [* |
| | | // å é¤ç©ºè¡æ°æ® |
| | | productcolumn := selectobject( this, FinancialSalesColumn, column, column.Index() = 0 ); |
| | | unitcolumn := selectobject( this, FinancialSalesColumn, column, column.Index() = 1 ); |
| | | //å 餿²¡æå¯¹åºæ¥ææ°æ®çè¡ |
| | | traverse ( this, FinancialSalesRow, row ) { |
| | | if ( forall( row, FinancialSalesCell, cell, true, ( cell.FinancialSalesColumn() <> productcolumn or cell.FinancialSalesColumn() <> unitcolumn ) and cell.Value().TrimBoth() = "" ) ) { |
| | | row.Delete(); |
| | | } |
| | | } |
| | | |
| | | // 夿æ¯å¦åå¨è´æ° |
| | | traverse ( this, FinancialSalesRow.FinancialSalesCell, cell ) { |
| | | if ( cell.FinancialSalesColumn().Index() <= 1 ) { |
| | | if ( cell.Value().TrimBoth() = "" ) { |
| | | error( Translations::MP_FinancialProductionReport_ImportIndetifyNullStrings() ); |
| | | } |
| | | } else { |
| | | if ( cell.Value().TrimBoth() = "" ) { |
| | | cell.Value( '0' ); |
| | | // error( Translations::AC_SalesForecastInputSource_Error6() ); |
| | | } else { |
| | | stn := StringToReal::StandardConverter(); |
| | | if ( not stn.CanConvert( cell.Value().TrimBoth() ) ) { |
| | | error( Translations::MP_FinancialProductionReport_ImportIndetifyIllegalCharacter() ); |
| | | } else { |
| | | if ( stn.Convert( cell.Value().TrimBoth() ) >= 0 ) { |
| | | cell.Value( [String]ceil( stn.Convert( cell.Value().TrimBoth() ) ) ); |
| | | } else { |
| | | error( Translations::MP_FinancialProductionReport_ImportIndetifyNegativeNumber() ); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | cell.FinancialSalesRow().DuplicateValueMarker( cell.FinancialSalesRow().DuplicateValueMarker() + |
| | | ifexpr( cell.FinancialSalesColumn().Index() = 0, "", "-" ) + |
| | | cell.Value() |
| | | ); |
| | | } |
| | | |
| | | // 夿æ¯å¦åå¨é夿°æ® |
| | | row := selectduplicates( this, FinancialSalesRow, row, true, row.DuplicateValueMarker() ); |
| | | if ( row.Size() > 1 ) { |
| | | error( Translations::MP_FinancialProductionReport_ImportIndetifyDuplicateData() ); |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method ImportVerification |
| | | { |
| | | TextBody: |
| | | [* |
| | | // çå
°é¸½ Jun-27-2024 (created) |
| | | owner := this.FinancialSalesSource().MacroPlan(); |
| | | startofthisyear := owner.StartOfPlanning().StartOfYear().Date(); |
| | | startofnextyear := owner.StartOfPlanning().StartOfNextYear().Date(); |
| | | |
| | | if ( exists( this, FinancialSalesColumn, column, ( column.Index() = 0 and column.Name() <> "Product" ) or |
| | | ( column.Index() = 1 and column.Name() <> "Unit" ) ) ){ |
| | | error( Translations::MP_FinancialProductionReport_ImportIndetifyNullStrings() ); |
| | | } |
| | | |
| | | indexcolumn := select( this, FinancialSalesColumn, column, column.Index() = 2 ); |
| | | if ( isnull( indexcolumn ) ) { |
| | | error( Translations::MP_FinancialProductionReport_ImportIndetifyNullStrings() ); |
| | | } else { |
| | | cnv2 := StringToDate::StandardConverter(); |
| | | cnv2.SetCustomConversion(); |
| | | cnv2.CustomFormatString( "dd/MM/yyyy" ); |
| | | |
| | | while ( not isnull( indexcolumn ) ) { |
| | | if ( not cnv2.CanConvert( indexcolumn.Name() ) ) { |
| | | error( Translations::MP_FinancialProductionReport_ImportIndetifyIllegalTime() ); |
| | | } |
| | | period := cnv2.Convert( indexcolumn.Name() ); |
| | | // info( "å¼å§æ¶é´ï¼", this.SalesForecastInputSource().PlanningStartDate().Format( "Y-M2-D2" ), |
| | | // "ç»ææ¶é´ï¼", this.SalesForecastInputSource().PlanningEndDate().Format( "Y-M2-D2" ), |
| | | // "åæ¶é´ï¼", cnv2.Convert( indexColumn.name() ).Format( "Y-M2-D2" ) ); |
| | | // 夿æ¯å¦å¨è®¡å卿å
|
| | | if ( period <= startofthisyear or period >= startofnextyear ) { |
| | | error( Translations::MP_FinancialProductionReport_ImportIndetifyOverPeriod() ); |
| | | } |
| | | indexcolumn := indexcolumn.NextColumn(); |
| | | } |
| | | } |
| | | |
| | | productcolumn := selectobject( this, FinancialSalesColumn, column, column.Index() = 0 ); |
| | | unitcolumn := selectobject( this, FinancialSalesColumn, column, column.Index() = 1 ); |
| | | |
| | | units := selectuniquevalues( unitcolumn, FinancialSalesCell, cell, cell.Value() ); |
| | | if( units.Size() <> 2 or ( units.Find( FinancialProductionReport::GetDefaultCCUnit() ) >= 0 |
| | | and units.Find( FinancialProductionReport::GetDefaultDLUnit() ) >= 0 ) ){ |
| | | error( Translations::MP_FinancialProductionReport_ImportIndetifyFactoryNoExist() ); |
| | | } |
| | | |
| | | products := selectuniquevalues( productcolumn, FinancialSalesCell, cell, cell.Value() ); |
| | | productnames := selectuniquevalues( owner, Product_MP, product, product.ID() ); |
| | | |
| | | if( not productnames.ContainsAll( products ) ){ |
| | | error( Translations::MP_FinancialProductionReport_ImportIndetifyProductNoExist() ); |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method SyncRows |
| | | { |
| | | TextBody: |
| | | [* |
| | | totalRows := 0; |
| | | totalColumns := this.FinancialSalesColumn( relsize ); |
| | | |
| | | if ( totalColumns > 0 ) { |
| | | randomCol := select( this, FinancialSalesColumn, tempFPC, true ); |
| | | totalRows := randomCol.FinancialSalesCell( relsize ); |
| | | |
| | | this.FinancialSalesRow( relflush ); |
| | | |
| | | cells := construct( FinancialSalesCells ); |
| | | traverse ( this, FinancialSalesColumn, fpc ) { |
| | | cells.Add( fpc.FirstCellInColumn() ); |
| | | } |
| | | |
| | | for ( i := 0; i < totalRows; i++ ) { |
| | | assert( selectvalues( cells, Elements, c, true, c.FinancialSalesColumn().Index() ).ToString( "" ) = |
| | | selectvalues( selectsortedset( cells, Elements, c, true, c.FinancialSalesColumn().Index() ), Elements, c, true, c.FinancialSalesColumn().Index() ).ToString( "" ), |
| | | "Assertion error in FrockDataTable::syncRows: Cells not sorted by column index" ); |
| | | row := this.FinancialSalesRow( relnew, RowNr := i ); |
| | | |
| | | newCells := construct( FinancialSalesCells ); |
| | | |
| | | traverse ( cells, Elements, c ) { |
| | | row.FinancialSalesCell( relinsert, c ); |
| | | |
| | | newCells.Add( c.NextCellInColumn() ); |
| | | } |
| | | |
| | | cells := &newCells; |
| | | } |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod GetDefaultAllUnit () const declarative as String |
| | | { |
| | | TextBody: |
| | | [* |
| | | // çå
°é¸½ Jun-25-2024 (created) |
| | | return '<All>'; |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod GetDefaultCCUnit () const as String |
| | | { |
| | | TextBody: |
| | | [* |
| | | // çå
°é¸½ Jun-25-2024 (created) |
| | | return 'é¿æ¥'; |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod GetDefaultDLUnit () const as String |
| | | { |
| | | TextBody: |
| | | [* |
| | | // çå
°é¸½ Jun-25-2024 (created) |
| | | return '大è¿'; |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod GetDefaultName () const as String |
| | | { |
| | | TextBody: |
| | | [* |
| | | // çå
°é¸½ Jun-25-2024 (created) |
| | | return 'Financial productions'; |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | XMLElementId |
| | | { |
| | | XMLAddressType { } |
| | | XMLID Key { } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | XMLElementId |
| | | { |
| | | XMLID QuintiqType { } |
| | | XMLQualifierType { } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | XMLObjectBase.ObjectDefinitions |
| | | { |
| | | IdField: Key |
| | | ObjectTypeField: QuintiqType |
| | | TargetType: FinancialSalesCell |
| | | XMLID cell { } |
| | | Attributes: |
| | | [ |
| | | XMLAttribute |
| | | { |
| | | Attribute: Value |
| | | XMLID value { } |
| | | } |
| | | ] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | XMLObjectBase.ObjectDefinitions |
| | | { |
| | | IdField: Key |
| | | ObjectTypeField: QuintiqType |
| | | TargetType: FinancialSalesColumn |
| | | XMLID column { } |
| | | Aggregates: |
| | | [ |
| | | XMLAggregate |
| | | { |
| | | ElementDefinition: cell |
| | | GenerateOutput: false |
| | | Relation: FinancialSalesCell |
| | | XMLID FinancialSalesCell { } |
| | | } |
| | | ] |
| | | Attributes: |
| | | [ |
| | | XMLAttribute |
| | | { |
| | | Attribute: Name |
| | | XMLID name { } |
| | | } |
| | | ] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | XMLObjectBase.ObjectDefinitions |
| | | { |
| | | IdField: Key |
| | | ObjectTypeField: QuintiqType |
| | | TargetType: FinancialSalesReport |
| | | XMLID table { } |
| | | Aggregates: |
| | | [ |
| | | XMLAggregate |
| | | { |
| | | ElementDefinition: column |
| | | GenerateOutput: false |
| | | Relation: FinancialSalesColumn |
| | | XMLID FinancialSalesColumn { } |
| | | } |
| | | ] |
| | | Attributes: |
| | | [ |
| | | XMLAttribute |
| | | { |
| | | Attribute: Name |
| | | XMLID name { } |
| | | } |
| | | ] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #root |
| | | #parent: #root |
| | | XML FinancialSalesReportXML |
| | | { |
| | | Direction: 'ImportExport' |
| | | Root: table |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | XMLElementId |
| | | { |
| | | XMLAddressType { } |
| | | XMLID Key { } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | XMLElementId |
| | | { |
| | | XMLID QuintiqType { } |
| | | XMLQualifierType { } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | XMLObjectBase.ObjectDefinitions |
| | | { |
| | | IdField: Key |
| | | ObjectTypeField: QuintiqType |
| | | TargetType: FinancialSalesColumn |
| | | XMLID column { } |
| | | Attributes: |
| | | [ |
| | | XMLAttribute |
| | | { |
| | | Attribute: Name |
| | | XMLID name { } |
| | | } |
| | | ] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | XMLObjectBase.ObjectDefinitions |
| | | { |
| | | IdField: Key |
| | | ObjectTypeField: QuintiqType |
| | | TargetType: FinancialSalesReport |
| | | XMLID table { } |
| | | Aggregates: |
| | | [ |
| | | XMLAggregate |
| | | { |
| | | ElementDefinition: column |
| | | GenerateOutput: false |
| | | Relation: FinancialSalesColumn |
| | | XMLID FinancialSalesColumn { } |
| | | } |
| | | ] |
| | | Attributes: |
| | | [ |
| | | XMLAttribute |
| | | { |
| | | Attribute: Name |
| | | XMLID name { } |
| | | } |
| | | ] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #root |
| | | #parent: #root |
| | | XML FinancialSalesReportXMLHeaders |
| | | { |
| | | Direction: 'ImportExport' |
| | | Root: table |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #root |
| | | #parent: #DomainModel |
| | | Type FinancialSalesReport |
| | | { |
| | | #keys: '5[415136.0.857450533][415136.0.857450531][0.0.0][415136.0.857450532][415136.0.857450534]' |
| | | BaseType: Object |
| | | Description: 'è´¢å¡ééæ¥è¡¨' |
| | | StructuredName: 'FinancialSalesReports' |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute DuplicateValueMarker |
| | | { |
| | | #keys: '3[415136.0.857450578][415136.0.857450577][415136.0.857450579]' |
| | | Description: '夿æ¯å¦åå¨éå¤å¼' |
| | | ValueType: String |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute Name |
| | | { |
| | | #keys: '3[415136.0.857450569][415136.0.857450568][415136.0.857450570]' |
| | | ValueType: String |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute RowNr |
| | | { |
| | | #keys: '3[415136.0.857450572][415136.0.857450571][415136.0.857450573]' |
| | | ValueType: Number |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute Unit |
| | | { |
| | | #keys: '3[415136.0.857450575][415136.0.857450574][415136.0.857450576]' |
| | | Description: '产线' |
| | | ValueType: String |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | DefaultValue |
| | | { |
| | | TargetAttribute: DuplicateValueMarker |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | DefaultValue |
| | | { |
| | | TargetAttribute: Name |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | DefaultValue |
| | | { |
| | | TargetAttribute: Unit |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method Filter ( |
| | | FinancialProductionSearch search, |
| | | Product_MPs products |
| | | ) declarative remote as Boolean |
| | | { |
| | | Description: 'è¿æ»¤' |
| | | TextBody: |
| | | [* |
| | | // çå
°é¸½ Jun-24-2024 (created) |
| | | allunit := '<All>'; |
| | | productids := selectuniquevalues( products, Elements, product, ( search.Generation() = allunit or product.Generation() = search.Generation() ) |
| | | and ( search.MqbMlb() = allunit or product.MQBMLB() = search.MqbMlb() ) |
| | | and ( search.Power() = allunit or product.Power() = search.Power() ), product.ID() ); |
| | | |
| | | productid := construct( Strings ); |
| | | productid.Add( this.Name() ); |
| | | |
| | | return productids.ContainsAll( productid ) and this.Unit() = search.Unit(); |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method Initialize ( |
| | | FinancialSalesColumn column, |
| | | String unit |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | // çå
°é¸½ Jun-24-2024 (created) |
| | | cell := column.FinancialSalesCell( relnew, Value := '' ); |
| | | |
| | | this.FinancialSalesCell( relinsert, cell ); |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method Initialize0 ( |
| | | FinancialSalesColumn column, |
| | | Real quantity |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | // çå
°é¸½ Jun-24-2024 (created) |
| | | cell := selectobject( this, FinancialSalesCell, cell, cell.FinancialSalesColumn() = column ); |
| | | |
| | | value := [Real]cell.Value() + quantity; |
| | | cell.Value( [String]value ); |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #root |
| | | #parent: #DomainModel |
| | | Type FinancialSalesRow |
| | | { |
| | | #keys: '5[415136.0.857450566][415136.0.857450564][0.0.0][415136.0.857450565][415136.0.857450567]' |
| | | BaseType: Object |
| | | Description: 'è´¢å¡ééè¡' |
| | | StructuredName: 'FinancialSalesRows' |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute Generation |
| | | { |
| | | #keys: '3[415136.0.857450503][415136.0.857450502][415136.0.857450504]' |
| | | ValueType: String |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute MqbMlb |
| | | { |
| | | #keys: '3[415136.0.857450506][415136.0.857450505][415136.0.857450507]' |
| | | ValueType: String |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute Power |
| | | { |
| | | #keys: '3[415136.0.857450509][415136.0.857450508][415136.0.857450510]' |
| | | ValueType: String |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute Unit |
| | | { |
| | | #keys: '3[415136.0.857450512][415136.0.857450511][415136.0.857450513]' |
| | | Description: '产线' |
| | | ValueType: String |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | DefaultValue |
| | | { |
| | | TargetAttribute: Generation |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | DefaultValue |
| | | { |
| | | TargetAttribute: MqbMlb |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | DefaultValue |
| | | { |
| | | TargetAttribute: Power |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | DefaultValue |
| | | { |
| | | TargetAttribute: Unit |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #root |
| | | #parent: #DomainModel |
| | | Type FinancialSalesSearch |
| | | { |
| | | #keys: '5[415136.0.857450500][415136.0.857450498][0.0.0][415136.0.857450499][415136.0.857450501]' |
| | | BaseType: Object |
| | | Description: 'æ¥è¯¢ç±»' |
| | | StructuredName: 'FinancialSalesSearchs' |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute FileBinaryValue |
| | | { |
| | | #keys: '3[415136.0.857450463][415136.0.857450462][415136.0.857450464]' |
| | | ValueType: BinaryValue |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute IsImport |
| | | { |
| | | #keys: '3[415136.0.857450466][415136.0.857450465][415136.0.857450467]' |
| | | ValueType: Boolean |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute IsXLSX |
| | | { |
| | | #keys: '3[415136.0.857450469][415136.0.857450468][415136.0.857450470]' |
| | | ValueType: Boolean |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute Name |
| | | { |
| | | #keys: '3[415136.0.857450472][415136.0.857450471][415136.0.857450473]' |
| | | ValueType: String |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute UploadDateTime |
| | | { |
| | | #keys: '3[415136.0.857450475][415136.0.857450474][415136.0.857450476]' |
| | | ValueType: String |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute UploadUser |
| | | { |
| | | #keys: '3[415136.0.857450478][415136.0.857450477][415136.0.857450479]' |
| | | ValueType: String |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | DefaultValue |
| | | { |
| | | TargetAttribute: Name |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | DefaultValue |
| | | { |
| | | TargetAttribute: UploadDateTime |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | DefaultValue |
| | | { |
| | | TargetAttribute: UploadUser |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method AfterImport |
| | | { |
| | | TextBody: |
| | | [* |
| | | // çå
°é¸½ Jun-24-2024 (created) |
| | | allunit := FinancialProductionReport::GetDefaultAllUnit(); |
| | | table := selectobject( this.MacroPlan(), FinancialSalesSource.FinancialSalesReport, table, not table.IsImport() and not table.IsShow() ); |
| | | //info( '--------------------------', table.Name() ); |
| | | traverse( this, FinancialSalesReport, report ){ |
| | | productcolumn := selectobject( report, FinancialSalesColumn, column, column.Name() = 'Product' ); |
| | | unitcolumn := selectobject( report, FinancialSalesColumn, column, column.Name() = 'Unit' ); |
| | | // info( '----------------------1-----------------', productcolumn.Name(), unitcolumn.Name() ); |
| | | |
| | | traverse( report, FinancialSalesRow, row ){ |
| | | product := selectobject( row, FinancialSalesCell, cell, cell.FinancialSalesColumn() = productcolumn ); |
| | | unit := selectobject( row, FinancialSalesCell, cell, cell.FinancialSalesColumn() = unitcolumn ); |
| | | // info( '----------------------2-----------------', product.Value(), unit.Value() ); |
| | | |
| | | unitrow := selectobject( table, FinancialSalesRow, unitrow, unitrow.Name() = product.Value() and unitrow.Unit() = unit.Value() ); |
| | | allrow := selectobject( table, FinancialSalesRow, allrow, allrow.Name() = product.Value() and allrow.Unit() = allunit ); |
| | | // info( '----------------------3-----------------', unitrow.Name(), unitrow.Unit() ); |
| | | // and product.Value() = '120 kW Rotor' and unit.Value() = 'Assembly Plant (Spain)' |
| | | traverse( row, FinancialSalesCell, cell, cell.FinancialSalesColumn() <> productcolumn and cell.FinancialSalesColumn() <> unitcolumn ){ |
| | | column := cell.FinancialSalesColumn(); |
| | | unitcell := selectobject( unitrow, FinancialSalesCell, unitcell, unitcell.FinancialSalesColumn().Name() = column.Name() ); |
| | | allcell := selectobject( allrow, FinancialSalesCell, allcell, allcell.FinancialSalesColumn().Name() = column.Name() ); |
| | | // info( isnull( unitcell ), isnull( allcell ), cell.Value(), unitcell.Value(), allcell.Value() ); |
| | | if( not isnull( unitcell ) ){ |
| | | unitcell.Value( cell.Value() ); |
| | | } |
| | | if( not isnull( allcell ) ){ |
| | | value := [Real]cell.Value() + [Real]allcell.Value(); |
| | | allcell.Value( [String]value ); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method IsExistFutureMonthData () as Boolean |
| | | { |
| | | TextBody: |
| | | [* |
| | | // çå
°é¸½ Jun-26-2024 (created) |
| | | startofplanning := this.MacroPlan().StartOfPlanning().Date().Format( 'M2/D2/Y' ); |
| | | columns := selectset( this, FinancialSalesReport.FinancialSalesColumn, column, column.Name() > startofplanning ); |
| | | return exists( columns, Elements.FinancialSalesCell, cell, cell.Value() <> '' ); |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method ReadStructure |
| | | { |
| | | TextBody: |
| | | [* |
| | | tableGroupHandle := TableGroupHandle::Create( this.Name() ); |
| | | tableGroupHandle := XLS::LoadTableGroupFromBinaryData( this.FileBinaryValue().AsBinaryData(), tableGroupHandle, true, this.IsXLSX() ); |
| | | sheets := tableGroupHandle.TableNames(); |
| | | |
| | | traverse ( sheets, Elements, sheetName ) { |
| | | tableHandle := tableGroupHandle.Table( sheetName ); |
| | | tableXML := TableHandle::ExportXML( tableHandle ); |
| | | |
| | | // info( tableXML.AsQUILL() ); |
| | | |
| | | FinancialSalesReport::XMLImportFinancialSalesReportXMLHeaders( tableXML ); |
| | | xlstable := FinancialSalesReport::XMLImportFinancialSalesReportXML( tableXML ); |
| | | |
| | | xlstable.SyncRows(); |
| | | |
| | | xlstable.Name( sheetName ); |
| | | xlstable.IsImport( true ); |
| | | this.FinancialSalesReport( relinsert, &xlstable ); |
| | | |
| | | Transaction::Transaction().Propagate( attribute( FinancialSalesColumn, Index ) ); |
| | | |
| | | // ï¼å¯¼å
¥åï¼ç»ç©ºå¼èµäºé»è®¤å¼ï¼N/Aï¼,å¹¶ä¸å é¤ç©ºè¡æ°æ®åæ°æ®æ ¡éª |
| | | xlstable.IdentifyNullValues(); |
| | | |
| | | xlstable.ImportVerification(); |
| | | } |
| | | //导å
¥åå¤çæ°æ® |
| | | //this.AfterImport(); |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod Download ( |
| | | MacroPlan macroPlan |
| | | ) as BinaryValue |
| | | { |
| | | Description: 'ä¸è½½è´¢å¡æ¥è¡¨æ°æ®' |
| | | TextBody: |
| | | [* |
| | | |
| | | table := selectobject( macroPlan, FinancialProductionSource.FinancialProductionReport, table, not table.IsImport() and 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 |
| | | productcolumnelement := xmlDOM.CreateElement( "column" ); |
| | | productnameelement := xmlDOM.CreateElement( "name" ); |
| | | producttypeelement := xmlDOM.CreateElement( "type" ); |
| | | productnameelement.TextContent( 'Product' ); |
| | | producttypeelement.TextContent( "String" ); |
| | | productcolumnelement.AppendChild( productnameelement ); |
| | | productcolumnelement.AppendChild( producttypeelement ); |
| | | //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( productcolumnelement ); |
| | | tableElement.AppendChild( unitcolumnelement ); |
| | | traverse ( table, FinancialProductionColumn, column ) { |
| | | 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 ); |
| | | |
| | | cells := selectsortedset( column, FinancialProductionCell, cell, cell.FinancialProductionRow().RowNr() ); |
| | | |
| | | traverse ( cells, Elements, c ) { |
| | | if( column.Index() = 0 ){ |
| | | row := c.FinancialProductionRow(); |
| | | //Product |
| | | productcellElement := xmlDOM.CreateElement( "cell" ); |
| | | productcellElement.SetAttribute( "value", row.Name() ); |
| | | productcolumnelement.AppendChild( productcellElement ); |
| | | //Unit |
| | | unitcellElement := xmlDOM.CreateElement( "cell" ); |
| | | unitcellElement.SetAttribute( "value", row.Unit() ); |
| | | unitcolumnelement.AppendChild( unitcellElement ); |
| | | } |
| | | cellElement := xmlDOM.CreateElement( "cell" ); |
| | | cellElement.SetAttribute( "value", c.Value() ); |
| | | columnelement.AppendChild( cellElement ); |
| | | } |
| | | tableElement.AppendChild( columnelement ); |
| | | } |
| | | |
| | | xmlString := xmlDOMI.CreateSerializer().WriteToString( xmlDOM ) |
| | | |
| | | //info( xmlString ); |
| | | |
| | | tableGroupHandle := TableGroupHandle::Create( FinancialProductionReport::GetDefaultName() ); |
| | | tableHandle := TableHandle::ImportXML( BinaryValue::Construct( xmlString ) ); |
| | | tableGroupHandle.Add( tableHandle ); |
| | | |
| | | binaryData := XLS::SaveTableGroupToBinaryData( tableGroupHandle, true ); |
| | | |
| | | return binaryData.AsBinaryValue(); |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod DownloadTemplate ( |
| | | MacroPlan macroPlan |
| | | ) as BinaryValue |
| | | { |
| | | TextBody: |
| | | [* |
| | | xmlDOMI := XMLDOMImplementation::Create(); |
| | | xmlDOM := xmlDOMI.CreateDocumentFromString( '<?xml version="1.0" encoding="UTF-16"?><table><name>Sheet1</name><column><name>Product</name><type>String</type></column><column><name>Unit</name><type>String</type></column></table>' ); |
| | | |
| | | tableElement := xmlDOM.GetElementByTagName( "table", 0 ); |
| | | |
| | | startofyear := macroPlan.StartOfPlanning().StartOfYear(); |
| | | startofnextyear := macroPlan.StartOfPlanning().StartOfNextYear(); |
| | | |
| | | for( start := startofyear; start < startofnextyear; start := start.StartOfNextMonth() ){ |
| | | columnElement := xmlDOM.CreateElement( "column" ); |
| | | nameElement := xmlDOM.CreateElement( "name" ); |
| | | typeElement := xmlDOM.CreateElement( "type" ); |
| | | nameElement.TextContent( start.Format( "M2/D2/Y" ) ); |
| | | typeElement.TextContent( "String" ); |
| | | columnElement.AppendChild( nameElement ); |
| | | columnElement.AppendChild( typeElement ); |
| | | tableElement.AppendChild( columnElement ); |
| | | } |
| | | |
| | | xmlString := xmlDOMI.CreateSerializer().WriteToString( xmlDOM ) |
| | | |
| | | //info( xmlString ); |
| | | |
| | | tableGroupHandle := TableGroupHandle::Create( FinancialProductionReport::GetDefaultName() ); |
| | | tableHandle := TableHandle::ImportXML( BinaryValue::Construct( xmlString ) ); |
| | | tableGroupHandle.Add( tableHandle ); |
| | | |
| | | binaryData := XLS::SaveTableGroupToBinaryData( tableGroupHandle, true ); |
| | | |
| | | return binaryData.AsBinaryValue(); |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod Initialize ( |
| | | MacroPlan owner |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | // çå
°é¸½ Jun-24-2024 (created) |
| | | owner.FinancialProductionSource( relflush ); |
| | | ccunit := FinancialProductionReport::GetDefaultCCUnit(); |
| | | dlunit := FinancialProductionReport::GetDefaultDLUnit(); |
| | | allunit := FinancialProductionReport::GetDefaultAllUnit(); |
| | | source := owner.FinancialProductionSource( relnew, IsImport := false, Name := FinancialProductionReport::GetDefaultName() ); |
| | | table := source.FinancialProductionReport( relnew, ID := source.Name(), Name := source.Name(), IsImport := false ); |
| | | showtable := source.FinancialProductionReport( relnew, ID := source.Name() + 'Show', Name := source.Name(), IsImport := false, IsShow := true ); |
| | | startofplanning := owner.StartOfPlanning(); |
| | | startofnextmonth := owner.StartOfPlanning().StartOfNextMonth(); |
| | | startofyear := startofplanning.StartOfYear(); |
| | | startofnextyear := startofplanning.StartOfNextYear(); |
| | | |
| | | search := source.FinancialProductionSearch( relnew, Unit := allunit, Generation := allunit, MqbMlb := allunit, Power := allunit ); |
| | | |
| | | products := construct( Product_MPs ); |
| | | |
| | | table.GenerateColumn( owner ); |
| | | |
| | | traverse( owner, Product_MP.ProductInStockingPoint_MP, pisp, pisp.Product_MP().IsLeaf() and ( pisp.StockingPoint_MP().UnitID() = ccunit or pisp.StockingPoint_MP().UnitID() = dlunit ) ){ |
| | | unit := pisp.StockingPoint_MP().UnitID(); |
| | | info( unit, pisp.ProductID() ); |
| | | ccrow := null( FinancialProductionRow ); |
| | | dlrow := null( FinancialProductionRow ); |
| | | allrow := selectobject( table, FinancialProductionRow, row, row.Name() = pisp.ProductID() and row.Unit() = allunit ); |
| | | if( unit = ccunit ){ |
| | | ccrow := table.FinancialProductionRow( relnew, Name := pisp.ProductID(), Unit := unit ); |
| | | }else{ |
| | | dlrow := table.FinancialProductionRow( relnew, Name := pisp.ProductID(), Unit := unit ); |
| | | } |
| | | if( isnull( allrow ) ){ |
| | | products.Add( pisp.Product_MP() ); |
| | | allrow := table.FinancialProductionRow( relnew, Name := pisp.ProductID(), Unit := allunit ); |
| | | } |
| | | |
| | | for( start := startofyear; start < startofnextyear; start := start.StartOfNextMonth() ){ |
| | | periodtime := start.Date(); |
| | | periodname := periodtime.Format( "M2/D2/Y" ); |
| | | column := selectobject( table, FinancialProductionColumn, column, column.Name() = periodname and column.Period() = periodtime ); |
| | | |
| | | if( not isnull( ccrow ) ){ |
| | | ccrow.Initialize( column, ccunit ); |
| | | } |
| | | if( not isnull( dlrow ) ){ |
| | | dlrow.Initialize( column, dlunit ); |
| | | } |
| | | if( not exists( allrow, FinancialProductionCell, allcell, allcell.FinancialProductionColumn() = column ) ){ |
| | | allrow.Initialize( column, allunit ); |
| | | } |
| | | } |
| | | |
| | | traverse( pisp, ProductInStockingPointInPeriod, pispip, pispip.Start() >= startofplanning |
| | | and ( ( pispip.Start() < startofnextmonth and pispip.Period_MP().TimeUnit() = Translations::MP_GlobalParameters_Day() ) |
| | | or ( pispip.Start() < startofnextyear and pispip.Period_MP().TimeUnit() = Translations::MP_GlobalParameters_Month() ) ) ){ |
| | | periodtime := pispip.Start().StartOfMonth().Date(); |
| | | periodname := periodtime.Format( "M2/D2/Y" ); |
| | | |
| | | column := selectobject( table, FinancialProductionColumn, column, column.Name() = periodname and column.Period() = periodtime ); |
| | | |
| | | if( not isnull( ccrow ) ){ |
| | | ccrow.Initialize( column, pispip.NewSupplyProductionQuantity() ); |
| | | } |
| | | if( not isnull( dlrow ) ){ |
| | | dlrow.Initialize( column, pispip.NewSupplyProductionQuantity() ); |
| | | } |
| | | allrow.Initialize( column, pispip.NewSupplyProductionQuantity() ); |
| | | } |
| | | } |
| | | rows := selectsortedset( table, FinancialProductionRow, row, row.Name() ); |
| | | i := 0; |
| | | traverse( rows, Elements, e ){ |
| | | e.RowNr( i ); |
| | | i := i + 1; |
| | | } |
| | | showtable.Generate( search, products ); |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod Upload ( |
| | | MacroPlan owner, |
| | | BinaryValue binaryValue, |
| | | String filePath |
| | | ) as FinancialProductionSource |
| | | { |
| | | TextBody: |
| | | [* |
| | | fileName := filePath.Tokenize( "\" ).Element( filePath.Tokenize( "\" ).Size() - 1 ); |
| | | |
| | | source := owner.FinancialProductionSource( relnew, FileBinaryValue := binaryValue, |
| | | Name := fileName, |
| | | IsXLSX := fileName.EndsWith( "xlsx" ), |
| | | IsImport := true, |
| | | UploadDateTime := DateTime::ActualTime().Format( "Y-M2-D2 H:m:s" ), |
| | | UploadUser := guard( QuintiqUser::CurrentUser().Username(), "" ) ); |
| | | |
| | | return source; |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #root |
| | | #parent: #DomainModel |
| | | Type FinancialSalesSource |
| | | { |
| | | #keys: '5[415136.0.857450460][415136.0.857450458][0.0.0][415136.0.857450459][415136.0.857450461]' |
| | | BaseType: Object |
| | | Description: 'è´¢å¡ééæ¥è¡¨' |
| | | StructuredName: 'FinancialSalesSources' |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #root |
| | | #parent: MacroPlannerWebApp |
| | | OrphanComponent FormFinancialSalesReport |
| | | { |
| | | #keys: '[415136.0.857870750]' |
| | | BaseType: 'WebForm' |
| | | Children: |
| | | [ |
| | | Component DataHolderTable id:DataHolderTable_847 |
| | | { |
| | | #keys: '[415136.0.857870828]' |
| | | BaseType: 'WebDataHolder' |
| | | Databinding: 'FinancialSalesReport' |
| | | Properties: |
| | | [ |
| | | Taborder: 0 |
| | | ] |
| | | } |
| | | Component dhSearch id:dhSearch_424 |
| | | { |
| | | #keys: '[415136.0.857870874]' |
| | | BaseType: 'WebDataHolder' |
| | | Databinding: 'FinancialSalesSearch' |
| | | Properties: |
| | | [ |
| | | Taborder: 1 |
| | | ] |
| | | } |
| | | ] |
| | | } |