Sha256: 15d68b3071e2604f1a3801bfd1afd00ff283752768c5225d595f4139e03acf27

Contents?: true

Size: 1.05 KB

Versions: 11

Compression:

Stored size: 1.05 KB

Contents

module Xeroizer
  module Record
    
    class ManualJournalModel < BaseModel
        
      set_permissions :read, :write, :update
            
    end
    
    class ManualJournal < Base
      
      JOURNAL_STATUS = {
        'DRAFT' =>      'Draft',
        'APPROVED' =>   'Approved'
      } unless defined?(INVOICE_TYPE)
      JOURNAL_STATUSES = JOURNAL_STATUS.keys.sort
            
      set_primary_key :manual_journal_id
      set_possible_primary_keys :manual_journal_id
      list_contains_summary_only true
      
      guid      :manual_journal_id
      date      :date
      string    :status
      string    :line_amount_types
      string    :narration
      datetime  :updated_date_utc, :api_name => 'UpdatedDateUTC'
      
      has_many  :journal_lines, :model_name => 'ManualJournalLine'
      
      validates_presence_of :narration
      validates_associated :journal_lines
      
      # Can only create/update manual journals in DRAFT status
      validates_inclusion_of :status, :in => %w(DRAFT)
      
      public
      
    end
    
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
xeroizer-0.3.4 lib/xeroizer/models/manual_journal.rb
xeroizer-0.3.3 lib/xeroizer/models/manual_journal.rb
xeroizer-0.3.2 lib/xeroizer/models/manual_journal.rb
xeroizer-0.3.1 lib/xeroizer/models/manual_journal.rb
xeroizer-0.3.0 lib/xeroizer/models/manual_journal.rb
xeroizer-0.2.2 lib/xeroizer/models/manual_journal.rb
xeroizer-0.2.1 lib/xeroizer/models/manual_journal.rb
xeroizer-0.2.0 lib/xeroizer/models/manual_journal.rb
xeroizer-0.1.3 lib/xeroizer/models/manual_journal.rb
xeroizer-0.1.2 lib/xeroizer/models/manual_journal.rb
xeroizer-0.1.0 lib/xeroizer/models/manual_journal.rb