_stock_item 710 B

12345678910111213141516171819202122
  1. # $stock_item
  2. !! generic function to be used to stock items in stores
  3. !! see # pharmacy for an example of use
  4. count = ARGS[0]
  5. $item = $ARGS[1]
  6. price = ARGS[2]
  7. $variable_name = $ARGS[3]
  8. $location = $ARGS[4]
  9. dynamic 'in_inventory = <<$variable_name>>'
  10. $buy_link = '<a' + iif(money >= price, ' href="exec: gs ''$buy_item'', <<count>>, ''<<$item>>'', <<price>>, ''<<$variable_name>>'', ''<<$location>>''">buy ','>buy ') + count + '</a>'
  11. $RESULT = '<tr>' + _
  12. '<td align="center"><<$item>></td>' + _
  13. '<td align="right">(you have <<in_inventory>>)</td>' + _
  14. '<td align="right"><<$buy_link>></td>' + _
  15. '<td align="left">for <<price>> <b>₽</b></td>' + _
  16. '</tr>'
  17. --- $stock_item ---------------------------------