Sha256: c67fca8c01bb831ef6d55b51e9c242b312d5f7d441f9eb4640629ab5836bf869

Contents?: true

Size: 605 Bytes

Versions: 4

Compression:

Stored size: 605 Bytes

Contents

# frozen_string_literal: true

require_relative 'account'
require_relative 'currency'
require_relative 'customer'
require_relative 'invoice_sales_line_item'

module LedgerSync
  class Invoice < LedgerSync::Resource
    attribute :memo, type: Type::String
    attribute :transaction_date, type: Type::Date
    attribute :deposit, type: Type::Integer

    references_one :customer, to: Customer
    references_one :account, to: Account
    references_one :currency, to: Currency

    references_many :line_items, to: InvoiceSalesLineItem

    def name
      "Invoice: #{transaction_date}"
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ledger_sync-1.3.5 lib/ledger_sync/resources/invoice.rb
ledger_sync-1.3.4 lib/ledger_sync/resources/invoice.rb
ledger_sync-1.3.3 lib/ledger_sync/resources/invoice.rb
ledger_sync-1.3.2 lib/ledger_sync/resources/invoice.rb