Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0][FIX] l10n_es_aeat_sii_oca: Campo BaseImponibleACoste obligatorio con… #2280

Closed

Conversation

eantones
Copy link
Contributor

… ^ClaveRegimenEspecialOTrascendencia.*$ = '06'

Migration to 14.0 of #1210

Como consecuencia de los cambios efectuados en la nueva versión del SII en vigor desde el 1 de octubre de 2019, se introducen nuevas validaciones que anteriormente eran opcionales y ahora son obligatorias.

Este PR se enfoca en resolver los siguientes errores relativos al campo "BaseImponibleACoste":

1272: "El campo BaseImponibleACoste es obligatorio cuando el valor de ClaveRegimenEspecialOTrascendencia o alguna ClaveRegimenEspecialOTrascendenciaAdicional sea 06"

1275: "Si el campo ClaveRegimenEspecialOTrascendencia o algunaClaveRegimenEspecialOTrascendenciaAdicional en facturas recibidas tiene un valor igual a 06 el campo BaseImponibleACoste se debe informar"

El #1210 en versión 11.0 ha estado funcionando en producción 2 años y medio sin ningún problema.

En esta versión 14, debido a los cambios en las facturas, la migración no es directa con lo qual estamos de nuevo delante una primera aproximación funcional pero muy poco testeada, un punto de partida a la espera de cualquier comentario, corrección y mejora.

Muchas gracias

@OCA-git-bot
Copy link
Contributor

Hi @pedrobaeza,
some modules you are maintaining are being modified, check this out!

@eantones
Copy link
Contributor Author

eantones commented May 17, 2022

@LoisRForgeFlow @mariadforgeflow @MiquelRForgeFlow can you please review, thanks :-)

@eantones eantones force-pushed the 14.0-l10n_es_aeat_sii-fix_tax_base_cost branch from ce47a8c to 24dd18d Compare May 17, 2022 20:04
Copy link

@mariadforgeflow mariadforgeflow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@pedrobaeza pedrobaeza added this to the 14.0 milestone May 24, 2022
@@ -731,6 +731,10 @@ def _is_sii_simplified_invoice(self):
is_simplified = partner.sii_simplified_invoice
return is_simplified

def _get_sii_base_cost(self):
self.ensure_one()
return sum([x["base"] for x in self._get_tax_info().values()])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No es redundante volver a obtener la información de impuestos? Debería estar ya hecho a otro nivel.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pedrobaeza Sí, ya me lo planteé.

Una alternativa es calcularlo a partir del desglose_factura que nos devuelve el _get_sii_in_taxes, algo del estilo sum([x['BaseImponible'] for x in list(desglose_factura.values())[0]['DetalleIVA']]) y algo similar para las ventas.

Otra alternativa és añadir un nuevo valor de retorno total_base_imponible a los métodos _get_sii_in_taxes/_get_sii_out_taxes.

Pero en cualquiera de los dos casos, el código es poco leíble, implica tocar más partes del código y es muy dependiente de cualquier cambio hecho en la estructura de los diccionarios generados en los métodos _get_sii_in_taxes/_get_sii_out_taxes.

Aún otra opción seria pasar como parámetro el resultado de _get_tax_info en la llamada a _get_sii_in_taxes/_get_sii_out_taxes, para así tenerlo disponible también dentro de los métodos _get_sii_invoice_dict_in/_get_sii_invoice_dict_out, quizás esta última es la que tiene menos problemas aunque implique cambiar los parámetros de los métodos.

¿Como lo ves?

@eantones eantones force-pushed the 14.0-l10n_es_aeat_sii-fix_tax_base_cost branch 2 times, most recently from 930b768 to 68361e7 Compare May 25, 2022 13:22
… ^ClaveRegimenEspecialOTrascendencia.*$ = '06'
@eantones eantones force-pushed the 14.0-l10n_es_aeat_sii-fix_tax_base_cost branch from 68361e7 to 637b55a Compare August 2, 2022 20:39
@github-actions
Copy link

github-actions bot commented Dec 4, 2022

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Dec 4, 2022
@rafaelbn
Copy link
Member

rafaelbn commented Dec 4, 2022

¿Podemos poner la etiqueta de "no stale" aquí?

Quizá podemos revisar @OCA/local-spain-maintainers y hacer merge?

¡Gracias!

@github-actions github-actions bot removed the stale PR/Issue without recent activity, it'll be soon closed automatically. label Dec 11, 2022
@github-actions
Copy link

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Apr 16, 2023
Copy link
Member

@rafaelbn rafaelbn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creo que esto debería estar merged hace tiempo 👍

Gracias @eantones ! @omar7r @HaraldPanten @pedrobaeza ? algún @OCA/local-spain-maintainers ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved stale PR/Issue without recent activity, it'll be soon closed automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants