Class: Belvo::TaxRetentions
Overview
A tax retention is the amount of money that the payer must deduct from the total amount of a purchase invoice, according to the regulations of the fiscal institution.
Defined Under Namespace
Classes: TaxRetentionsType
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
-
#initialize(session) ⇒ TaxRetentions
constructor
A new instance of TaxRetentions.
- #resume(_session_id, _token, _link: nil) ⇒ Object
-
#retrieve(link:, type:, options: nil) ⇒ Object
Retrieve tax retentions from a specific fiscal link.
Methods inherited from Resource
#clean, #delete, #detail, #list
Constructor Details
#initialize(session) ⇒ TaxRetentions
Returns a new instance of TaxRetentions.
529 530 531 532 |
# File 'lib/belvo/resources.rb', line 529 def initialize(session) super(session) @endpoint = 'api/tax-retentions/' end |
Instance Method Details
#resume(_session_id, _token, _link: nil) ⇒ Object
561 562 563 564 |
# File 'lib/belvo/resources.rb', line 561 def resume(_session_id, _token, _link: nil) raise NotImplementedError \ 'TaxRetentions does not support resuming a session' end |
#retrieve(link:, type:, options: nil) ⇒ Object
Retrieve tax retentions from a specific fiscal link. for (UUID). the invoice (from the perspective of the Link owner). ‘OUTFLOW` relates to a tax retention for a sent invoice. `INFLOW` relates to a tax retention for a received invoice. (inflow or outflow)
547 548 549 550 551 552 553 554 555 556 557 558 559 |
# File 'lib/belvo/resources.rb', line 547 def retrieve(link:, type:, options: nil) = TaxRetentionsOptions.from() body = { link: link, date_from: .date_from, date_to: .date_to, save_data: .save_data, attach_xml: .attach_xml, type: type }.merge() body = clean body: body @session.post(@endpoint, body) end |