Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create job to schedule reports - invoice reconciliation #14945 #1089

Merged
merged 2 commits into from
Feb 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .github/workflows/notebook-report-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@ jobs:
run: |
make cd

- name: Watch new rollout (trigger by image change in Openshift)
shell: bash
run: |
oc rollout status dc/${{ env.APP_NAME }}-${{ env.TAG_NAME }} -n ${{ secrets.OPENSHIFT4_REPOSITORY }}-${{ env.TAG_NAME }} -w

- name: Rocket.Chat Notification
uses: RocketChat/Rocket.Chat.GitHub.Action.Notification@master
if: failure()
Expand Down Expand Up @@ -96,11 +91,6 @@ jobs:
run: |
make cd

- name: Watch new rollout (trigger by image change in Openshift)
shell: bash
run: |
oc rollout status dc/${{ env.APP_NAME }}-${{ env.TAG_NAME }} -n ${{ secrets.OPENSHIFT4_REPOSITORY }}-${{ env.TAG_NAME }} -w

- name: Rocket.Chat Notification
uses: RocketChat/Rocket.Chat.GitHub.Action.Notification@master
if: failure()
Expand Down
14 changes: 7 additions & 7 deletions jobs/notebook-report/daily/reconciliation_details.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,13 @@
"outputs": [],
"source": [
"%%sql daily_reconciliation_details <<\n",
"SELECT created_on, id, (total - service_fees) AS subtotal, service_fees, total, disbursement_status_code, payment_method_code, invoice_status_code, corp_type_code \n",
"FROM invoices \n",
"WHERE corp_type_code = 'CSO' \n",
"AND invoice_status_code IN ('PAID', 'REFUNDED', 'CANCELLED', 'CREDITED') \n",
"AND payment_method_code IN ('PAD','EJV', 'DRAWDOWN') \n",
"AND date(created_on) > date(current_date - 1 - interval '1 days')\n",
"AND date(created_on) <= date(current_date - 1)\n",
"SELECT i.created_on, i.updated_on, i.id, ir.invoice_number, (i.total - i.service_fees) AS subtotal, i.service_fees, i.total, i.disbursement_status_code, i.payment_method_code, i.invoice_status_code, i.corp_type_code \n",
"FROM invoices i join invoice_references ir on ir.invoice_id = i.id\n",
"WHERE i.corp_type_code = 'CSO' \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",
"ORDER BY 1;"
]
},
Expand Down
20 changes: 10 additions & 10 deletions jobs/notebook-report/monthly/reconciliation_summary.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"AND invoice_status_code = 'PAID' \n",
"AND payment_method_code in ('PAD','EJV', 'DRAWDOWN') \n",
"AND date(created_on) > date(current_date - 1 - interval '1 months')\n",
"AND date(created_on) <= date(current_date - 1)\n",
"AND date(created_on) <= date(current_date - 1)\n",
"GROUP BY (created_on)::date, payment_method_code, corp_type_code;"
]
},
Expand Down Expand Up @@ -141,15 +141,15 @@
"outputs": [],
"source": [
"%%sql monthly_reconciliation_disbursed <<\n",
"SELECT count(*) as transaction_count, sum(total - service_fees) as subtotal, sum(service_fees) as service_fees, sum(total) as total, (created_on)::date, payment_method_code, corp_type_code \n",
"FROM invoices \n",
"WHERE corp_type_code = 'CSO' \n",
"AND invoice_status_code = 'PAID' \n",
"AND payment_method_code in ('PAD','EJV') \n",
"AND disbursement_status_code = 'COMPLETED' \n",
"AND date(created_on) > date(current_date - 1 - interval '1 months')\n",
"AND date(created_on) <= date(current_date - 1)\n",
"GROUP BY (created_on)::date, payment_method_code, corp_type_code;"
"SELECT count(*) as transaction_count, sum(total - service_fees) as subtotal, sum(service_fees) as service_fees, sum(total) as total, (updated_on)::date, payment_method_code, corp_type_code\n",
"FROM invoices\n",
"WHERE corp_type_code = 'CSO'\n",
"AND invoice_status_code = 'PAID'\n",
"AND payment_method_code in ('PAD','EJV')\n",
"AND disbursement_status_code = 'COMPLETED'\n",
"AND date(updated_on) > date(current_date - 1 - interval '1 months')\n",
"AND date(updated_on) <= date(current_date - 1)\n",
"GROUP BY (updated_on)::date, payment_method_code, corp_type_code;"
]
},
{
Expand Down