Please anyone who has a sample code for this need:
I got two related tables: inventory and inventory_movement.
A form of 'inventory_movement' is for the user to enter items to be either 'Out for use', 'Returned' and 'Non-returnable'.
I need to decrease the item 'quantity' from the main table...