Sha256: 8e90d060bb27d45f961ec068c18713a8b2291bcaa23f29275a53404d70153755

Contents?: true

Size: 1.27 KB

Versions: 3

Compression:

Stored size: 1.27 KB

Contents

# frozen_string_literal: true

require_relative '../expense_line_item/ledger_serializer'

module LedgerSync
  module Adaptors
    module QuickBooksOnline
      module JournalEntryLineItem
        class LedgerSerializer < QuickBooksOnline::LedgerSerializer
          attribute ledger_attribute: 'DetailType' do
            'JournalEntryLineDetail'
          end

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

          attribute ledger_attribute: 'JournalEntryLineDetail.PostingType',
                    resource_attribute: :entry_type,
                    type: LedgerSerializerType::JournalEntryLineItemType

          attribute ledger_attribute: 'JournalEntryLineDetail.AccountRef.value',
                    resource_attribute: 'account.ledger_id'

          attribute ledger_attribute: 'JournalEntryLineDetail.ClassRef.value',
                    resource_attribute: 'ledger_class.ledger_id'

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

          attribute ledger_attribute: 'Description',
                    resource_attribute: :description
        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/journal_entry_line_item/ledger_serializer.rb
ledger_sync-1.3.4 lib/ledger_sync/adaptors/quickbooks_online/journal_entry_line_item/ledger_serializer.rb
ledger_sync-1.3.3 lib/ledger_sync/adaptors/quickbooks_online/journal_entry_line_item/ledger_serializer.rb