Skip to content

Commit

Permalink
Merge PR #3479 into 15.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Apr 2, 2024
2 parents 08e3c35 + 595f55d commit bf9d29c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
6 changes: 4 additions & 2 deletions l10n_es_ticketbai/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,8 +478,10 @@ def validate_refund_invoices():
refund_invoices = self.sudo().filtered(
lambda x: x.tbai_enabled
and "out_refund" == x.move_type
and not x.tbai_refund_type
or x.tbai_refund_type == RefundType.differences.value
and (
not x.tbai_refund_type
or x.tbai_refund_type == RefundType.differences.value
)
and x.tbai_send_invoice
)

Expand Down
17 changes: 15 additions & 2 deletions l10n_es_ticketbai_batuz/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,18 @@ def _get_lroe_tax_line_req(self, tax):
)
return re_tax

def _get_lroe_concept_group_account(self, tax_line):
concepto = ""
lines_with_tax = self.line_ids.filtered(
lambda l: tax_line["tax"].id in l.tax_ids.ids
)
if lines_with_tax:
for line in lines_with_tax:
concepto = line.account_id.group_id.code_prefix_start
if concepto:
break
return concepto

@api.model
def _get_lroe_tax_dict(self, tax_line, tax_lines, deductible=True):
"""Get the LROE tax dictionary for the passed tax line.
Expand Down Expand Up @@ -400,19 +412,20 @@ def _get_lroe_tax_dict(self, tax_line, tax_lines, deductible=True):
]
)
else:
concept = self._get_lroe_concept_group_account(tax_line)
tax_dict = OrderedDict(
[
("Epigrafe", self.company_id.main_activity_iae),
# TODO: 140 - BienAfectoIRPFYOIVA --> valor por defecto "N"
# TODO: 140 - Concepto --> grupo de cuenta contable L20
("Concepto", concept),
# TODO: 140 - ReferenciaBien
("InversionSujetoPasivo", "N"),
# TODO: 140 - OperacionEnRecargoDeEquivalenciaORegimenSimplificado
("BaseImponible", base),
("TipoImpositivo", str(tax_type)),
("CuotaIVASoportada", cuota),
("CuotaIVADeducible", cuota * int(deductible)),
# TODO: 140 - ImporteGastoIRPF
("ImporteGastoIRPF", base),
# TODO: 140 - CriterioCobrosYPagos
]
)
Expand Down

0 comments on commit bf9d29c

Please sign in to comment.