uzerpllp / uzerp

uzERP - Open Source Business Management
http://www.uzerp.com
Other
55 stars 25 forks source link

Changes to postponed VAT Accounting (PVA) entry #237

Closed mshiner closed 3 years ago

mshiner commented 3 years ago

There are a couple of issues that I think we need to fix in the UI:

  1. The date field is set based on the date of first invoice in the drop down list but I don't believe it is ajaxed (or it is not firing correctly) when a different invoice is selected
  2. I think ajax is firing when the period is changed which seems to reset the invoice - I guess we need to 'chain' the ajaxing as follows... selected invoice date->posting date ->glperiod
  3. HOWEVER - the posting date also needs to be amended/entered by the user to match the PVA statement from HMRC.... this may (or may not) change the period so I guess we need to ajax the glperiod based on any date change made by the user

In addition, when posting the PVA entry we potentially need to be able to post into a closed glperiod (i.e. as per the list of periods in the dropdown) IF the related VAT period is still open to take a account of the fact that the PVA statement from HMRC can take up to a week to arrive.

Posting into prior periods is blocked at present, except for year end journals, but because the PVA posting is a 'zero balance' transaction with both the debt and credit to a single gl account this won't affect the trial balance for the closed period.

steveblamey commented 3 years ago

The date should be updated when an invoice is selected/changed but the javascript is not targeting the correct form control.

The periods available are selected based on their tax period status. Any GL period that has an open tax period will be listed.

The GLTransaction::makePVAEntry function should set the $cp_override parameter when calling the GLTransaction::Factory. That will disable the closed period check for the creation of these transaction records.