Sha256: 6038e881c91a624ee6e082e89381a14bda23e42466c162917a4790c27087fff2

Contents?: true

Size: 488 Bytes

Versions: 29

Compression:

Stored size: 488 Bytes

Contents

module Pacioli
  class JournalEntryValidator
    attr_accessor :journal_entry

    def self.for(journal_entry)
      validator = new
      validator.journal_entry = journal_entry
      validator
    end

    def execute
      unless self.journal_entry.balanced?
        raise Pacioli::AccountsNotBalancedException, "The aggregate balance of all accounts having positive balances must be equal to the aggregate balance of all accounts having negative balances."
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
pacioli-0.0.29 lib/pacioli/validations/journal_entry_validator.rb
pacioli-0.0.28 lib/pacioli/validations/journal_entry_validator.rb
pacioli-0.0.27 lib/pacioli/validations/journal_entry_validator.rb
pacioli-0.0.26 lib/pacioli/validations/journal_entry_validator.rb
pacioli-0.0.25 lib/pacioli/validations/journal_entry_validator.rb
pacioli-0.0.24 lib/pacioli/validations/journal_entry_validator.rb
pacioli-0.0.23 lib/pacioli/validations/journal_entry_validator.rb
pacioli-0.0.22 lib/pacioli/validations/journal_entry_validator.rb
pacioli-0.0.21 lib/pacioli/validations/journal_entry_validator.rb
pacioli-0.0.20 lib/pacioli/validations/journal_entry_validator.rb
pacioli-0.0.19 lib/pacioli/validations/journal_entry_validator.rb
pacioli-0.0.18 lib/pacioli/validations/journal_entry_validator.rb
pacioli-0.0.17 lib/pacioli/validations/journal_entry_validator.rb
pacioli-0.0.16 lib/pacioli/validations/journal_entry_validator.rb
pacioli-0.0.15 lib/pacioli/validations/journal_entry_validator.rb
pacioli-0.0.14 lib/pacioli/validations/journal_entry_validator.rb
pacioli-0.0.13 lib/pacioli/validations/journal_entry_validator.rb
pacioli-0.0.12 lib/pacioli/validations/journal_entry_validator.rb
pacioli-0.0.11 lib/pacioli/validations/journal_entry_validator.rb
pacioli-0.0.10 lib/pacioli/validations/journal_entry_validator.rb