Sorry I forgot to include the code it's below

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
naeja
Posts: 7
Joined: 2021-04-03 17:01

Sorry I forgot to include the code it's below

Post by naeja » 2021-04-05 19:19

function InventoryItem_after_insert($data, $memberInfo, &$args) {
$new_qty=sqlvalue("SELECT IFNULL(i.Quantity,0)-{$data['Add']} from InventoryItem i where i.itemtype= {$data['itemtype']}");
sqlvalue("UPDATE Inventoryitem i set i.Quantity = {$new_qty} where i.itemtype ={$data['itemtype']}");
return TRUE;
}

Post Reply