comee_core 0.2.36 → 0.2.38

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: 9e9e650443cc408aaf5be8f1ecb6838100af7f2a51ea36b1dbf6c9a63154e30d
4
- data.tar.gz: 5030a418187ced18a1afd12ec36127858d02461c7dd796889c6dca205664f2e2
3
+ metadata.gz: 033e75a2d4507949ad9f3363a5346d3dde0c682e96eb901e5d6095e94d462f92
4
+ data.tar.gz: a7829b047ad6f4850365acde44bb33019a33bc24268adb3865a48f399d587548
5
5
  SHA512:
6
- metadata.gz: e49268b1d68d607ef6a1c284f8d21c77e2dfdf84986d13299b522faf64c9dc55f188ac9481623cabccd790778c110f9ee8bf21c60b7906d0893a6cd5113dc8a9
7
- data.tar.gz: 25262be73c2e10219a3c74769f8356a0e0026ba7edc324425c8f96c24d4ce678a3812e843c76e78f24e58cb60a05af7225c7cc8e644f8f98b2868c03f00358eb
6
+ metadata.gz: d47f62c4a336b48237fefe3ccdb2a2f5993eda913864c566c09b07ea284f34f51672c653620b385785b7c3b2911550adf3a3b21a3e991811f7f3592967dee578
7
+ data.tar.gz: 65f6674ddac2c67d125ced475c93a23846326b5458b40cb35aba5138635a12086017e14dddb81a2642d8c75a675958b6b4a40f84bb774ba6677dd13fc59c75df
@@ -7,11 +7,10 @@ module Comee
7
7
 
8
8
  belongs_to :purchase_order
9
9
  belongs_to :unit
10
- belongs_to :source, polymorphic: true
11
10
 
12
11
  validates :quantity, presence: true, numericality: {greater_than: 0}
13
12
  validates :price, presence: true, numericality: {greater_than_or_equal_to: 0}
14
- validates :status, :delivery_date, :confirmed_delivery_date, presence: true
13
+ validates :status, :delivery_date, presence: true
15
14
 
16
15
  def calculate_total_price
17
16
  self.total_price = price * quantity
@@ -22,6 +21,8 @@ module Comee
22
21
 
23
22
  self.confirmed_quantity = quantity unless confirmed_quantity
24
23
 
24
+ self.confirmed_delivery_date = delivery_date unless confirmed_delivery_date
25
+
25
26
  self.confirmed_total_price = confirmed_price * confirmed_quantity
26
27
  end
27
28
 
@@ -43,7 +44,6 @@ module Comee
43
44
  def self.ransackable_associations(_auth_object = nil)
44
45
  %w[
45
46
  purchase_order
46
- source
47
47
  unit
48
48
  ]
49
49
  end
@@ -20,6 +20,7 @@ class CreateComeeCoreClients < ActiveRecord::Migration[7.0]
20
20
  index: {name: "currency_on_ccc_indx"},
21
21
  foreign_key: {to_table: :comee_core_currencies}
22
22
 
23
+ t.boolean :subsidiary, default: false
23
24
  t.timestamps
24
25
  end
25
26
  add_index :comee_core_clients, :code, unique: true
@@ -6,7 +6,6 @@ class CreateComeeCorePurchaseOrderItems < ActiveRecord::Migration[7.1]
6
6
  index: {name: "pos_on_ccpoitm_indx"},
7
7
  foreign_key: {to_table: :comee_core_purchase_orders}
8
8
 
9
- t.references :source, polymorphic: true, null: false
10
9
  t.float :quantity, null: false
11
10
  t.float :confirmed_quantity, null: false
12
11
  t.references :unit,
@@ -13,6 +13,7 @@ class CreateComeeCoreInvoices < ActiveRecord::Migration[7.0]
13
13
  t.date :date_issued
14
14
  t.date :due_date
15
15
  t.float :total_price
16
+ t.float :amount_paid, default: 0
16
17
  t.string :payment_term
17
18
  t.integer :notifications_sent
18
19
  t.integer :status, null: false, default: 0
@@ -1,5 +1,5 @@
1
1
  module Comee
2
2
  module Core
3
- VERSION = "0.2.36".freeze
3
+ VERSION = "0.2.38".freeze
4
4
  end
5
5
  end
@@ -2,7 +2,6 @@ FactoryBot.define do
2
2
  factory :purchase_order_item, class: "Comee::Core::PurchaseOrderItem" do
3
3
  purchase_order
4
4
  unit
5
- source factory: :purchase_requisition_item
6
5
  quantity { 10 }
7
6
  confirmed_quantity { quantity }
8
7
  price { 100 }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: comee_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.36
4
+ version: 0.2.38
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henock L.
@@ -437,10 +437,8 @@ files:
437
437
  - db/migrate/20240124161320_create_comee_core_additional_items.rb
438
438
  - db/migrate/20240125003634_create_comee_core_payment_deposits.rb
439
439
  - db/migrate/20240125044630_create_comee_core_payments.rb
440
- - db/migrate/20240303191625_add_amount_paid_field_to_invoice.rb
441
440
  - db/migrate/20240314111117_create_comee_core_purchase_requisitions.rb
442
441
  - db/migrate/20240314111307_create_comee_core_purchase_requisition_items.rb
443
- - db/migrate/20240315163900_add_subsidiary_to_client.rb
444
442
  - lib/comee/core.rb
445
443
  - lib/comee/core/engine.rb
446
444
  - lib/comee/core/version.rb
@@ -1,5 +0,0 @@
1
- class AddAmountPaidFieldToInvoice < ActiveRecord::Migration[7.1]
2
- def change
3
- add_column :comee_core_invoices, :amount_paid, :integer, default: 0
4
- end
5
- end
@@ -1,5 +0,0 @@
1
- class AddSubsidiaryToClient < ActiveRecord::Migration[7.1]
2
- def change
3
- add_column :comee_core_clients, :subsidiary, :boolean, default: false
4
- end
5
- end