Class: Quickbooks::Model::Invoice
Constant Summary
collapse
- REST_RESOURCE =
'invoice'
- XML_COLLECTION_NODE =
"Invoice"
- XML_NODE =
"Invoice"
- EMAIL_STATUS_NEED_TO_SEND =
'NeedToSend'
- MINORVERSION =
37
GlobalTaxCalculation::GLOBAL_TAX_CALCULATION, GlobalTaxCalculation::NOT_APPLICABLE, GlobalTaxCalculation::TAX_EXCLUDED, GlobalTaxCalculation::TAX_INCLUSIVE
Instance Method Summary
collapse
#ensure_line_items_initialization, #initialize
#auto_doc_number!
Methods inherited from BaseModel
#as_json, attribute_names, #attributes, attrs_with_types, #initialize, inspect, #inspect, reference_attrs, reference_setters, resource_for_collection, resource_for_singular, to_xml_big_decimal, #to_xml_inject_ns, #to_xml_ns
Methods included from Validator
#line_item_size
Methods included from Definition
included, #is_name_list_entity?, #is_transaction_entity?
Instance Method Details
#billing_email_address=(email_address_string) ⇒ Object
87
88
89
|
# File 'lib/quickbooks/model/invoice.rb', line 87
def billing_email_address=(email_address_string)
self.bill_email = EmailAddress.new(email_address_string)
end
|
#email_status_for_delivery? ⇒ Boolean
96
97
98
|
# File 'lib/quickbooks/model/invoice.rb', line 96
def email_status_for_delivery?
email_status == EMAIL_STATUS_NEED_TO_SEND
end
|
#existence_of_customer_ref ⇒ Object
101
102
103
104
105
|
# File 'lib/quickbooks/model/invoice.rb', line 101
def existence_of_customer_ref
if customer_ref.nil? || (customer_ref && customer_ref.value == 0)
errors.add(:customer_ref, "CustomerRef is required and must be a non-zero value.")
end
end
|
#required_bill_email_if_email_delivery ⇒ Object
79
80
81
82
83
84
85
|
# File 'lib/quickbooks/model/invoice.rb', line 79
def required_bill_email_if_email_delivery
return unless email_status_for_delivery?
if bill_email.nil?
errors.add(:bill_email, "BillEmail is required if EmailStatus=NeedToSend")
end
end
|
#wants_billing_email_sent! ⇒ Object
92
93
94
|
# File 'lib/quickbooks/model/invoice.rb', line 92
def wants_billing_email_sent!
self.email_status = EMAIL_STATUS_NEED_TO_SEND
end
|