_Main/BL/InfoMessages.qbl | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
_Main/BL/Type_FinancialProductionReport/Method_IdentifyNullValues.qbl | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
_Main/BL/Type_FinancialProductionReport/Method_ImportVerification.qbl | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
_Main/BL/Type_FinancialProductionRow/Attribute_DuplicateValueMarker.qbl | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
_Main/BL/Type_FinancialProductionRow/DefaultValue_DuplicateValueMarker.qbl | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
_Main/BL/Type_FinancialProductionSource/Method_ReadStructure.qbl | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
_Main/BL/InfoMessages.qbl
@@ -98,6 +98,38 @@ { DefaultText: 'The two products selected are the same.' } InfoMessage MP_FinancialProductionReport_ImportIndetifyDuplicateData { DefaultText: 'There is duplicate data present.' } InfoMessage MP_FinancialProductionReport_ImportIndetifyFactoryNoExist { DefaultText: 'Factory does not exist.' } InfoMessage MP_FinancialProductionReport_ImportIndetifyIllegalCharacter { DefaultText: 'The required quantity contains illegal characters.' } InfoMessage MP_FinancialProductionReport_ImportIndetifyIllegalTime { DefaultText: 'The required period contains illegal time.' } InfoMessage MP_FinancialProductionReport_ImportIndetifyNegativeNumber { DefaultText: 'The required quantity includes negative numbers.' } InfoMessage MP_FinancialProductionReport_ImportIndetifyNullStrings { DefaultText: 'Required fields contain empty data.' } InfoMessage MP_FinancialProductionReport_ImportIndetifyOverPeriod { DefaultText: 'The template month is not within the planning cycle.' } InfoMessage MP_FinancialProductionReport_ImportIndetifyProductNoExist { DefaultText: 'Product does not exist.' } InfoMessage MP_FinancialProductionReport_Question { DefaultText: 'å¯¼å ¥æ¨¡æ¿å 嫿ªæ¥æä»½çè´¢å¡æ°æ®ï¼æ¯å¦è¦çç³»ç»è®¡ç®ç»æï¼' _Main/BL/Type_FinancialProductionReport/Method_IdentifyNullValues.qbl
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,53 @@ Quintiq file version 2.0 #parent: #root Method IdentifyNullValues { TextBody: [* // å é¤ç©ºè¡æ°æ® productcolumn := selectobject( this, FinancialProductionColumn, column, column.Index() = 0 ); unitcolumn := selectobject( this, FinancialProductionColumn, column, column.Index() = 1 ); //å 餿²¡æå¯¹åºæ¥ææ°æ®çè¡ traverse ( this, FinancialProductionRow, row ) { if ( forall( row, FinancialProductionCell, cell, true, ( cell.FinancialProductionColumn() <> productcolumn or cell.FinancialProductionColumn() <> unitcolumn ) and cell.Value().TrimBoth() = "" ) ) { row.Delete(); } } // 夿æ¯å¦åå¨è´æ° traverse ( this, FinancialProductionRow.FinancialProductionCell, cell ) { if ( cell.FinancialProductionColumn().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.FinancialProductionRow().DuplicateValueMarker( cell.FinancialProductionRow().DuplicateValueMarker() + ifexpr( cell.FinancialProductionColumn().Index() = 0, "", "-" ) + cell.Value() ); } // 夿æ¯å¦åå¨é夿°æ® row := selectduplicates( this, FinancialProductionRow, row, true, row.DuplicateValueMarker() ); if ( row.Size() > 1 ) { error( Translations::MP_FinancialProductionReport_ImportIndetifyDuplicateData() ); } *] } _Main/BL/Type_FinancialProductionReport/Method_ImportVerification.qbl
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,57 @@ Quintiq file version 2.0 #parent: #root Method ImportVerification { TextBody: [* // çå °é¸½ Jun-27-2024 (created) owner := this.FinancialProductionSource().MacroPlan(); startofthisyear := owner.StartOfPlanning().StartOfYear().Date(); startofnextyear := owner.StartOfPlanning().StartOfNextYear().Date(); if ( exists( this, FinancialProductionColumn, column, ( column.Index() = 0 and column.Name() <> "Product" ) or ( column.Index() = 1 and column.Name() <> "Unit" ) ) ){ error( Translations::MP_FinancialProductionReport_ImportIndetifyNullStrings() ); } indexcolumn := select( this, FinancialProductionColumn, 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, FinancialProductionColumn, column, column.Index() = 0 ); unitcolumn := selectobject( this, FinancialProductionColumn, column, column.Index() = 1 ); units := selectuniquevalues( unitcolumn, FinancialProductionCell, 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, FinancialProductionCell, cell, cell.Value() ); productnames := selectuniquevalues( owner, Product_MP, product, product.ID() ); if( not productnames.ContainsAll( products ) ){ error( Translations::MP_FinancialProductionReport_ImportIndetifyProductNoExist() ); } *] } _Main/BL/Type_FinancialProductionRow/Attribute_DuplicateValueMarker.qbl
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,8 @@ Quintiq file version 2.0 #parent: #root Attribute DuplicateValueMarker { #keys: '3[415136.0.857450433][415136.0.857450432][415136.0.857450434]' Description: '夿æ¯å¦åå¨éå¤å¼' ValueType: String } _Main/BL/Type_FinancialProductionRow/DefaultValue_DuplicateValueMarker.qbl
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,6 @@ Quintiq file version 2.0 #parent: #root DefaultValue { TargetAttribute: DuplicateValueMarker } _Main/BL/Type_FinancialProductionSource/Method_ReadStructure.qbl
@@ -24,6 +24,11 @@ this.FinancialProductionReport( relinsert, &xlstable ); Transaction::Transaction().Propagate( attribute( FinancialProductionColumn, Index ) ); // ï¼å¯¼å ¥åï¼ç»ç©ºå¼èµäºé»è®¤å¼ï¼N/Aï¼,å¹¶ä¸å é¤ç©ºè¡æ°æ®åæ°æ®æ ¡éª xlstable.IdentifyNullValues(); xlstable.ImportVerification(); } //å¯¼å ¥åå¤çæ°æ® //this.AfterImport();