weenhanceit / autism-funding

A Web App to Help Manage BC Autism Funding
MIT License
0 stars 0 forks source link

Invoices #28

Open lcreid opened 8 years ago

lcreid commented 8 years ago

Entering invoices -- at least how much, and who pays -- is pretty basic to the usefulness of the site. There are some subtleties that would be worth discussing, and then perhaps writing a bit of a specification. Here are some random thoughts about invoices:

philcarrillo commented 8 years ago

I think I may have asked this before, but how do provincial and federal sales tax impact the dollars. Are they all tax-exclusive or tax-inlclusive?

lcreid commented 8 years ago

The funding is for the total amount including tax.

lcreid commented 8 years ago

I think invoices are probably generic and the attributes of an invoice are not particularly tied to the funding authorization. There's only one thing I think we need to vary by type of authorization, and that's for invoices for services, that typically cover a period (month). But even that isn't related to the type of authorization, because a CF0925 can authorize one time and repeating items.

The bare minimum we need for an invoice is:

philcarrillo commented 8 years ago

I had a different vision for the invoices, so the data model is slightly different.

I was working under the assumption that the application is not checking or commenting on the validity of applying the invoice to any particular RTP. If this is the case, I question the requirement to have services start and end dates, for example. The key item would be the amount, as what we are trying to do is total amounts invoiced that are 'covered' by the RTP.

The present data model has the following items:

Based on the above I should add

What data integrity checks should be applied to the invoice before the invoice is considered valid (only valid invoices would be included in the summary report for the funded child)? Possible ideas

lcreid commented 8 years ago

It looks like the routes all worked out automagically. I wonder how that works? I guess Rails is smart enough to know there's already a route for some actions, so it doesn't generate extra ones.

lcreid commented 8 years ago

According to our behaviour consultant, he doesn't bill for Section B expenses. He thought some consultants might bill for travel. He thinks Section B is more for parents who want to go to a conference or have some other, non-equipment, expense.

lcreid commented 8 years ago

I think I may have created some confusion. I wanted to avoid a situation where the user has to match invoices the RTPs, but I was expecting that the system might have to match invoices to RTPs. It turns out we do, because you can't properly figure out how much has been spent unless you can somehow align the different invoices to the different RTPs. For example, someone might be overspent with one agency, but underspent on another. Also, the date of the invoice has to line up with the RTP.

I think there's a good chance that if this ever became an operational system for a funding agency, that we'd have to add explicit ability to assign invoices to RTPs to handle edge cases of some sort. But that's for later.

I think I might have just come up with an algorithm that will handle all reasonable cases without doing explicit linking. I need to think on it a bit more.

philcarrillo commented 8 years ago

If we do use an algorithm to match invoices to RTPs, it must be something that is not going to confuse users in the event that a change is made to the data. This would mean, for example, that we need to guarantee that, if a new invoice is entered, the resulting summary will change funding in a seemingly arbitrary manner. My question would be, if we are making this relationship - should we not expose our decisions to the user? Or are the various cases of invoice entry so well defined that the summary will always 'make sense' to the user?

The downside of exposing the relationship is that the user may wish to 'override' the algorithm - a case which would complicate the algorithm itself.