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

Fix period for customer invoice #106

Closed
wants to merge 2 commits into from
Closed

Fix period for customer invoice #106

wants to merge 2 commits into from

Conversation

sergiocorato
Copy link
Contributor

For supplier invoices the existing code is correct.
For customer invoices, the period has to be taken from date of invoice and after, if missing, from registration date.

@oca-clabot
Copy link

Hey @sergiocorato, thank you for your Pull Request.

It looks like some users haven't signed our Contributor License Agreement, yet.
You can read and sign our full Contributor License Agreement here: http://odoo-community.org/page/website.cla
Here is a list of the users:

Appreciation of efforts,
OCA CLAbot

@eLBati
Copy link
Member

eLBati commented Apr 13, 2015

Hello @sergiocorato
I don't think inv.date_invoice can be empty after calling

super(AccountInvoice, self).action_move_create(
            cr, uid, ids, context=context)

Moreover, this would cause account.move and account.move.line to have incoherent date and period_id, doesn't it?

@sergiocorato
Copy link
Contributor Author

Hello @eLBati
I didn't meant to say that the date_invoice is null (the code is unchanged in that part).
My commit is for another reason:

  • when I register a supplier invoice, VAT has to be calculated from the registration date period
  • when I register a customer invoice, VAT has to be calculated from the emission date period
    Anyway, it's not common that a customer invoice is registered in a different date than the emission date, so is not a so worrying bug.

@eLBati
Copy link
Member

eLBati commented Apr 14, 2015

For instance using this line

date_start = inv.date_invoice or inv.registration_date or time.strftime('%Y-%m-%d')

implies that, as inv.date_invoice can't be empty, date_start will always be = inv.date_invoice.
Thus, if inv.registration_date is not empty, period_id is retrieved using date_invoice, but mov_date using reg_date, that is = inv.registration_date.

So, period_id and date of account.move would be incoherent.

@sergiocorato
Copy link
Contributor Author

Perhaps our VAT law is incoherent, but we must comply to it.

or time.strftime('%Y-%m-%d')
if inv.type in ['in_invoice', 'in_refund']:
date_start = inv.registration_date or inv.date_invoice \
or time.strftime('%Y-%m-%d')
Copy link
Member

Choose a reason for hiding this comment

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

could you please define a variable today = time.strftime('%Y-%m-%d')?

@oca-clabot
Copy link

Hey @sergiocorato,
We acknowledge that the following users have signed our Contributor License Agreement:

Appreciation of efforts,
OCA CLAbot

@sergiocorato
Copy link
Contributor Author

done, thanks

@eLBati
Copy link
Member

eLBati commented Jul 3, 2015

Sorry, @sergiocorato I just tried to better understand the PR but I can't see what this change solves

the period has to be taken from date of invoice and after, if missing, from registration date

What do you mean with if missing? invoice date can't be missing.
Maybe could you describe the use case this changes solves?

@sergiocorato
Copy link
Contributor Author

Hi @eLBati, the use case is from dpr 633/72 art. 1. Il contribuente deve annotare entro quindici giorni le fatture emesse, nell'ordine della loro numerazione e con riferimento alla data della loro emissione, in apposito registro.
So emission date have to be taken to select period, not registration date or today, if there is. If can't be missing, I can remove "or inv.registration_date or today" completely.

@eLBati
Copy link
Member

eLBati commented Jul 4, 2015

With use case I mean something like

  • I create an invoice with date ...
  • I confirm invoice ...
    Observed behavior: ...
    Expected behavior: ...

@sergiocorato
Copy link
Contributor Author

I have an user which register some invoices on 1° of month with last day of previous month date, so VAT registries are wrong because invoices go in the month of registration.

@eLBati
Copy link
Member

eLBati commented Jul 6, 2015

I have an user which register some invoices on 1° of month with last day of previous month date, so VAT registries are wrong because invoices go in the month of registration

On http://2948683-8-0-2b230f.runbot2.odoo-community.org/ just created SAJ/2015/006, set Invoice Date = 2015-06-30, added one line and confirmed.
Entry date is correct: I am not able to reproduce the error

@sergiocorato
Copy link
Contributor Author

Sorry the misunderstanding, the problem is the period (taxes are based on period, not on dates). I created SAJ/2015/007 with registration date 6th July and emission date 30th Juin, period is wrong (7th).

@eLBati
Copy link
Member

eLBati commented Jul 9, 2015

On 6 July 2015 at 21:46, Sergio Corato notifications@github.com wrote:

Sorry the misunderstanding, the problem is the period (taxes are based on
period, not on dates). I created SAJ/2015/007 with registration date 6th
July and emission date 30th Juin, period is wrong (7th).

So, in this case, why do you fill the 'registration date' field?
Why don't you leave it empty?

Probably we should make the 'registration date' field visible for supplier
invoices only.

@sergiocorato
Copy link
Contributor Author

All is possible, but it's legally register a customer invoice within 15
days from the emission, so if this field is hidden it would create a
missing legal feature.

Sergio Corato
Product Manager
SimplERP srl
tel. +390498597240
fax +390498596066

2015-07-09 16:32 GMT+02:00 Lorenzo Battistini notifications@github.com:

On 6 July 2015 at 21:46, Sergio Corato notifications@github.com wrote:

Sorry the misunderstanding, the problem is the period (taxes are based on
period, not on dates). I created SAJ/2015/007 with registration date 6th
July and emission date 30th Juin, period is wrong (7th).

So, in this case, why do you fill the 'registration date' field?
Why don't you leave it empty?

Probably we should make the 'registration date' field visible for supplier
invoices only.


Reply to this email directly or view it on GitHub
#106 (comment).

@eLBati
Copy link
Member

eLBati commented Jul 9, 2015 via email

@sergiocorato
Copy link
Contributor Author

I leave it empty always, but some users could want to do that (even if I think it's an ugly practice)

@eLBati
Copy link
Member

eLBati commented Jul 15, 2015

On 9 July 2015 at 17:28, Sergio Corato notifications@github.com wrote:

I leave it empty always, but some users could want to do that (even if I
think it's an ugly practice)

This is why I propose to make the 'registration date' field visible for
supplier invoices only.
I think it would make everything more simple.
What do you think?

@sergiocorato
Copy link
Contributor Author

Yes, I think it's better for a simpler usage too.

2015-07-15 16:39 GMT+02:00 Lorenzo Battistini notifications@github.com:

On 9 July 2015 at 17:28, Sergio Corato notifications@github.com wrote:

I leave it empty always, but some users could want to do that (even if I
think it's an ugly practice)

This is why I propose to make the 'registration date' field visible for
supplier invoices only.
I think it would make everything more simple.
What do you think?


Reply to this email directly or view it on GitHub
#106 (comment).

eLBati added a commit to eLBati/l10n-italy that referenced this pull request Jul 16, 2015
@eLBati
Copy link
Member

eLBati commented Jul 16, 2015

Here we are #123

OpenCode pushed a commit to OpenCode/l10n-italy that referenced this pull request May 9, 2017
…migr

Migration of stock_picking_deliver_uos
RodrigoBM pushed a commit to factorlibre/l10n-spain that referenced this pull request Oct 11, 2021
patrickt-oforce pushed a commit to patrickt-oforce/l10n-italy that referenced this pull request Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants