I need to subtract the quantity from the Product stock when making a sale … that is, subtract when the quantity field is entered in the OrderDatail table.
How can I do this?
Thx!
hi @willvin Is the syntax SQL or will it depend on the language in which it is?
Could you give me a small example please according to my data structure?
Thanks!
The project is with laravel vue quasar. Although we are looking at the possibility of buying the flask licenses, because they want to change the backend to python. But for now it is laravel vue the licenses that they have in my work.
Radsystems provide you with a sample snippet of code for running queries for the project types on the Page Events, by double-clicking on the snippet name it will be displayed for you. You need a basic knowledge of the backed language to use them properly. I will be providing a sample code for the Laravel Project type.
$params = ['p_id' => $modeldata['IDProduct']];
$results = DB::select("UPDATE product SET stock = stock-1 WHERE IDProduct = :p_id", $params);