comee_core 0.2.3 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/comee/core/additional_item.rb +9 -0
- data/app/models/comee/core/invoice.rb +5 -1
- data/db/migrate/20240124161320_create_comee_core_additional_items.rb +15 -0
- data/lib/comee/core/version.rb +1 -1
- data/spec/factories/comee/core/additional_items.rb +8 -0
- data/spec/factories/comee/core/invoices.rb +4 -0
- metadata +4 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 709ba512de5167e177d2bd3590f8e63cfc327736b9701763cf43da56e55ec1b7
|
4
|
+
data.tar.gz: d5a59cda7b72aa7eb070d3fe7e8dac183aa037aed22e950023d22912801991c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee1d492b05abb3e6e2ec223931ffee4616a3c3894a8b707dd0ae3e4bc8930e57c532860ed2084cd43beea39d2b7a3ba427ac29ca650b13e4ec8ea77b098dc786
|
7
|
+
data.tar.gz: facd7621610fa761f80e0137743eb9ad6b66d090fd0c5264f82e123141b468808e1e7059c76fc64a4f55e0b32b3f4af32e4612fad123a6f351a8ebadfdc8f1bc
|
@@ -4,6 +4,7 @@ module Comee
|
|
4
4
|
belongs_to :sales_order
|
5
5
|
belongs_to :pod
|
6
6
|
has_many :invoice_items
|
7
|
+
has_many :additional_items
|
7
8
|
|
8
9
|
has_noticed_notifications model_name: "Comee::Core::Notification"
|
9
10
|
|
@@ -11,9 +12,12 @@ module Comee
|
|
11
12
|
enum :payment_status, {not_paid: 0, partially_paid: 1, fully_paid: 2, overpaid: 3}
|
12
13
|
|
13
14
|
validates :invoice_no, presence: true, uniqueness: true
|
14
|
-
validates :
|
15
|
+
validates :status, :payment_status, presence: true
|
15
16
|
validates :total_price, numericality: {greater_than_or_equal_to: 0, allow_nil: true}
|
16
17
|
|
18
|
+
delegate(:order_number, to: :sales_order, prefix: false)
|
19
|
+
delegate(:reference_no, to: :pod, prefix: true)
|
20
|
+
|
17
21
|
def self.ransackable_attributes(_auth_object = nil)
|
18
22
|
%w[
|
19
23
|
id
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class CreateComeeCoreAdditionalItems < ActiveRecord::Migration[7.1]
|
2
|
+
def change
|
3
|
+
create_table :comee_core_additional_items do |t|
|
4
|
+
t.references :invoice,
|
5
|
+
null: false,
|
6
|
+
index: {name: "invoice_on_ccai_indx"},
|
7
|
+
foreign_key: {to_table: :comee_core_invoices}
|
8
|
+
t.float :quantity, null: false, default: 1
|
9
|
+
t.float :unit_price, null: false
|
10
|
+
t.float :total_price, null: false
|
11
|
+
|
12
|
+
t.timestamps
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/lib/comee/core/version.rb
CHANGED
@@ -10,5 +10,9 @@ FactoryBot.define do
|
|
10
10
|
notifications_sent { 0 }
|
11
11
|
status { Comee::Core::Invoice.statuses[:draft] }
|
12
12
|
payment_status { Comee::Core::Invoice.payment_statuses[:not_paid] }
|
13
|
+
|
14
|
+
trait :approved do
|
15
|
+
status { Comee::Core::Invoice.statuses[:approved] }
|
16
|
+
end
|
13
17
|
end
|
14
18
|
end
|
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.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henock L.
|
@@ -299,6 +299,7 @@ files:
|
|
299
299
|
- app/jobs/comee_core/application_job.rb
|
300
300
|
- app/mailers/comee/core/application_mailer.rb
|
301
301
|
- app/mailers/comee/core/supplier_mailer.rb
|
302
|
+
- app/models/comee/core/additional_item.rb
|
302
303
|
- app/models/comee/core/agent.rb
|
303
304
|
- app/models/comee/core/application_record.rb
|
304
305
|
- app/models/comee/core/back_order.rb
|
@@ -429,11 +430,13 @@ files:
|
|
429
430
|
- db/migrate/20240109185931_create_comee_core_time_slots.rb
|
430
431
|
- db/migrate/20240111112140_create_comee_core_pickup_schedules.rb
|
431
432
|
- db/migrate/20240119100125_create_comee_core_client_warehouses.rb
|
433
|
+
- db/migrate/20240124161320_create_comee_core_additional_items.rb
|
432
434
|
- lib/comee/core.rb
|
433
435
|
- lib/comee/core/engine.rb
|
434
436
|
- lib/comee/core/version.rb
|
435
437
|
- lib/comee_core.rb
|
436
438
|
- lib/tasks/comee_core_tasks.rake
|
439
|
+
- spec/factories/comee/core/additional_items.rb
|
437
440
|
- spec/factories/comee/core/agents.rb
|
438
441
|
- spec/factories/comee/core/back_order_items.rb
|
439
442
|
- spec/factories/comee/core/back_orders.rb
|