Class: ViewReceipt

Inherits:
ApplicationViewRecord show all
Includes:
Models::SearchableView
Defined in:
app/models/view_receipt.rb

Overview

== Schema Information

Table name: view_receipts
Database name: primary

id :integer primary key
amount :decimal(8, 2)
approved_for_refund :boolean
auth_code :string(255)
bank_account_name :text
card_type :string(255)
category :string(255)
company_name :string(255)
currency :string(255)
customer_name :string(255)
customer_type :string(255)
email :string
exchange_rate :float
exported :boolean
gl_date :date
jde_number :string(255)
order_reference_number :string(255)
receipt_date :date
reference :string(255)
remark :string(255)
state :string(255)
bank_account_id :integer
company_id :integer
customer_id :integer
order_id :integer

Has many collapse

Instance Method Summary collapse

Methods included from Models::SearchableView

#crm_link, #crm_link_subtitle, #has_columns?, #main_resource, #readonly?

Methods inherited from ApplicationViewRecord

create, create!, #readonly?

Methods inherited from ApplicationRecord

ransackable_associations, ransackable_attributes, ransackable_scopes, ransortable_attributes, #to_relation

Methods included from Models::EventPublishable

#publish_event

Instance Method Details

#receiptObject



38
39
40
# File 'app/models/view_receipt.rb', line 38

def receipt
  Receipt.find(id)
end

#receipt_detailsActiveRecord::Relation<ReceiptDetail>

Returns:

See Also:



34
# File 'app/models/view_receipt.rb', line 34

has_many :receipt_details, foreign_key: :receipt_id