Class: Cfdi40::TrasladoDR

Inherits:
Node
  • Object
show all
Defined in:
lib/cfdi40/traslado_dr.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#children_nodes, #element_name, #parent_node, #readonly, #xml_document, #xml_parent

Instance Method Summary collapse

Methods inherited from Node

#add_attributes_to, #add_child_node, #add_children_to, #add_namespaces_to, #attibute_is_null?, attributes, #clean_cached_xml, #create_xml_node, #current_namespace, default_values, define_attribute, define_element_name, define_namespace, define_reader, define_writer, #delete_child, element_name, #expanded_element_name, formats, #formatted_value, #initialize, #load_from_ng_node, #lock, namespaces, #set_defaults, verify_class_variables

Constructor Details

This class inherits a constructor from Cfdi40::Node

Instance Attribute Details

#monto_pagoObject

Returns the value of attribute monto_pago.



11
12
13
# File 'lib/cfdi40/traslado_dr.rb', line 11

def monto_pago
  @monto_pago
end

Instance Method Details

#calculate!Object



13
14
15
16
# File 'lib/cfdi40/traslado_dr.rb', line 13

def calculate!
  self.base_dr = (monto_pago / (1 + tasa_o_cuota_dr.to_f)).round(2)
  self.importe_dr = (monto_pago - base_dr).round(2)
end