# $stock_item
!! generic function to be used to stock items in stores
!! see # pharmacy for an example of use

count = ARGS[0]
$item = $ARGS[1]
price = ARGS[2]
$variable_name = $ARGS[3]
$location = $ARGS[4]
dynamic 'in_inventory = <<$variable_name>>'

$buy_link = '<a' + iif(money >= price, ' href="exec: gs ''$buy_item'', <<count>>, ''<<$item>>'', <<price>>, ''<<$variable_name>>'', ''<<$location>>''">buy ','>buy ') + count + '</a>'

$RESULT = '<tr>' + _
'<td align="center"><<$item>></td>' + _
'<td align="right">(you have <<in_inventory>>)</td>' + _
'<td align="right"><<$buy_link>></td>' + _
'<td align="left">for <<price>> <b>₽</b></td>' + _
'</tr>'

--- $stock_item ---------------------------------

