/// <summary> /// Retrieves the financial period with the same <see cref="MasterFinPeriod.PeriodNbr"/> /// as the one specified, but residing in the previous financial year. /// If no such period exists, returns <c>null</c>. /// </summary> public string GetSamePeriodInPreviousYear(string financialPeriodID) { if (financialPeriodID == null) { return(null); } PXGraph graph = PXGraph.CreateInstance <MasterFinPeriodMaint>(); try { IFinPeriodRepository finPeriodRepository = graph.GetService <IFinPeriodRepository>(); string resultingPeriodID = finPeriodRepository.GetSamePeriodInPreviousYear(financialPeriodID, FinPeriod.organizationID.MasterValue); return(FinPeriodIDFormattingAttribute.FormatForDisplay(resultingPeriodID)); } catch (PXFinPeriodException) { return(null); } }