Skip to content

Commit

Permalink
Merge 0ac6bee into c9d6f09
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiocorato committed Jan 25, 2020
2 parents c9d6f09 + 0ac6bee commit 9d4a0a9
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
7 changes: 7 additions & 0 deletions l10n_it_fatturapa_in/models/company.py
Expand Up @@ -31,6 +31,10 @@ class ResCompany(models.Model):
help="Tax used to both round up and down bills amount."
)
enasarco_relax_checks = fields.Boolean('Relax checks for Enasarco')
in_invoice_registration_date = fields.Selection([
('inv_date', 'Invoice Date'),
('rec_date', 'Received Date'),
], string='Vendor invoice registration default date')


class AccountConfigSettings(models.TransientModel):
Expand Down Expand Up @@ -59,3 +63,6 @@ class AccountConfigSettings(models.TransientModel):
enasarco_relax_checks = fields.Boolean(
related='company_id.enasarco_relax_checks', readonly=False
)
in_invoice_registration_date = fields.Selection(
related='company_id.in_invoice_registration_date', readonly=False
)
13 changes: 13 additions & 0 deletions l10n_it_fatturapa_in/views/company_view.xml
Expand Up @@ -41,6 +41,19 @@
</div>
</div>
</div>
<div class="o_setting_left_pane"/>
<div class="o_setting_right_pane">
<label for="in_invoice_registration_date"/>
<span class="fa fa-lg fa-building-o" title="Values set here are company-specific."
aria-label="Values set here are company-specific."
groups="base.group_multi_company" role="img"/>
<div class="text-muted">
Set default date used to register vendor invoices: date of invoice or received date.
</div>
<div>
<field name="in_invoice_registration_date"/>
</div>
</div>
<div class="o_setting_left_pane">
<field name="enasarco_relax_checks"/>
</div>
Expand Down
3 changes: 3 additions & 0 deletions l10n_it_fatturapa_in/wizard/wizard_import_fatturapa.py
Expand Up @@ -875,9 +875,12 @@ def invoiceCreate(
e_invoice_received_date.date()
else:
e_invoice_received_date = fatturapa_attachment.create_date.date()
e_invoice_date = FatturaBody.DatiGenerali.DatiGeneraliDocumento.Data.date()

invoice_data = {
'e_invoice_received_date': e_invoice_received_date,
'date': e_invoice_received_date
if company.in_invoice_registration_date == 'rec_date' else e_invoice_date,
'fiscal_document_type_id': docType_id,
'sender': fatt.FatturaElettronicaHeader.SoggettoEmittente or False,
'account_id': pay_acc_id,
Expand Down

0 comments on commit 9d4a0a9

Please sign in to comment.