Jean-Baptiste Bellet
09491cfc6d
Only return order with the selected shipping rates is true
...
Same concept as
https://github.com/openfoodfoundation/openfoodnetwork/blob/master/app/services/search_orders.rb#L31
2021-07-28 17:05:50 +02:00
Matt-Yorkley
886e03af2f
Merge pull request #7805 from Matt-Yorkley/adjustments-admin
...
[Adjustments] Admin adjustments
2021-07-27 12:23:29 +02:00
Matt-Yorkley
12c9914d1b
Delete old Adjustment scopes #with_tax and #without_tax
2021-07-09 21:49:36 +01:00
Jean-Baptiste Bellet
1a8a12fb0c
Filter language to not display the current lang in the dropdown
...
No need to set a lang that is actually already set
2021-07-08 09:15:09 +02:00
Andy Brett
92216cc1c7
Merge pull request #7761 from apricot12/show_variant_SKU_in_xero
...
Show product variant SKU in Xero report
2021-06-23 08:59:15 -07:00
Pau Pérez Fabregat
aa9a85159e
Merge pull request #7806 from mkllnk/feature-toggles
...
Remove custom feature toggles
2021-06-18 12:23:21 +02:00
Maikel Linke
a8eecf963d
Remove unused custom FeatureToggle implementation
...
Flipper is now our only source of truth regarding feature toggles.
2021-06-18 10:46:51 +10:00
Maikel Linke
bba85e5e79
Remove feature toggling via ENV vars
...
We don't use ENV vars for feature toggles any more. Flipper is much
easier to manage.
2021-06-18 10:46:51 +10:00
Luis Ramos
e52937c113
Use rubocop auto correct to add frozen string literal to all files
...
This is an unsafe auto corection, we will need to trust our build here
2021-06-17 23:07:26 +01:00
Luis Ramos
a253228b96
Add some rubocop disable commands in the code to avoid future wrong rubocop auto corrections
2021-06-17 22:26:54 +01:00
Luis Ramos
23627c5453
Run rubocop -a (safe corrections) removing all exceptions so all possible fixes are applied
...
9290 issues fixed
2021-06-17 22:19:26 +01:00
Nihal Mohammed
3b73f72ac2
Show product variant SKU in Xero report
2021-06-08 19:53:55 +05:30
Matt-Yorkley
7b641ace23
Update Xero Invoices scopes for taxable fees
...
Taxable enterprise fee adjustments now have a tax_category
2021-06-06 20:20:41 +01:00
Matt-Yorkley
2de442f44d
Move taxing of enterprise fees to TaxRate
2021-06-06 20:16:03 +01:00
Maikel
1e1706d371
Merge pull request #7280 from Matt-Yorkley/atomic
...
Remove atomic gem
2021-05-20 17:53:36 +10:00
Viktor Smari
6a342ae368
Ransack.search is deprecated. Use .ransack instead
...
https://github.com/activerecord-hackery/ransack/pull/975
2021-05-09 01:05:37 +02:00
Pau Perez
5bca7d1f8f
Remove the old balance's code branch
...
This keeps the `OrderBalance` abstraction but removes the old code now
that the feature is enabled for all users in all instances and there are
no bugs reported. It's become dead code.
2021-04-19 11:52:41 +02:00
Andy Brett
4aa2ce4b58
Merge pull request #7362 from richardc2117/master
...
Fixes Alphabetical Sorting In Packing Reports
2021-04-15 09:50:02 -07:00
Maikel
0c182c4606
Merge pull request #7259 from jibees/7193-implements-feature-toggle-with-flipper
...
Implements feature toggle with flipper
2021-04-15 11:33:12 +10:00
Matt-Yorkley
e323d016a2
Simplify arguments of #create_adjustment method
2021-04-14 12:01:21 +01:00
Maikel Linke
5775051e35
Simplify FeatureToggle module
...
This saves ten lines of code and makes the simplicity of the
FeatureToggle interface clearer.
2021-04-12 18:26:18 +02:00
Maikel Linke
7a0912d5a4
Use Flipper within the OFN FeatureToggle interface
...
This ensures that we keep the same interface as before and can migrate
to Flipper in a backwards-compatible way.
2021-04-12 18:26:18 +02:00
Maikel Linke
b045a59685
Consider feature toggles without user as well
...
This is running the same feature toggle logic when a user is given or no
user is given. This allows features to define what to do with guests.
2021-04-12 18:26:18 +02:00
ricchen
61bb1bdcdc
fix incorrect last name sorting for packing report
2021-04-08 22:47:04 -04:00
Matt-Yorkley
05b8b8e9db
Fix outstanding balance sum in payment report
2021-04-07 10:56:20 +01:00
Matt-Yorkley
a26880a3a1
Update shipment tax fetching in Xero Invoices report
2021-04-04 19:19:06 +01:00
Matt-Yorkley
1d1b842e08
Delete dead code
2021-04-04 19:19:06 +01:00
Pau Pérez Fabregat
7d5726b6c7
Merge pull request #7150 from coopdevs/use-order-balance-object
...
Feature-toggle all remaining parts of the app where the order balance is shown
2021-03-30 15:58:12 +02:00
Matt-Yorkley
153ec268b7
Remove RackRequestBlocker
2021-03-30 13:24:44 +01:00
Luis Ramos
d66a78ecce
Add magic comment
2021-03-26 23:42:07 +00:00
Luis Ramos
34771c89f9
Fix rspec syntax
2021-03-26 22:34:16 +00:00
Matt-Yorkley
f1e4612c05
Update deprecated uses of #uniq
...
Enumerable#uniq is fine (eg calling #uniq on an Array object), but now using #uniq on an ActiveRecord::Relation is deprecated in favour of #distinct (which modifies the query itself, as opposed to iterating over the results of the query).
2021-03-24 11:42:24 +00:00
Pau Perez
c7b85a3591
Sum balances in Payments report implementing #+
...
This avoids consumers of `OrderBalance` having to couple with the inner
details of this abstraction, which makes the code more changeable.
2021-03-23 09:28:40 +01:00
Pau Perez
5082b6dc99
Make BalanceCalculator use old balance calculation
...
This class is currently used and it gets skipped when the
:customer_balance toggle is enabled, so there's no point on abstracting
the balance with `OrderBalance`. It'll never go through its
`#new_outstanding_balance` branch and it'll be removed once we active
that toggle to everyone.
2021-03-22 11:45:12 +01:00
Pau Perez
5815d1a4a4
Make #outstanding_balance return an OrderBalance
...
This will let us branch by abstraction. All existing calls to
`#outstanding_balance` will go through `OrderBalance` hence, will
check the feature toggle.
Note that by default, `OrderBalance` will end up calling
`#old_outstanding_balance`. As the name states, that's exactly what
`#outstanding_balance` was so far. This means no consumers will see any
change in behavior. We just added on item in the call stack (sort of).
2021-03-22 11:45:12 +01:00
Matt-Yorkley
a768cb2510
Set adjustment "target" (adjustable) to be the line item when adding enterprise fees on line items
2021-03-18 13:18:20 +00:00
Matt-Yorkley
064f7582cc
Update line_item included taxes
...
Drops use of the `spree_adjustments.included_tax` database field (when summing line item tax), which we are slowly deprecating before eventual removal
2021-03-17 22:23:04 +00:00
Pau Pérez Fabregat
51f63060a4
Merge pull request #6879 from coopdevs/customer-balance-bulk-coop-report
...
Customer balance bulk coop report
2021-03-17 12:08:44 +01:00
Pau Perez
16647006c6
Feature-test payments report
...
This report displays order balances and we'll need this basic
feature-test coverage to ensure it keeps working once we refactor them.
2021-03-16 17:05:31 +01:00
Matt-Yorkley
c5feb19e5b
Fix use of ActiveRecord::Type::Boolean#type_cast_from_database
...
This method longer exists.
2021-03-11 12:06:00 +00:00
Matt-Yorkley
b1bf2487e2
Update adjustment scope use in Xero Invoices report
2021-03-04 14:27:02 +00:00
Matt-Yorkley
e33950721c
Change misleading method name in Xero Invoices code
2021-03-04 14:27:02 +00:00
Matt-Yorkley
55db911334
Update sales tax report
2021-03-04 14:27:02 +00:00
Pau Perez
f67b45a580
Reuse query object in Reports::LineItems
...
This almost removes the responsibility of fetching orders from this
class, that has too many. Ideally, I'd go on and leave this up to the
caller of this class making `Reports::LineItems` rely completely on the
passed in `orders_relation`. Not today.
2021-03-03 18:21:43 +01:00
Pau Perez
72597ea3f9
Optionally inject orders relation
...
So we can fetch them differently if we need to. Spoiler: we do in the
bulk coop report.
2021-03-03 18:21:07 +01:00
Pau Perez
fce98da88d
Reject line items in a more succinct way
...
Thanks for the suggestion @mkllnk!
2021-03-03 18:19:26 +01:00
Pau Perez
d00a35e12c
Split long statement
2021-03-03 18:19:26 +01:00
Pau Perez
a3b2a25ccf
Refactor and reuse :not_state scope
2021-03-03 18:19:26 +01:00
Matt-Yorkley
9852470ef6
Merge pull request #6913 from Matt-Yorkley/rails-5-backports
...
Rails 5 backports
2021-02-23 11:55:31 +01:00
Matt-Yorkley
0e3429dc35
Merge pull request #6758 from Matt-Yorkley/enterprise-fees-refactor
...
Enterprise fees refactor
2021-02-22 17:59:18 +01:00