comee_core 0.3.35 → 0.3.37

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8807655abe4f6e6ab31ffc7a9a1a1b0a4e6c07ba679420b949bf3bda351c882e
4
- data.tar.gz: 3efe3c4e1a46c15c2edcb31204ad96ec8a97c27ad79eccf06e96849b3b8da8cb
3
+ metadata.gz: b282b997b88b2c2237d81f624916d1bd02a8c212389fe07b25444ccb447e9bcc
4
+ data.tar.gz: 3bbca82dcf254a73866b3254e6380b727d92d0460f79ec38a0d7c7d01158e7c1
5
5
  SHA512:
6
- metadata.gz: 1841899e0b61c2daef53b44793da1a2e1396f8a6d0bf350286407aa06a1613872e09db6876ae983399e257041520c46a738a09572d597755cc360408c74230d6
7
- data.tar.gz: 60bd5f8bf1a11f652454ca3fcd06b007ad54adb469c7fc76158c56d49c02469723440e3d190943ebde42774dc53db0f5870163e67cc5e274f60d91bd5cdca7eb
6
+ metadata.gz: 4c893967f70b7a11dd2399531aefe9d98ea8b007bd51742963ec6f9cef1513ae81da0272e344225e6dd408034ea0f7243b6557f359ef1315fb92e53a5d39ead5
7
+ data.tar.gz: 839c94449544e313bbfa7f710afd734e77ef9ee128c015b306f51e0d008e9ca87a53ed77be3677493763abd25108706fdccc67fdf6ac0f694cc9f3501a415acc
@@ -6,6 +6,9 @@ module Comee
6
6
 
7
7
  belongs_to :sales_order
8
8
  belongs_to :pod
9
+ belongs_to :invoice_address,
10
+ -> { where(address_type: ClientAddress::INVOICING_ADDRESS) },
11
+ class_name: "Comee::Core::ClientAddress"
9
12
  has_many :invoice_items
10
13
  has_many :additional_items
11
14
  has_many :payments
@@ -1,6 +1,8 @@
1
1
  module Comee
2
2
  module Core
3
3
  class PurchaseOrderItem < ApplicationRecord
4
+ default_scope { order(serial_no: :asc) }
5
+
4
6
  before_save :calculate_total_price, :calculate_confirmation_values
5
7
  after_save :update_purchase_order
6
8
  after_destroy :update_purchase_order
@@ -0,0 +1,20 @@
1
+ class AddInvoiceAddressToInvoice < ActiveRecord::Migration[7.1]
2
+ def change
3
+ add_column :comee_core_invoices, :invoice_address_id, :bigint
4
+
5
+ reversible do |dir|
6
+ sql = <<-SQL
7
+ UPDATE comee_core_invoices
8
+ SET invoice_address_id = comee_core_sales_orders.invoice_address_id
9
+ FROM comee_core_sales_orders
10
+ WHERE comee_core_invoices.sales_order_id = comee_core_sales_orders.id
11
+ SQL
12
+ dir.up do
13
+ execute sql
14
+ end
15
+ end
16
+ change_column_null :comee_core_invoices, :invoice_address_id, false
17
+ add_foreign_key :comee_core_invoices, :comee_core_client_addresses, column: :invoice_address_id
18
+ add_index :comee_core_invoices, :invoice_address_id, name: "ia_on_cci_indx"
19
+ end
20
+ end
@@ -1,5 +1,5 @@
1
1
  module Comee
2
2
  module Core
3
- VERSION = "0.3.35".freeze
3
+ VERSION = "0.3.37".freeze
4
4
  end
5
5
  end
@@ -11,6 +11,7 @@ FactoryBot.define do
11
11
  notifications_sent { 0 }
12
12
  status { Comee::Core::Invoice.statuses[:draft] }
13
13
  payment_status { Comee::Core::Invoice.payment_statuses[:not_paid] }
14
+ association :invoice_address, factory: :client_address, address_type: Comee::Core::ClientAddress::INVOICING_ADDRESS
14
15
 
15
16
  trait :approved do
16
17
  status { Comee::Core::Invoice.statuses[:approved] }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: comee_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.35
4
+ version: 0.3.37
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henock L.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-20 00:00:00.000000000 Z
11
+ date: 2024-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_model_serializers
@@ -527,6 +527,7 @@ files:
527
527
  - db/migrate/20240716143922_add_customer_item_alias_to_customer_and_sales_order.rb
528
528
  - db/migrate/20240718103456_make_delivery_note_no_and_goods_issue_date_optional.rb
529
529
  - db/migrate/20240720091730_add_use_alias_field_to_line_items.rb
530
+ - db/migrate/20240721035647_add_invoice_address_to_invoice.rb
530
531
  - lib/comee/core.rb
531
532
  - lib/comee/core/engine.rb
532
533
  - lib/comee/core/version.rb