Class: Nfe::TaxCoupon::Total

Inherits:
Data
  • Object
show all
Defined in:
lib/nfe/resources/dto/consumer_invoice_query/tax_coupon.rb,
sig/nfe/resources/dto/consumer_invoice_query/tax_coupon.rbs

Overview

Monetary totals of the coupon (+total+). total_amount is the approximate tax amount (vCFeLei12741) and coupon_amount is the coupon grand total (vCFe).

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTotal

Returns a new instance of Total.

Parameters:

  • total_amount: (Object)
  • coupon_amount: (Object)


29
# File 'sig/nfe/resources/dto/consumer_invoice_query/tax_coupon.rbs', line 29

def initialize: (total_amount: untyped, coupon_amount: untyped) -> void

Instance Attribute Details

#coupon_amountObject (readonly)

Returns the value of attribute coupon_amount.

Returns:

  • (Object)


25
26
27
# File 'sig/nfe/resources/dto/consumer_invoice_query/tax_coupon.rbs', line 25

def coupon_amount
  @coupon_amount
end

#total_amountObject (readonly)

Returns the value of attribute total_amount.

Returns:

  • (Object)


24
25
26
# File 'sig/nfe/resources/dto/consumer_invoice_query/tax_coupon.rbs', line 24

def total_amount
  @total_amount
end

Class Method Details

.from_api(payload) ⇒ Nfe::TaxCoupon::Total?

Parameters:

  • payload (Hash[untyped, untyped], nil)

Returns:



67
68
69
70
71
72
73
74
# File 'lib/nfe/resources/dto/consumer_invoice_query/tax_coupon.rb', line 67

def self.from_api(payload)
  return nil if payload.nil?

  new(
    total_amount: payload["totalAmount"],
    coupon_amount: payload["couponAmount"]
  )
end

.newinstance

Parameters:

  • total_amount: (Object)
  • coupon_amount: (Object)

Returns:

  • (instance)


28
# File 'sig/nfe/resources/dto/consumer_invoice_query/tax_coupon.rbs', line 28

def self.new: (total_amount: untyped, coupon_amount: untyped) -> instance