Class: DearInventory::Models::Purchases

Inherits:
DearInventory::Model show all
Extended by:
T::Sig
Defined in:
lib/dear_inventory/models/purchases.rb,
lib/dear_inventory/models/purchases/line.rb,
lib/dear_inventory/models/purchases/order.rb,
lib/dear_inventory/models/purchases/stock.rb,
lib/dear_inventory/models/purchases/invoice.rb,
lib/dear_inventory/models/purchases/stock_line.rb,
lib/dear_inventory/models/purchases/credit_note.rb,
lib/dear_inventory/models/purchases/invoice_line.rb,
lib/dear_inventory/models/purchases/payment_line.rb,
lib/dear_inventory/models/purchases/unstock_line.rb,
lib/dear_inventory/models/purchases/advanced/stock.rb,
lib/dear_inventory/models/purchases/manual_journal.rb,
lib/dear_inventory/models/purchases/advanced/invoice.rb,
lib/dear_inventory/models/purchases/additional_charge.rb,
lib/dear_inventory/models/purchases/advanced/put_away.rb,
lib/dear_inventory/models/purchases/inventory_movement.rb,
lib/dear_inventory/models/purchases/advanced/stock_line.rb,
lib/dear_inventory/models/purchases/manual_journal_line.rb,
lib/dear_inventory/models/purchases/advanced/credit_note.rb,
lib/dear_inventory/models/purchases/advanced/put_away_line.rb,
lib/dear_inventory/models/purchases/advanced/manual_journal.rb,
lib/dear_inventory/models/purchases/invoice_additional_charge.rb

Defined Under Namespace

Modules: Advanced Classes: AdditionalCharge, CreditNote, InventoryMovement, Invoice, InvoiceAdditionalCharge, InvoiceLine, Line, ManualJournal, ManualJournalLine, Order, PaymentLine, Stock, StockLine, UnstockLine

Instance Method Summary collapse

Methods inherited from DearInventory::Model

define_readers, enumerate_fields, fields, #initialize, #initialize_abstract, #to_h

Methods included from IsASubclass

#is_a?

Constructor Details

This class inherits a constructor from DearInventory::Model

Instance Method Details

#full_recordObject



125
126
127
128
129
130
131
132
# File 'lib/dear_inventory/models/purchases.rb', line 125

def full_record
  case T.unsafe(self).type
  when "Advanced Purchase", "Service Purchase"
    DearInventory::AdvancedPurchase.show(id: T.unsafe(self).id)
  else
    DearInventory::Purchase.show(id: T.unsafe(self).id)
  end
end