Openbravo Issue Tracking System - Retail Modules
View Issue Details
0034253Retail ModulesWeb POSpublic2016-10-20 17:352016-11-12 18:56
daniOpenbravo 
mtaal 
urgentmajoralways
closedfixed 
3014.04
 
 
AugustoMauch
No
0034253: [STORE SERVER 1985] Document sequence of invoices is not synchronized so invoices doc number can be duplicated.
Next assign number of Document sequence (invoices) is not synchronized when CS turns from offline to online, so invoices doc number can be duplicated in orders flows and pickings can not be created in online mode.
** CS ONLINE & SS ONLINE: [CS=52.17.253.61 ; SS=52.31.227.242]
1. Log in Backend: check that Document Sequence "214 AR Invoice" has the same "Next Assigned number" in both CS and SS. Imagine that this next number is: 1000291.

** CS OFFLINE & SS ONLINE:
1. Log in Web POS: (52.31.227.242)
2. Layaway this receipt.
3. Select product "Victor" and add it to the ticket with delivery condition: "Deferred carried away".
4. Pay the ticket.
5. Click on "Prepare" in order preparation.
6. Select the order that has just been created and click on "Prepare selected".
7. Go to dropdown menu and select "Pickings" option.
8. Assign user.
9. Confirm All.
10. Deliver.
11. Close the picking. At this point, check that the order has been created with its shipment and invoice (invoice number is 1000291, so Next Assign Number in document sequence is: 1000292).

** CS ONLINE & SS ONLINE:
1. Log in backend of CS.
2. Go to Document Sequence "214 AR Invoice" and take a look at "Next Assigned number": it will be: 1000291 (It has not been synchronized!!), so there are several consequences:
- Try to repeat all steps from 1 to 11: realize that an error is raised at step 11 when trying to close the picking as the invoice that is going to be created would have the same document number: 1000291.
- However, try to create a ticket (invoicing it): the invoice will be created with duplicated document number: 1000291.
SER-QA
related to design defect 0034329RR17Q2 closed mtaal Support manually decrease of next assigned ad_sequence and replication to store servers 
Issue History
2016-10-20 17:35daniOpenbravoNew Issue
2016-10-20 17:35daniOpenbravoAssigned To => mtaal
2016-10-20 17:35daniOpenbravoResolution time => 1477519200
2016-10-20 17:35daniOpenbravoTriggers an Emergency Pack => No
2016-10-20 17:35daniOpenbravoIssue Monitored: daniOpenbravo
2016-10-20 17:35daniOpenbravoTag Attached: SER-QA
2016-10-20 17:47daniOpenbravoSummary[STORE SERVER] Document sequence of invoices is not synchronized so invoices doc number can be duplicated. => [STORE SERVER 1985] Document sequence of invoices is not synchronized so invoices doc number can be duplicated.
2016-10-21 10:45hgbotCheckin
2016-10-21 10:45hgbotNote Added: 0090751
2016-10-21 10:45hgbotStatusnew => resolved
2016-10-21 10:45hgbotResolutionopen => fixed
2016-10-21 10:45hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/4d6e4701609906247ef43a42c629b8aa5fb67b31 [^]
2016-10-22 15:57mtaalReview Assigned To => AugustoMauch
2016-10-25 15:20AugustoMauchNote Added: 0090867
2016-10-25 15:20AugustoMauchStatusresolved => new
2016-10-25 15:20AugustoMauchResolutionfixed => open
2016-10-25 15:21mtaalNote Added: 0090868
2016-10-28 09:31mtaalRelationship addedrelated to 0034329
2016-10-28 09:32mtaalNote Added: 0090979
2016-10-29 20:15hgbotCheckin
2016-10-29 20:15hgbotNote Added: 0091010
2016-10-29 20:15hgbotStatusnew => resolved
2016-10-29 20:15hgbotResolutionopen => fixed
2016-10-29 20:15hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/4d6e4701609906247ef43a42c629b8aa5fb67b31 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/a859a140bf377f926e9e6bb6dc4270bbfb2eeaf4 [^]
2016-11-12 18:56AugustoMauchNote Added: 0091414
2016-11-12 18:56AugustoMauchStatusresolved => closed

Notes
(0090751)
hgbot   
2016-10-21 10:45   
Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization
Changeset: 4d6e4701609906247ef43a42c629b8aa5fb67b31
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Fri Oct 21 10:45:39 2016 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/4d6e4701609906247ef43a42c629b8aa5fb67b31 [^]

Fixes issue 34253: [STORE SERVER 1985] Document sequence of invoices is not synchronized so invoices doc number can be duplicated.
Make document sequence bidirectional and when synchronizing prevent updating next nummer to lower value

---
M src-db/database/sourcedata/STRSYNC_SYNCHRONIZEDTABLE.xml
A src/org/openbravo/retail/storeserver/synchronization/DocumentSequenceWriterFilterAdapter.java
---
(0090867)
AugustoMauch   
2016-10-25 15:20   
Two things to review:
- The DatabaseWriterFilterAdapter should be NO-OP when the data event type is an insertion
- It is not clear whether it should be allowed to modify the Next Assigned Number field (currentnext column) of AD_COLUMN. If it is not allowed, than an event handler should be implemented to prevent this change in the ERP. If it is allowed, then the DatabaseWriterFilterAdapter should be modified, because the change would not be synchronized.
(0090868)
mtaal   
2016-10-25 15:21   
Additional comment:
To support a reset of document number to the start we should allow a large decrease when updating the store from central. But not the other way around.
(0090979)
mtaal   
2016-10-28 09:32   
The support for resetting next assigned number in this case is covered in the related issue.
(0091010)
hgbot   
2016-10-29 20:15   
Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization
Changeset: a859a140bf377f926e9e6bb6dc4270bbfb2eeaf4
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Sat Oct 29 20:11:03 2016 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/a859a140bf377f926e9e6bb6dc4270bbfb2eeaf4 [^]

Fixes issue 34253: [STORE SERVER 1985] Document sequence of invoices is not synchronized so invoices doc number can be duplicated.
Skip inserts data replication requests

---
M src/org/openbravo/retail/storeserver/synchronization/DocumentSequenceWriterFilterAdapter.java
---
(0091414)
AugustoMauch   
2016-11-12 18:56   
Code reviewed and verified in [1]@a1311dd247c9

[1] https://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization [^]