| | |
| | | { |
| | | DefaultText: 'The two products selected are the same.' |
| | | } |
| | | InfoMessage MP_FinancialProductionReport_Question |
| | | { |
| | | DefaultText: '导å
¥æ¨¡æ¿å
嫿ªæ¥æä»½çè´¢å¡æ°æ®ï¼æ¯å¦è¦çç³»ç»è®¡ç®ç»æï¼' |
| | | } |
| | | InfoMessage MP_LibCal_EventType_Exist |
| | | { |
| | | DefaultText: 'The ID or name is the same.' |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute IsShow |
| | | { |
| | | #keys: '3[415136.0.853939545][415136.0.853939544][415136.0.853939546]' |
| | | ValueType: Boolean |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method Clear |
| | | { |
| | | TextBody: |
| | | [* |
| | | // çå
°é¸½ Jun-25-2024 (created) |
| | | this.FinancialProductionColumn( relflush ); |
| | | this.FinancialProductionRow( relflush ); |
| | | |
| | | this.GenerateColumn( this.FinancialProductionSource().MacroPlan() ); |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method Generate ( |
| | | FinancialProductionSearch search, |
| | | Product_MPs products |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | // çå
°é¸½ Jun-25-2024 (created) |
| | | table := selectobject( this, FinancialProductionSource.FinancialProductionReport, 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.FinancialProductionRow( relnew, Name := 'SUM', Unit := search.Unit(), RowNr := table.FinancialProductionRow( relsize ) ); |
| | | traverse( table, FinancialProductionRow, row, row.Unit() = search.Unit() ){ |
| | | productid := construct( Strings ); |
| | | productid.Add( row.Name() ); |
| | | |
| | | if( productids.ContainsAll( productid ) ){ |
| | | showrow := this.FinancialProductionRow( relnew, Name := row.Name(), Unit := row.Unit(), RowNr := row.RowNr() ); |
| | | |
| | | traverse( row, FinancialProductionCell, cell ){ |
| | | column := selectobject( this, FinancialProductionColumn, column, column.Name() = cell.FinancialProductionColumn().Name() ); |
| | | |
| | | sumcell := selectobject( column, FinancialProductionCell, c, c.FinancialProductionRow() = sumrow ); |
| | | if( isnull( sumcell ) ){ |
| | | sumcell := column.FinancialProductionCell( relnew, Value := '0' ); |
| | | sumrow.FinancialProductionCell( relinsert, sumcell ); |
| | | } |
| | | |
| | | showcell := column.FinancialProductionCell( relnew, Value := cell.Value() ); |
| | | showrow.FinancialProductionCell( 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.FinancialProductionColumn( relnew, Name := periodname, Period := periodtime ); |
| | | } |
| | | *] |
| | | } |
| | |
| | | [* |
| | | // çå
°é¸½ Jun-24-2024 (created) |
| | | allunit := FinancialProductionReport::GetDefaultAllUnit(); |
| | | table := selectobject( this.MacroPlan(), FinancialProductionSource.FinancialProductionReport, table, not table.IsImport() ); |
| | | table := selectobject( this.MacroPlan(), FinancialProductionSource.FinancialProductionReport, table, not table.IsImport() and not table.IsShow() ); |
| | | //info( '--------------------------', table.Name() ); |
| | | traverse( this, FinancialProductionReport, report ){ |
| | | productcolumn := selectobject( report, FinancialProductionColumn, column, column.Name() = 'Product' ); |
| | | unitcolumn := selectobject( report, FinancialProductionColumn, column, column.Name() = 'Unit' ); |
| | | // info( '----------------------1-----------------', productcolumn.Name(), unitcolumn.Name() ); |
| | | |
| | | traverse( report, FinancialProductionRow, row ){ |
| | | product := selectobject( row, FinancialProductionCell, cell, cell.FinancialProductionColumn() = productcolumn ); |
| | | unit := selectobject( row, FinancialProductionCell, cell, cell.FinancialProductionColumn() = unitcolumn ); |
| | | // info( '----------------------2-----------------', product.Value(), unit.Value() ); |
| | | |
| | | unitrow := selectobject( table, FinancialProductionRow, unitrow, unitrow.Name() = product.Value() and unitrow.Unit() = unit.Value() ); |
| | | allrow := selectobject( table, FinancialProductionRow, allrow, allrow.Name() = product.Value() and allrow.Unit() = allunit ); |
| | | |
| | | traverse( row, FinancialProductionCell, cell, cell.FinancialProductionColumn() <> productcolumn and cell.FinancialProductionColumn() <> unitcolumn and product.Value() = '120 kW Rotor' and unit.Value() = 'Assembly Plant (Spain)' ){ |
| | | // info( '----------------------3-----------------', unitrow.Name(), unitrow.Unit() ); |
| | | // and product.Value() = '120 kW Rotor' and unit.Value() = 'Assembly Plant (Spain)' |
| | | traverse( row, FinancialProductionCell, cell, cell.FinancialProductionColumn() <> productcolumn and cell.FinancialProductionColumn() <> unitcolumn ){ |
| | | column := cell.FinancialProductionColumn(); |
| | | unitcell := selectobject( unitrow, FinancialProductionCell, unitcell, unitcell.FinancialProductionColumn().Name() = column.Name() ); |
| | | allcell := selectobject( allrow, FinancialProductionCell, allcell, allcell.FinancialProductionColumn().Name() = column.Name() ); |
| | | info( isnull( unitcell ), isnull( allcell ), cell.Value(), unitcell.Value(), allcell.Value() ); |
| | | // info( isnull( unitcell ), isnull( allcell ), cell.Value(), unitcell.Value(), allcell.Value() ); |
| | | if( not isnull( unitcell ) ){ |
| | | unitcell.Value( cell.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, FinancialProductionReport.FinancialProductionColumn, column, column.Name() > startofplanning ); |
| | | return exists( columns, Elements.FinancialProductionCell, cell, cell.Value() <> '' ); |
| | | *] |
| | | } |
| | |
| | | Transaction::Transaction().Propagate( attribute( FinancialProductionColumn, Index ) ); |
| | | } |
| | | //导å
¥åå¤çæ°æ® |
| | | this.AfterImport(); |
| | | //this.AfterImport(); |
| | | *] |
| | | } |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod Download ( |
| | | MacroPlan macroPlan, |
| | | Boolean istemplate |
| | | MacroPlan macroPlan |
| | | ) as BinaryValue |
| | | { |
| | | Description: 'ä¸è½½è´¢å¡æ¥è¡¨æ°æ®' |
| | | TextBody: |
| | | [* |
| | | startofplanning := macroPlan.StartOfPlanning().Date(); |
| | | allunit := FinancialProductionReport::GetDefaultAllUnit(); |
| | | table := selectobject( macroPlan, FinancialProductionSource.FinancialProductionReport, table, not table.IsImport() ); |
| | | |
| | | 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.AppendChild( productcolumnelement ); |
| | | tableElement.AppendChild( unitcolumnelement ); |
| | | traverse ( table, FinancialProductionColumn, column, not istemplate or column.Period() < startofplanning ) { |
| | | traverse ( table, FinancialProductionColumn, column ) { |
| | | columnelement := xmlDOM.CreateElement( "column" ); |
| | | nameelement := xmlDOM.CreateElement( "name" ); |
| | | typeelement := xmlDOM.CreateElement( "type" ); |
| | |
| | | columnelement.AppendChild( nameelement ); |
| | | columnelement.AppendChild( typeelement ); |
| | | |
| | | cells := selectsortedset( column, FinancialProductionCell, cell, cell.FinancialProductionRow().Unit() <> allunit, cell.FinancialProductionRow().Name() ); |
| | | cells := selectsortedset( column, FinancialProductionCell, cell, cell.FinancialProductionRow().RowNr() ); |
| | | |
| | | traverse ( cells, Elements, c ) { |
| | | if( column.Index() = 0 ){ |
| | |
| | | unitcolumnelement.AppendChild( unitcellElement ); |
| | | } |
| | | cellElement := xmlDOM.CreateElement( "cell" ); |
| | | if( istemplate ){ |
| | | cellElement.SetAttribute( "value", '' ); |
| | | }else{ |
| | | cellElement.SetAttribute( "value", c.Value() ); |
| | | } |
| | | cellElement.SetAttribute( "value", c.Value() ); |
| | | columnelement.AppendChild( cellElement ); |
| | | } |
| | | tableElement.AppendChild( columnelement ); |
| | |
| | | tableElement := xmlDOM.GetElementByTagName( "table", 0 ); |
| | | |
| | | startofyear := macroPlan.StartOfPlanning().StartOfYear(); |
| | | startofplanning := macroPlan.StartOfPlanning(); |
| | | startofnextyear := macroPlan.StartOfPlanning().StartOfNextYear(); |
| | | |
| | | for( start := startofyear; start < startofplanning; start := start.StartOfNextMonth() ){ |
| | | for( start := startofyear; start < startofnextyear; start := start.StartOfNextMonth() ){ |
| | | columnElement := xmlDOM.CreateElement( "column" ); |
| | | nameElement := xmlDOM.CreateElement( "name" ); |
| | | typeElement := xmlDOM.CreateElement( "type" ); |
| | |
| | | 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(); |
| | | |
| | | source.FinancialProductionSearch( relnew, Unit := allunit, Generation := allunit, MqbMlb := allunit, Power := allunit ); |
| | | 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(); |
| | |
| | | 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 ); |
| | | } |
| | | |
| | |
| | | periodtime := start.Date(); |
| | | periodname := periodtime.Format( "M2/D2/Y" ); |
| | | column := selectobject( table, FinancialProductionColumn, column, column.Name() = periodname and column.Period() = periodtime ); |
| | | |
| | | if( isnull( column ) ){ |
| | | column := table.FinancialProductionColumn( relnew, Name := periodname, Period := periodtime ); |
| | | } |
| | | |
| | | if( not isnull( ccrow ) ){ |
| | | ccrow.Initialize( column, ccunit ); |
| | |
| | | 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 ); |
| | | *] |
| | | } |
| | |
| | | Properties: |
| | | [ |
| | | DataType: 'FinancialProductionReport' |
| | | FilterArguments: 'products:QLibMacroPlannerWebUI::ApplicationMacroPlanner.DataHolderProduct;search:QMacroPlanner::FormFinancialProductionReport.dhSearch' |
| | | FixedFilter: 'object.Filter( search, products )' |
| | | Source: 'DataHolderTable' |
| | | Taborder: 0 |
| | | Transformation: 'FinancialProductionRow' |
| | |
| | | Properties: |
| | | [ |
| | | Legend: 'Name' |
| | | SortCriteria: 'Name' |
| | | SortCriteria: 'RowNr' |
| | | Taborder: 1 |
| | | ] |
| | | } |
| | |
| | | Body: |
| | | [* |
| | | //åå§å |
| | | //if( not exists( MacroPlan, FinancialProductionSource, source, not source.IsImport() ) ){ |
| | | if( not exists( MacroPlan, FinancialProductionSource, source, not source.IsImport() ) ){ |
| | | FinancialProductionSource::Initialize( MacroPlan ); |
| | | //} |
| | | } |
| | | //info( '------------------1----------------' ); |
| | | table := selectobject( MacroPlan, FinancialProductionSource.FinancialProductionReport, table, not table.IsImport() ); |
| | | //info( '------------------2----------------' ); |
| | | table := selectobject( MacroPlan, FinancialProductionSource.FinancialProductionReport, table, not table.IsImport() and table.IsShow() ); |
| | | info( '------------------2----------------', table.IsImport(), table.IsShow() ); |
| | | DataHolderTable.Data( table ); |
| | | |
| | | dhSearch.Data( table.FinancialProductionSource().FinancialProductionSearch() ); |
| | |
| | | { |
| | | Body: |
| | | [* |
| | | binaryValue := FinancialProductionSource::Download( MacroPlan, false ); |
| | | binaryValue := FinancialProductionSource::Download( MacroPlan ); |
| | | |
| | | Application.Download( "Financial productions.xlsx", binaryValue.AsBinaryData() ); |
| | | *] |
| | |
| | | { |
| | | Body: |
| | | [* |
| | | binaryValue := FinancialProductionSource::Download( MacroPlan, true ); |
| | | binaryValue := FinancialProductionSource::DownloadTemplate( MacroPlan ); |
| | | |
| | | Application.Download( "Financial productions.xlsx", binaryValue.AsBinaryData() ); |
| | | *] |
| | |
| | | source := FinancialProductionSource::Upload( MacroPlan, webFileBinaryData, fileName ); |
| | | source.ReadStructure(); |
| | | |
| | | if( not source.IsExistFutureMonthData() or |
| | | ( source.IsExistFutureMonthData() and WebMessageBox::Question( this, Translations::MP_FinancialProductionReport_Question(), 'Yes|No' ) = 0 ) ){ |
| | | source.AfterImport(); |
| | | DataHolderTable.Data().Generate( dhSearch.Data(), DataHolderProduct.Data() ); |
| | | } |
| | | |
| | | WebMessageBox::Success( Translations::A_VWED_Success() ); |
| | | traverse( MacroPlan, FinancialProductionSource, psource, psource.IsImport() and psource <> source ){ |
| | | psource.Delete(); |
| | |
| | | { |
| | | Body: |
| | | [* |
| | | dhSearch.Data().Generation( selection ); |
| | | if( dhSearch.Data().Generation() <> selection ){ |
| | | dhSearch.Data().Generation( selection ); |
| | | DataHolderTable.Data().Generate( dhSearch.Data(), DataHolderProduct.Data() ); |
| | | } |
| | | *] |
| | | GroupServerCalls: false |
| | | } |
| | |
| | | { |
| | | Body: |
| | | [* |
| | | dhSearch.Data().MqbMlb( selection ); |
| | | if( dhSearch.Data().MqbMlb() <> selection ){ |
| | | dhSearch.Data().MqbMlb( selection ); |
| | | DataHolderTable.Data().Generate( dhSearch.Data(), DataHolderProduct.Data() ); |
| | | } |
| | | *] |
| | | GroupServerCalls: false |
| | | } |
| | |
| | | { |
| | | Body: |
| | | [* |
| | | dhSearch.Data().Power( selection ); |
| | | if( dhSearch.Data().Power() <> selection ){ |
| | | dhSearch.Data().Power( selection ); |
| | | DataHolderTable.Data().Generate( dhSearch.Data(), DataHolderProduct.Data() ); |
| | | } |
| | | *] |
| | | GroupServerCalls: false |
| | | } |
| | |
| | | Body: |
| | | [* |
| | | |
| | | valueString := "<All>;Spider Assy Line 1;Body in White Line 3"; |
| | | valueString := "<All>;" + FinancialProductionReport::GetDefaultCCUnit() + ";" + FinancialProductionReport::GetDefaultDLUnit(); |
| | | |
| | | this.Strings( valueString ); |
| | | *] |
| | |
| | | { |
| | | Body: |
| | | [* |
| | | dhSearch.Data().Unit( selection ); |
| | | if( dhSearch.Data().Unit() <> selection ){ |
| | | dhSearch.Data().Unit( selection ); |
| | | DataHolderTable.Data().Generate( dhSearch.Data(), DataHolderProduct.Data() ); |
| | | } |
| | | *] |
| | | GroupServerCalls: false |
| | | } |