approve changes before changes are applied

I need some advises on how to implement a system such that any changes (updates/removes) will need to be approved before changes are applied.

Here is the use case.

1 PO (Purchase Order) can have 1 or more Items.

An Item has quantity field.

A user can create a PO and are free to add/remove/update Items. When user is satisfied, he will submit the PO to be approved.

Once approved, user can not update PO items freely anymore. Instead, he is allowed to update/add/remove items but those changes are not applied immediately. An admin will have to go through the changes and approve them. Once approved, existing PO will show new changes.

Any ideas how to implement such system ?

Hi,

Sorry no complete solution…

But I would start with something like that:

I think - more or less - this is the easy part.

Just a simple status-flag in the PO-table indicating if this PO needs approval - is approved - or is rejected.

Here you need surely some extra tables to keep track of the changes.

And you COULD have another "approval-flag" inside the table which keeps record of all changes…

Never done something like that by my own,

but you find a lot of topics regarding change-management on the web.

https://www.google.de/?gws_rd=ssl#q=mysql+how+to+keep+track+of+changes

Regards

I would add a sequence_no to the PO so that every single PO can have a history.

  • The user creates a new record of PO with an unique PO_no, setting the status flag as false (not approved) and the sequence_no being 1.

  • The user can edit the PO freely by adding a new record with the sequence_no incremented by 1. The status flag should be false.

  • All the PO records with the same PO_no consist the history of the changes of the PO.

  • Every PO record must have its own Item records independently.

  • The PO record with the largest sequence_no is the current request of the user.

  • The admin can approve the current PO request by changing the status-flag.

  • The PO record with the largest sequence_no and the status flag being true is the last approved PO.