Sha256: a1761ebbb88d8a66dc44b65fc9742934af49bedf5ca537c38bc3948920ce2ff3
Contents?: true
Size: 708 Bytes
Versions: 25
Compression:
Stored size: 708 Bytes
Contents
module BrDanfe module DanfeLib module NfeLib class Cst def self.to_danfe(xml) value = origin(xml) if csosn?(xml) value += xml.css('ICMS/*/CSOSN').text elsif cst?(xml) value += xml.css('ICMS/*/CST').text end value end def self.origin(xml) xml.css('ICMS/*/orig').text end private_class_method :origin def self.cst?(xml) xml.css('ICMS/*/CST').text != '' end private_class_method :cst? def self.csosn?(xml) xml.css('ICMS/*/CSOSN').text != '' end private_class_method :csosn? end end end end
Version data entries
25 entries across 25 versions & 1 rubygems