Commit Graph

2033 Commits

Author SHA1 Message Date
Jean-Baptiste Bellet
53978de632 Create a new report that show revenues (incl. or excl. taxes) by hub
+ Create spec
2022-09-08 09:04:44 +02:00
jibees
20ee0d5009 Merge pull request #9301 from mkllnk/3975-unsupported-image
Allow SVG images for products and show errors when uploading unsupported file
2022-07-21 16:56:11 +02:00
Filipe
b977bc77c8 Merge pull request #9272 from jibees/7905-retrieve-order-already-placed-on-user-confirmation-with-customer-email
On user confirmation, retrieve and link all orders to the new user that were already placed with the same email
2022-06-21 18:12:58 +01:00
François Turbelin
606a56a64d Improve specs 2022-06-21 10:08:12 +02:00
François Turbelin
76ea7089d9 Implement suggestions 2022-06-21 10:08:12 +02:00
François Turbelin
39a6b5d20f Add disabled_at logic on spree users 2022-06-21 10:08:12 +02:00
Jean-Baptiste Bellet
bc43028cb1 On User confirmation, link all already placed orders to this new user
if user.email == customer.email

Co-Authored-By: Maikel <maikel@email.org.au>
2022-06-20 15:39:22 +02:00
Maikel Linke
004c7eef9e Show SVG product images 2022-06-14 15:35:55 +10:00
Filipe
43888f7f3c Merge pull request #9126 from mkllnk/active-storage
[Breaking] Replace Paperclip with Active Storage
2022-06-07 11:14:39 +01:00
Filipe
4a15ed9b39 Merge pull request #9190 from georgethoppil/duplicate-transaction-fees
Destroy all adjustments on cart empty
2022-06-02 11:36:27 +01:00
Maikel Linke
b7efa1b018 Replace Paperclip on Spree::Image 2022-06-01 17:16:55 +10:00
Maikel Linke
4a0ed99919 Replace Paperclip on Enterprise model
We configured Paperclip to convert images to JPG in some cases but I
omitted that here because we don't need it. If an image is better
represented as PNG or another format then the user should be able to
choose that.

Some specs were also testing the generated URL but the Active Storage
URL doesn't contain a style name anymore and it's not helpful to test
the URL.
2022-06-01 17:16:55 +10:00
Maikel Linke
45995ac984 Replace Paperclip on EnterpriseGroup 2022-06-01 17:16:55 +10:00
Maikel Linke
421ffae78c Replace Paperclip on TermsOfServeFile 2022-06-01 17:16:54 +10:00
Maikel Linke
727eef3c4f Replace Paperclippable ContentConfig
The old Paperclip configuration was very clever and easy to use but it
was also a complicated implementation building on the complicated Spree
preference system.

I simplified this with Active Storage, storing simple references to blob
ids and default URLs as backup.
2022-06-01 17:16:54 +10:00
georgethoppil
03b24bfc38 Destroy all adjustments on cart empty 2022-05-17 20:21:47 -04:00
Sebastian Castro
452a3fa933 Reports Refactor 2: Merge Spree::reports into Admin::Reports 2022-05-12 16:54:13 +02:00
GeorgeThoppil
8903496a1b Optional restocking items 2022-05-06 10:55:24 -04:00
Maikel Linke
ec64e5c8f7 Store images with Active Storage as well
While we migrate from Paperclip to Active Storage, we need to use both
at the same time to avoid any downtime or lost images.

Once the migration is complete, we want to use the same name for
attachment as before. Using Paperclip and Active Storage at the same
time creates a name conflict on a couple of methods.

