Module:Infobox Recipe: Difference between revisions

Fix raw material quantity not multiplying price
No edit summary
(Fix raw material quantity not multiplying price)
Line 1:
require('strict')
require('Module:Mw.html extension')
local currency = require('Module:Currency')
local hc = require('Module:Param Parse').has_content
Line 100 ⟶ 102:
--Creates a row suitable for the raw materials section of the infobox.
local function createRawMaterialRow(item)
local materialBuyPrice = getBuyPrice(item) * (item.quantity or 1)
rawMaterialCost = rawMaterialCost + materialBuyPrice
return mw.html.create('tr')
Line 270 ⟶ 272:
:done()
:done()
if :IF(args.output1 then)
 
out
-- Values
:tag('tr')
:tag('td')
:css{ ['border-right'] = 'none' }
:wikitext('[[File:' .. args.output1 .. '.png|30px|link=' .. args.output1 .. ']]' or 'Unknown')
:done()
:tag('td')
:css{ ['border-left'] = 'none' }
:wikitext('[[' .. args.output1 .. ']]' or 'Unknown')
:done()
:tag('td')
:css{ ['text-align'] = 'right' }
:wikitext(args.output1qty or 1)
:done()
:wikitext(currency_cell(output1TotalValue))
:done()
:tagEND('td')
-- Add profit data
:css{ ['border-left'] = 'none' }
:wikitext('[[' .. args.output1 .. ']]' or 'Unknown')
:done()
:tag('td')
:css{ ['text-align'] = 'right' }
:wikitext(args.output1qty or 1)
:done()
:wikitext(currency_cell(output1TotalValue))
:done()
end
-- Add profit data
out
:tag('tr')
:tag('th')
165

edits