formatting on last price normalizarion display
This commit is contained in:
parent
f936b9d31d
commit
d77b042581
@ -4,7 +4,17 @@ FROM pricequote.single_price_call(
|
|||||||
'FARM0001',
|
'FARM0001',
|
||||||
'KEYB0001',
|
'KEYB0001',
|
||||||
'HZP3E103E21D050',
|
'HZP3E103E21D050',
|
||||||
'v1:T..BDL..',
|
'v1:C..BDL..',
|
||||||
|
50000
|
||||||
|
) f
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
ui_json->'details'
|
||||||
|
FROM pricequote.single_price_call(
|
||||||
|
'FARM0001',
|
||||||
|
'KEYB0001',
|
||||||
|
'HZP3E103E21D050',
|
||||||
|
'v1:C..BDL..',
|
||||||
50000
|
50000
|
||||||
) f
|
) f
|
||||||
|
|
||||||
|
@ -475,7 +475,9 @@ BEGIN
|
|||||||
)
|
)
|
||||||
ELSE
|
ELSE
|
||||||
''
|
''
|
||||||
END AS note
|
END
|
||||||
|
+ CASE WHEN last_isdiff <> '' THEN ' | normalized to: ' + cast(last_price_norm AS varchar(10)) ELSE '' END
|
||||||
|
AS note
|
||||||
FOR JSON PATH -- array with one object (no WITHOUT_ARRAY_WRAPPER)
|
FOR JSON PATH -- array with one object (no WITHOUT_ARRAY_WRAPPER)
|
||||||
) AS details
|
) AS details
|
||||||
|
|
||||||
|
@ -464,26 +464,26 @@ BEGIN
|
|||||||
ELSE NULL END
|
ELSE NULL END
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
-- ||CASE WHEN _last_premium IS NOT NULL THEN
|
||CASE WHEN COALESCE(_last_premium,1) <> 1 THEN
|
||||||
||COALESCE(jsonb_build_array(jsonb_build_object(
|
COALESCE(jsonb_build_array(jsonb_build_object(
|
||||||
'label','Price Difference',
|
'label','Price Difference',
|
||||||
'value', _last_premium,
|
'value', _last_premium,
|
||||||
'type','percent',
|
'type','percent',
|
||||||
'note', _last_premium_method
|
'note', _last_premium_method
|
||||||
)),'[]'::jsonb)
|
)),'[]'::jsonb)
|
||||||
-- ELSE
|
ELSE
|
||||||
-- '[]'::jsonb
|
'[]'::jsonb
|
||||||
-- END
|
END
|
||||||
-- ||CASE WHEN _last_premium IS NOT NULL THEN
|
||CASE WHEN COALESCE(_last_premium,1) <> 1 THEN
|
||||||
||COALESCE(jsonb_build_array(jsonb_build_object(
|
COALESCE(jsonb_build_array(jsonb_build_object(
|
||||||
'label','Adjusted Price',
|
'label','Adjusted Price',
|
||||||
'value', _last_price_norm,
|
'value', _last_price_norm,
|
||||||
'type','currency',
|
'type','currency',
|
||||||
'note','normalized to ' || _v1ds
|
'note','normalized to ' || _v1ds
|
||||||
)),'[]'::jsonb)
|
)),'[]'::jsonb)
|
||||||
-- ELSE
|
ELSE
|
||||||
-- '[]'::jsonb
|
'[]'::jsonb
|
||||||
-- END
|
END
|
||||||
),
|
),
|
||||||
------------------------------------------
|
------------------------------------------
|
||||||
-- price list
|
-- price list
|
||||||
|
Loading…
Reference in New Issue
Block a user