I'm using alias_method as a temporary solution to access Active Storage
methods. We will remove that after the migration. I declare Paperclip
afterwards so that we have those methods declarations for backwards
compatibility now.
2022-04-25 13:00:31 +10:00
GeorgeThoppil
8aa4631e21 Setting payment state for subscription order 2022-04-13 19:08:51 -04:00
Maikel
a4bffc61f1 Merge pull request #8997 from apricot12/8968-Group-products-by-supplier-P1
Sort products by supplier in invoice
2022-04-13 11:54:12 +10:00
Maikel Linke
5e0c901790 Improve spec of sorted line items
The previous version wasn't actually testing the sorting option. There
was only one supplier and the items got sorted the same way in both
cases.
2022-04-12 10:45:40 +10:00
Nihal Mohammed
48613a4b42 Add test for sorted_line_items 2022-04-11 20:11:32 +05:30
Filipe
6ce29f81d8 Merge pull request #8920 from apricot12/Remove_checkout_only_option_from_payment_methods_display
Remove checkout only option from payment methods edit form.
2022-03-10 14:38:45 +00:00
Nihal Mohammed
3820d4c591 Removed checkout only from DISPLAY options on payment method edit form and updated payment_method_spec 2022-03-07 17:33:09 +05:30
Filipe
385cd49964 Merge pull request #8876 from SarvarKh/product-import-validation
Fix product import on existing, empty unit_type and variant_unit
2022-02-21 23:20:04 +00:00
Filipe
dbf5eb76f8 Merge pull request #8689 from apricot12/Transaction_fee_when_crediting
Revoke transaction fee if there is an amount to be credited in order
2022-02-21 20:30:19 +00:00
Filipe
7590b3ecf8 Merge pull request #8756 from jibees/8075-take-into-account-the-inherits_properties-attribute
Product that don't inherits from "producer"/"enterprise" properties should be filtered out by user on shop page
2022-02-21 19:04:08 +00:00
Matt-Yorkley
6c695df917 Merge pull request #8895 from Matt-Yorkley/cloned-subscription-syncing
Sync subscriptions on newly-cloned order cycles
2022-02-17 12:44:39 +00:00
Matt-Yorkley
00fa84e3b5 Sync when switching from nil dates to open 2022-02-16 21:45:43 +00:00
Matt-Yorkley
5913720c85 Sync for both open and upcoming OCs when switching from closed 2022-02-16 18:33:09 +00:00
SarvarKhalimov
22de758e3a Add spec for product import validation 2022-02-16 14:17:35 +05:00
Maikel Linke
d09ba16411 Associate customers again
And simplify the before_validation actions.
2022-02-16 10:23:23 +11:00
Maikel Linke
07314af3f6 Spec customer record association more realistically
The newly added specs were tested on the master branch and passed. But
the previous commit broke one test case which I marked as pending here.

The removed specs are completely replaced by the new ones. Their main
downside was to test only small bits of internal behaviour without
considering the whole callback chain of the order. The new specs are
more realistic and catch bugs like mentioned above.
2022-02-16 10:23:23 +11:00
François Turbelin
554a8625e5 Refactor ensure_customer method 2022-02-16 10:23:23 +11:00
Adrien Chauve
ba6523bb76 Add Customer.full_name 2022-02-16 10:23:22 +11:00
Matt-Yorkley
711a51f2ff Remove .eligible scope
In this case we actually expect there to be no payment fee adjustments at all on the payment, regardless of their eligibility.
2022-02-15 12:24:28 +00:00
Matt-Yorkley
5fba7811c4 Remove #try
#try is useful when the object might be nil or might not respond to the given method. In this case we expect it to exist and respond to #finalized?, so this is a bit more precise.
2022-02-15 12:21:34 +00:00
Matt-Yorkley
5be1b139b9 Replace .stub with expect(x).to receive(:y)
The #stub method is slightly deprecated syntax. Using #expect has the additional benefit here of failing if the object does not receive the expected method call.
2022-02-15 12:19:15 +00:00
Nihal M. Kelanthodika
b017420319 Add specs to check ensure payment method fee is not applied when crediting/refunding order 2022-02-15 11:52:26 +00:00
Matt-Yorkley
e5818955ff Invalidate all incomplete payments when creating a new one, not just those in "checkout" state.
Looking at prod data; when a checkout submission fails due to something like a card being out of date, the payment's state seems to be "pending" and not "checkout", which means this mechanism fro invalidating old payments is potentially not working where it should.
2022-02-11 17:25:27 +00:00
Filipe
820417e6cc Merge pull request #8828 from apricot12/8794-Keep_schedule_when_cloning_OC
Carry over linked schedule to cloned Order Cycle
2022-02-10 17:09:56 +00:00
Filipe
30c1d89525 Merge pull request #8822 from Matt-Yorkley/split-checkout-payment-total
[Split Checkout] Move setting of payment total during checkout into OrderUpdater
2022-02-09 16:21:47 +00:00
Maikel Linke
572a65b324 Create a scope to retrieve product based on its properties
both inherited and own product properties

Update the product spec to test the scope that concern properties
2022-02-07 08:57:18 +01:00
Maikel Linke
2e6d8c1216 Provide aws-sdk with working URI.encode method
The S3 class is calling URI.encode which is removed in Ruby 3. By
providing a URI module within the S3 class makes the S3 code call that
module instead.
2022-02-03 15:20:51 +11:00
Maikel Linke
6468b7d98d Spec image upload
The use of AWS S3 was untested before and it failed after upgrading to
Ruby 3.
2022-02-03 11:25:16 +11:00
Nihal M. Kelanthodika
b45f0f3416 Update order_cycle model spec to account for cloning of schedule along with OC 2022-02-02 21:21:38 +05:30
Matt-Yorkley
35392cb117 Remove Order#set_payment_amount! 2022-02-01 11:39:07 +00:00
Filipe
8d18279f53 Merge pull request #8784 from apricot12/7398-Weight_field-on-non-weight-variants
Convert variant.weight into decimal if integer or 0.0 if nil
2022-01-31 18:55:31 +00:00
Nihal M. Kelanthodika
ddaac654ef Add specs for conversion of variant weight input into decimal/0.0 2022-01-31 17:43:15 +05:30