CREATE OR REPLACE VIEW core.item_selling_price_scrud_view
AS
SELECT item_selling_prices.item_selling_price_id,
items.item_code,
items.item_name,
party_types.party_type_code,
party_types.party_type_name,
((units.unit_code::text || ' ('::text) || units.unit_name::text) || ')'::text AS unit,
item_selling_prices.price
FROM core.item_selling_prices
JOIN core.items ON item_selling_prices.item_id = items.item_id
JOIN core.units ON item_selling_prices.unit_id = units.unit_id
LEFT JOIN core.price_types ON item_selling_prices.price_type_id = price_types.price_type_id
LEFT JOIN core.party_types ON item_selling_prices.party_type_id = party_types.party_type_id;