Class: ViewAccountingTransmission
- Inherits:
-
ApplicationViewRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- ApplicationViewRecord
- ViewAccountingTransmission
- Includes:
- Models::SearchableView
- Defined in:
- app/models/view_accounting_transmission.rb
Overview
== Schema Information
Table name: view_accounting_transmissions
Database name: primary
id :integer primary key
billing_entity_contact_point :string(255)
billing_entity_notification_channel :text
customer_full_name :string(255)
customer_notification_channel :text
doc_type :text
document_date :date
is_homeowner :boolean
order_ref :string
po_number :string
profile :string(255)
reference_number :string
rep :text
rma_funding :text
rma_number :string
rma_state :string
state :string
terms :string
total :decimal(, )
transmission_state :string(255)
transmission_type :text
customer_id :integer
order_id :integer
rma_id :integer
Instance Method Summary collapse
Methods included from Models::SearchableView
#crm_link, #crm_link_subtitle, #has_columns?, #main_resource, #readonly?
Methods inherited from ApplicationViewRecord
Methods inherited from ApplicationRecord
ransackable_associations, ransackable_attributes, ransackable_scopes, ransortable_attributes, #to_relation
Methods included from Models::EventPublishable
Instance Method Details
#class_name ⇒ Object
35 36 37 38 39 40 41 42 43 44 |
# File 'app/models/view_accounting_transmission.rb', line 35 def class_name case doc_type when 'INV' 'Invoice' when 'CM' 'CreditMemo' when 'SOA' 'StatementOfAccount' end end |
#unsent_communication ⇒ Object
46 47 48 49 50 |
# File 'app/models/view_accounting_transmission.rb', line 46 def unsent_communication return @unsent_communication if instance_variable_defined?(:@unsent_communication) @unsent_communication = Communication.where(resource_type: class_name, resource_id: id, state: ['draft', 'queued', 'exception']).first end |