Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0010807
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 09. Financial managementmajoralways2009-09-29 10:422010-02-18 00:31
ReporternetworkbView Statuspublic 
Assigned Torafaroda 
PriorityurgentResolutionfixedFixed in Version2.50MP9
StatusclosedFix in branchFixed in SCM revision7de7c4a6be7e
ProjectionnoneETAnoneTarget Version2.50MP8
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product Version2.50MP5SCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0010807: The documentno on invoices is not unique

DescriptionThe documentno on invoices is not unique. You can use the same documentno
in the same organization.

Steps To Reproduce-Create a new invoice on organization A and save it
-Create another new invoice on organization A and put in the documentno the documentno of the invoice created previously
Proposed SolutionLogic will be added into the invoice completion function (C_Invoice_Post) in order that these documents can not be completed if the document number is repeated in the organization tree of the document sequence within the same fiscal year.

Can not be done via a trigger since it will lead to mutating table issues.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 00113842.50MP9 closedrafaroda Unable to complete the sales invoice document 
related to defect 0012230pi closedrafaroda not able to void invoices 

-  Notes
(0020572)
rafaroda (developer)
2009-09-30 06:46

Upgraded to urgent.
(0021000)
shuehner (administrator)
2009-10-14 12:11

Note: this will be an API change and require extra effort on upgrades (for installations where the new unique constraint is not satisfied))
(0021049)
gorkaion (developer)
2009-10-15 13:01

In some countries it is possible to have the same Document Number in an organization for different fiscal years. So creating an index is not an option.
(0021369)
dmitry_mezentsev (developer)
2009-10-26 12:49

Gorka,

There was a discussion about the best way to fix this issue. Could you please share it with Rafa if his team is going to resolve it (just as a reminder if it is not yet done cause the issue is moving to its deadline)?
(0021504)
hgbot (developer)
2009-11-02 13:51

Repository: erp/devel/pi
Changeset: 005a6d8a4029174ac9c2bf5e1bd9066660c1018a
Author: Rafa Roda Palacios <rafael.roda <at> openbravo.com>
Date: Thu Oct 29 04:39:58 2009 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/005a6d8a4029174ac9c2bf5e1bd9066660c1018a [^]

Fixes issue 10807 Now document numbers can not be repeated.

Logic has been added into the invoice completion function (C_Invoice_Post) in order that these documents can not be completed if the document number is repeated in the organization tree of the document sequence within the same fiscal year.

---
M src-db/database/model/functions/C_INVOICE_POST.xml
M src-db/database/sourcedata/AD_MESSAGE.xml
---
(0021505)
rafaroda (developer)
2009-11-02 13:53
edited on: 2009-11-18 18:30

Steps to test the fix.

With the following organization tree:
_ *
__ Main
___ A
____ A1
____ A2
___ B

1) Create a AR sales invoice in organization A with document number 200200 and invoice date 22-10-2009 and complete it.

2) Create a AR Credit Memo sales invoice in organization A with document number 200200 and invoice date 22-12-2009 and complete it.

3) Re-activate it and change its transaction document to AR Invoice and complete it. You will not be allowed since you are in the same organization and fiscal year (and same transaction document -document type-).

4) Change is organization to A1 and complete it. You will not be allowed since the document type is defined at * level and both A and A1 are children of it.

5) Change its invoice date to 22-10-2008 and complete it.

6) Create a AR sales invoice in organization A2 with document number 200200 and invoice date 22-10-2009 and complete it. You will not be allowed since the document type is defined at * level and both A and A2 are children of it.

7) Change its document number to 200201 and complete it.

8) Create a AR sales invoice in organization Main with document number 200200 and invoice date 22-10-2009 and complete it. You will not be allowed since the document type is defined at * level and both Main and A are children of it.

9) Change its document number to 200201 and complete it. You will not be allowed since the document type is defined at * level and both Main and A2 are children of it.

10) Change its invoice date to 22-10-2007 and complete it.

11) Create a AR sales invoice in organization B with document number 200201 and invoice date 22-12-2007 and complete it. You will not be allowed since the document type is defined at * level and both Main and B are children of it.

12) Change its document number to 200200 and complete it.

13) Re-activate it, change its invoice date to 22-10-2009 and complete it. You will not be allowed since the document type is defined at * level and both A and B are children of it.

(0021506)
rafaroda (developer)
2009-11-02 13:57

Why using date invoiced for looking for invoices in the same fiscal year?

After completing the invoice, accounting date can be changed (until the invoice is posted) but not the invoiced date. If one forgets to include the invoice in the accounting of one year he can always change its accounting date for including it in the following year. But the document sequence number has to follow the invoiced date year.
(0021629)
arunkumar (reporter)
2009-11-09 07:51

