Class: BrDanfe::DanfeLib::NfeLib::Xprod

Inherits:
Object
  • Object
show all
Defined in:
lib/br_danfe/danfe_lib/nfe_lib/xprod.rb

Instance Method Summary collapse

Constructor Details

#initialize(det) ⇒ Xprod

Returns a new instance of Xprod.



5
6
7
# File 'lib/br_danfe/danfe_lib/nfe_lib/xprod.rb', line 5

def initialize(det)
  @det = det
end

Instance Method Details

#renderObject



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/br_danfe/danfe_lib/nfe_lib/xprod.rb', line 9

def render
  xprod = @det.css('prod/xProd').text.to_s

  xprod += infAdProd if infAdProd?
  xprod += fci if fci?
  xprod += icms_st if icms_st?
  xprod += fcp if fcp?
  xprod += fcp_st if fcp_st?
  xprod += add_icms_st_ret_to_product

  xprod
end