Sha256: f5ff750c7fc289813bfd46a02788cfa30fc90c6a7ddac1ab6991d60db50cfc39

Contents?: true

Size: 1.69 KB

Versions: 4

Compression:

Stored size: 1.69 KB

Contents

# frozen_string_literal: true

require_relative '../currency/ledger_serializer'
require_relative '../payment_line_item/ledger_serializer'

module LedgerSync
  module Adaptors
    module QuickBooksOnline
      module Payment
        class LedgerSerializer < QuickBooksOnline::LedgerSerializer
          id

          attribute ledger_attribute: 'TotalAmt',
                    resource_attribute: :amount,
                    type: LedgerSerializerType::AmountType

          references_one ledger_attribute: :CurrencyRef,
                         resource_attribute: :currency,
                         serializer: Currency::LedgerSerializer

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

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

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

          attribute ledger_attribute: 'PaymentRefNum',
                    resource_attribute: :reference_number

          attribute ledger_attribute: 'PrivateNote',
                    resource_attribute: :memo

          attribute ledger_attribute: 'ExchangeRate',
                    resource_attribute: :exchange_rate

          attribute ledger_attribute: 'TxnDate',
                    resource_attribute: :transaction_date,
                    type: LedgerSerializerType::DateType

          references_many ledger_attribute: 'Line',
                          resource_attribute: :line_items,
                          serializer: PaymentLineItem::LedgerSerializer
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ledger_sync-1.3.5 lib/ledger_sync/adaptors/quickbooks_online/payment/ledger_serializer.rb
ledger_sync-1.3.4 lib/ledger_sync/adaptors/quickbooks_online/payment/ledger_serializer.rb
ledger_sync-1.3.3 lib/ledger_sync/adaptors/quickbooks_online/payment/ledger_serializer.rb
ledger_sync-1.3.2 lib/ledger_sync/adaptors/quickbooks_online/payment/ledger_serializer.rb