We are busy creating a stand alone suppliers register for a client and I want to ask the thoughts from the community what would be the best way to work the status field for the invoices. There are going to be a number of values for the status field, for example, Unallocated, Assigned to Ops, Assigned to Finance, Query, Rejected, Authorized, Finalized, Processed, Paid. There is going to be various validations per status option, for example, a status can't be marked as Paid if it has been rejected, or Authorized if it has not yet been assigned to Finance. Those validations are the easy part because that will just be scripted, the issue is, what if the user wants to change the status from Authorized back to Assigned to Ops?
Lets say that by the time the invoice has reached the finance department they pick up something on the invoice and operations needs to check it again. Changing the status back to Assigned to Ops would be easy, but adding security around it so that once the invoice has reached finance only finance can change the status, or if it has been marked as Query, it cant be marked as Finalized or another one could be, for the invoice to be marked as Finalized, it has have been marked as Assigned to Ops, Assigned to Finance and Authorized before it can be marked as Finalized.
We have thought about 2 options for this. First having a check field for every option and when the status changes, the corresponding field will have a check mark added to it. The other idea is to have a StatusCheck field and then that would get updated based on the Status field. For example, if the user changes the Status from Assigned to Ops to Authorized, the word Authorized gets added to the bottom of the StatusCheck, or if they go from Authorized back to Assigned to Ops, then the word Authorized gets removed from the StatusCheck field. The reason I thought about the second option is then we could use PatternCount ( StatusCheck ; Status ) = 1 or 0 and then do validation based on the result.
The 2 options that we are thinking about, do they sound plausible or should we re-think this one?