Sha256: ce8b8b08e6093f42987901b9f71986e1e82f60d9e1bc15e12378b052c645ac0c

Contents?: true

Size: 1.75 KB

Versions: 4

Compression:

Stored size: 1.75 KB

Contents

# frozen_string_literal: true

require_relative '../reference/deserializer'
require_relative '../bill_payment_line/deserializer'
require_relative '../credit_card_payment/deserializer'
require_relative '../check_payment/deserializer'

module LedgerSync
  module Ledgers
    module QuickBooksOnline
      class BillPayment
        class Deserializer < QuickBooksOnline::Deserializer
          id

          amount :TotalAmt
          attribute :DocNumber
          attribute :PrivateNote
          attribute :ExchangeRate
          date :TxnDate

          mapping :PayType,
                  hash: BillPayment::PAYMENT_TYPES.invert

          references_one :Currency,
                         hash_attribute: 'CurrencyRef',
                         deserializer: Reference::Deserializer

          references_one :Vendor,
                         hash_attribute: 'VendorRef',
                         deserializer: Reference::Deserializer

          references_one :APAccount,
                         hash_attribute: 'APAccountRef',
                         deserializer: Reference::Deserializer

          references_one :Department,
                         hash_attribute: 'DepartmentRef',
                         deserializer: Reference::Deserializer

          references_one :CreditCardPayment,
                         hash_attribute: 'CreditCardPayment',
                         deserializer: CreditCardPayment::Deserializer

          references_one :CheckPayment,
                         hash_attribute: 'CheckPayment',
                         deserializer: CheckPayment::Deserializer

          references_many :Line,
                          hash_attribute: 'Line',
                          deserializer: BillPaymentLine::Deserializer
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ledger_sync-1.6.0 lib/ledger_sync/ledgers/quickbooks_online/bill_payment/deserializer.rb
ledger_sync-1.5.2 lib/ledger_sync/ledgers/quickbooks_online/bill_payment/deserializer.rb
ledger_sync-1.5.1 lib/ledger_sync/ledgers/quickbooks_online/bill_payment/deserializer.rb
ledger_sync-1.5.0 lib/ledger_sync/ledgers/quickbooks_online/bill_payment/deserializer.rb