Partner Balance : Wrong Period implementation

Bug #523080 reported by Vincent Renaville@camptocamp
24
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Medium
Unassigned

Bug Description

Hello,

Partner Balance mechanism is wrong if you use Period.

When you select by period in the wizard,
 it just transform selected period into a date range.
This is TOTALLY wrong, you need to have one mechanism to compute it by date and one to compute it by period

A problem will occur if you choose an invoice date wich is not in range of the period of the invoice.

I have completely rewrite the financial report in the 4.2 (c2c_finance_report and c2c_finance_report),
I don't understand why this kind of problem is still in the Version 5.0

I will complete this bug if I found new problems on other Financial reports

Vincent

Tags: 5.0
Revision history for this message
Ferdinand (office-chricar) wrote :

Hi
in Austria we have the mutualy agreed rule that the "date" (of voucher, invoice, stock picking ..) must be IN the period

for this I have modified all forms in
https://code.launchpad.net/~openerp-commiter/openobject-addons/chricar_price_unit
to allow date entry and on change selects the period in function of the date to ensure, that the condition mentioned above is met

this option to enter the date is only available for users with a special role.

should we discuss this on accounting/usability expert list ?

Revision history for this message
Borja López Soilán (NeoPolus) (borjals) wrote :

Ferdinand, same is true for Spain; the period of the invoice should match its date (it's kind of a legal requirement).
Maybe we need a (per period) option to set whether a period admits invoices/account moves with dates outside of that period, and enforce such rule when validating those records (add the check on the creation/writing of account moves).

Revision history for this message
Ferdinand (office-chricar) wrote :

the reason for matching date = period is the VAT system

both partners have to declare the VAT of the same document in the same periode

as the period is not printed on the documents (and it shouldn't because it's not common to do so) only the date is available to determine the period for both partners.

Revision history for this message
Vincent Renaville@camptocamp (vrenaville-c2c) wrote :

Hello,

Thanks for your responds, but I'm not agree with you.
The date must match the period in normal case.
But at the begun of the year, when you make paiement that concern the last year, you need to force the period to be on the last year.

Hope this will help.

Vincent

Revision history for this message
Jan Verlaan (jan-verlaan) wrote :

Hello Vincent, into the Netherlands your explanation is not allowed.
Payments are mostly done via bank and have a bank transaction date that should match in ERP too. Data entry in ERP for Bank and Cash transactions can be booked in e.g. Januari with period 12 and a date in period 12 e.g. 30 December.
If you have Payment transaction done in Januari for e.g. the December work done of your external accountant, one can make a reservation in December for that amount without tax and when payment is done contrabook the reservation. That way the costs will be taken in december and your financial administration will keep clean. Taxes are in the right period, namely the Januari where you received the invoice.

So in my opinion period and date should ALWAYS match.

Revision history for this message
Borja López Soilán (NeoPolus) (borjals) wrote :

Vicent,

I think the problem is that it depends on your country whether the date must match the period.

In Spain, at the begun of the year, when you receive invoices from the last year (i.e. sent by a supplier on 29/12/2009, but received by you on 04/01/2010) you have to use not only the period of the last year, but also the original date of the invoice (29/12/2009 not 04/01/2010) at least for the accounting entries (spanish accounting programs usually have 2 dates for supplier invoices: the original 'invoice date' and the 'reception date'; the same is true for supplier packing lists and sale orders).

Just think of this: Spanish "Hacienda" (the Treasury Department) might check those invoice dates against your supplier invoice dates and they have to match on quantities and dates.

But the payments of those invoices are encoded on the periods of the payments date. If you pay the invoice on 29/05/2010 (yeah, in Spain some invoices are paid at 180 or more days), it has to be registered on the second period of 2010 (given you use 3-months periods), not on 2009.

That's why I say that somehow it has to be configurable.

Revision history for this message
Borja López Soilán (NeoPolus) (borjals) wrote :

By the way, I'm sorry, I just wrote the dates in DD/MM/YYYY format (29/12/2009) without thinking that YYYY-MM-DD format (2009-12-29) would be more 'universal' :)

Revision history for this message
Hernan P. Dacharry (hernanpd) wrote :

Similar as it happens in spain (according to Borja), in Argentina supplier invoices can arrive in the next period, when you have already presented the vat declaration to the authorities, in these cases it is legal to make the accounting and tax entries in the next period, however the original invoice date should be recorded in the invoice (aswell as in the next vat declaration).
So summing up:
* I agree with vincent in that "accounting move date's" should match the period the moves corresponds to.
* "invoices date" (supplier invoices in argentina and spain) don't necessarily match the "move period" and "move date".

What I have done in the implementations done here in Argentina is to make the "invoice period" field optional during the supplier invoice encoding. If when validating the invoice if the period is not set, it takes the one corresponding to the invoice date, however if it is specified (exceptional cases, invoices arriving late), it forces the accounting move in the specified period.

Revision history for this message
Borja López Soilán (NeoPolus) (borjals) wrote :

Hernan, just a comment: in Spain suppliers invoice can arrive in the next period, *BUT* only before you have presented the vat declaration.

I mean, on medium and small business (which use 3-months periods) the first period goes from january's 1st to march's 31th, but the vat declaration can be done from april's 1st to april's 20th. That means that we have plenty time (up to 20 days) to receive the invoices of the previous period and include them in the tax declaration.

What happens if the invoice is received after those 20 days? I dunno; but I suppose that the supplier would have a problem, as he registered an invoice in his vat declaration, that does not match with your vat declaration: that usually would end with a call from the treasury department (Hacienda) asking for the accounting books.

Revision history for this message
Ferdinand (office-chricar) wrote :

Timing question in Austria
VAT declarations have to be filed and payed ~ 45 days (15th of the month or first working day after 15th) after the end of the month (period) of invoice date (actually this is the period of shipment or service which is usually the period of the invoice date )
So we usually have plenty of time to wait for suppliers invoices.

@ Borja
I am astonished that the terms of fileing/payment is only 20 days.
To our exeperience even well organized medium sized companies have problems to handle 10 days payment term of supplieres invocie, due to the time internal audit needs to check the correctness.
Hence an invoice dated the last day of a month arrives 3-5 days later (postal service) + 10 days = 15 days.

AND
a lot of service companies here create their invoices "sometimes" during the following month and back date them with the correct month of service. This is especially true for all services concering the old fiscal year.

Revision history for this message
Borja López Soilán (NeoPolus) (borjals) wrote :

You got me wrong Ferdinand!

We (in Spain) have 20 days since the end of the accounting period to close it (all the invoices must have been filed before the 20th of the first month of the next period). But payments don't have to be filed on that period.

In fact, the average payment time in Spain is about 98 days!!! (second highest on Europe), small clients usually pay at 30 days, medium sized or big clients usually pay at 90, 120 or 180 days. I think is easy to gasp that you can't file a payment in the same period of the invoice if you receive the payment 6 months later! So is just the opposite of what you though :)

Just as reference, the 'usual' way to invoice in Spain is (as far as I know) like this:

   Small clients (though not P.O.S. clients) :
     - Invoiced monthly, on the last days of the month of the first days of the next month. Only an invoice is sent for all the goods supplied to them (or services) during that month. So you may have 6 sale orders during a month, but just one invoice per client.
     - The invoice has to be payed 15, 30 or 30/60 days later (the most common being end of the next month).
     - Most payment orders are dispatched directly to the bank ('our' bank). One (ASCII-text fixed-length record) file is sent to the bank with all the charges that must be performed to clients. Clients are then charged automatically by 'their' bank (though they might refuse the charge later) at the maturity date of the payment (the bank may advance the cash to us at the time the order is dispatched [yes, it's a kind of credit]).

   Medium/big clients:
     - Invoiced monthly (regular orders) or per order (big/single orders).
     - The invoice has to be payed 30/60, 90, 120, or 180 days later (there are more combinations, some even longer).
     - Some payment orders are dispatched directly to the bank (like before, but most use the credit/advanced cash option), the others are made by Check or Bank Transfer.

The VAT declarations are (currently, they are thinking of changing this on medium term) done based on the invoices, not the payments. That means that you have to pay the taxes to the treasury ("Hacienda") on the fiscal period you file the invoice, not on the fiscal period you file the payment. Yeah, that means that you pay the taxes in advance, usually several months before you get paid! (that's why Spanish companies depend a lot on banks).

Revision history for this message
Cloves Almeida (cjalmeida) wrote :

Invoicing and payment should be two different moves:
  M1: (D) Expense/Stock <--> (C) Payable when invoice arrives
  M2: (D) Payables <--> (C) Bank when paying the invoice

In Brazil, M1 date should match invoice date. M2 should match the bank statement. Dates must always within the fiscal period. Once you close the period, moves within it should be made only exceptionally.

Revision history for this message
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote :

Hi all,

What a discussion ! Thanks for your comments and advices. I personally think this is really a bug. I understand that in different country, there is different problematic.

I know that in some country, you are not allowed to have difference between date and period. But this is not the case for everyone, everywhere.

My reasoning is that in OpenERP, we CAN make a move (from an invoice for example) that has a certain date, but a different period ! This is allowed, unless you install the account_date_check module if I remember it well. So, according to that, I mean, if the tool support this, then it has to be consistent and support it everywhere... Otherwise, we're going to face troubles.

In some cases, it has also some advantages that this features is supported. As this was design like this in OpenERP, I suggest that :

1. Installing the account_date_check will forbid that, and solve your troubles

2. Without this module, we need to be consistent and should be able to print those report based on date or period. This will not affect you, but will allow others to benefit from this advantage !

Conclusion : Need to fix that in financial reporting...

Regards,

Changed in openobject-addons:
status: New → Confirmed
milestone: none → 5.0.8
importance: Undecided → Medium
Changed in openobject-addons:
milestone: 5.0.8 → 5.0.9
Changed in openobject-addons:
milestone: 5.0.9 → 5.0.10
Changed in openobject-addons:
assignee: nobody → Anup (Open ERP) (ach-openerp)
status: Confirmed → In Progress
Revision history for this message
Anup(SerpentCS) (anup-serpent) wrote :

Hello Everyone,

   I suggest to keep a _constraint so that an invoice is not created beyond a fiscal year. I have attached a patch along with this. Would you please check it and notify us.

Thanks.

Revision history for this message
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote :

Hi Anup,

I think your patch is a good idea. This will ensure that invoice are related to the fiscal year. I suggest to include it, but this will not solve this bug I think.

Please, refer to my post #13. The period selection should base the account move selection on :

period_id in (chosen periods)

And not :

date between (date of the chosen period)

I don't know if I'm clear enough, so please let me know if you don't understand me ...

Regards,

Joël

Changed in openobject-addons:
milestone: 5.0.10 → 5.0.11
Changed in openobject-addons:
milestone: 5.0.11 → 5.0.12
Changed in openobject-addons:
assignee: Anup (OpenERP) (ach-openerp) → JMA(Open ERP) (jma-openerp)
milestone: 5.0.12 → none
Changed in openobject-addons:
assignee: JMA(Open ERP) (jma-openerp) → nobody
Revision history for this message
Ferdinand (office-chricar) wrote :

my 2c
in branch
https://code.launchpad.net/~openerp-commiter/openobject-addons/chricar_price_unit
I have put in all moves (accountig / stock / some others ) a period_id (with index) which can be selected directly.

Revision history for this message
Ferdinand (office-chricar) wrote :

BTW using period_id's it is possible to select moves of special periods which can't be filtered using a date filed alon

Revision history for this message
qdp (OpenERP) (qdp) wrote :

Hello,

it's affecting only stable version. Do not spend time on this bug because it will be solved when we will backport the reports from tunk into a module for the stable.

Thanks

Changed in openobject-addons:
status: In Progress → Triaged
tags: added: 5.0
Revision history for this message
qdp (OpenERP) (qdp) wrote :

the module account_v6_reports_backport available in the extra addons solve this bug. This one can thus be closed.

Thanks

Changed in openobject-addons:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.