Sha256: b02f562c9ae89270c5cdb4cfaa480f59eb88cfa0abee5d40915cdb3410aac308

Contents?: true

Size: 1.21 KB

Versions: 4

Compression:

Stored size: 1.21 KB

Contents

# frozen_string_literal: true

require_relative '../bill_line_item/serializer'
require_relative '../currency/serializer'

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

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

          date 'DueDate',
               resource_attribute: :due_date

          attribute 'PrivateNote', resource_attribute: :memo

          date 'TxnDate',
               resource_attribute: :transaction_date

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

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

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

          attribute 'DocNumber',
                    resource_attribute: :reference_number

          references_many 'Line',
                          resource_attribute: :line_items,
                          serializer: BillLineItem::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/bill/serializer.rb
ledger_sync-1.4.2 lib/ledger_sync/ledgers/quickbooks_online/bill/serializer.rb
ledger_sync-1.4.1 lib/ledger_sync/ledgers/quickbooks_online/bill/serializer.rb
ledger_sync-1.4.0 lib/ledger_sync/ledgers/quickbooks_online/bill/serializer.rb