View Definition:
SELECT DISTINCT
i.incident_id,
i.inc_report_number,
i.report_date,
i.start_date,
i.end_date,
i.summary,
isupp.supp_agency_code,
(select ac1.agency_desc from agency_codes ac1 where ac1.agency_code = isupp.supp_agency_code),
isupp.isc_status_code,
(SELECT INITCAP (ec.description)
FROM ejs_codes ec
WHERE ec.code_type = 'INCIDENT_STATUS_CODES' AND ec.code = isupp.isc_status_code),
isupp.supp_seq,
isupp.responsible_user_id,
isupp.agency_only,
isupp.cid,
isupp.security_level,
isupp.approving_agency_code,
(select ac.agency_desc from agency_codes ac where ac.agency_code = isupp.approving_agency_code),
ip.status_code,
(select ps.description from ejs_codes ps where ps.code_type = 'PROPERTY_STATUS_CODES' and ps.code = ip.status_code),
ip.inc_prop_id,
p.property_id,
p.property_type_code,
(SELECT pt.description FROM ejs_codes pt where pt.code_type = 'PROPERTY_TYPE_CODES' and pt.code = p.property_type_code),
p.evidence,
p.document,
p.type_of_quantity,
p.primary_color,
(select pcol.description from ejs_codes pcol where pcol.code_type = 'COLOR_CODES' and pcol.code = p.primary_color),
p.secondary_color,
(select pcol2.description from ejs_codes pcol2 where pcol2.code_type = 'COLOR_CODES' and pcol2.code = p.secondary_color),
p.drug_type,
(select dt.description from ejs_codes dt where dt.code_type = p.drug_type_type and dt.code = p.drug_type),
p.quantity,
p.description,
p.make,
p.model,
p.serial_number,
p.VALUE,
p.misc,
p.document_number,
p.bank,
p.document_date,
p.account_name,
p.account_number,
p.payable_to,
p.amount,
p.endorsee,
p.barrel_length,
p.calgag_code,
(select calg.description from ejs_codes calg where calg.code_type = p.calgag_code_type and calg.code = p.calgag_code),
p.gun_act_code,
(select gun.description from ejs_codes gun where gun.code_type = p.gun_act_code_type and gun.code = p.gun_act_code),
p.gun_typ_code,
(select gt.description from ejs_codes gt where gt.code_type = p.gun_typ_code_type and gt.code = p.gun_typ_code),
p.currency_code,
(select cr.description from ejs_codes cr where cr.code_type = p.currency_code_type and cr.code = p.currency_code),
p.indx_sec_level_code,
pc.denomination_code,
(select den.description from ejs_codes den where den.code_type = pc.denomination_code_type and den.code = pc.denomination_code),
pc.quantity,
pc.sub_total,
ejs_get_property_desc(p.property_id)
FROM properties p,
incident_properties ip,
incident_supplements isupp,
incidents i,
property_cash pc
WHERE p.property_id = ip.property_id
AND ip.incsup_incident_id = isupp.inc_incident_id
AND ip.incsup_supp_seq = isupp.supp_seq
AND i.incident_id = isupp.inc_incident_id
AND p.property_id = pc.property_id(+)