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

[Reports] Add a "payout" report #506

Open
RachL opened this issue Mar 25, 2024 · 2 comments
Open

[Reports] Add a "payout" report #506

RachL opened this issue Mar 25, 2024 · 2 comments
Labels
D1. API All issues that are part of Data & Interoperability > API Funded Feature Issue is part of the (potential) funded features pipe

Comments

@RachL
Copy link
Contributor

RachL commented Mar 25, 2024

What is the need/problem?

Hub need to be able to see quickly how much they owe each producer. And / or to use data in an integration to send producers purchase orders for example

Reports columns :

  • Name of the producer
  • Producer’s address
  • Producer’s ABN/ACN
  • Producer’s email
  • Name of Hub
  • Hub’s address
  • Hub’s postal code
  • Hub’s contact email
  • Order number
  • Order date
  • Name of order cycle
  • Order cycle start date
  • Order cycle end date
  • Name of product
  • Variant unit name
  • Quantity ordered
  • total product without fees and tax
  • total product with producers fees and without tax
  • total producers fees without tax
  • total producer fees tax
  • total tax (incl. producer fees)
  • Total amount incl. tax and producers fees (and excl. hub fees)

Report filters :

  • date range
  • hub
  • producer
  • order cycle

+usual rendering options

What type of users does this affect (and how many, if known)?

  • Hub Managers (MCFEs)
  • Producers

Additional context

example of an output the file can make easier: https://drive.google.com/file/d/1GLi9sndnL9zo98Eo17uyyEe-SfHPHht6/view

@RachL RachL added Funded Feature Issue is part of the (potential) funded features pipe D1. API All issues that are part of Data & Interoperability > API labels Mar 25, 2024
@dacook
Copy link
Member

dacook commented May 7, 2024

This report appears pretty straightforward.
Would there be any filter options? I guess filter by hub (if user has access to more than one hub) and by producer.

I guess that any purchase order integration/email would be triggered by order cycle closing.

We can add a webhook for that event pretty easily, but it wouldn't contain the information needed to send purchase orders. However it could be used by a middleware like n8n to then access the necessary information (by this report, or orders api) and build the emails.

@rioug
Copy link

rioug commented May 29, 2024

@RachL

It looks like the report Order Cycle Distributor Totals by Supplier could be good base for this :
https://github.com/openfoodfoundation/openfoodnetwork/blob/master/lib/reporting/reports/orders_and_fulfillment/order_cycle_distributor_totals_by_supplier.rb
And it looks the xero invoice report might be helpful as well : https://github.com/openfoodfoundation/openfoodnetwork/blob/master/lib/reporting/reports/xero_invoices/base.rb

Rough estimate :

  • setting the report, and various filter: 0.5 days
  • handling total calculation: 1.5 days
  • extra 20% to cover unforeseen problem : 0.4
    Total: 2.4 days

It's a bit hard to tell how difficult it's going to be to calculate the various total. I believe the data is there so it's just a matter of combining the various adjustments.
Correct me if I am wrong, but as fas as I understand we don't need to worry about voucher for this report. A voucher covers the part of the payment to the hub, but it doesn't affect how much the hub owes to a producer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D1. API All issues that are part of Data & Interoperability > API Funded Feature Issue is part of the (potential) funded features pipe
Projects
Status: Funded Features
Development

No branches or pull requests

3 participants