Skip to content

Commit

Permalink
Merge PR #3587 into 17.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed May 17, 2024
2 parents a6ae31f + e9b8313 commit 9d733fa
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 65 deletions.
2 changes: 2 additions & 0 deletions l10n_es_aeat_mod303/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ Contributors

- Iván Antón

- Arantxa Sudón `Moduon <https://www.moduon.team>`__

Maintainers
-----------

Expand Down
60 changes: 11 additions & 49 deletions l10n_es_aeat_mod303/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"
"X-Generator: Poedit 3.4\n"

#. module: l10n_es_aeat_mod303
#: model:ir.model.fields,help:l10n_es_aeat_mod303.field_l10n_es_aeat_mod303_report__casilla_46
Expand Down Expand Up @@ -294,6 +294,11 @@ msgstr "C - Actividades no iniciadas"
msgid "Calculation Date"
msgstr "Fecha de cálculo"

#. module: l10n_es_aeat_mod303
#: model:ir.model.fields,help:l10n_es_aeat_mod303.field_l10n_es_aeat_mod303_report__return_last_period
msgid "Check if you are submitting the last period return"
msgstr "Marcar si quieres enviar la devolución en el último período"

#. module: l10n_es_aeat_mod303
#: model:ir.model.fields,field_description:l10n_es_aeat_mod303.field_l10n_es_aeat_mod303_report__company_id
msgid "Company"
Expand Down Expand Up @@ -583,6 +588,11 @@ msgstr "Diario en el que se publica el movimiento."
msgid "L.R. VAT number"
msgstr "NIF del representante legal"

#. module: l10n_es_aeat_mod303
#: model:ir.model.fields,field_description:l10n_es_aeat_mod303.field_l10n_es_aeat_mod303_report__return_last_period
msgid "Last Period Return"
msgstr "Devolución último período"

#. module: l10n_es_aeat_mod303
#: model:ir.model.fields,field_description:l10n_es_aeat_mod303.field_l10n_es_aeat_mod303_report__write_uid
#: model:ir.model.fields,field_description:l10n_es_aeat_mod303.field_l10n_es_aeat_mod303_report_activity_code__write_uid
Expand Down Expand Up @@ -1044,51 +1054,3 @@ msgstr "¿SII voluntario?"
#: model:ir.model.fields,field_description:l10n_es_aeat_mod303.field_l10n_es_aeat_mod303_report__has_operation_volume
msgid "¿Volumen de operaciones?"
msgstr "¿Volumen de operaciones?"

#~ msgid "Last Modified on"
#~ msgstr "Última modificación en"

#~ msgid "Main Attachment"
#~ msgstr "Adjunto Principal"

#~ msgid "Number of messages which requires an action"
#~ msgstr "Número de mensajes que requieren una acción"

#~ msgid "Model"
#~ msgstr "Modelo"

#~ msgid "Number of unread messages"
#~ msgstr "Número de mensajes no leídos"

#~ msgid "Unread Messages"
#~ msgstr "Mensajes no leídos"

#~ msgid "Unread Messages Counter"
#~ msgstr "Contador de mensajes no leídos"

#~ msgid "Allow posting"
#~ msgstr "Permitir generar asiento"

#~ msgid "Calculation date"
#~ msgstr "Fecha de cálculo"

#~ msgid "Contact email"
#~ msgstr "Email de contacto"

#~ msgid "Followers (Channels)"
#~ msgstr "Seguidores (Canales)"

#~ msgid "Period type"
#~ msgstr "Tipo de período"

#~ msgid "Result type"
#~ msgstr "Tipo de resultado"

