Matt-Yorkley
0b878dd0a2
Use named scope for finding line_items in a set of orders
2020-03-21 09:45:35 +01:00
luisramos0
1e948735fb
Fix major performance problem by inverting the logic, instead of looking for line_items that are hidden, it looks for line items that are not editable using a merge statement that performs much better
...
Also, remove unnecessary if clause, merge will return an empty relation if no items are found, no need to test for empty.
The test report runs in a little over one minute instead of 8minutes
2019-11-30 22:38:03 +00:00
luisramos0
0ef4247914
Convert Report::LineItems to class and memoize orders so it's only executed once (this improves the report in 3secs for the case I am testing)
2019-11-29 21:51:54 +00:00
luisramos0
cc3368704a
Fix rubocop issues in reports_controller_decorator and in report line_items
2019-11-29 13:54:30 +00:00
luisramos0
da6d035a1d
Rename some reports permissions to order_permissions
2019-11-29 11:23:17 +00:00
Kristina Lim
a91a23aa39
Eager-load associations for Orders and Fulfillment report subtypes
2019-10-16 19:06:35 +08:00
Matt-Yorkley
a5d2579c69
Pluck line_item ids instead of all line_items
2019-10-01 15:51:45 +01:00
luisramos0
86b0d71c7e
Result of rubocop auto-correct and rebuilding rubocop_manual_todo
2019-05-28 12:57:29 +01:00
Kristina Lim
3f84d0008a
Move some in OpenFoodNetwork to engine services
...
This removes the OpenFoodNetwork namespace from these too.
2019-02-08 21:26:38 +00:00
Kristina Lim
9e035efd50
Render enterprise fee report directly in renderer
2019-02-08 21:26:38 +00:00
Kristina Lim
552bf1b9f7
Move report list to own class
2019-02-08 21:26:38 +00:00
Kristina Lim
9ce313c7f5
Define filter authorizer for enterprise fee report
2019-02-08 21:26:37 +00:00
Kristina Lim
cd3e258b59
Rename report authorizers to reflect permissions
2019-02-08 21:26:37 +00:00
Kristina Lim
7d74ddc85b
Add HTML view for enterprise fee summary report
2019-02-08 21:26:37 +00:00
Kristina Lim
418050c1b8
Remove blank strings from array report parameters
...
Remove the blank strings that Rails multiple selects add by default to
make sure that blank lists are still submitted to the server as arrays
instead of nil.
https://api.rubyonrails.org/classes/ActionView/Helpers/FormOptionsHelper.html#method-i-select
2019-02-08 21:26:37 +00:00
Kristina Lim
6e03ab03f5
Extract general behaviour for report parameters
2019-02-08 21:26:37 +00:00
Kristina Lim
34dc16f8c9
Base filter options from initial authorizer object
2019-02-08 21:26:37 +00:00
Kristina Lim
ed2b8e9b9f
Add CSV renderer for enterprise fee summary report
2019-02-08 21:26:37 +00:00
Kristina Lim
3763cb98a3
Add data classes for Enterprise Fee Summary report
2019-02-08 21:26:37 +00:00
Maikel Linke
0fa9ca653e
Move duplicate code into its own module
2018-05-18 11:27:48 +10:00
Julius Pabrinkis
8b2b51d511
Fix code style for Rubocop
2017-07-21 12:17:13 +10:00
Julius Pabrinkis
55b2c19b64
Extract translations from lib folder
2017-07-21 12:17:12 +10:00
Rob Harrington
28ea23965b
Rubocop: Correct Lint/AmbiguousOperator offences
2017-06-23 16:49:08 +10:00
Rob Harrington
7bb58342fc
Rubocop: Auto-correct Style/EmptyLineBetweenDefs offences
2017-06-23 16:49:08 +10:00
Rob Harrington
40972cc6ec
Updating reports to use naming information from line_items directly, rather than from the original variant
2015-10-28 13:07:31 +11:00
Maikel Linke
e25805aa78
Restoring all changes of the last combined branch
...
This reverts commit 1e55e8a907 .
2015-09-10 15:03:13 +10:00
Maikel Linke
1e55e8a907
Reverting all changes of the last combined branch
...
The production server hangs on certain requests. To rule out a code bug,
we revert to the last deployed version.
2015-09-10 12:50:40 +10:00
Maikel Linke
2e2e767564
always displaying group_buy_unit_size
2015-09-09 12:22:28 +10:00
Maikel Linke
0fdd000589
Showing Bulk Unit Size in BulkCoopReport
...
The group_buy_unit_size field is now shown even if 'group buy' is not
enabled. And "Group By Unit Size" is now displayed as "Bulk Unit Size".
2015-09-03 12:26:40 +10:00
Rohan Mitchell
917c17af59
Clarify quantities used for calculations, show excess available via max_quantity
2015-07-24 18:31:49 +10:00
Rohan Mitchell
21a9681205
Do not show negative remainder when there are no purchases
2015-07-24 17:42:23 +10:00
Rohan Mitchell
54fd298e3a
Reinstate variant full name column - needed to identify variants differing only by description
2015-07-24 17:42:00 +10:00
Rohan Mitchell
211171aed4
Rename column for clarity
2015-07-24 12:49:43 +10:00
Rohan Mitchell
17fb4a7247
DRY by extracting calculation to method
2015-07-24 07:17:20 +10:00
Rohan Mitchell
3abce54115
Split variant name into number and unit columns
2015-07-24 07:07:49 +10:00
Rohan Mitchell
28de125b59
Bulk coop allocation report uses unit value rather than variant weight
2015-07-24 07:00:49 +10:00
Rohan Mitchell
4d71a56e38
Update available/unallocated calculations
2015-07-23 16:40:50 +10:00
Rohan Mitchell
ae968cd0eb
Simple refactoring of original total_allocated code
2015-07-23 16:21:37 +10:00
Rohan Mitchell
1a89c3caf4
Translate bulk coop allocation report to reports DSL
2015-07-23 15:07:39 +10:00
Rohan Mitchell
bdd792a3ea
Extract helpers to new superclass
2015-07-23 15:07:15 +10:00
Rohan Mitchell
8665b35f1d
Units required shows amount to fulfil order, not complete units required. Remainder works in opposite direction to suit.
2015-07-23 14:16:40 +10:00
Rohan Mitchell
d68cfbff18
Use scaled value for group_buy_unit_size
2015-07-23 14:06:04 +10:00
Rohan Mitchell
e8f7ab5425
Do bulk coop report calculations using unit values rather than variant weight field
2015-07-23 14:06:04 +10:00
Rohan Mitchell
8ee467d2b9
Split variant name into number and unit columns
2015-07-23 12:22:30 +10:00
Rohan Mitchell
dcae584673
Extract bulk coop supplier report into Report DSL
2015-07-23 12:02:24 +10:00
Rohan Mitchell
a90666467a
Add helper support to Reports DSL
2015-07-23 11:45:19 +10:00
Rohan Mitchell
cc9d0defca
Use class attributes instead of class variables to avoid leakage between subclasses
2015-07-23 11:04:36 +10:00
Rohan Mitchell
142e1d6d9a
Report outputs rules as array for use by OrderGrouper
2015-07-23 10:46:20 +10:00
Rohan Mitchell
1d39fb4438
Report rules can define a summary row
2015-07-23 10:37:47 +10:00
Rohan Mitchell
07eb857a8d
Report can define nested rules
2015-07-23 10:24:10 +10:00