From ee6746d8308d7fb32f4f5e5d87a04885482c713b Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Wed, 30 May 2018 13:38:27 -0400 Subject: [PATCH] post date has no space for collateral --- reload/pncl/extract.sql | 2 +- reload/pncl/srce.json | 4 ++-- reports/colateral_balalance.sql | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/reload/pncl/extract.sql b/reload/pncl/extract.sql index d9b58d1..256a6ce 100644 --- a/reload/pncl/extract.sql +++ b/reload/pncl/extract.sql @@ -4,7 +4,7 @@ COPY ( SELECT r."Schedule#" - ,to_char(r."PostDate",'mm/dd/yyyy') "Post Date" + ,to_char(r."PostDate",'mm/dd/yyyy') "PostDate" ,r."Assn#" ,r."Coll#" ,COALESCE(r."AdvanceRate",0) "AdvanceRate" diff --git a/reload/pncl/srce.json b/reload/pncl/srce.json index 718196a..fffd0de 100644 --- a/reload/pncl/srce.json +++ b/reload/pncl/srce.json @@ -15,8 +15,8 @@ }, { "type": "date", - "column_name": "Post Date", - "path": "{Post Date}" + "column_name": "PostDate", + "path": "{PostDate}" }, { "type": "text", diff --git a/reports/colateral_balalance.sql b/reports/colateral_balalance.sql index b25b144..5641c54 100644 --- a/reports/colateral_balalance.sql +++ b/reports/colateral_balalance.sql @@ -4,7 +4,7 @@ SELECT WHEN '02IN Raw Material' THEN 13097563.42 WHEN '03IN Finished Goods' THEN 35790696.52 ELSE 0 - END + SUM("Sales"+"Credits & Adjustments"-"Gross Collections") OVER (PARTITION BY "Schedule#" ORDER BY "Schedule#" ASC, "Post Date" ASC) running_bal + END + SUM("Sales"+"Credits & Adjustments"-"Gross Collections") OVER (PARTITION BY "Schedule#" ORDER BY "Schedule#" ASC, "PostDate" ASC) running_bal ,(LEAST("CollateralBalance" - "Ineligible Amount","MaxEligible")*("AdvanceRate"/100))::NUMERIC(20,2) qualified_collateral ,(("CollateralBalance" - "Ineligible Amount")*("AdvanceRate"/100))::NUMERIC(20,2) qualified_collateral_nl FROM @@ -16,4 +16,4 @@ WHERE ORDER BY "Schedule#" asc - ,r."Post Date" asc \ No newline at end of file + ,r."PostDate" asc \ No newline at end of file