From b8b8e3f3d3c2bc1bb9cd9ea5dbcb2dd59a0d418a Mon Sep 17 00:00:00 2001 From: nikz Date: Sun, 25 Feb 2018 18:43:26 +0000 Subject: [PATCH] Adds Payment Terms field to Contact --- lib/xero_gateway/contact.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/xero_gateway/contact.rb b/lib/xero_gateway/contact.rb index 0390c873..2e63b84f 100644 --- a/lib/xero_gateway/contact.rb +++ b/lib/xero_gateway/contact.rb @@ -17,7 +17,7 @@ class Contact attr_accessor :contact_id, :contact_number, :account_number, :status, :name, :first_name, :last_name, :email, :addresses, :phones, :updated_at, :bank_account_details, :tax_number, :accounts_receivable_tax_type, :accounts_payable_tax_type, :is_customer, :is_supplier, - :default_currency, :contact_groups + :default_currency, :contact_groups, :payment_terms def initialize(params = {}) @@ -154,6 +154,7 @@ def to_xml(b = Builder::XmlMarkup.new) b.IsCustomer true if self.is_customer b.IsSupplier true if self.is_supplier b.DefaultCurrency if self.default_currency + b.PaymentTerms if self.payment_terms b.Addresses { addresses.each { |address| address.to_xml(b) } } unless addresses.nil? @@ -187,6 +188,7 @@ def self.from_xml(contact_element, gateway = nil) when "IsSupplier" then contact.is_supplier = (element.text == "true") when "DefaultCurrency" then contact.default_currency = element.text when "UpdatedDateUTC" then contact.updated_at = parse_date_time(element.text) + when "PaymentTerms" then contact.payment_terms = element.text end end contact