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

Closed
Jxio opened this issue Jan 11, 2023 · 4 comments
Closed

Create job to schedule reports - invoice reconciliation #14945

Jxio opened this issue Jan 11, 2023 · 4 comments
Assignees
Labels
SRE SRE team task

Comments

@Jxio
Copy link
Collaborator

Jxio commented Jan 11, 2023

Currently, Travis just manually send reports to partners.
There is a lot going on where it's hard to reconcile and figure out where the bugs are, because partners don't have access to the invoice data.

The new job should run regularly and auto-send reports to partners.

@Jxio Jxio added the SRE SRE team task label Jan 11, 2023
@seeker25
Copy link
Collaborator

seeker25 commented Jan 11, 2023

  1. Data dump of invoices:
SET timezone TO 'America/Vancouver' ;
select created_on, id, (total - service_fees) as subtotal, service_fees, total, disbursement_status_code, payment_method_code, invoice_status_code from invoices where corp_type_code = 'CSO' and invoice_status_code in ('PAID', 'REFUNDED', 'CANCELLED', 'CREDITED') and payment_method_code in ('PAD','EJV', 'DRAWDOWN') order by 1;
  1. Daily summary:
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 from invoices where corp_type_code = 'CSO' and invoice_status_code = 'PAID' and payment_method_code in ('PAD','EJV', 'DRAWDOWN') group by (created_on)::date, payment_method_code;
  1. What was disbursed from our internal GL for CSO to their external GL
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 from invoices where corp_type_code = 'CSO' and invoice_status_code = 'PAID' and payment_method_code in ('PAD','EJV') and disbursement_status_code = 'COMPLETED' group by (created_on)::date, payment_method_code;

@pwei1018
Copy link
Collaborator

@pwei1018
Copy link
Collaborator

@stevenc987 Can you help @Jxio setup this report in Pay?

@stevenc987
Copy link
Collaborator

This job was migrated to Prod yesterday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SRE SRE team task
Projects
None yet
Development

No branches or pull requests

4 participants