Sha256: 83fbf2c8feec1b16beee26940d90eebf4e653a17579e67d8df117dbd47c95edf

Contents?: true

Size: 1.27 KB

Versions: 4

Compression:

Stored size: 1.27 KB

Contents

# frozen_string_literal: true

require_relative 'account'
require_relative 'currency'
require_relative 'department'
require_relative 'vendor'
require_relative 'bill_payment_line'
require_relative 'check_payment'
require_relative 'credit_card_payment'

module LedgerSync
  module Ledgers
    module QuickBooksOnline
      class BillPayment < QuickBooksOnline::Resource
        PAYMENT_TYPES = {
          'cash' => 'Cash',
          'check' => 'Check',
          'credit_card' => 'CreditCard'
        }.freeze

        attribute :TotalAmt, type: Type::Integer
        attribute :PrivateNote, type: Type::String
        attribute :TxnDate, type: Type::Date
        attribute :ExchangeRate, type: Type::Float
        attribute :DocNumber, type: Type::String
        attribute :PayType, type: Type::StringFromSet.new(values: PAYMENT_TYPES.keys)

        references_one :APAccount, to: Account
        references_one :Currency, to: Currency
        references_one :Department, to: Department
        references_one :Vendor, to: Vendor

        references_one :CheckPayment, to: CheckPayment
        references_one :CreditCardPayment, to: CreditCardPayment

        references_many :Line, to: BillPaymentLine

        def name
          "Bill Payment: #{self.DocNumber}"
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ledger_sync-1.6.0 lib/ledger_sync/ledgers/quickbooks_online/resources/bill_payment.rb
ledger_sync-1.5.2 lib/ledger_sync/ledgers/quickbooks_online/resources/bill_payment.rb
ledger_sync-1.5.1 lib/ledger_sync/ledgers/quickbooks_online/resources/bill_payment.rb
ledger_sync-1.5.0 lib/ledger_sync/ledgers/quickbooks_online/resources/bill_payment.rb