Created
January 21, 2014 19:26
-
-
Save buccolo/8546554 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module NetSuite | |
module Records | |
class CustomerRefundDepositList | |
include Support::Fields | |
include Support::Records | |
include Namespaces::TranCust | |
fields :amount, :apply, :currency, :deposit_date, :doc, :line, :ref_num, :remaining, :total, :replace_all | |
def initialize(attributes = {}) | |
initialize_from_attributes_hash(attributes) | |
case attributes[:customer_refund_deposit] | |
when Hash | |
deposits << CustomerRefundDeposit.new(attributes[:customer_refund_deposit]) | |
when Array | |
attributes[:customer_refund_deposit].each { |deposit| deposits << CustomerRefundDeposit.new(deposit) } | |
end | |
end | |
def deposits | |
@deposits ||= [] | |
end | |
def to_record | |
super.merge({ "#{record_namespace}:customerRefundDeposit" => deposits.first.to_record }) | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment