aboutsummaryrefslogtreecommitdiffstats
path: root/sql/dawn.sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql/dawn.sql')
-rw-r--r--sql/dawn.sql16
1 files changed, 16 insertions, 0 deletions
diff --git a/sql/dawn.sql b/sql/dawn.sql
index 658eeb47..c4fc6e27 100644
--- a/sql/dawn.sql
+++ b/sql/dawn.sql
@@ -5185,3 +5185,19 @@ AS SELECT tc.date AS settle_date,
LEFT JOIN cds ON tc.tranche_id = cds.id
LEFT JOIN counterparties ON cds.cp_code::text = counterparties.code::text
ORDER BY tc.date DESC, cds.fund, cds.cp_code;
+
+
+CREATE VIEW bond_upload_status AS
+SELECT
+ bt.*,
+ accounts.counterparty AS account_counterparty,
+ u.id AS upload_id,
+ u.identifier AS upload_identifier,
+ u.accrued_payment AS upload_accrued_payment,
+ u.principal_payment AS upload_principal_payment
+FROM
+ bond_trades bt
+LEFT JOIN
+ accounts ON bt.account = accounts.code
+LEFT JOIN
+ bond_csv_upload u ON bt.id = u.allocationid; \ No newline at end of file