Skip to content

Commit

Permalink
Add in TZ conversion (#1459)
Browse files Browse the repository at this point in the history
  • Loading branch information
seeker25 authored Apr 4, 2024
1 parent a2c55c1 commit d0c18a7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions jobs/notebook-report/daily/vs_reconciliation_details.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
"outputs": [],
"source": [
"%%sql\n",
"select now() AT TIME ZONE 'PST' as current_date"
"select now() AT TIME ZONE 'america/vancouver' as current_date"
]
},
{
Expand Down Expand Up @@ -172,8 +172,8 @@
"WHERE i.corp_type_code = :partner_code\n",
"AND i.invoice_status_code IN ('PAID', 'REFUNDED', 'CANCELLED', 'CREDITED')\n",
"AND i.payment_method_code IN ('PAD','EJV', 'DRAWDOWN')\n",
"AND date(i.created_on) > date(current_date - 1 - interval '1 days')\n",
"AND date(i.created_on) <= date(current_date - 1)\n",
"AND date(i.created_on at time zone 'utc' at time zone 'america/vancouver') > date(current_date - 1 - interval '1 days')\n",
"AND date(i.created_on at time zone 'utc' at time zone 'america/vancouver') <= date(current_date - 1)\n",
"ORDER BY 1;"
]
},
Expand Down
24 changes: 12 additions & 12 deletions jobs/notebook-report/monthly/vs_reconciliation_summary.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
"outputs": [],
"source": [
"%%sql\n",
"select now() AT TIME ZONE 'PST' as current_date"
"select now() AT TIME ZONE 'america/vancouver' as current_date"
]
},
{
Expand All @@ -161,11 +161,11 @@
"outputs": [],
"source": [
"%%sql monthly_reconciliation_summary <<\n",
"SELECT count(*) AS transaction_count,\n",
"SELECT\n",
"sum(pli.total) AS subtotal,\n",
"sum(pli.service_fees) AS service_fees,\n",
"sum(pli.total + pli.service_fees) AS total,\n",
"(i.payment_date)::date,\n",
"(i.payment_date at time zone 'utc' at time zone 'america/vancouver')::date,\n",
"pli.description,\n",
"i.payment_method_code,\n",
"i.corp_type_code\n",
Expand All @@ -174,10 +174,10 @@
"WHERE i.corp_type_code = :partner_code\n",
"AND i.invoice_status_code = 'PAID'\n",
"AND i.payment_method_code IN ('PAD', 'EJV', 'DIRECT_PAY', 'DRAWDOWN')\n",
"AND date(i.payment_date) > date(current_date - 1 - interval '1 months')\n",
"AND date(i.payment_date) <= date(current_date - 1)\n",
"GROUP BY (i.payment_date)::date, i.payment_method_code, i.corp_type_code, pli.description\n",
"ORDER BY (i.payment_date)::date, pli.description, i.payment_method_code;"
"AND date(i.payment_date at time zone 'utc' at time zone 'america/vancouver') > date(current_date - 1 - interval '1 months')\n",
"AND date(i.payment_date at time zone 'utc' at time zone 'america/vancouver') <= date(current_date - 1)\n",
"GROUP BY (i.payment_date at time zone 'utc' at time zone 'america/vancouver')::date, i.payment_method_code, i.corp_type_code, pli.description\n",
"ORDER BY (i.payment_date at time zone 'utc' at time zone 'america/vancouver')::date, pli.description, i.payment_method_code"
]
},
{
Expand Down Expand Up @@ -226,7 +226,7 @@
"sum(pli.total) AS sub_total,\n",
"sum(pli.service_fees) AS service_fees,\n",
"sum(pli.total + pli.service_fees) AS total,\n",
"(i.disbursement_date)::date,\n",
"(i.disbursement_date at time zone 'utc' at time zone 'america/vancouver')::date,\n",
"pli.description,\n",
"i.payment_method_code,\n",
"i.corp_type_code\n",
Expand All @@ -236,10 +236,10 @@
"AND i.invoice_status_code = 'PAID'\n",
"AND i.payment_method_code IN ('PAD', 'EJV', 'DIRECT_PAY')\n",
"AND i.disbursement_status_code = 'COMPLETED'\n",
"AND date(disbursement_date) > date(current_date - 1 - interval '1 months')\n",
"AND date(disbursement_date) <= date(current_date - 1)\n",
"GROUP BY (disbursement_date)::date, payment_method_code, corp_type_code, pli.description\n",
"ORDER BY (disbursement_date)::date, pli.description, i.payment_method_code;"
"AND date(disbursement_date at time zone 'utc' at time zone 'america/vancouver') > date(current_date - 1 - interval '1 months')\n",
"AND date(disbursement_date at time zone 'utc' at time zone 'america/vancouver') <= date(current_date - 1)\n",
"GROUP BY (disbursement_date at time zone 'utc' at time zone 'america/vancouver')::date, payment_method_code, corp_type_code, pli.description\n",
"ORDER BY (disbursement_date at time zone 'utc' at time zone 'america/vancouver')::date, pli.description, i.payment_method_code;"
]
},
{
Expand Down

0 comments on commit d0c18a7

Please sign in to comment.