I have tested the steps given by Rafa to test the fix.They are working fine.
(0021989)
hgbot (developer)
2009-11-18 19:17

Repository: erp/devel/pi
Changeset: 9ad3ddb414cd2351a1eb44faf899882b96d2f183
Author: Rafa Roda Palacios <rafael.roda <at> openbravo.com>
Date: Fri Nov 13 04:26:44 2009 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/9ad3ddb414cd2351a1eb44faf899882b96d2f183 [^]

Fixes issue 11384 fixes issue 10807 DocumentNo check is now filtering by client.

---
M src-db/database/model/functions/C_INVOICE_POST.xml
---
(0021997)
sureshbabu (reporter)
2009-11-19 05:34

Tested working fine
(0024414)
hgbot (developer)
2010-02-16 15:15

Repository: erp/devel/pi
Changeset: 7de7c4a6be7eb6b511d2156f5c75b9953af86bf9
Author: Rafa Roda Palacios <rafael.roda <at> openbravo.com>
Date: Tue Feb 16 15:08:01 2010 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/7de7c4a6be7eb6b511d2156f5c75b9953af86bf9 [^]

Fixes issue 12230 Check for repeated invoice document nos works also now for non existing periods. Related to issue 10807

---
M src-db/database/model/functions/C_INVOICE_POST.xml
---
(0024541)
hudsonbot (developer)
2010-02-18 00:31

A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/7de7c4a6be7e [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/7c1b489fb0a0 [^]
Tests: http://builds.openbravo.com/view/devel-int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.16459.obx [^]

- Issue History
Date Modified Username Field Change
2009-09-29 10:42 networkb New Issue
2009-09-29 10:42 networkb Assigned To => rafaroda
2009-09-29 22:32 psarobe Status new => scheduled
2009-09-29 22:32 psarobe fix_in_branch => pi
2009-09-30 06:46 rafaroda Note Added: 0020572
2009-09-30 06:46 rafaroda Priority normal => urgent
2009-09-30 06:46 rafaroda fix_in_branch pi =>
2009-10-13 12:12 psarobe Assigned To rafaroda => gorkaion
2009-10-14 12:11 shuehner Note Added: 0021000
2009-10-15 13:01 gorkaion Note Added: 0021049
2009-10-19 11:39 rafaroda Assigned To gorkaion => rafaroda
2009-10-20 15:01 rafaroda Steps to Reproduce Updated
2009-10-22 10:03 networkb Target Version 2.50MP7 => 2.50MP8
2009-10-26 12:49 dmitry_mezentsev Note Added: 0021369
2009-11-02 13:46 rafaroda Steps to Reproduce Updated
2009-11-02 13:51 hgbot Checkin
2009-11-02 13:51 hgbot Note Added: 0021504
2009-11-02 13:51 hgbot Status scheduled => resolved
2009-11-02 13:51 hgbot Resolution open => fixed
2009-11-02 13:51 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/005a6d8a4029174ac9c2bf5e1bd9066660c1018a [^]
2009-11-02 13:53 rafaroda Note Added: 0021505
2009-11-02 13:57 rafaroda Note Added: 0021506
2009-11-09 07:51 arunkumar Status resolved => closed
2009-11-09 07:51 arunkumar Note Added: 0021629
2009-11-09 07:51 arunkumar Fixed in Version => 2.50MP9
2009-11-10 00:00 anonymous sf_bug_id 0 => 2894887
2009-11-17 15:02 rafaroda Relationship added related to 0011384
2009-11-18 18:30 rafaroda Note Edited: 0021505
2009-11-18 19:17 hgbot Checkin
2009-11-18 19:17 hgbot Note Added: 0021989
2009-11-18 19:17 hgbot Status closed => resolved
2009-11-18 19:17 hgbot Fixed in SCM revision http://code.openbravo.com/erp/devel/pi/rev/005a6d8a4029174ac9c2bf5e1bd9066660c1018a [^] => http://code.openbravo.com/erp/devel/pi/rev/9ad3ddb414cd2351a1eb44faf899882b96d2f183 [^]
2009-11-19 05:34 sureshbabu Note Added: 0021997
2009-11-19 05:34 sureshbabu Status resolved => closed
2010-02-16 12:55 rafaroda Relationship added related to 0012230
2010-02-16 15:15 hgbot Checkin
2010-02-16 15:15 hgbot Note Added: 0024414
2010-02-16 15:15 hgbot Fixed in SCM revision http://code.openbravo.com/erp/devel/pi/rev/9ad3ddb414cd2351a1eb44faf899882b96d2f183 [^] => http://code.openbravo.com/erp/devel/pi/rev/7de7c4a6be7eb6b511d2156f5c75b9953af86bf9 [^]
2010-02-18 00:31 hudsonbot Checkin
2010-02-18 00:31 hudsonbot Note Added: 0024541


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker