Solved

How to Programmatically Open/Close Financial Period

  • 19 April 2024
  • 7 replies
  • 78 views

Userlevel 1
Badge

Hi Team

We have a requirement where on payment save we have to programmatically open the financial periods, if closed. I have tried to Implement logic in ARPaymentEntry graph on Save but it is not working as expected, can you help please to achieve this.

public delegate void PersistDelegate();
[PXOverride]
public void Persist(PersistDelegate del)
{
if (Base.Document.Current != null/* && Base.IsImport == true*/)
{

FinPeriodStatusProcess finPeriodStatusProcess = PXGraph.CreateInstance<FinPeriodStatusProcess>();
finPeriodStatusProcess.Filter.Current.Action = FinPeriodStatusProcessParameters.action.Open;
finPeriodStatusProcess.Filter.Current.FromYear = "2024";
finPeriodStatusProcess.Filter.Current.ToYear = "2024";

string month = "202404";
string year = "2024";
FinPeriod masterFinPeriod = PXSelect<FinPeriod, Where<FinPeriod.finPeriodID, Equal<Required<FinPeriod.finPeriodID>>,
And<FinPeriod.finYear, Equal<Required<FinPeriod.finYear>>>>>.Select(Base, month, year);
finPeriodStatusProcess.FinPeriods.Current = masterFinPeriod;

masterFinPeriod.Selected = true;
// masterFinPeriod.Closed = true;
masterFinPeriod.Status = "Open";
finPeriodStatusProcess.FinPeriods.Update(masterFinPeriod);

finPeriodStatusProcess.Actions["Process"].Press();
}
del();
}

Thank you In Advance.

icon

Best answer by Laura02 22 April 2024, 17:45

View original

7 replies

Badge +18

Hello, 

Did you consider adding the AR Payment user to the Financial Supervisor role, and leaving period status as is?

Members of Financial Supervisor role may post to closed periods without re-opening/re-closing any periods.

 

Laura

Userlevel 1
Badge

Hi @Laura02 

Thank you for the response.

Did you consider adding the AR Payment user to the Financial Supervisor role, and leaving period status as is? - Can you please suggest how we can do that ?

Members of Financial Supervisor role may post to closed periods without re-opening/re-closing any periods. - Not sure on this as we have to re-open the financial periods through code. So if  a payment is getting created, user does not have to specifically go to Financial Period screen and re-open the periods.

Badge +18

Hello,

Place the AR User in the Financial Supervisor role in Users screen as shown.

Members of Financial Supervisor may post to closed periods without reopen.

From the Acumatica Help:

Hope this helps! 

Laura

Userlevel 1
Badge

Hi @Laura02 

We enabled the suggested modification and verified the implementation but it is not working as expected.

Badge +18

Hello,

Please post a screen shot of what happens when your AR user who is in the financial supervisor’s role attempts to post a payment to a closed period.

It’s important to know the status of the periods - In this case, Periods should be Closed, not Locked status.

Thank you.

Laura

Userlevel 1
Badge

Hi @Laura02 

We have activated the Financial Supervisor role and verified with the Implemented code but still facing the Issue in Payment and Applications screen.

Please find the below screen shots.


​​​

Thank you

Badge +18

Hello,

To post any transaction in period 04-2024, from any screen, the status of the period must be Open.  Unless your users are posting into the future, it is normal for current Periods (April 2024) to be Open status.  Click Checkbox then Process as shown, or click Process All to open all periods of 2024.

Laura

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved