Commit all views for ITSA
This commit is contained in:
29
Database Backups/SQL Views/vw_bi_itsa_fct_shipment_fees.sql
Normal file
29
Database Backups/SQL Views/vw_bi_itsa_fct_shipment_fees.sql
Normal file
@@ -0,0 +1,29 @@
|
||||
CREATE OR REPLACE VIEW public.vw_bi_itsa_fct_shipment_fees AS
|
||||
SELECT "intFeeId",
|
||||
"strShipmentType" AS "Shipment Type",
|
||||
"intShipmentId",
|
||||
"strPackaging" AS "Packaging",
|
||||
"strPayOrRec" AS "Pay or Rec",
|
||||
"strType" AS "Type",
|
||||
"strProduct" AS "Fee",
|
||||
"strSupplier" AS "Supplier",
|
||||
"strState" AS "State",
|
||||
"strWeightType" AS "Weighing Type",
|
||||
COALESCE("dblQuantity", (0)::numeric) AS "Quantity",
|
||||
CASE
|
||||
WHEN (upper(("strProduct")::text) = 'PROFIT SHARING'::text) THEN abs("dblPrice")
|
||||
ELSE ("dblPrice" * ("dblSignMultiplier")::numeric)
|
||||
END AS "Price",
|
||||
"strCurrency" AS "Currency",
|
||||
"strUnit" AS "Unit",
|
||||
(COALESCE("dblQuantity", (0)::numeric) *
|
||||
CASE
|
||||
WHEN (upper(("strProduct")::text) = 'PROFIT SHARING'::text) THEN abs("dblPrice")
|
||||
ELSE ("dblPrice" * ("dblSignMultiplier")::numeric)
|
||||
END) AS "Amount",
|
||||
CASE
|
||||
WHEN (upper(("strProduct")::text) = 'MARITIME FREIGHT'::text) THEN "strProduct"
|
||||
WHEN (upper(("strProduct")::text) = 'PROFIT SHARING'::text) THEN "strProduct"
|
||||
ELSE 'Other Costs'::character varying
|
||||
END AS "Cost Group"
|
||||
FROM vw_utility_shipment_fees;;
|
||||
Reference in New Issue
Block a user