Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion brazilfiscalreport/dacte/dacte.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ def __init__(self, xml, config: DacteConfig = None):
self.outros = root.find(f"{URL}toma4")
self.inf_prot = root.find(f"{URL}infProt")
self.inf_cte_supl = root.find(f"{URL}infCTeSupl")
self.tomador = root.find(f"{URL}toma3") or self.outros
toma3 = root.find(f"{URL}toma3")
self.tomador = toma3 if toma3 is not None else self.outros
self.inf_carga = root.find(f"{URL}infCarga")
self.inf_doc = root.find(f"{URL}infDoc")
self.v_prest = root.find(f"{URL}vPrest")
Expand Down
4 changes: 2 additions & 2 deletions brazilfiscalreport/damdfe/damdfe.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def _build_seg_str(self):

def _build_ciot_str(self):
self.inf_ciot_str = []
if not self.inf_modal:
if self.inf_modal is None:
return self.inf_ciot_str

for ciot_node in self.inf_modal.findall(f"{URL}rodo/{URL}infANTT/{URL}infCIOT"):
Expand Down Expand Up @@ -237,7 +237,7 @@ def _draw_void_watermark(self):
when the environment is homologation.
"""
is_production_environment = extract_text(self.ide, "tpAmb") == "1"
is_protocol_available = bool(self.prot_mdfe)
is_protocol_available = self.prot_mdfe is not None

# Exit early if no watermark is needed
if is_production_environment and is_protocol_available:
Expand Down
6 changes: 3 additions & 3 deletions brazilfiscalreport/danfe/danfe.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ def _draw_void_watermark(self):
when the environment is homologation.
"""
is_production_environment = extract_text(self.ide, "tpAmb") == "1"
is_protocol_available = bool(self.prot_nfe)
is_protocol_available = self.prot_nfe is not None

# Exit early if no watermark is needed
watermark_text = None
Expand Down Expand Up @@ -1094,7 +1094,7 @@ def _draw_location_block(self, elem, description):
block_entrega.render()

def _draw_billing(self):
if not self.cobr:
if self.cobr is None:
# Skip
return

Expand Down Expand Up @@ -1451,7 +1451,7 @@ def _draw_products(self, height_product_table, products, additional_data=""):
return row_info, add_info_lines, max_add_info_lines

def _draw_issqn_calculation(self):
if not self.issqn_tot:
if self.issqn_tot is None:
return
# content data
im = extract_text(self.emit, "IM")
Expand Down
Loading