lib/netsuite/records/invoice.rb in netsuite-0.0.18 vs lib/netsuite/records/invoice.rb in netsuite-0.0.19
- old
+ new
@@ -25,10 +25,15 @@
:tax_total, :terms, :time_disc_amount, :time_disc_print, :time_disc_rate, :time_disc_tax_1_amt, :time_disc_taxable,
:time_discount, :time_list, :time_tax_code, :time_tax_rate_1, :time_tax_rate_2, :to_be_emailed, :to_be_faxed,
:to_be_printed, :total_cost_estimate, :tracking_numbers, :tran_date, :tran_id, :tran_is_vsoe_bundle,
:transaction_bill_address, :transaction_ship_address, :vat_reg_num, :vsoe_auto_calc
+ field :transaction_bill_address, BillAddress
+ field :transaction_ship_address, ShipAddress
+ field :item_list, InvoiceItemList
+ field :custom_field_list, CustomFieldList
+
read_only_fields :sub_total, :discount_total, :total, :recognized_revenue, :amount_remaining, :amount_paid
record_refs :account, :bill_address_list, :custom_form, :entity, :klass, :posting_period, :ship_address_list
attr_reader :internal_id
@@ -36,41 +41,9 @@
def initialize(attributes = {})
@internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
@external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
initialize_from_attributes_hash(attributes)
- end
-
- def transaction_bill_address=(attrs)
- attributes[:transaction_bill_address] = attrs.kind_of?(BillAddress) ? attrs : BillAddress.new(attrs)
- end
-
- def transaction_bill_address
- attributes[:transaction_bill_address] ||= BillAddress.new
- end
-
- def transaction_ship_address=(attrs)
- attributes[:transaction_ship_address] = attrs.kind_of?(ShipAddress) ? attrs : ShipAddress.new(attrs)
- end
-
- def transaction_ship_address
- attributes[:transaction_ship_address] ||= ShipAddress.new
- end
-
- def item_list
- attributes[:item_list] ||= InvoiceItemList.new
- end
-
- def item_list=(attrs)
- attributes[:item_list] = InvoiceItemList.new(attrs)
- end
-
- def custom_field_list
- attributes[:custom_field_list] ||= CustomFieldList.new
- end
-
- def custom_field_list=(attrs)
- attributes[:custom_field_list] = attrs.kind_of?(CustomFieldList) ? attrs : CustomFieldList.new(attrs)
end
def self.get(options = {})
response = Actions::Get.call(self, options)
if response.success?