From 2ea6d85afe5de0da1e4ec73dfe88204cc79c8b5a Mon Sep 17 00:00:00 2001 From: bilbonet Date: Thu, 7 Dec 2023 17:20:04 +0100 Subject: [PATCH 1/2] [IMP] l10n_es_ticketbai_batuz: LROE modelo 140 implementar metodo para rellenar grupo de cuenta contable L20 --- l10n_es_ticketbai_batuz/models/account_move.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/l10n_es_ticketbai_batuz/models/account_move.py b/l10n_es_ticketbai_batuz/models/account_move.py index ba00ab83fcc..64d2f9c617b 100644 --- a/l10n_es_ticketbai_batuz/models/account_move.py +++ b/l10n_es_ticketbai_batuz/models/account_move.py @@ -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. @@ -400,11 +412,12 @@ 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 @@ -412,7 +425,7 @@ def _get_lroe_tax_dict(self, tax_line, tax_lines, deductible=True): ("TipoImpositivo", str(tax_type)), ("CuotaIVASoportada", cuota), ("CuotaIVADeducible", cuota * int(deductible)), - # TODO: 140 - ImporteGastoIRPF + ("ImporteGastoIRPF", base), # TODO: 140 - CriterioCobrosYPagos ] ) From 595f55dce62ac6f7dc7e4e3e0cc112744c4216b1 Mon Sep 17 00:00:00 2001 From: bilbonet Date: Thu, 28 Mar 2024 13:03:50 +0100 Subject: [PATCH 2/2] [FIX] l10n_es_ticketbai: Se envian las facturas rectificativas de proveedor como facturas emitidas Ticketbai --- l10n_es_ticketbai/models/account_move.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/l10n_es_ticketbai/models/account_move.py b/l10n_es_ticketbai/models/account_move.py index d3a9c33d025..3ca16373573 100644 --- a/l10n_es_ticketbai/models/account_move.py +++ b/l10n_es_ticketbai/models/account_move.py @@ -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 )