Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0024198Openbravo ERPA. Platformpublic2013-06-26 16:512013-07-18 16:42
emartinez 
dmiguelez 
normalminoralways
newopen 
5
3.0MP24 
 
Core
No
0024198: Documentno in Expense Sheet not working well for different Organization sequences
When we have two different organizations (and thus different sequences for expense sheet), the documentno does not take the correct sequence according to the organization that has created it.
1) Go to Document Sequence Window,
2) Search the following standard document sequence: DocumentNo_S_TimeExpense
3) You will see it belongs to organization *, change it to organization A
4) Create the same sequence (with same name), but assign it to organization B
5) Now go to expense sheet window, and try to create one register belonging to organization A, see the sequence automatically chosen. Is it the correct one?
7) Finally, create a new register for organization B, is the sequence correct?
No tags attached.
related to feature request 0018693 new jonalegriaesarte You are not able to introduce different sequence in Journal Batch 
png doc.png (51,082) 2013-07-09 15:02
https://issues.openbravo.com/file_download.php?file_id=6245&type=bug
png
Issue History
2013-06-26 16:51emartinezNew Issue
2013-06-26 16:51emartinezAssigned To => dmiguelez
2013-06-26 16:51emartinezModules => Core
2013-06-26 16:51emartinezTriggers an Emergency Pack => No
2013-06-27 10:20emartinezTypedesign defect => defect
2013-06-27 10:20emartinezSummaryDifferent document types and sequences in Expense Sheet => Documentno in Expense Sheet not working well for different Organization sequences
2013-06-27 10:20emartinezDescription Updatedbug_revision_view_page.php?rev_id=4840#r4840
2013-06-27 10:24psarobeAssigned Todmiguelez => AugustoMauch
2013-06-27 10:24psarobeCategory08. Project and service management => A. Platform
2013-06-27 14:55emartinezIssue Monitored: emartinez
2013-06-28 14:58emartinezSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=4846#r4846
2013-06-28 14:58emartinezFile Added: TimeExpense.png
2013-07-05 14:16AugustoMauchAssigned ToAugustoMauch => dbaz
2013-07-09 15:02emartinezSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=4857#r4857
2013-07-09 15:02emartinezFile Deleted: TimeExpense.png
2013-07-09 15:02emartinezFile Added: doc.png
2013-07-18 16:42dbazNote Added: 0060101
2013-07-18 16:42dbazAssigned Todbaz => dmiguelez
2013-07-18 16:42dbazTypedefect => design defect
2014-12-18 18:30ngarciaRelationship addedrelated to 0018693

Notes
(0060101)
dbaz   
2013-07-18 16:42   
The "Document Sequence" that actually exists, has a 'Organization' field, but it is not used in the logic but it is there like it is in any other application table. Said that, the issue has changed to 'design defect'. The effort is medium/high and the regression risk is high.

An explanation about actually how it is working:

    When 'NEW' is pressend in a window, to draw the needed document sequence ("Document No") the following code applies:
    https://code.openbravo.com/erp/devel/pi/file/93daf5858a3b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/UIDefinition.java#l171 [^]
    There is a call to "getDocumentNo" which at the end in finally calls the data base function AD_Sequence_DocType. The 'organization' is not a parameter.

    When the field is saved, there is handler in charge of update the documentNo (if it is needed) and save the new sequence value:
    https://code.openbravo.com/erp/devel/pi/file/93daf5858a3b/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/SetDocumentNoHandler.java#l104 [^]

    Otherwise (besides the issue, but to take into account during the development) there is the 'Document Type', which also uses the 'Document Sequence', but although it shares some of its functions (like the already mentioned "getDocumentNo"), if there would be the need of a 'Document Type' -> 'Document Sequence' dependency, there is a (manual) callout for each situations. Callout example in charge of update the "Sales Order" > "Document No" based in "Transaction Document"
    https://code.openbravo.com/erp/devel/pi/file/93daf5858a3b/src/org/openbravo/erpCommon/ad_callouts/SL_Order_DocType.java#l125 [^]