Sha256: 445605d7379cb5de9445d01715dd0c76e07d5f3acba61e8aad75ef05c674442a

Contents?: true

Size: 841 Bytes

Versions: 1

Compression:

Stored size: 841 Bytes

Contents

require 'clevic.rb'

# db connection
Clevic::DbOptions.connect( $options ) do
  database :accounts_test
  adapter :postgresql
  username 'accounts'
end

# This is a read-only view, which is currently not implemented
class Values < Clevic::Record
  set_table_name 'values'
  has_many :debits, :class_name => 'Entry', :foreign_key => 'debit_id'
  has_many :credits, :class_name => 'Entry', :foreign_key => 'credit_id'
  def self.ui( parent )
    Clevic::TableView.new( self, parent ).create_model do
      readonly
      plain       :date
      plain       :description
      plain       :debit
      plain       :credit
      plain       :pre_vat_amount
      plain       :cheque_number
      plain       :vat, :label => 'VAT'
      plain       :financial_year
      plain       :month
      
      records :order => 'date'
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
clevic-0.7.0 models/values_models.rb