spree_core 5.2.2 → 5.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 40e658898150457b9405d6d68e58d78c1b31b23518e2ffdb6829d3bfb0d68a90
4
- data.tar.gz: e36b7e5d2e39426e2ea9cb4078625f72c36ed58e626959b277174f7f033bdd1f
3
+ metadata.gz: 71ab78c8a32714ab778383e109efa7639a0ed868b971e05e80c1c31861976b73
4
+ data.tar.gz: a6bd61a06df7d9bc875e3ec60c247a72cbc0088be0827a88e69dd96adc4e2ce4
5
5
  SHA512:
6
- metadata.gz: f01a4d3e5245986e4a851dc51fb18103405cf2fab2669a43d504c922a5e7284739a23f6cd17da01276a6ab9a71b4c9589667a4bd7e3373d2c83a9508ea9b87e4
7
- data.tar.gz: 1be2f451d4c370d7c72eee740dfce1536308d61ad7f16c114a7db2eb2462401150ca874b56cda455645abccdc65e9bc97e5810ef82dac16a263ed64ea584c7f7
6
+ metadata.gz: 38858f3d772887de4a876568ed5af0f892a6b51e3c82e9268bd735747dc35825848c7665387373fe5dc951623e4df402fae65d3c9d3cb62c62d21684ddf1aa1f
7
+ data.tar.gz: fbdbfa593a3718e6c59bfa31a2c1ef7e6061b4c21fea192962bb402e4c18421d044503b832b3b0dbd17eee24616ce42523a5cecb4e0a862ea374f826787f3c22
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
2
+ <path stroke-linecap="round" stroke-linejoin="round" d="M2.25 18.75a60.07 60.07 0 0 1 15.797 2.101c.727.198 1.453-.342 1.453-1.096V18.75M3.75 4.5v.75A.75.75 0 0 1 3 6h-.75m0 0v-.375c0-.621.504-1.125 1.125-1.125H20.25M2.25 6v9m18-10.5v.75c0 .414.336.75.75.75h.75m-1.5-1.5h.375c.621 0 1.125.504 1.125 1.125v9.75c0 .621-.504 1.125-1.125 1.125h-.375m1.5-1.5H21a.75.75 0 0 0-.75.75v.75m0 0H3.75m0 0h-.375a1.125 1.125 0 0 1-1.125-1.125V15m1.5 1.5v-.75A.75.75 0 0 0 3 15h-.75M15 10.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm3 0h.008v.008H18V10.5Zm-12 0h.008v.008H6V10.5Z" />
3
+ </svg>
@@ -0,0 +1,22 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.0" id="katman_1" x="0px" y="0px" style="enable-background:new 0 0 1190.55 841.89;" xml:space="preserve" viewBox="238.65 160 712.7 521">
2
+ <style type="text/css">
3
+ .st0{fill:#26367D;}
4
+ .st1{clip-path:url(#SVGID_00000165933728503162618370000013584018841918814628_);}
5
+ .st2{fill:#FFFFFF;}
6
+ .st3{fill:#FBBA2C;}
7
+ </style>
8
+ <path class="st0" d="M302,160h586c34.99,0,63.35,28.36,63.35,63.35v394.3c0,34.99-28.36,63.35-63.35,63.35H302 c-34.99,0-63.35-28.36-63.35-63.35v-394.3C238.65,188.36,267.01,160,302,160z"/>
9
+ <g>
10
+ <defs>
11
+ <rect id="SVGID_1_" x="341.04" y="162.96" width="507.9" height="506.81"/>
12
+ </defs>
13
+ <clipPath id="SVGID_00000137126528663880082090000017192719521453020821_">
14
+ <use xlink:href="#SVGID_1_" style="overflow:visible;"/>
15
+ </clipPath>
16
+ <g style="clip-path:url(#SVGID_00000137126528663880082090000017192719521453020821_);">
17
+ <path class="st0" d="M367.09,226.31h455.81c14.38,0,26.04,13.62,26.04,30.41v319.29c0,16.79-11.66,30.41-26.04,30.41H367.09 c-14.38,0-26.05-13.62-26.05-30.41V256.72C341.04,239.93,352.71,226.31,367.09,226.31z"/>
18
+ <path class="st2" d="M404.53,381.92c0,3.22,0,5.34,1.06,8.55c0,1.09,1.05,2.12,1.05,3.22c2.06,13.91,8.3,20.27,21.76,21.38 c9.3,1.08,19.64,2.12,29,3.22c5.18,0,8.3,3.22,8.3,9.58c0,6.38-2.06,10.69-8.3,10.69h-18.64c-6.24,0-8.3-3.22-9.3-12.81h-24.82 v9.66c0,1.08,1.06,3.22,1.06,4.24c1.05,9.6,7.24,16.03,16.58,18.15c6.22,1.09,12.4,1.09,18.64,2.12h18.64 c6.24-1.09,11.4-2.12,17.58-4.24c7.24-2.12,12.42-7.48,13.46-16.03c1.06-7.48,1.06-16.03,1.06-23.5 c-1.05-8.55-5.16-14.94-13.46-17.1l-18.64-3.23c-6.22-1.09-12.42-1.09-18.64-1.09c-7.24,0-9.3-3.22-9.3-9.58 c0-7.48,3.12-9.6,9.3-10.69h10.34c9.3,0,11.4,1.11,12.42,10.69v1.09h24.82v-6.43c0-13.91-6.22-22.47-20.7-24.6 c-14.46-2.12-28.98-2.12-43.46,1.09c-11.4,2.12-16.58,7.48-18.64,20.27C405.55,378.69,404.53,379.8,404.53,381.92z M631.19,458.83 v-27.8h35.18c13.46,0,22.76-8.55,24.82-21.38c1.06-8.55,2.06-17.1,1.06-25.61c-1.06-19.24-10.34-28.82-28.98-29.93 c-17.58-1.09-35.18-1.09-52.82-1.09c-4.12,0-5.18,1.11-5.18,5.35v101.5C613.61,459.92,622.91,459.92,631.19,458.83z M631.19,407.53V377.6c0,0,2.06-2.12,3.12-2.12h18.64c7.24,1.11,10.36,4.32,10.36,11.78v10.69c0,6.43-2.06,9.58-8.3,9.58H631.19z M708.83,459.92c1.06-5.34,2.06-11.77,4.18-17.1c0-1.11,2.06-2.14,3.12-2.14h33.1c1.06,0,2.06,2.12,3.12,3.22 c2.06,5.35,3.12,10.69,5.18,16.03h27.94c-1.06-2.12-2.06-5.34-3.12-7.46l-27.94-96.23c0-1.09-2.06-3.22-3.12-3.22h-39.34 c-4.18,12.88-7.24,25.67-11.4,38.49c-6.24,22.41-13.46,45.9-19.64,68.37C680.9,459.87,708.83,459.92,708.83,459.92z M747.12,421.43h-26.94c4.12-15,8.3-31.01,12.42-45.96h1.05c4.18,15,9.34,29.93,13.46,45.96H747.12z"/>
19
+ <path class="st3" d="M575.35,441.71c-16.6,0-29-7.46-34.18-19.24h37.28l4.12-11.77h-45.58v-8.55l46.59,2.12l5.16-13.86h-49.68 c5.16-14.94,18.64-22.46,36.22-22.46c7.44-0.05,14.81,1.44,21.76,4.26l4.12-14.94c-4.12-2.14-13.46-4.26-26.92-4.26 c-27.95,0-49.71,13.91-56.94,38.49h-12.35l-5.18,11.78h15.52v9.53h-9.3l-6.22,11.78h17.58c6.24,21.37,25.88,34.18,53.82,34.18 c13.46,0,23.82-2.12,27.94-4.26l-3.12-14.94C591.93,440.69,583.63,441.71,575.35,441.71z"/>
20
+ </g>
21
+ </g>
22
+ </svg>
@@ -163,16 +163,22 @@ module Spree
163
163
  # Skip cancelled shipments
164
164
  return BigDecimal('0') if shipment.canceled?
165
165
 
166
- # Get all inventory units in this shipment for this line item
167
- line_item_units = shipment.inventory_units.where(line_item_id: id).count
166
+ # Skip shipments with no cost/zero cost
167
+ return BigDecimal('0') if shipment.cost.zero?
168
168
 
169
169
  # Get total inventory units in this shipment
170
- total_units = shipment.inventory_units.count
170
+ total_units = shipment.inventory_units
171
+
172
+ # Calculate proportional shipping cost
173
+ return BigDecimal('0') if total_units.empty?
174
+
175
+ # Get all inventory units in this shipment for this line item
176
+ line_item_units = shipment.inventory_units.find_all { |unit| unit.line_item_id == id }.count
171
177
 
172
178
  # Calculate proportional shipping cost
173
- return BigDecimal('0') if total_units.zero? || line_item_units.zero? || shipment.cost.zero?
179
+ return BigDecimal('0') if line_item_units.zero?
174
180
 
175
- shipment.cost * (line_item_units.to_d / total_units)
181
+ shipment.cost * (line_item_units.to_d / total_units.count)
176
182
  end
177
183
  end
178
184
 
@@ -204,10 +204,12 @@ module Spree
204
204
  }
205
205
 
206
206
  scope :by_best_selling, lambda { |order_direction = :desc|
207
- left_joins(:orders).
208
- select("#{Spree::Product.table_name}.*, COUNT(#{Spree::Order.table_name}.id) AS completed_orders_count, SUM(#{Spree::Order.table_name}.total) AS completed_orders_total").
209
- where(Spree::Order.table_name => { id: nil }).
210
- or(where.not(Spree::Order.table_name => { completed_at: nil })).
207
+ left_joins(variants_including_master: { line_items: :order }).
208
+ select(
209
+ "#{Spree::Product.table_name}.*",
210
+ "COUNT(DISTINCT CASE WHEN #{Spree::Order.table_name}.completed_at IS NOT NULL THEN #{Spree::Order.table_name}.id END) AS completed_orders_count",
211
+ "COALESCE(SUM(CASE WHEN #{Spree::Order.table_name}.completed_at IS NOT NULL THEN (#{Spree::LineItem.table_name}.price * #{Spree::LineItem.table_name}.quantity) END), 0) AS completed_orders_total"
212
+ ).
211
213
  group("#{Spree::Product.table_name}.id").
212
214
  order(completed_orders_count: order_direction, completed_orders_total: order_direction)
213
215
  }
@@ -25,6 +25,10 @@ module Spree
25
25
  #
26
26
  has_one_attached :attachment, service: Spree.private_storage_service_name
27
27
 
28
+ def self.report_type
29
+ name.demodulize.underscore
30
+ end
31
+
28
32
  # Returns a scope of records to be used for generating report lines
29
33
  #
30
34
  # @return [ActiveRecord::Relation]
@@ -43,7 +47,11 @@ module Spree
43
47
  end
44
48
 
45
49
  def to_partial_path
46
- "spree/admin/reports/report"
50
+ 'spree/admin/reports/report'
51
+ end
52
+
53
+ def no_report_data_partial_path
54
+ 'spree/admin/reports/no_report_data'
47
55
  end
48
56
 
49
57
  def human_name
@@ -7,7 +7,7 @@ module Spree
7
7
  currency: currency,
8
8
  completed_at: (date_from.to_time.beginning_of_day)..(date_to.to_time.end_of_day)
9
9
  )
10
- ).includes(:order, variant: :product)
10
+ ).includes(:order, shipments: :inventory_units, variant: :product)
11
11
 
12
12
  scope = scope.where(vendor_id: vendor.id) if defined?(vendor) && vendor.present?
13
13
 
@@ -1410,6 +1410,7 @@ en:
1410
1410
  oops: Oops!
1411
1411
  no_products_added: No products added
1412
1412
  no_products_found: No products found
1413
+ no_report_data: No report data
1413
1414
  no_resource_found: No %{resource} found
1414
1415
  no_results: No results
1415
1416
  no_returns_found: No returns found
@@ -1909,6 +1910,7 @@ en:
1909
1910
  select_stock: Select stock
1910
1911
  select_stores: Select Store(s)
1911
1912
  select_user: Select customer
1913
+ select_vendor: Select vendor
1912
1914
  selected_quantity_not_available: selected of %{item} is not available.
1913
1915
  send_consumer_transactional_emails: Send Customer Transactional Emails
1914
1916
  send_copy_of_all_mails_to: Send Copy of All Mails To
@@ -1,5 +1,5 @@
1
1
  module Spree
2
- VERSION = '5.2.2'.freeze
2
+ VERSION = '5.2.4'.freeze
3
3
 
4
4
  def self.version
5
5
  VERSION
Binary file
@@ -0,0 +1,4 @@
1
+ {
2
+ "id": 1,
3
+ "name": "Example"
4
+ }
Binary file
@@ -0,0 +1,18 @@
1
+ slug,sku,name,status,vendor_name,brand_name,description,meta_title,meta_description,meta_keywords,tags,labels,price,compare_at_price,currency,width,height,depth,dimensions_unit,weight,weight_unit,available_on,discontinue_on,track_inventory,inventory_count,inventory_backorderable,tax_category,digital,image1_src,image2_src,image3_src,option1_name,option1_value,option2_name,option2_value,option3_name,option3_value,category1,category2,category3,metafield.properties.fit,metafield.properties.manufacturer,metafield.properties.material,metafield.custom.brand,metafield.custom.material
2
+ denim-shirt,"",Denim Shirt,draft,,,Adipisci sapiente velit nihil ullam. Placeat cumque ipsa cupiditate velit magni sapiente mollitia dolorum. Veritatis esse illo eos perferendis. Perspiciatis vel iusto odio eveniet quam officia quidem. Fugiat a ipsum tempore optio accusantium autem in fugit.,,,,"","",0.0,0.0,USD,,,,,0.0,lb,2025-10-09 14:35:53,,true,100,true,Default,false,,,,,,,,,,Categories -> Men -> Shirts,Categories -> Women,Categories -> Sportswear,Lose,Wannabe,90% Cotton 10% Elastan,,
3
+ denim-shirt,DENIM-SHIRT-XS-BLUE,,,,,,,,,,,62.99,0.0,USD,,,,,0.0,lb,2025-10-09 14:35:53,,true,100,true,Clothing,false,,,,Color,Blue,Size,XS,,,,,
4
+ denim-shirt,DENIM-SHIRT-S-BLUE,,,,,,,,,,,62.99,0.0,USD,,,,,0.0,lb,2025-10-09 14:35:53,,true,100,true,Clothing,false,,,,Color,Blue,Size,S,,,,,
5
+ denim-shirt,DENIM-SHIRT-M-BLUE,,,,,,,,,,,62.99,0.0,USD,,,,,0.0,lb,2025-10-09 14:35:53,,true,100,true,Clothing,false,,,,Color,Blue,Size,M,,,,,
6
+ denim-shirt,DENIM-SHIRT-L-BLUE,,,,,,,,,,,62.99,0.0,USD,,,,,0.0,lb,2025-10-09 14:35:53,,true,100,true,Clothing,false,,,,Color,Blue,Size,L,,,,,
7
+ denim-shirt,DENIM-SHIRT-XL-BLUE,,,,,,,,,,,62.99,0.0,USD,,,,,0.0,lb,2025-10-09 14:35:53,,true,100,true,Clothing,false,,,,Color,Blue,Size,XL,,,,,
8
+ denim-shirt,DENIM-SHIRT-XS-LIGHT-BLUE,,,,,,,,,,,62.99,0.0,USD,,,,,0.0,lb,2025-10-09 14:35:53,,true,100,true,Clothing,false,,,,Color,Light Blue,Size,XS,,,,,
9
+ denim-shirt,DENIM-SHIRT-S-LIGHT-BLUE,,,,,,,,,,,62.99,0.0,USD,,,,,0.0,lb,2025-10-09 14:35:53,,true,100,true,Clothing,false,,,,Color,Light Blue,Size,S,,,,,
10
+ denim-shirt,DENIM-SHIRT-M-LIGHT-BLUE,,,,,,,,,,,62.99,0.0,USD,,,,,0.0,lb,2025-10-09 14:35:53,,true,100,true,Clothing,false,,,,Color,Light Blue,Size,M,,,,,
11
+ denim-shirt,DENIM-SHIRT-L-LIGHT-BLUE,,,,,,,,,,,62.99,0.0,USD,,,,,0.0,lb,2025-10-09 14:35:53,,true,100,true,Clothing,false,,,,Color,Light Blue,Size,L,,,,,
12
+ denim-shirt,DENIM-SHIRT-XL-LIGHT-BLUE,,,,,,,,,,,62.99,0.0,USD,,,,,0.0,lb,2025-10-09 14:35:53,,true,100,true,Clothing,false,,,,Color,Light Blue,Size,XL,,,,,
13
+ checked-shirt,"",Checked Shirt,draft,,,Et ipsam repudiandae itaque tenetur laborum. Cupiditate nulla blanditiis quia tenetur doloremque possimus explicabo asperiores. Facere adipisci veniam aut nemo magnam.,,,,"","",0.0,0.0,USD,,,,,0.0,lb,2025-10-09 14:35:54,,true,100,true,Default,false,,,,,,,,,,Categories -> Men -> Shirts,Categories -> Women,Categories -> Sportswear,Lose,Wannabe,10% Cotton 90% Elastan,,
14
+ checked-shirt,CHECKED-SHIRT-XS-RED,,,,,,,,,,,22.99,0.0,USD,,,,,0.0,lb,2025-10-09 14:35:54,,true,100,true,Clothing,false,,,,Color,Red,Size,XS,,,,,
15
+ checked-shirt,CHECKED-SHIRT-S-RED,,,,,,,,,,,22.99,0.0,USD,,,,,0.0,lb,2025-10-09 14:35:54,,true,100,true,Clothing,false,,,,Color,Red,Size,S,,,,,
16
+ checked-shirt,CHECKED-SHIRT-M-RED,,,,,,,,,,,22.99,0.0,USD,,,,,0.0,lb,2025-10-09 14:35:54,,true,100,true,Clothing,false,,,,Color,Red,Size,M,,,,,
17
+ checked-shirt,CHECKED-SHIRT-L-RED,,,,,,,,,,,22.99,0.0,USD,,,,,0.0,lb,2025-10-09 14:35:54,,true,100,true,Clothing,false,,,,Color,Red,Size,L,,,,,
18
+ checked-shirt,CHECKED-SHIRT-XL-RED,,,,,,,,,,,22.99,0.0,USD,,,,,0.0,lb,2025-10-09 14:35:54,,true,100,true,Clothing,false,,,,Color,Red,Size,XL,,,,,
@@ -0,0 +1 @@
1
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.2
4
+ version: 5.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
@@ -273,6 +273,20 @@ dependencies:
273
273
  - - "~>"
274
274
  - !ruby/object:Gem::Version
275
275
  version: '1.1'
276
+ - !ruby/object:Gem::Dependency
277
+ name: ostruct
278
+ requirement: !ruby/object:Gem::Requirement
279
+ requirements:
280
+ - - ">="
281
+ - !ruby/object:Gem::Version
282
+ version: '0'
283
+ type: :runtime
284
+ prerelease: false
285
+ version_requirements: !ruby/object:Gem::Requirement
286
+ requirements:
287
+ - - ">="
288
+ - !ruby/object:Gem::Version
289
+ version: '0'
276
290
  - !ruby/object:Gem::Dependency
277
291
  name: paranoia
278
292
  requirement: !ruby/object:Gem::Requirement
@@ -600,6 +614,7 @@ files:
600
614
  - app/assets/images/payment_icons/bankmuamalat.svg
601
615
  - app/assets/images/payment_icons/bankofamerica.svg
602
616
  - app/assets/images/payment_icons/bankrakyat.svg
617
+ - app/assets/images/payment_icons/banktransfer.svg
603
618
  - app/assets/images/payment_icons/base.svg
604
619
  - app/assets/images/payment_icons/becs.svg
605
620
  - app/assets/images/payment_icons/benefit.svg
@@ -742,6 +757,7 @@ files:
742
757
  - app/assets/images/payment_icons/seabankid.svg
743
758
  - app/assets/images/payment_icons/seabankph.svg
744
759
  - app/assets/images/payment_icons/sepa_bank_transfer.svg
760
+ - app/assets/images/payment_icons/sepadebit.svg
745
761
  - app/assets/images/payment_icons/sepadirectdebit.svg
746
762
  - app/assets/images/payment_icons/seveneleven.svg
747
763
  - app/assets/images/payment_icons/shib.svg
@@ -1667,6 +1683,15 @@ files:
1667
1683
  - lib/tasks/core.rake
1668
1684
  - lib/tasks/dependencies.rake
1669
1685
  - lib/tasks/exchanges.rake
1686
+ - spec/fixtures/favicon.ico
1687
+ - spec/fixtures/files/example.json
1688
+ - spec/fixtures/files/icon_256x256.gif
1689
+ - spec/fixtures/files/icon_256x256.png
1690
+ - spec/fixtures/files/icon_512x512.png
1691
+ - spec/fixtures/files/img_256x128.png
1692
+ - spec/fixtures/files/products_import.csv
1693
+ - spec/fixtures/text-file.txt
1694
+ - spec/fixtures/thinking-cat.jpg
1670
1695
  - vendor/javascript/@rails--request.js.js
1671
1696
  - vendor/javascript/@stimulus-components--auto-submit.js
1672
1697
  - vendor/javascript/stimulus-reveal-controller.js
@@ -1678,9 +1703,9 @@ licenses:
1678
1703
  - BSD-3-Clause
1679
1704
  metadata:
1680
1705
  bug_tracker_uri: https://github.com/spree/spree/issues
1681
- changelog_uri: https://github.com/spree/spree/releases/tag/v5.2.2
1706
+ changelog_uri: https://github.com/spree/spree/releases/tag/v5.2.4
1682
1707
  documentation_uri: https://docs.spreecommerce.org/
1683
- source_code_uri: https://github.com/spree/spree/tree/v5.2.2
1708
+ source_code_uri: https://github.com/spree/spree/tree/v5.2.4
1684
1709
  rdoc_options: []
1685
1710
  require_paths:
1686
1711
  - lib
@@ -1695,7 +1720,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1695
1720
  - !ruby/object:Gem::Version
1696
1721
  version: 1.8.23
1697
1722
  requirements: []
1698
- rubygems_version: 3.6.9
1723
+ rubygems_version: 4.0.2
1699
1724
  specification_version: 4
1700
1725
  summary: The bare bones necessary for Spree
1701
1726
  test_files: []