Class: Quickbooks::Model::Invoice
  
  
  
  
    
      Constant Summary
      collapse
    
    
      
        - REST_RESOURCE =
          
  
 
- 'invoice' 
- XML_COLLECTION_NODE =
          
        
- "Invoice" 
- XML_NODE =
          
        
- "Invoice" 
- EMAIL_STATUS_NEED_TO_SEND =
          
        
- 'NeedToSend' 
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
  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 
  
  
  
  
    | 
84
85
86 | # File 'lib/quickbooks/model/invoice.rb', line 84
def billing_email_address=(email_address_string)
  self.bill_email = EmailAddress.new(email_address_string)
end | 
 
    
      
  
  
    #email_status_for_delivery?  ⇒ Boolean 
  
  
  
  
    | 
93
94
95 | # File 'lib/quickbooks/model/invoice.rb', line 93
def email_status_for_delivery?
  email_status == EMAIL_STATUS_NEED_TO_SEND
end | 
 
    
      
  
  
    #existence_of_customer_ref  ⇒ Object 
  
  
  
  
    | 
98
99
100
101
102 | # File 'lib/quickbooks/model/invoice.rb', line 98
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 
  
  
  
  
    | 
76
77
78
79
80
81
82 | # File 'lib/quickbooks/model/invoice.rb', line 76
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 
  
  
  
  
    | 
89
90
91 | # File 'lib/quickbooks/model/invoice.rb', line 89
def wants_billing_email_sent!
  self.email_status = EMAIL_STATUS_NEED_TO_SEND
end |