
EXEC pricing.single_price_call
    @bill = 'GRIF0001',
    @ship = 'GRIF0001',
    @part = 'XNS0T1G3G18B096',
    @v1ds = 'v1:B.L.PLT..',
    @vol = 9600;


SELECT 
	* 
FROM pricing.single_price_call_fn(
    'GRIF0001',
    'GRIF0001',
    'XNS0T1G3G18B096',
    'v1:B..PLT..',
    9600
) f



SELECT TOP 10
	q.qid,
	q.qrn,
	q.qcustomer,
	q.part,
	q.v1ds,
	q.units_each,
	q.price,
	q.targetp,
	q.lastsalesprice,
	q.finalrecommendedprice,
	q.lowerpricelimit,
	q.upperpricelimit,
	q.curstdus,
	p.guidance_price,
	p.expl
FROM 
	rlarp.live_quotes q
	OUTER APPLY pricing.single_price_call_fn(
		q.billto
		,q.shipto
		,q.part 
		,q.v1ds 
		,q.units_each
	) p
WHERE
	qstat LIKE 'Submitted%'


SELECT 
	* 
FROM pricing.single_price_call(
    'GRIF0001',
    'GRIF0001',
    'XNS0T1G3G18B096',
    'v1:B..PLT..',
    9600
) f