Add FinancialLinks
For now this is only usefull for plugins, since there is no UI.
This commit is contained in:
parent
75deec9f06
commit
53bb096046
12 changed files with 95 additions and 7 deletions
4
app/models/financial_link.rb
Normal file
4
app/models/financial_link.rb
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
class FinancialLink < ActiveRecord::Base
|
||||
has_many :financial_transactions
|
||||
has_many :invoices
|
||||
end
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
class FinancialTransaction < ActiveRecord::Base
|
||||
belongs_to :ordergroup
|
||||
belongs_to :user
|
||||
belongs_to :financial_link
|
||||
|
||||
validates_presence_of :amount, :note, :user_id, :ordergroup_id
|
||||
validates_numericality_of :amount, greater_then: -100_000,
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ class Invoice < ActiveRecord::Base
|
|||
|
||||
belongs_to :supplier
|
||||
belongs_to :created_by, :class_name => 'User', :foreign_key => 'created_by_user_id'
|
||||
belongs_to :financial_link
|
||||
has_many :deliveries
|
||||
has_many :orders
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue