Sha256: b2879ccff1441111b521b2bd4f24d9b9e229aad926ea540fce36792229b4e593

Contents?: true

Size: 1.35 KB

Versions: 4

Compression:

Stored size: 1.35 KB

Contents

# frozen_string_literal: true

require_relative '../currency/serializer'
require_relative '../payment_line_item/serializer'

module LedgerSync
  module Ledgers
    module QuickBooksOnline
      class Payment
        class Serializer < QuickBooksOnline::Serializer
          id

          amount 'TotalAmt',
                 resource_attribute: :amount

          references_one :CurrencyRef,
                         resource_attribute: :currency,
                         serializer: Currency::Serializer

          attribute 'CustomerRef.value',
                    resource_attribute: 'customer.ledger_id'

          attribute 'DepositToAccountRef.value',
                    resource_attribute: 'deposit_account.ledger_id'

          attribute 'ARAccountRef.value',
                    resource_attribute: 'account.ledger_id'

          attribute 'PaymentRefNum',
                    resource_attribute: :reference_number

          attribute 'PrivateNote',
                    resource_attribute: :memo

          attribute 'ExchangeRate',
                    resource_attribute: :exchange_rate

          date 'TxnDate',
               resource_attribute: :transaction_date

          references_many 'Line',
                          resource_attribute: :line_items,
                          serializer: PaymentLineItem::Serializer
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ledger_sync-1.4.4 lib/ledger_sync/ledgers/quickbooks_online/payment/serializer.rb
ledger_sync-1.4.2 lib/ledger_sync/ledgers/quickbooks_online/payment/serializer.rb
ledger_sync-1.4.1 lib/ledger_sync/ledgers/quickbooks_online/payment/serializer.rb
ledger_sync-1.4.0 lib/ledger_sync/ledgers/quickbooks_online/payment/serializer.rb