CREATE VIEW [dbo].[RPMViewItemCurrency]
AS
SELECT IV00105.ITEMNMBR, IV00105.CURNCYID, CUR.ISOCURRC, RTRIM(LTRIM(IV40202.UOMSCHDL)) + '-' + CAST(IV40202.SEQNUMBR AS VARCHAR) AS UOFMERPID,
	IV40202.UOFM, CAST((IV00101.CURRCOST * QTYBSUOM) AS DECIMAL(19,5)) AS CURRCOST, CAST((IV00105.LISTPRCE * QTYBSUOM) AS DECIMAL(19,5)) AS LISTPRCE
	FROM IV00101 
	LEFT JOIN IV00105 ON IV00105.ITEMNMBR = IV00101.ITEMNMBR
	LEFT JOIN @SYSTEMDATABASE@.dbo.MC40200 CUR ON IV00105.CURNCYID = CUR.CURNCYID
	LEFT JOIN IV40202 ON IV40202.UOMSCHDL = IV00101.UOMSCHDL
	LEFT JOIN IV40201 ON IV40201.UOMSCHDL = IV40202.UOMSCHDL
WHERE IV40202.EQUIVUOM = IV40201.BASEUOFM
