comee_core 0.2.2 → 0.2.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 533b12b534893ae3a9ab0fe5976dfa979948f08d81d4d9f0358198b2f4107cc5
|
4
|
+
data.tar.gz: bddaa2611d2356cd19a8baad4aa6a4ef43166ffb88ac3d5bbba0a13638f769a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9398df564bb22dd6bf7be8e9951d0c3889c398557e674087a61594dd3c166c553b56527fa70ef0abc735c7edcf837b2211ea222c62fa4578631e96f40b3581f6
|
7
|
+
data.tar.gz: 84b0d8c2415dc761605629ba662722f09789c13a1dda2c77d8966677427b5dd674e50a81990bb4fc71f26a8a271f928da4df8a443800ae72dc7114817d17d092
|
@@ -2,6 +2,7 @@ module Comee
|
|
2
2
|
module Core
|
3
3
|
class Invoice < ApplicationRecord
|
4
4
|
belongs_to :sales_order
|
5
|
+
belongs_to :pod
|
5
6
|
has_many :invoice_items
|
6
7
|
|
7
8
|
has_noticed_notifications model_name: "Comee::Core::Notification"
|
@@ -10,9 +11,12 @@ module Comee
|
|
10
11
|
enum :payment_status, {not_paid: 0, partially_paid: 1, fully_paid: 2, overpaid: 3}
|
11
12
|
|
12
13
|
validates :invoice_no, presence: true, uniqueness: true
|
13
|
-
validates :
|
14
|
+
validates :status, :payment_status, presence: true
|
14
15
|
validates :total_price, numericality: {greater_than_or_equal_to: 0, allow_nil: true}
|
15
16
|
|
17
|
+
delegate(:order_number, to: :sales_order, prefix: false)
|
18
|
+
delegate(:reference_no, to: :pod, prefix: true)
|
19
|
+
|
16
20
|
def self.ransackable_attributes(_auth_object = nil)
|
17
21
|
%w[
|
18
22
|
id
|
@@ -6,6 +6,10 @@ class CreateComeeCoreInvoices < ActiveRecord::Migration[7.0]
|
|
6
6
|
null: false,
|
7
7
|
index: {name: "co_on_cci_indx"},
|
8
8
|
foreign_key: {to_table: :comee_core_sales_orders}
|
9
|
+
t.references :pod,
|
10
|
+
null: false,
|
11
|
+
index: {name: "pod_on_cci_indx"},
|
12
|
+
foreign_key: {to_table: :comee_core_pods}
|
9
13
|
t.date :date_issued
|
10
14
|
t.date :due_date
|
11
15
|
t.float :total_price
|
data/lib/comee/core/version.rb
CHANGED