This topic is locked
[SOLVED]

 Stock update on fly

4/24/2016 5:20:36 PM
PHPRunner General questions
A
azmi author

I am using PHPRunner 8.1 and need to update stock on fly
My database is as follow:
tblProduct (Product_Id(int), Issued(num))

tblTransac (Product_Id(int), Quantity_out(num)
Requirement:

If ADD record in tblTransac then tblProduct.Issued updated with (tblProduct.Issued + tblTransac.Quantity_Out)
Any help highly appreciated

Sergey Kornilov admin 4/26/2016

You can try something like this in AfterAdd event of tblTransac table:

CustomQuery("update tblProduct set Issued = Issued +".$values["Quantity_Out"]." where Product_Id=".$values["Product_Id"]);
A
azmi author 4/27/2016



You can try something like this in AfterAdd event of tblTransac table:

CustomQuery("update tblProduct set Issued = Issued +".$values["Quantity_Out"]." where Product_Id=".$values["Product_Id"]);



Great! Thanks a Lot