Class: Tripletexer::Endpoints::Ledger
- Inherits:
-
AbstractEndpoint
- Object
- AbstractEndpoint
- Tripletexer::Endpoints::Ledger
- Defined in:
- lib/tripletexer/endpoints/ledger.rb
Defined Under Namespace
Classes: Account, AccountingPeriod, AnnualAccount, CloseGroup, Posting, VatType, Voucher, VoucherType
Constant Summary collapse
- DEFAULT_FIELDS =
'*,account(id,number,name,description),postings(*)'
Instance Method Summary collapse
- #account ⇒ Object
- #accounting_period ⇒ Object
- #annual_account ⇒ Object
- #close_group ⇒ Object
- #posting ⇒ Object
- #search(date_from, date_to, params = {}) ⇒ Object
- #type ⇒ Object
- #vat_type ⇒ Object
- #voucher ⇒ Object
Methods inherited from AbstractEndpoint
Constructor Details
This class inherits a constructor from Tripletexer::Endpoints::AbstractEndpoint
Instance Method Details
#account ⇒ Object
17 18 19 |
# File 'lib/tripletexer/endpoints/ledger.rb', line 17 def account Tripletexer::Endpoints::Ledger::Account.new(api_client) end |
#accounting_period ⇒ Object
21 22 23 |
# File 'lib/tripletexer/endpoints/ledger.rb', line 21 def accounting_period Tripletexer::Endpoints::Ledger::AccountingPeriod.new(api_client) end |
#annual_account ⇒ Object
25 26 27 |
# File 'lib/tripletexer/endpoints/ledger.rb', line 25 def annual_account Tripletexer::Endpoints::Ledger::AnnualAccount.new(api_client) end |
#close_group ⇒ Object
29 30 31 |
# File 'lib/tripletexer/endpoints/ledger.rb', line 29 def close_group Tripletexer::Endpoints::Ledger::CloseGroup.new(api_client) end |
#posting ⇒ Object
33 34 35 |
# File 'lib/tripletexer/endpoints/ledger.rb', line 33 def posting Tripletexer::Endpoints::Ledger::Posting.new(api_client) end |
#search(date_from, date_to, params = {}) ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/tripletexer/endpoints/ledger.rb', line 8 def search(date_from, date_to, params = {}) final_params = params.merge( 'dateFrom' => ::Tripletexer::FormatHelpers.format_date(date_from), 'dateTo' => ::Tripletexer::FormatHelpers.format_date(date_to) ) final_params['fields'] = DEFAULT_FIELDS unless final_params.key?('fields') find_entities('/v2/ledger', final_params) end |
#type ⇒ Object
45 46 47 |
# File 'lib/tripletexer/endpoints/ledger.rb', line 45 def type Tripletexer::Endpoints::Ledger::Type.new(api_client) end |
#vat_type ⇒ Object
37 38 39 |
# File 'lib/tripletexer/endpoints/ledger.rb', line 37 def vat_type Tripletexer::Endpoints::Ledger::VatType.new(api_client) end |
#voucher ⇒ Object
41 42 43 |
# File 'lib/tripletexer/endpoints/ledger.rb', line 41 def voucher Tripletexer::Endpoints::Ledger::Voucher.new(api_client) end |