Class: SalesForecast

Inherits:
ApplicationRecord show all
Includes:
Models::Auditable
Defined in:
app/models/sales_forecast.rb

Overview

== Schema Information

Table name: sales_forecasts
Database name: primary

id :integer not null, primary key
amount :decimal(12, 2)
month :integer
year :integer
created_at :datetime not null
updated_at :datetime not null
business_unit_id :integer
company_id :integer
creator_id :integer
ledger_account_id :integer
updater_id :integer

Indexes

idx_sales_forecasts_company_account_year_month (company_id,ledger_account_id,year,month)

Constant Summary

Constants included from Models::Auditable

Models::Auditable::ALWAYS_IGNORED

Instance Attribute Summary collapse

Belongs to collapse

Methods included from Models::Auditable

#creator, #updater

Methods included from Models::Auditable

#all_skipped_columns, #audit_reference_data, #should_not_save_version, #stamp_record

Methods inherited from ApplicationRecord

ransackable_associations, ransackable_attributes, ransackable_scopes, ransortable_attributes, #to_relation

Methods included from Models::EventPublishable

#publish_event

Instance Attribute Details

#amountObject (readonly)



29
# File 'app/models/sales_forecast.rb', line 29

validates :company_id, :year, :month, :business_unit_id, :ledger_account_id, :amount, presence: true

#business_unit_idObject (readonly)



29
# File 'app/models/sales_forecast.rb', line 29

validates :company_id, :year, :month, :business_unit_id, :ledger_account_id, :amount, presence: true

#company_idObject (readonly)



29
# File 'app/models/sales_forecast.rb', line 29

validates :company_id, :year, :month, :business_unit_id, :ledger_account_id, :amount, presence: true

#ledger_account_idObject (readonly)



29
# File 'app/models/sales_forecast.rb', line 29

validates :company_id, :year, :month, :business_unit_id, :ledger_account_id, :amount, presence: true

#monthObject (readonly)



29
# File 'app/models/sales_forecast.rb', line 29

validates :company_id, :year, :month, :business_unit_id, :ledger_account_id, :amount, presence: true

#yearObject (readonly)



29
# File 'app/models/sales_forecast.rb', line 29

validates :company_id, :year, :month, :business_unit_id, :ledger_account_id, :amount, presence: true

Instance Method Details

#business_unitBusinessUnit



27
# File 'app/models/sales_forecast.rb', line 27

belongs_to :business_unit, optional: true

#companyCompany

Returns:

See Also:



25
# File 'app/models/sales_forecast.rb', line 25

belongs_to :company, optional: true

#ledger_accountLedgerAccount



26
# File 'app/models/sales_forecast.rb', line 26

belongs_to :ledger_account, optional: true