add sample build of new target logic
This commit is contained in:
		
							parent
							
								
									e9bd81f352
								
							
						
					
					
						commit
						6e2e806f9b
					
				| @ -1,4 +1,4 @@ | |||||||
| SELECT  | SELECT | ||||||
| 	ui_json->'details' | 	ui_json->'details' | ||||||
| FROM pricequote.single_price_call( | FROM pricequote.single_price_call( | ||||||
|     'FARM0001', |     'FARM0001', | ||||||
| @ -6,9 +6,9 @@ FROM pricequote.single_price_call( | |||||||
|     'HCA10000B661100', |     'HCA10000B661100', | ||||||
|     'v1:T..CSE..D', |     'v1:T..CSE..D', | ||||||
|     50000 |     50000 | ||||||
| ) f | ) f; | ||||||
| 
 | 
 | ||||||
| SELECT  | SELECT | ||||||
| 	ui_json->'details' | 	ui_json->'details' | ||||||
| FROM pricequote.single_price_call( | FROM pricequote.single_price_call( | ||||||
|     'FARM0001', |     'FARM0001', | ||||||
| @ -16,9 +16,9 @@ FROM pricequote.single_price_call( | |||||||
|     'HZP3E103E21D050', |     'HZP3E103E21D050', | ||||||
|     'v1:C..BDL..', |     'v1:C..BDL..', | ||||||
|     50000 |     50000 | ||||||
| ) f | ) f; | ||||||
| 
 | 
 | ||||||
| SELECT  | SELECT | ||||||
| 	ui_json | 	ui_json | ||||||
| FROM pricequote.single_price_call( | FROM pricequote.single_price_call( | ||||||
|     'BFGS0001', |     'BFGS0001', | ||||||
| @ -26,29 +26,44 @@ FROM pricequote.single_price_call( | |||||||
|     'HTI10754B12B024LXB04', |     'HTI10754B12B024LXB04', | ||||||
|     'v1:L.L.PLT..', |     'v1:L.L.PLT..', | ||||||
|     172000 |     172000 | ||||||
| ) f | ) f; | ||||||
| 
 | 
 | ||||||
| SELECT * FROM pricequote.lastpricedetail l WHERE customer = 'HYBELS' AND l.partgroup = 'HZP3E100' | SELECT * FROM pricequote.lastpricedetail l WHERE customer = 'HYBELS' AND l.partgroup = 'HZP3E100'; | ||||||
| 
 | 
 | ||||||
| SELECT | SELECT | ||||||
| 	pc.expl | 	pc.expl | ||||||
| FROM  | FROM | ||||||
| 	pricequote.live_quotes | 	pricequote.live_quotes | ||||||
| 	LEFT JOIN LATERAL pricequote.single_price_call( | 	LEFT JOIN LATERAL pricequote.single_price_call( | ||||||
| 		billto, shipto, part, v1ds, units_each | 		billto, shipto, part, v1ds, units_each | ||||||
| 	) pc ON TRUE | 	) pc ON TRUE | ||||||
| WHERE  | WHERE | ||||||
| 	qid  = 113173 | 	qid  = 113173 | ||||||
| 	AND qrn = 32 | 	AND qrn = 32; | ||||||
| 
 | 
 | ||||||
|  | -- SELECT | ||||||
|  | --     c.compset, | ||||||
|  | --     c.stlc, | ||||||
|  | --     c.floor, | ||||||
|  | --     b.ds, | ||||||
|  | --     b.chan, | ||||||
|  | --     b.tier, | ||||||
|  | --     b.vol, | ||||||
|  | --     b.val, | ||||||
|  | --     b.price, | ||||||
|  | --     json_pretty(to_json(b.math)) math | ||||||
|  | -- FROM | ||||||
|  | --     pricequote.core_target c | ||||||
|  | --     LEFT JOIN LATERAL pricequote.build_pricing_path_base (options||jsonb_build_object('entity','Anchor','attr',c.stlc,'val',c.floor,'func','Price')) b ON b.lastflag | ||||||
|  | -- LIMIT 10000; | ||||||
| 
 | 
 | ||||||
| -- SELECT  | -- SELECT | ||||||
| --     stlc, ds, chan, tier, vol, price, math | --     stlc, ds, chan, tier, vol, price, math | ||||||
| -- FROM  | -- FROM | ||||||
| --     pricequote.build_pricing_path_base( | --     pricequote.build_pricing_path_base( | ||||||
| -- $$ | -- $$ | ||||||
| -- [{"folder":"01 Gal Can","entity":"Anchor","attr":"BM.03000","val":0.15,"func":"Price"},{"folder":"01 Gal Can","entity":"Color Tier","attr":"B","val":1,"func":"Factor"},{"folder":"01 Gal Can","entity":"Color Tier","attr":"C","val":1.2,"func":"Factor"},{"folder":"01 Gal Can","entity":"Color Tier","attr":"L","val":1.1,"func":"Factor"},{"folder":"01 Gal Can","entity":"Color Tier","attr":"M","val":1.2,"func":"Factor"},{"folder":"01 Gal Can","entity":"Color Tier","attr":"P","val":1.2,"func":"Factor"},{"folder":"01 Gal Can","entity":"Color Tier","attr":"T","val":1.1,"func":"Factor"},{"folder":"01 Gal Can","entity":"Branding","attr":null,"val":0,"func":"Price"},{"folder":"01 Gal Can","entity":"Branding","attr":"L","val":0.04,"func":"Price"},{"folder":"01 Gal Can","entity":"Branding","attr":"P","val":0.1,"func":"Price"},{"folder":"01 Gal Can","entity":"Packaging","attr":"BDL","val":0.005,"func":"Price"},{"folder":"01 Gal Can","entity":"Packaging","attr":"CSE","val":0.01,"func":"Price"},{"folder":"01 Gal Can","entity":"Packaging","attr":"PLT","val":0,"func":"Price"},{"folder":"01 Gal Can","entity":"Packaging","attr":"SLV","val":0.005,"func":"Price"},{"folder":"01 Gal Can","entity":"Suffix","attr":null,"val":1,"func":"Factor"},{"folder":"01 Gal Can","entity":"Accessories","attr":null,"val":0,"func":"Price"},{"folder":"01 Gal Can","entity":"Channel","attr":"DIR","val":1,"func":"Factor"},{"folder":"01 Gal Can","entity":"Channel","attr":"DRP","val":1,"func":"Factor"},{"folder":"01 Gal Can","entity":"Channel","attr":"WHS","val":1.1,"func":"Factor"},{"folder":"01 Gal Can","entity":"Tier","attr":1,"val":1,"func":"Factor"},{"folder":"01 Gal Can","entity":"Tier","attr":2,"val":1.05,"func":"Factor"},{"folder":"01 Gal Can","entity":"Tier","attr":3,"val":1.1,"func":"Factor"},{"folder":"01 Gal Can","entity":"Volume","attr":"00-01","val":1.35,"func":"Factor"},{"folder":"01 Gal Can","entity":"Volume","attr":"01-08","val":1.1,"func":"Factor"},{"folder":"01 Gal Can","entity":"Volume","attr":"24","val":1,"func":"Factor"},{"folder":"01 Gal Can","entity":"Volume","attr":"08-24","val":1.05,"func":"Factor"}] | -- [{"folder":"01 Gal Can","entity":"Anchor","attr":"BM.03000","val":0.15,"func":"Price"},{"folder":"01 Gal Can","entity":"Color Tier","attr":"B","val":1,"func":"Factor"},{"folder":"01 Gal Can","entity":"Color Tier","attr":"C","val":1.2,"func":"Factor"},{"folder":"01 Gal Can","entity":"Color Tier","attr":"L","val":1.1,"func":"Factor"},{"folder":"01 Gal Can","entity":"Color Tier","attr":"M","val":1.2,"func":"Factor"},{"folder":"01 Gal Can","entity":"Color Tier","attr":"P","val":1.2,"func":"Factor"},{"folder":"01 Gal Can","entity":"Color Tier","attr":"T","val":1.1,"func":"Factor"},{"folder":"01 Gal Can","entity":"Branding","attr":null,"val":0,"func":"Price"},{"folder":"01 Gal Can","entity":"Branding","attr":"L","val":0.04,"func":"Price"},{"folder":"01 Gal Can","entity":"Branding","attr":"P","val":0.1,"func":"Price"},{"folder":"01 Gal Can","entity":"Packaging","attr":"BDL","val":0.005,"func":"Price"},{"folder":"01 Gal Can","entity":"Packaging","attr":"CSE","val":0.01,"func":"Price"},{"folder":"01 Gal Can","entity":"Packaging","attr":"PLT","val":0,"func":"Price"},{"folder":"01 Gal Can","entity":"Packaging","attr":"SLV","val":0.005,"func":"Price"},{"folder":"01 Gal Can","entity":"Suffix","attr":null,"val":1,"func":"Factor"},{"folder":"01 Gal Can","entity":"Accessories","attr":null,"val":0,"func":"Price"},{"folder":"01 Gal Can","entity":"Channel","attr":"DIR","val":1,"func":"Factor"},{"folder":"01 Gal Can","entity":"Channel","attr":"DRP","val":1,"func":"Factor"},{"folder":"01 Gal Can","entity":"Channel","attr":"WHS","val":1.1,"func":"Factor"},{"folder":"01 Gal Can","entity":"Tier","attr":1,"val":1,"func":"Factor"},{"folder":"01 Gal Can","entity":"Tier","attr":2,"val":1.05,"func":"Factor"},{"folder":"01 Gal Can","entity":"Tier","attr":3,"val":1.1,"func":"Factor"},{"folder":"01 Gal Can","entity":"Volume","attr":"00-01","val":1.35,"func":"Factor"},{"folder":"01 Gal Can","entity":"Volume","attr":"01-08","val":1.1,"func":"Factor"},{"folder":"01 Gal Can","entity":"Volume","attr":"24","val":1,"func":"Factor"},{"folder":"01 Gal Can","entity":"Volume","attr":"08-24","val":1.05,"func":"Factor"}] | ||||||
| -- $$ | -- $$ | ||||||
| -- ) | -- ) | ||||||
| -- WHERE  | -- WHERE | ||||||
| --     lastflag | --     lastflag | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user