increment pricing targets 5%

This commit is contained in:
Paul Trowbridge 2021-05-24 17:53:03 -04:00
parent d129e5d0f6
commit c1b8062d67

View File

@ -1,51 +1,51 @@
BEGIN; --BEGIN;
WITH WITH
------------------goal price increases--------------------- ------------------goal price increases---------------------
incr AS ( incr AS (
SELECT * FROM (VALUES SELECT * FROM (VALUES
('110','PP','B',0.3), ('110','PP','B',0.35),
('110','PP','T',0.3), ('110','PP','T',0.35),
('110','PP','L',0.4), ('110','PP','L',0.45),
('110','PP','M',0.4), ('110','PP','M',0.45),
('110','PP','P',0.4), ('110','PP','P',0.45),
('110','PP','C',0.4), ('110','PP','C',0.45),
('210','PE','B',0.3), ('210','PE','B',0.4),
('210','PE','T',0.3), ('210','PE','T',0.4),
('210','PE','L',0.3), ('210','PE','L',0.4),
('210','PE','M',0.3), ('210','PE','M',0.4),
('210','PE','P',0.3), ('210','PE','P',0.4),
('210','PE','C',0.3), ('210','PE','C',0.4),
('310','PE','B',0.25), ('310','PE','B',0.3),
('310','PE','T',0.3), ('310','PE','T',0.35),
('310','PE','L',0.3), ('310','PE','L',0.35),
('310','PE','M',0.3), ('310','PE','M',0.35),
('310','PE','P',0.3), ('310','PE','P',0.35),
('310','PE','C',0.3), ('310','PE','C',0.35),
('310','PP','B',0.25), ('310','PP','B',0.3),
('310','PP','T',0.25), ('310','PP','T',0.3),
('310','PP','L',0.25), ('310','PP','L',0.3),
('310','PP','M',0.25), ('310','PP','M',0.3),
('310','PP','P',0.25), ('310','PP','P',0.3),
('310','PP','C',0.25), ('310','PP','C',0.3),
('310','PS','B',0.25), ('310','PS','B',0.3),
('310','PS','T',0.25), ('310','PS','T',0.3),
('310','PS','L',0.25), ('310','PS','L',0.3),
('310','PS','M',0.25), ('310','PS','M',0.3),
('310','PS','P',0.25), ('310','PS','P',0.3),
('310','PS','C',0.25), ('310','PS','C',0.3),
('320','PE','B',0.25), ('320','PE','B',0.3),
('320','PE','T',0.25), ('320','PE','T',0.3),
('320','PE','L',0.25), ('320','PE','L',0.3),
('320','PE','M',0.25), ('320','PE','M',0.3),
('320','PE','P',0.25), ('320','PE','P',0.3),
('320','PE','C',0.25), ('320','PE','C',0.3),
('320','PP','B',0.25), ('320','PP','B',0.3),
('320','PP','T',0.25), ('320','PP','T',0.3),
('320','PP','L',0.25), ('320','PP','L',0.3),
('320','PP','M',0.25), ('320','PP','M',0.3),
('320','PP','P',0.25), ('320','PP','P',0.3),
('320','PP','C',0.25), ('320','PP','C',0.3),
('910','PE','B',0.25), ('910','PE','B',0.25),
('910','PE','D',0.25), ('910','PE','D',0.25),
('910','PE','F',0.25), ('910','PE','F',0.25),
@ -55,6 +55,14 @@ incr AS (
('910','PS','B',0.25), ('910','PS','B',0.25),
('910','PS','D',0.25), ('910','PS','D',0.25),
('910','PS','F',0.25), ('910','PS','F',0.25),
('910','','B',0.25),
('910','','T',0.25),
('910','','L',0.25),
('910','','M',0.25),
('910','','P',0.25),
('910','','D',0.25),
('910','','F',0.25),
('910','','C',0.25),
('610','','B',0.02), ('610','','B',0.02),
('610','','S',0.02), ('610','','S',0.02),
('610','','W',0.02) ('610','','W',0.02)
@ -268,14 +276,15 @@ SELECT
ELSE CASE p.majg ELSE CASE p.majg
WHEN '610' THEN .02 WHEN '610' THEN .02
ElSE CASE p.colgrp ElSE CASE p.colgrp
WHEN 'B' THEN .15 WHEN 'B' THEN .20
WHEN 'C' THEN .20 WHEN 'C' THEN .25
ELSE 1 ELSE 1
END END
END END
END rate END rate
,ms.avg_price target ,ms.avg_price target
,JSONB_AGG(DISTINCT plist.jcpric/1000) jcprice ----------------potential price list increase of 5% across board-----
,JSONB_AGG(DISTINCT (plist.jcpric*1.05)/1000) jcprice
--,CASE WHEN sum(val_usd) FILTER (WHERE oseas = 2020) IS NULL --,CASE WHEN sum(val_usd) FILTER (WHERE oseas = 2020) IS NULL
-- THEN CASE WHEN sum(units) FILTER (WHERE oseas = 2021) IS NULL -- THEN CASE WHEN sum(units) FILTER (WHERE oseas = 2021) IS NULL
-- THEN 'unknown' -- THEN 'unknown'
@ -347,7 +356,7 @@ GROUP BY
SELECT SELECT
$${ $${
"message":"application of last price and target increases to all forecast orders", "message":"application of last price and target increases to all forecast orders",
"tag":"last price", "tag":"last price r1",
"type":"build" "type":"build"
}$$::jsonb doc }$$::jsonb doc
RETURNING * RETURNING *