Neal Chambers
099b2f455f
Remove Unified Orphaned Records SQLs
2023-10-06 11:06:54 +09:00
Neal Chambers
816ffe6e32
Convert rake task to spec
2023-10-06 11:06:54 +09:00
Neal Chambers
6729218846
Improve SQL query to Allow for Optional Relationships
2023-10-06 11:06:54 +09:00
Neal Chambers
bf2c6128a7
Add Foreign Key Column
2023-10-06 11:06:54 +09:00
Neal Chambers
5b87890141
Add SQL script to check for Orphaned Records
2023-10-06 11:06:54 +09:00
Neal Chambers
cb864411ee
Add Rake Task that Generates Migrations for Missing Foreign Keys
2023-10-06 11:06:50 +09:00
filipefurtad0
0e699e9cee
Adds attribute to enterprise factory
...
so that sample data rake task creates visible enterprises by default
2023-10-04 18:00:36 +01:00
David Cook
2558855ad5
Merge pull request #11595 from openfoodfoundation/dependabot/bundler/rubocop-1.56.4
...
chore(deps-dev): bump rubocop from 1.56.3 to 1.56.4
2023-10-03 16:26:21 +11:00
Maikel Linke
fec6caf576
Remove unnecessary Rubocop disable
2023-10-02 16:18:51 +11:00
Konrad
8150a8b04a
Merge pull request #11579 from macanudo527/remove_delegate_belongs_to
...
Remove Deprecated delegate_belongs_to
2023-10-01 13:19:22 +02:00
Konrad
06ebeeac0f
Merge pull request #11543 from rioug/11364-Voucher-fix-tax-report
...
[Vouchers] Fix Sales Tax Totals By Order report
2023-10-01 02:09:33 +02:00
Neal Chambers
50eb8f31f2
Remove Deprecated delegate_belongs_to
2023-09-26 09:50:08 +09:00
Jean-Baptiste Bellet
2803f1c6b2
Group all orders by customer_id, email and distributor_id
...
Therefore have one (and only) row per customer
Co-Authored-By: Maikel <maikel@email.org.au >
2023-09-22 16:44:33 +01:00
Maikel Linke
adc5bf6e93
Simplify date filter in customers report
2023-09-22 16:44:33 +01:00
Jean-Baptiste Bellet
82ccdcca70
Customers report has only one report: Customers
...
No more `addresses` report
+ Fix pre-existing rubocop issues
+ Create method to simplify and remove CyclomaticComplexity error
2023-09-22 16:44:33 +01:00
Jean-Baptiste Bellet
5edc8d8ce1
Delete Mailing List report
2023-09-22 16:44:33 +01:00
Jean-Baptiste Bellet
c6c9cdca65
Add last completed order date
2023-09-22 16:44:33 +01:00
Jean-Baptiste Bellet
d2fbaa7cfd
Add total amount spent at the shop for the customer
2023-09-22 16:44:33 +01:00
Jean-Baptiste Bellet
d55098f94f
Add the number of orders for the customer
2023-09-22 16:44:33 +01:00
Jean-Baptiste Bellet
1378202732
Disable rubocop warning. Not sure how to handle it actually
2023-09-22 16:44:33 +01:00
Jean-Baptiste Bellet
cc26da6560
We'll need to get all the orders per line to count and sum them; prepare it
2023-09-22 16:44:33 +01:00
Jean-Baptiste Bellet
c134de850c
Add filter on completed_at of an order
2023-09-22 16:44:33 +01:00
Jean-Baptiste Bellet
9e295146cb
Remove supplier filter
2023-09-22 16:44:33 +01:00
Gaetan Craig-Riou
9e49da8fae
Add unit test for Reporting::Reports::SalesTax::SalesTaxTotalsByOrder
...
And a small refactoring.
Currently it only covers tax excluded from price
2023-09-22 10:17:50 +02:00
Gaetan Craig-Riou
bec5ad55dd
Use VoucherAdjustmentsService to retrieve tax part of the voucher
2023-09-22 10:17:50 +02:00
Neal Chambers
4596997547
Fix Style/HashSyntax
2023-09-16 09:05:31 +09:00
Gaetan Craig-Riou
0c005ad734
Sales Tax Totals by order included tax, fix tax amount when voucher applied
...
Plus specs
2023-09-14 10:21:50 +02:00
Neal Chambers
bf9db13bb3
Fix Style/HashSyntax
2023-09-14 16:25:49 +09:00
David Cook
ef1ccca4fa
Temporarily 'hide' report
...
The reports framework doesn't currently support hidden reports, but we can mark it with a strike-through at least.
2023-09-13 19:09:55 +02:00
David Cook
db8392ce81
Temporarily hide report
2023-09-13 19:09:55 +02:00
Mohamed ABDELLANI
4cb91da8b2
load only enterprise fees connected to incoming exchanges on the OC
2023-09-13 19:09:55 +02:00
Mohamed ABDELLANI
624b4c8ad2
fix calculation of the summary row's total excl tax
2023-09-13 19:09:55 +02:00
Mohamed ABDELLANI
a3f012c9fe
calculate tax total using existing rows
2023-09-13 19:09:55 +02:00
David Cook
e934bc7cb9
Ignore ClassLength
...
I'm never quite sure the best way to deal with these, so I added a comment to at least explain my justification.
2023-09-13 19:09:55 +02:00
David Cook
93cca56e68
Style/HashSyntax
2023-09-13 19:09:55 +02:00
Mohamed ABDELLANI
080e81e0fe
optimize join_supplier
2023-09-13 19:09:55 +02:00
Mohamed ABDELLANI
6dd70d310c
fix the calculation of the cost of produce
...
we want the cost of produce to only include the items produced by the supplier used to group the rows.
2023-09-13 19:09:55 +02:00
Mohamed ABDELLANI
7a875723ca
fix order_cycle summary row.
...
the summary row has to only include the line items coming from the supplier used in the grouping key
2023-09-13 19:09:55 +02:00
Mohamed ABDELLANI
7b0a99c652
fix enterprise fees listing
...
For every producer, we want to only show the enterprise fees that are applied to at lease one of his products.
To do that, we use the order cycle to build a list of the enterprise fees for every variant.
Every variant will have coordinator fee + additional fees coming from incoming/outgoing exchanges.
2023-09-13 19:09:55 +02:00
Mohamed ABDELLANI
1cd0f88c1e
fix supplier filter
2023-09-13 19:09:55 +02:00
David Cook
9ae65e135b
Rails/Pick
...
Prefer pick("sum(amount)") over pluck("sum(amount)").first
2023-09-13 19:09:55 +02:00
David Cook
55742f40d1
Show a line for cost of produce
...
Utilising a second group_by rule, we can add a second summary_row. The cost of produce is also inserted into the TOTALS row as per requirements.
2023-09-13 19:09:55 +02:00
David Cook
cc54e2e6c7
Add long report class to .rubocop_todo.yml
...
Long classes are a problem that would be good to resolve one day. But it's hard to resolve with the current reports framework.
2023-09-13 19:09:55 +02:00
Mohamed ABDELLANI
ee7668e713
implement enterprise fee report filters
...
squash Reformat/Refactor spec
2023-09-13 19:09:55 +02:00
Mohamed ABDELLANI
2880fd5a87
implement EnterpriseFeesWithTaxReportByProducer
...
squash Re-format code
squash Apply suggestions from code review
Co-authored-by: Maikel <maikel@email.org.au >
squash More refactor
squash Update lib/reporting/reports/enterprise_fee_summary/enterprise_fees_with_tax_report_by_producer.rb
2023-09-13 19:09:55 +02:00
Gaetan Craig-Riou
9925399292
Sales Tax Totals by order, fix tax amount when voucher applied
...
Apply the tax discount to the tax collumn when a voucher is added
to the order, and update total excluding tax accordingly.
2023-09-12 14:36:28 +02:00
Maikel Linke
fc7c8757d9
Move DFC patches into our DFC engine
...
It seems to belong there and it's avoiding some loading issues with
Spring.
2023-09-11 14:57:38 +10:00
Maikel Linke
73193fbfd0
Explicitely load our DFC Connector patches
...
It makes sure we can extend functionality without conflicts.
2023-09-11 14:57:38 +10:00
Maikel
b1a88ab7a9
Merge pull request #11490 from mkllnk/sample-data-validation
...
Skip online validation of sample emails
2023-09-05 09:28:16 +10:00
Konrad
fd6f2338e5
Merge pull request #11450 from mkllnk/feature-toggle-enterprise
...
Activate vouchers feature per user or enterprise
2023-09-04 21:30:41 +02:00