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.
522 523 524 525 |
# File 'lib/belvo/resources.rb', line 522 def initialize(session) super(session) @endpoint = 'api/tax-retentions/' end |
Instance Method Details
#resume(_session_id, _token, _link: nil) ⇒ Object
554 555 556 557 |
# File 'lib/belvo/resources.rb', line 554 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)
540 541 542 543 544 545 546 547 548 549 550 551 552 |
# File 'lib/belvo/resources.rb', line 540 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 |