Openbravo Issue Tracking System - POS2
View Issue Details
0056070POS2POSpublic2024-07-19 11:542024-07-22 11:57
migueldejuana 
sreehari 
normalmajoralways
closedfixed 
5
 
24Q4 
No
0056070: When sequenceNumber is undefined we get it from terminal and we get DocumentNo duplicated
When sequenceNumber is undefined we get it from terminal and we get DocumentNo duplicated.

In case we lose the value of state.DocumentSequence.lastassignednum.sequenceNumber we get the information from terminal but this info is not always up to date.
- Login in POS2
- Create 3 orders and confirm the DocNo in Sales Order window in the ERP (i.e.: 001, 002 and 003)
- Put a breakpoint in https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/blob/master/web-jspack/org.openbravo.pos2/src/ob-init.js#L3309 [^]
- Set to undefined the sequenceNumber (state.DocumentSequence.lastassignednum.sequenceNumber = undefined;)
- Put a breakpoint in https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/blob/master/web-jspack/org.openbravo.pos2/src/authentication/loginInitActions.js#L141 [^]
- Resume the first breakpoint
- Check in the second breakpoint that "Terminal.terminal.lastDocumentNumber" is not "3" as expected.
- Resume the second breakpoint
- DO a sale a confirm that the DocNo of this order is duplicated ("001")
If state.DocumentSequence.lastassignednum.sequenceNumber is undefined in initializeDocumentSequence, we should do a request to the backend to get that information instead of getting "Terminal.terminal.lastDocumentNumber".

Check this code that could be useful: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/blob/master/src/org/openbravo/retail/posterminal/term/Terminal.java#L85 [^]
No tags attached.
related to defect 0056246 closed sreehari Implement second Mitigation for duplicating document sequence number 
Issue History
2024-07-19 11:54migueldejuanaNew Issue
2024-07-19 11:54migueldejuanaAssigned To => Retail
2024-07-19 11:54migueldejuanaTriggers an Emergency Pack => No
2024-07-19 12:04sreehariAssigned ToRetail => sreehari
2024-07-19 12:04sreehariStatusnew => scheduled
2024-07-22 08:47hgbotNote Added: 0167210
2024-07-22 11:57hgbotNote Added: 0167218
2024-07-22 11:57hgbotResolutionopen => fixed
2024-07-22 11:57hgbotStatusscheduled => closed
2024-07-22 11:57hgbotFixed in Version => 24Q4
2024-07-22 11:57hgbotNote Added: 0167219
2024-08-13 07:14sreehariRelationship addedrelated to 0056246

Notes
(0167210)
hgbot   
2024-07-22 08:47   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/2811 [^]
(0167218)
hgbot   
2024-07-22 11:57   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/2811 [^]
(0167219)
hgbot   
2024-07-22 11:57   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2 [^]
Changeset: 3b98aafeeaa3a836d09bf8f5bc66c5be4879afeb
Author: Sreehari Venkataraman <sreehari.venkataraman.ext@openbravo.com>
Date: 19-07-2024 18:54:48
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/commit/3b98aafeeaa3a836d09bf8f5bc66c5be4879afeb [^]

Fixes ISSUE-56070: loadTerminalData when DocumentSequence is undefined

---
M web-jspack/org.openbravo.pos2/src/authentication/loginInitActions.js
---