 SELECT * FROM 
 pricequote.single_price_call(
                        'CYGR0002' ,
                        'CYGR0002' ,
                        'SVP03002G18C800' ,
                        'SVP03000',
                        'v1:B..PLT..',
                        100000
                )
                
	SELECT pricing FROM rlarp.osm_stack l WHERE l.customer ='CROS-B-CREST FARM' AND partgroup = 'STG04250'
	
	CALL pricequote.process_queue()	
	
	REFRESH MATERIALIZED VIEW rlarp.osm_stack_pretty;
                
                
SELECT 
	q.qid,
	q.qrn,
--	q.qcustomer,
	q.partbuilt,
	i.pricegroup,
	q.v1ds,
	q.units_each,
	q.targetp,
	q.lastsalesprice,
--	q.finalrecommendedprice,
--	q.lowerpricelimit,
--	q.upperpricelimit,
	q.curstdus,
	q.price,
	p.guidance_price guidance,
	p.expl
FROM 
	pricequote.live_quotes q
	LEFT OUTER JOIN "CMS.CUSLG".itemm i ON 
		i.item = q.part
	LEFT JOIN LATERAL pricequote.single_price_call(
		q.billto
		,q.shipto
		,q.part 
		,substring(q.part,1,8) 
		,q.v1ds 
		,q.units_each
	) p ON TRUE
WHERE
	qstat LIKE 'Submitted%'
	AND qid = 113035 --AND q.qrn = 1
ORDER BY 
	qrn ASC