You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At Vanga, we have received the request to limit the invoicing of a patient if they are associated with a debtor group that has maxed out its debt limit. That is, when we check to load the debtor group, the invoicing module should show warning that disables the submission of the debtor group has a balance over the limit.
Design
To accomplish this, I'll rename the max_credit field on the debtor_group table to max_debt. I'll change the translation keys around this to "Overdraft Limit", with the description talking about how this will prevent billing patients after the account balance surpasses the limit.
Then, I'll add two checks to the PatientInvoiceFormService when the patient is loaded. First, it will check the account balance using the AccountService.getBalance() function. Next, it will call DebtorGroup.read() to check the max_debt field from the patient's debtor group. If the max_debt value is non-zero, and the account balance (debit - credit) exceeds the max_debt value, the PatientInvoiceFormService will set an error flag informing the user that this patient's debtor group has a debt that exceeds the institution's policy, and the patient cannot be billed in this debtor group.
Finally, I'll add the same logic to the patientInvoice.create.js service-side controller to prevent the creation of invoices via the API if the same conditions aren't met.
Considerations
Some implementation notes:
We could limit credit/debit balances on the account itself, instead of the debtor group. However, this would force us to have a good UI/UX to resolve issues across the entire application (purchasing, vouchers, transaction edit modal, etc). That design is too big a challenge for this issue.
This will not protect the debtor group from being "over drafted" in the traditional sense. If the limit is $500 on a debtor group, they can still process a bill for $510. However, the next invoice will fail. This seems like a reasonable tradeoff to me.
To prevent users from working around this restriction by never posting, the account balance will be the balance including the posting journal. This means that a debtor group may exceed its max debt dynamically between two invoices. It also means that clever accountants cannot work around the issue by simply never posting.
The text was updated successfully, but these errors were encountered:
It sounds like we will need to do another release with the final updates to reports from @lomamech. I'll take this opportunity to add in this change requested by Vanga, since they are encountering administrative difficulties over account spending limits.
At Vanga, we have received the request to limit the invoicing of a patient if they are associated with a debtor group that has maxed out its debt limit. That is, when we check to load the debtor group, the invoicing module should show warning that disables the submission of the debtor group has a balance over the limit.
Design
To accomplish this, I'll rename the
max_credit
field on thedebtor_group
table tomax_debt
. I'll change the translation keys around this to "Overdraft Limit", with the description talking about how this will prevent billing patients after the account balance surpasses the limit.Then, I'll add two checks to the
PatientInvoiceFormService
when the patient is loaded. First, it will check the account balance using theAccountService.getBalance()
function. Next, it will callDebtorGroup.read()
to check themax_debt
field from the patient's debtor group. If themax_debt
value is non-zero, and the account balance (debit - credit) exceeds themax_debt
value, thePatientInvoiceFormService
will set an error flag informing the user that this patient's debtor group has a debt that exceeds the institution's policy, and the patient cannot be billed in this debtor group.Finally, I'll add the same logic to the
patientInvoice.create.js
service-side controller to prevent the creation of invoices via the API if the same conditions aren't met.Considerations
Some implementation notes:
The text was updated successfully, but these errors were encountered: