-
Notifications
You must be signed in to change notification settings - Fork 20
L10n ve accountant fix#58983 amounts #377
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
Changes from all commits
16d5afe
72d00e9
2e5e1fc
dc8bedd
c203e0b
843c068
7b24f68
7c746a8
adf892b
e625bf9
19bd129
3a00c64
6bbd9a8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,7 +1,6 @@ | ||||||||||||||
| /** @odoo-module **/ | ||||||||||||||
|
|
||||||||||||||
| import { formatFloat, formatMonetary } from "@web/views/fields/formatters"; | ||||||||||||||
| import { parseFloat } from "@web/views/fields/parsers"; | ||||||||||||||
| import { formatMonetary } from "@web/views/fields/formatters"; | ||||||||||||||
| import { standardFieldProps } from "@web/views/fields/standard_field_props"; | ||||||||||||||
| import { registry } from "@web/core/registry"; | ||||||||||||||
|
|
||||||||||||||
|
|
@@ -10,23 +9,33 @@ import { patch } from "@web/core/utils/patch"; | |||||||||||||
| const { Component, onPatched, onWillUpdateProps, useRef, toRaw, useState } = owl; | ||||||||||||||
|
|
||||||||||||||
| patch(TaxTotalsComponent.prototype, { | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
| formatData(props) { | ||||||||||||||
| let totals = JSON.parse(JSON.stringify(toRaw(props.record.data[this.props.name]))); | ||||||||||||||
| if (!totals) { | ||||||||||||||
| return; | ||||||||||||||
| } | ||||||||||||||
| const foreignCurrencyFmtOpts = { currencyId: props.record.data.foreign_currency_id && props.record.data.foreign_currency_id[0] }; | ||||||||||||||
| totals.formatted_total_amount_currency_ves = totals.formatted_total_amount_currency_ves | ||||||||||||||
| const foreignCurrencyFmtOpts = { currencyId: props.record.data.foreign_currency_id }; | ||||||||||||||
| const currencyFmtOpts = { currencyId: props.record.data.currency_id && props.record.data.currency_id[0] }; | ||||||||||||||
| if (totals.subtotals && Array.isArray(totals.subtotals)) { | ||||||||||||||
| for (let subtotal of totals.subtotals) { | ||||||||||||||
| subtotal.formatted_base_amount_foreign_currency = formatMonetary(subtotal.base_amount_foreign_currency, foreignCurrencyFmtOpts); | ||||||||||||||
| subtotal.formatted_base_amount_currency = formatMonetary(subtotal.base_amount_currency, currencyFmtOpts); | ||||||||||||||
| // Solo VEES | ||||||||||||||
| subtotal.formatted_base_amount_currency_ves = totals.formatted_base_amount_currency_ves | ||||||||||||||
|
|
||||||||||||||
| if (subtotal.tax_groups && Array.isArray(subtotal.tax_groups)) { | ||||||||||||||
| for (let taxGroup of subtotal.tax_groups) { | ||||||||||||||
| taxGroup.formatted_tax_amount_foreign_currency = formatMonetary(taxGroup.tax_amount_foreign_currency, foreignCurrencyFmtOpts); | ||||||||||||||
| taxGroup.formatted_base_amount_foreign_currency = formatMonetary(taxGroup.base_amount_foreign_currency, foreignCurrencyFmtOpts); | ||||||||||||||
|
|
||||||||||||||
| taxGroup.formatted_tax_amount_currency = formatMonetary(taxGroup.tax_amount_currency, currencyFmtOpts); | ||||||||||||||
|
|
||||||||||||||
| taxGroup.formatted_base_amount_currency = formatMonetary(taxGroup.base_amount_currency, currencyFmtOpts); | ||||||||||||||
| // Solo VEES | ||||||||||||||
| taxGroup.formatted_tax_amount_currency_ves = taxGroup.formatted_tax_amount_currency_ves; | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
|
|
@@ -35,11 +44,21 @@ patch(TaxTotalsComponent.prototype, { | |||||||||||||
| totals.formatted_total_amount_currency = formatMonetary(totals.total_amount_currency, currencyFmtOpts); | ||||||||||||||
| this.totals = totals; | ||||||||||||||
| return totals; | ||||||||||||||
| }, | ||||||||||||||
|
|
||||||||||||||
| formatMonetaryForeign(value) { | ||||||||||||||
| const currency = this.props.record.data.foreign_currency_id; | ||||||||||||||
|
||||||||||||||
| const currency = this.props.record.data.foreign_currency_id; | |
| const currency = this.props.record.data.foreign_currency_id; | |
| if (!currency || !currency.id) { | |
| // Si no hay moneda extranjera, retornar el valor original o una cadena vacía | |
| return ""; | |
| } |
Copilot
AI
Nov 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The template property is assigned twice consecutively. The first assignment on line 56 is immediately overwritten by line 57, making it ineffective. Remove line 56 if only the VES template should be used, or clarify the intended logic.
| TaxTotalsComponents.template = "l10n_ve_tax.TaxForeignTotalsField"; |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,6 +1,6 @@ | ||||||||||||||||||
|
|
||||||||||||||||||
| <templates xml:space="preserve"> | ||||||||||||||||||
|
|
||||||||||||||||||
| <!-- Tax Group Component normal --> | ||||||||||||||||||
| <t | ||||||||||||||||||
| t-name="l10n_ve_accountant.TaxGroupComponent" | ||||||||||||||||||
| t-inherit="account.TaxGroupComponent" | ||||||||||||||||||
|
|
@@ -19,13 +19,13 @@ | |||||||||||||||||
|
|
||||||||||||||||||
| <td class="o_tax_group"> | ||||||||||||||||||
| <span class="o_tax_group_amount_value o_list_monetary"> | ||||||||||||||||||
| <t t-out="props.taxGroup.formatted_base_amount_currency" style="white-space: nowrap;"/> | ||||||||||||||||||
| <t t-out="formatMonetary(props.taxGroup.base_amount_currency)" style="white-space: nowrap;"/> | ||||||||||||||||||
| </span> | ||||||||||||||||||
| </td> | ||||||||||||||||||
| </tr> | ||||||||||||||||||
| </xpath> | ||||||||||||||||||
| </t> | ||||||||||||||||||
|
|
||||||||||||||||||
| <!-- Discounts --> | ||||||||||||||||||
| <t t-name="l10n_ve_tax.TaxTotalsField" t-inherit="account.TaxTotalsField" t-inherit-mode="extension" owl="1"> | ||||||||||||||||||
| <xpath expr="//table[1]/tbody[1]/t[1]" position="before"> | ||||||||||||||||||
| <tr t-if="totals.discount_amount and totals.show_discount"> | ||||||||||||||||||
|
|
@@ -54,18 +54,21 @@ | |||||||||||||||||
| </tr> | ||||||||||||||||||
| </xpath> | ||||||||||||||||||
| </t> | ||||||||||||||||||
|
|
||||||||||||||||||
| <!-- Foreign Currency Totals--> | ||||||||||||||||||
| <t t-name="l10n_ve_tax.TaxForeignTotalsField" owl="1"> | ||||||||||||||||||
| <table t-if="totals" class="oe_right"> | ||||||||||||||||||
| <table class="oe_right"> | ||||||||||||||||||
| <tbody> | ||||||||||||||||||
| <h1> | ||||||||||||||||||
| <span t-out="totals.currency_id.symbol"/> | ||||||||||||||||||
| </h1> | ||||||||||||||||||
|
Comment on lines
+61
to
+63
|
||||||||||||||||||
| <h1> | |
| <span t-out="totals.currency_id.symbol"/> | |
| </h1> | |
| <tr> | |
| <td colspan="2" style="text-align: center;"> | |
| <span style="font-size: 2em; font-weight: bold;" t-out="totals.currency_id.symbol"/> | |
| </td> | |
| </tr> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line assigns a property to itself, which has no effect. Either remove this line or implement the intended formatting logic.