Inventory Database

Inventory Database

I added trucks to my inventory DB. Now I want to be able to subtract the Part used from that truck, and update the total in my inventory. Presently it just subtracts when personal uses a part. I have a script below.
I am trying to picture this script, but keep getting confused. 
Example: If truck 1 uses a part from his truck, how can i subtract it from that truck, and update the balance in my inventory?
//Below is the Parts Used validation script 
input.WO_Date = zoho.currentdate ; 
Product_Number = Inventory[Product_Number == input.Part_Number1] ; 
Product_Number.Qty_In_Stock = (Product_Number.Qty_In_Stock - input.Quanity) ; 
//Caculate parts cost used