#~ msgid ""
#~ "Información adicional - Operaciones realizadas en el ejercicio - Total "
#~ "volumen de operaciones "
#~ "([80]+[81]+[93]+[94]+[83]+[84]+[85]+[86]+[95]+[96]+[97]+[98]-[79]-[99])"
#~ msgstr ""
#~ "Información adicional - Operaciones realizadas en el ejercicio - Total "
#~ "volumen de operaciones "
#~ "([80]+[81]+[93]+[94]+[83]+[84]+[85]+[86]+[95]+[96]+[97]+[98]-[79]-[99])"
12 changes: 12 additions & 0 deletions l10n_es_aeat_mod303/i18n/l10n_es_aeat_mod303.pot
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-01-16 16:07+0000\n"
"PO-Revision-Date: 2024-01-16 16:07+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
Expand Down Expand Up @@ -279,6 +281,11 @@ msgstr ""
msgid "Calculation Date"
msgstr ""

#. module: l10n_es_aeat_mod303
#: model:ir.model.fields,help:l10n_es_aeat_mod303.field_l10n_es_aeat_mod303_report__return_last_period
msgid "Check if you are submitting the last period return"
msgstr ""

#. module: l10n_es_aeat_mod303
#: model:ir.model.fields,field_description:l10n_es_aeat_mod303.field_l10n_es_aeat_mod303_report__company_id
msgid "Company"
Expand Down Expand Up @@ -546,6 +553,11 @@ msgstr ""
msgid "L.R. VAT number"
msgstr ""

#. module: l10n_es_aeat_mod303
#: model:ir.model.fields,field_description:l10n_es_aeat_mod303.field_l10n_es_aeat_mod303_report__return_last_period
msgid "Last Period Return"
msgstr ""

#. module: l10n_es_aeat_mod303
#: model:ir.model.fields,field_description:l10n_es_aeat_mod303.field_l10n_es_aeat_mod303_report__write_uid
#: model:ir.model.fields,field_description:l10n_es_aeat_mod303.field_l10n_es_aeat_mod303_report_activity_code__write_uid
Expand Down
54 changes: 38 additions & 16 deletions l10n_es_aeat_mod303/models/mod303.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,25 +450,47 @@ def onchange_type(self):
self.previous_result = 0

def calculate(self):
self.cuota_compensar = 0
res = super().calculate()
for mod303 in self:
prev_reports = mod303._get_previous_fiscalyear_reports(
mod303.date_start
).filtered(lambda x: x.state not in ["draft", "cancelled"])
if not prev_reports:
continue
prev_report = min(
prev_reports,
key=lambda x: abs(
fields.Date.to_date(x.date_end)
- fields.Date.to_date(mod303.date_start)
),
)
if prev_report.result_type == "C":
amount = abs(prev_report.resultado_liquidacion)
mod303.write(
{"cuota_compensar": amount, "potential_cuota_compensar": amount}
prev_reports = self.search(
[("date_start", "<", mod303.date_start)]
).filtered(lambda m: m.state not in ["draft", "cancelled"])
if prev_reports:
prev_report = min(
prev_reports,
key=lambda x: abs(
fields.Date.to_date(x.date_end)
- fields.Date.to_date(mod303.date_start)
),
)
if (
prev_report.remaining_cuota_compensar > 0
or prev_report.result_type == "C"
):
mod303.write(
{
"potential_cuota_compensar": (
prev_report.remaining_cuota_compensar
- prev_report.resultado_liquidacion
),
}
)
if (
float_compare(
mod303.resultado_liquidacion,
0,
precision_digits=mod303.currency_id.decimal_places,
)
!= -1
):
cuota_compensar = min(
mod303.potential_cuota_compensar, mod303.resultado_liquidacion
)
else:
cuota_compensar = 0
mod303.cuota_compensar = cuota_compensar

return res

def button_confirm(self):
Expand Down
1 change: 1 addition & 0 deletions l10n_es_aeat_mod303/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
- Valentin Vinagre
- [Ozono Multimedia](https://www.ozonomultimedia.com):
- Iván Antón
- Arantxa Sudón [Moduon](https://www.moduon.team)
1 change: 1 addition & 0 deletions l10n_es_aeat_mod303/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<li>Iván Antón</li>
</ul>
</li>
<li>Arantxa Sudón <a class="reference external" href="https://www.moduon.team">Moduon</a></li>
</ul>
</div>
<div class="section" id="maintainers">
Expand Down

0 comments on commit 9d733fa

Please sign in to comment.