lib/xero_gateway/invoice.rb in xero_gateway-2.0.12 vs lib/xero_gateway/invoice.rb in xero_gateway-2.0.13
- old
+ new
@@ -37,11 +37,11 @@
# Represents whether the line_items have been downloaded when getting from GET /API.XRO/2.0/INVOICES
attr_accessor :line_items_downloaded
# All accessible fields
- attr_accessor :invoice_id, :invoice_number, :invoice_type, :invoice_status, :date, :due_date, :reference, :line_amount_types, :currency_code, :line_items, :contact, :payments, :fully_paid_on, :amount_due, :amount_paid, :amount_credited
+ attr_accessor :invoice_id, :invoice_number, :invoice_type, :invoice_status, :date, :due_date, :reference, :line_amount_types, :currency_code, :line_items, :contact, :payments, :fully_paid_on, :amount_due, :amount_paid, :amount_credited, :sent_to_contact
def initialize(params = {})
@errors ||= []
@payments ||= []
@@ -276,9 +276,10 @@
when "InvoiceNumber" then invoice.invoice_number = element.text
when "Payments" then element.children.each { | payment | invoice.payments << Payment.from_xml(payment) }
when "AmountDue" then invoice.amount_due = BigDecimal.new(element.text)
when "AmountPaid" then invoice.amount_paid = BigDecimal.new(element.text)
when "AmountCredited" then invoice.amount_credited = BigDecimal.new(element.text)
+ when "SentToContact" then invoice.sent_to_contact = (element.text.strip.downcase == "true")
end
end
invoice
end
end