Sha256: 04126fd45d325151a78bc1ae3559c9be2fd651c88758c8e147739047262a0ab0

Contents?: true

Size: 1.54 KB

Versions: 3

Compression:

Stored size: 1.54 KB

Contents

# frozen_string_literal: true

require_relative '../bill_line_item/ledger_serializer'
require_relative '../currency/ledger_serializer'

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

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

          attribute ledger_attribute: 'DueDate',
                    resource_attribute: :due_date,
                    type: LedgerSerializerType::DateType

          attribute ledger_attribute: 'PrivateNote', resource_attribute: :memo

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

          attribute ledger_attribute: 'VendorRef.value',
                    resource_attribute: 'vendor.ledger_id'

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

          attribute ledger_attribute: 'DepartmentRef.value',
                    resource_attribute: 'department.ledger_id'

          attribute ledger_attribute: 'DocNumber',
                    resource_attribute: :reference_number

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

Version data entries

3 entries across 3 versions & 1 rubygems

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