Class: Nfe::Generated::ServiceInvoiceRtcV1::DeductionDocument

Inherits:
Data
  • Object
show all
Defined in:
lib/nfe/generated/service_invoice_rtc_v1/deduction_document.rb,
sig/nfe/generated/service_invoice_rtc_v1/deduction_document.rbs

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDeductionDocument

Returns a new instance of DeductionDocument.

Parameters:

  • deductible_total: (Float)
  • deduction_type: (String)
  • fiscal_document_number: (String)
  • issue_date: (String)
  • municipal_nfse: (Hash[String, untyped])
  • nfe_key: (String)
  • nfse_key: (String)
  • non_fiscal_document_number: (String)
  • other_deduction_description: (String)
  • supplier: (PartyDefinition)
  • used_amount: (Float)


21
# File 'sig/nfe/generated/service_invoice_rtc_v1/deduction_document.rbs', line 21

def initialize: (deductible_total: Float, deduction_type: String, ?fiscal_document_number: String, issue_date: String, ?municipal_nfse: Hash[String, untyped], ?nfe_key: String, ?nfse_key: String, ?non_fiscal_document_number: String, ?other_deduction_description: String, ?supplier: PartyDefinition, used_amount: Float) -> void

Instance Attribute Details

#deductible_totalObject (readonly)

Returns the value of attribute deductible_total

Returns:

  • (Object)

    the current value of deductible_total



9
10
11
# File 'lib/nfe/generated/service_invoice_rtc_v1/deduction_document.rb', line 9

def deductible_total
  @deductible_total
end

#deduction_typeObject (readonly)

Returns the value of attribute deduction_type

Returns:

  • (Object)

    the current value of deduction_type



9
10
11
# File 'lib/nfe/generated/service_invoice_rtc_v1/deduction_document.rb', line 9

def deduction_type
  @deduction_type
end

#fiscal_document_numberObject (readonly)

Returns the value of attribute fiscal_document_number

Returns:

  • (Object)

    the current value of fiscal_document_number



9
10
11
# File 'lib/nfe/generated/service_invoice_rtc_v1/deduction_document.rb', line 9

def fiscal_document_number
  @fiscal_document_number
end

#issue_dateObject (readonly)

Returns the value of attribute issue_date

Returns:

  • (Object)

    the current value of issue_date



9
10
11
# File 'lib/nfe/generated/service_invoice_rtc_v1/deduction_document.rb', line 9

def issue_date
  @issue_date
end

#municipal_nfseObject (readonly)

Returns the value of attribute municipal_nfse

Returns:

  • (Object)

    the current value of municipal_nfse



9
10
11
# File 'lib/nfe/generated/service_invoice_rtc_v1/deduction_document.rb', line 9

def municipal_nfse
  @municipal_nfse
end

#nfe_keyObject (readonly)

Returns the value of attribute nfe_key

Returns:

  • (Object)

    the current value of nfe_key



9
10
11
# File 'lib/nfe/generated/service_invoice_rtc_v1/deduction_document.rb', line 9

def nfe_key
  @nfe_key
end

#nfse_keyObject (readonly)

Returns the value of attribute nfse_key

Returns:

  • (Object)

    the current value of nfse_key



9
10
11
# File 'lib/nfe/generated/service_invoice_rtc_v1/deduction_document.rb', line 9

def nfse_key
  @nfse_key
end

#non_fiscal_document_numberObject (readonly)

Returns the value of attribute non_fiscal_document_number

Returns:

  • (Object)

    the current value of non_fiscal_document_number



9
10
11
# File 'lib/nfe/generated/service_invoice_rtc_v1/deduction_document.rb', line 9

def non_fiscal_document_number
  @non_fiscal_document_number
end

#other_deduction_descriptionObject (readonly)

Returns the value of attribute other_deduction_description

Returns:

  • (Object)

    the current value of other_deduction_description



9
10
11
# File 'lib/nfe/generated/service_invoice_rtc_v1/deduction_document.rb', line 9

def other_deduction_description
  @other_deduction_description
end

#supplierObject (readonly)

Returns the value of attribute supplier

Returns:

  • (Object)

    the current value of supplier



9
10
11
# File 'lib/nfe/generated/service_invoice_rtc_v1/deduction_document.rb', line 9

def supplier
  @supplier
end

#used_amountObject (readonly)

Returns the value of attribute used_amount

Returns:

  • (Object)

    the current value of used_amount



9
10
11
# File 'lib/nfe/generated/service_invoice_rtc_v1/deduction_document.rb', line 9

def used_amount
  @used_amount
end

Class Method Details

.from_api(payload) ⇒ instance?

Parameters:

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

Returns:

  • (instance, nil)


10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/nfe/generated/service_invoice_rtc_v1/deduction_document.rb', line 10

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

  new(
    deductible_total: payload["deductibleTotal"],
    deduction_type: payload["deductionType"],
    fiscal_document_number: payload["fiscalDocumentNumber"],
    issue_date: payload["issueDate"],
    municipal_nfse: payload["municipalNfse"],
    nfe_key: payload["nfeKey"],
    nfse_key: payload["nfseKey"],
    non_fiscal_document_number: payload["nonFiscalDocumentNumber"],
    other_deduction_description: payload["otherDeductionDescription"],
    supplier: PartyDefinition.from_api(payload["supplier"]),
    used_amount: payload["usedAmount"],
  )
end

.newinstance

Parameters:

  • deductible_total: (Float)
  • deduction_type: (String)
  • fiscal_document_number: (String)
  • issue_date: (String)
  • municipal_nfse: (Hash[String, untyped])
  • nfe_key: (String)
  • nfse_key: (String)
  • non_fiscal_document_number: (String)
  • other_deduction_description: (String)
  • supplier: (PartyDefinition)
  • used_amount: (Float)

Returns:

  • (instance)


20
# File 'sig/nfe/generated/service_invoice_rtc_v1/deduction_document.rbs', line 20

def self.new: (deductible_total: Float, deduction_type: String, ?fiscal_document_number: String, issue_date: String, ?municipal_nfse: Hash[String, untyped], ?nfe_key: String, ?nfse_key: String, ?non_fiscal_document_number: String, ?other_deduction_description: String, ?supplier: PartyDefinition, used_amount: Float) -> instance