forked from OCA/l10n-italy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] l10n_it_fatturapa_out_rc: supporto per la conversione degli imp…
…orti in EUR per fatture in valuta estera
- Loading branch information
Showing
3 changed files
with
28 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,30 @@ | ||
# Copyright 2021 Alex Comba - Agile Business Group | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo import models | ||
from odoo import api, models | ||
|
||
from .efattura import EFatturaOut | ||
|
||
|
||
class WizardExportFatturapa(models.TransientModel): | ||
_inherit = "wizard.export.fatturapa" | ||
|
||
@api.model | ||
def _get_efattura_class(self): | ||
return EFatturaOut | ||
|
||
@api.model | ||
def getSign(self, invoice): | ||
sign = 1 | ||
if invoice.move_type in [ | ||
"out_refund", | ||
"in_refund", | ||
] and invoice.fiscal_document_type_id.code not in ["TD04", "TD08"]: | ||
sign = -1 | ||
return sign | ||
|
||
@api.model | ||
def getImportoTotale(self, invoice): | ||
amount_total = super().getImportoTotale(invoice) | ||
amount_total *= self.getSign(invoice) | ||
return amount_total |