Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0016417Openbravo ERP07. Sales managementpublic2011-03-22 12:212012-04-02 06:12
Xpand-IT 
Sandrahuguet 
urgentmajoralways
closedfixed 
5
pi 
 
Core
No
0016417: Ad_Sequence_Doc function increments the sequence for all clients
Ad_Sequence_Doc does not take into consideration the p_ad_client_id argument when updating CurrentNext in AD_Sequence table.
Replace:

  IF p_Update_Next='Y' THEN
    UPDATE AD_Sequence
      SET CurrentNext=CurrentNext + IncrementNo, Updated=TO_DATE(NOW())
    WHERE Name=p_SequenceName;
  END IF;
  p_DocumentNo:=COALESCE(v_Prefix, '') || v_NextNo || COALESCE(v_Suffix, '') ;


By:


  IF p_Update_Next='Y' THEN
    UPDATE AD_Sequence
      SET CurrentNext=CurrentNext + IncrementNo, Updated=TO_DATE(NOW())
    WHERE Name=p_SequenceName
    AND ad_client_id=p_ad_client_id;
  END IF;
  p_DocumentNo:=COALESCE(v_Prefix, '') || v_NextNo || COALESCE(v_Suffix, '') ;
VMA-Reviewed
Issue History
2011-03-22 12:21Xpand-ITNew Issue
2011-03-22 12:21Xpand-ITAssigned To => adrianromero
2011-03-22 12:21Xpand-ITModules => Core
2011-06-03 10:58dalsasuaAssigned Toadrianromero => dalsasua
2011-07-20 18:16dalsasuaAssigned Todalsasua => jonalegriaesarte
2011-09-19 22:21psarobeStatusnew => scheduled
2011-09-19 22:21psarobeversion => pi
2012-02-15 19:04iciordiaAssigned Tojonalegriaesarte => vmromanos
2012-02-16 16:18vmromanosTag Attached: VMA-Reviewed
2012-03-22 11:39SandrahuguetAssigned Tovmromanos => Sandrahuguet
2012-03-22 13:12SandrahuguetNote Added: 0046653
2012-03-27 13:06vmromanosNote Added: 0046760
2012-03-27 13:09hgbotCheckin
2012-03-27 13:09hgbotNote Added: 0046761
2012-03-27 13:09hgbotStatusscheduled => resolved
2012-03-27 13:09hgbotResolutionopen => fixed
2012-03-27 13:09hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/e630342dafb1ebab21e85100c0aa082a27c97ffd [^]
2012-03-27 13:09vmromanosNote Added: 0046762
2012-03-27 13:09vmromanosStatusresolved => closed
2012-04-02 06:12hudsonbotCheckin
2012-04-02 06:12hudsonbotNote Added: 0047238

Notes
(0046653)
Sandrahuguet   
2012-03-22 13:12   
Test Plan:

F&B Client
-Create a Sales Invoice
  -Organization: F&B España, S.A.
  -Transaction Document: AR Invoice

QA Testing
-Create a Sales Invoice
  -Organization: Spain
  -Transaction Document: AR Invoice

F&B Client
-Create a Sales Invoice
  -Organization: F&B España, S.A.
  -Transaction Document: AR Invoice

You can see that Document No. has a different sequence for each client
(0046760)
vmromanos   
2012-03-27 13:06   
Alternative test plan:
Run the following queries directly into the database:

1. SELECT CurrentNext, Prefix, Suffix, ad_client_id
FROM AD_Sequence
WHERE Name='AR Invoice' AND IsActive='Y' AND IsTableID='N' AND IsAutoSequence='Y'

2. Remember the CurrentNext values

3. Select AD_Sequence_Doc('AR Invoice', 'FF8080812AFBCB14012AFBD3E373001F', 'Y') from dual;

4. SELECT CurrentNext, Prefix, Suffix, ad_client_id
FROM AD_Sequence
WHERE Name='AR Invoice' AND IsActive='Y' AND IsTableID='N' AND IsAutoSequence='Y'

5. Ensure the CurrentNext has been incremented only for the 'FF8080812AFBCB14012AFBD3E373001F' client
(0046761)
hgbot   
2012-03-27 13:09   
Repository: erp/devel/pi
Changeset: e630342dafb1ebab21e85100c0aa082a27c97ffd
Author: Sandra Huguet <sandra.huguet <at> openbravo.com>
Date: Thu Mar 22 12:34:56 2012 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/e630342dafb1ebab21e85100c0aa082a27c97ffd [^]

Fixed issue 16417 Incremets the sequence number at correct form in Ad_Sequence_Doc

---
M src-db/database/model/functions/AD_SEQUENCE_DOC.xml
---
(0046762)
vmromanos   
2012-03-27 13:09   
code review + testing OK
(0047238)
hudsonbot   
2012-04-02 06:12   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/7814864461ac [^]

Maturity status: Test