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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0036568
TypeCategorySeverityReproducibilityDate SubmittedLast Update
feature request[Retail Modules] StoreServermajorhave not tried2017-08-01 12:282017-09-01 12:34
ReportermtaalView Statuspublic 
Assigned Tomtaal 
PrioritynormalResolutionopenFixed in VersionRR17Q4
StatusclosedFix in branchFixed in SCM revision41df8f2375c1
ProjectionnoneETAnoneTarget VersionRR17Q4
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned ToAugustoMauch
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0036568: Gift card synchronization should only replicate local gift cards

DescriptionThe current logic replicates all gift cards and also all their transactions to each store.
For large organizations this is too much and only local gift cards need to be present in the store.

A local gift card is defined:
- not belonging to an org with type 'legal with accounting', and
- not having a type with only-org=N

Steps To ReproduceInstall multi-server
Enable synchronized mode
Install gift can gift card sync module
Proposed SolutionAdapt the dataset and synchronized table setup to provided the requested logic.

Test plan:
https://docs.google.com/a/openbravo.com/spreadsheets/d/1_r9-_O94bOsjRtvsI31gJZQMzZ-rolTjOxAtgiNqqtI/edit?usp=sharing [^]
TagsNo tags attached.
Attached Filespdf file icon Gift Card Email Discussion.pdf [^] (178,928 bytes) 2017-08-01 12:29

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0098306)
mtaal (manager)
2017-08-01 12:39

Docs:
http://wiki.openbravo.com/wiki/Retail:Store_Server#Replicating_Gift_Cards [^]
(0098314)
hgbot (developer)
2017-08-01 17:11

Repository: erp/pmods/org.openbravo.retail.giftcards.synchronization
Changeset: 1248af7cf74a54f2c6bae35a2580a047b1b8fd21
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Tue Aug 01 17:11:40 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.giftcards.synchronization/rev/1248af7cf74a54f2c6bae35a2580a047b1b8fd21 [^]

Fixes issue 36568: Gift card synchronization should only replicate local gift cards

Changes:
- use the store data channel
- implemented a new GiftCardRouter
- use the gift card router it in case of replicating central to store for gift cards and gift card products
- updated the dataset queries for gift card to use the global versus local definition

---
M src-db/database/sourcedata/AD_DATASET_TABLE.xml
M src-db/database/sourcedata/STRSYNC_SYNCHRONIZEDTABLE.xml
---
(0098320)
hgbot (developer)
2017-08-01 19:14

Repository: erp/pmods/org.openbravo.retail.giftcards.synchronization
Changeset: 4d127261eed75e8257bcbcdfe3047a59caf2fca8
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Tue Aug 01 19:14:39 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.giftcards.synchronization/rev/4d127261eed75e8257bcbcdfe3047a59caf2fca8 [^]

Related to issue 36568: Gift card synchronization should only replicate local gift cards
Added files missed by previous commit

---
A src-db/database/sourcedata/STRSYNC_CUSTOM_ROUTER.xml
A src/org/openbravo/retail/giftcards/synchronization/GiftCardRouter.java
---
(0098375)
AugustoMauch (manager)
2017-08-03 14:16

I reviewed the issue, and I think there is still one scenario that is not properly handled. If the central server is offline, the global giftcard will be created on the store. Once it is online again, the global giftcard will be synchronized from the store server to the central server. So far so good.

The problem is that from then on, the giftcard will not get updates (the central server does not send to the store updates for global giftcards), and will be kept in the store potentially outdated. If then someone looks for this giftcard when the store server is offline, it will received the potentially updated version.

There are two ways to approach this problem:
- To add a field to the giftcard instance table, to store the server where the giftcard was created. Then in the central server the router can take this into account, and send the updates done to the global giftcard to the store where it was created.
- Change the search filter so that only local giftcards can be found in the store server. That way, the global giftcard will not be retrievable by the POS in the store server, and the request will be redirected to the central server. I prefere this option, because it goes in line with the concept of the central server being the owner of the global giftcards.
(0098577)
hgbot (developer)
2017-08-22 13:48

Repository: erp/pmods/org.openbravo.retail.giftcards.synchronization
Changeset: 41df8f2375c17cc2b2a9951ad251cd6076e5d72e
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Tue Aug 22 13:47:34 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.giftcards.synchronization/rev/41df8f2375c17cc2b2a9951ad251cd6076e5d72e [^]

Fixes issue 36568: Gift card synchronization should only replicate local gift cards
Sync also global giftcards which are from a local order. Updated also the dataset to export the needed gift card information.

---
M src-db/database/sourcedata/AD_DATASET_TABLE.xml
M src/org/openbravo/retail/giftcards/synchronization/GiftCardRouter.java
---
(0098635)
hgbot (developer)
2017-08-24 14:12

Repository: erp/pmods/org.openbravo.retail.giftcards.synchronization
Changeset: c81dcbba1ef2a67280f52b1f84f4e35375748ae0
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu Aug 24 14:11:48 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.giftcards.synchronization/rev/c81dcbba1ef2a67280f52b1f84f4e35375748ae0 [^]

Related with issue 36568: Refactors the GiftCardRouter

Three small changes have been done:
- Diamond operator is used to create instance of HashSet
- Uses equalsIgnoreCase instead of equals(string.toLowerCase(...)))
- Breaks up isGlobalGiftCard in two methods to improve readability

---
M src/org/openbravo/retail/giftcards/synchronization/GiftCardRouter.java
---
(0098664)
hgbot (developer)
2017-08-28 00:46

Repository: erp/pmods/org.openbravo.retail.giftcards.synchronization
Changeset: 678937dc3b566be7c936a12617e689dd966b0ea6
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Mon Aug 28 00:46:07 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.giftcards.synchronization/rev/678937dc3b566be7c936a12617e689dd966b0ea6 [^]

Related with issue 36568: export global gift card to origin store
Also export the global gift card to the original store in the dataset and router

---
M src-db/database/sourcedata/AD_DATASET_TABLE.xml
M src/org/openbravo/retail/giftcards/synchronization/GiftCardRouter.java
---
(0098712)
hgbot (developer)
2017-08-29 23:08

Repository: erp/pmods/org.openbravo.retail.giftcards.synchronization
Changeset: db6c7063dae4e4f265be5debb7cf769cc0d421e7
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Tue Aug 29 23:08:19 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.giftcards.synchronization/rev/db6c7063dae4e4f265be5debb7cf769cc0d421e7 [^]

Related with issue 36568: export global gift card to origin store

STRSYNC_SYNCHRONIZEDTABLE: Sync gift card transactions bidirectional
GiftCardCurrentAmountWriterFilterAdapter: recompute product quantity and amounts in the correct way based on delete/update/insert of gift card transaction
GiftCardRouter: route also on the basis of the organisation of the payment

---
M src-db/database/sourcedata/STRSYNC_SYNCHRONIZEDTABLE.xml
M src/org/openbravo/retail/giftcards/synchronization/GiftCardCurrentAmountWriterFilterAdapter.java
M src/org/openbravo/retail/giftcards/synchronization/GiftCardRouter.java
---
(0098731)
hgbot (developer)
2017-08-30 12:25

Repository: erp/pmods/org.openbravo.retail.giftcards.synchronization
Changeset: dc5517aabb9f0d66b8fa77b88301468615172bd1
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed Aug 30 12:24:36 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.giftcards.synchronization/rev/dc5517aabb9f0d66b8fa77b88301468615172bd1 [^]

Related with issue 36568:GiftCardCurrentAmountWriterFilterAdapter clean up

The following changes have been done:
- Diamond operator is used
- Uses constant strings for "m_product_id" and "V"
- Adds comment to initialize to specify why it is empty
- Extract methods to handle the code for inserts, updates and deletions separately

---
M src/org/openbravo/retail/giftcards/synchronization/GiftCardCurrentAmountWriterFilterAdapter.java
---
(0098744)
AugustoMauch (manager)
2017-08-31 10:23

Point #17 of the test plan [1] not satisfied. Giftcard transaction are synchronized, but they sometimes reference entries from c_order that are not present in the target store.


[1] https://docs.google.com/spreadsheets/d/1_r9-_O94bOsjRtvsI31gJZQMzZ-rolTjOxAtgiNqqtI/edit#gid=0 [^]
(0098745)
hgbot (developer)
2017-08-31 10:50

Repository: erp/pmods/org.openbravo.retail.giftcards.synchronization
Changeset: fd502e3e203675d90a4e9608697df69a4e7e1013
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Thu Aug 31 10:50:12 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.giftcards.synchronization/rev/fd502e3e203675d90a4e9608697df69a4e7e1013 [^]

Related with issue 36568: add exclude order and order line from gift card transaction

---
A src-db/database/sourcedata/STRSYNC_EXCLUDEDCOL.xml
---
(0098774)
AugustoMauch (manager)
2017-09-01 12:34

Code reviewed and verified

- Issue History
Date Modified Username Field Change
2017-08-01 12:28 mtaal New Issue
2017-08-01 12:28 mtaal Assigned To => mtaal
2017-08-01 12:28 mtaal Triggers an Emergency Pack => No
2017-08-01 12:29 mtaal File Added: Gift Card Email Discussion.pdf
2017-08-01 12:39 mtaal Note Added: 0098306
2017-08-01 13:03 mtaal Review Assigned To => AugustoMauch
2017-08-01 17:11 hgbot Checkin
2017-08-01 17:11 hgbot Note Added: 0098314
2017-08-01 17:11 hgbot Status new => resolved
2017-08-01 17:11 hgbot Resolution open => fixed
2017-08-01 17:11 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.giftcards.synchronization/rev/1248af7cf74a54f2c6bae35a2580a047b1b8fd21 [^]
2017-08-01 19:14 hgbot Checkin
2017-08-01 19:14 hgbot Note Added: 0098320
2017-08-03 14:16 AugustoMauch Note Added: 0098375
2017-08-03 14:16 AugustoMauch Status resolved => new
2017-08-03 14:16 AugustoMauch Resolution fixed => open
2017-08-22 13:48 hgbot Checkin
2017-08-22 13:48 hgbot Note Added: 0098577
2017-08-22 13:48 hgbot Status new => resolved
2017-08-22 13:48 hgbot Resolution open => fixed
2017-08-22 13:48 hgbot Fixed in SCM revision http://code.openbravo.com/erp/pmods/org.openbravo.retail.giftcards.synchronization/rev/1248af7cf74a54f2c6bae35a2580a047b1b8fd21 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.giftcards.synchronization/rev/41df8f2375c17cc2b2a9951ad251cd6076e5d72e [^]
2017-08-24 14:12 hgbot Checkin
2017-08-24 14:12 hgbot Note Added: 0098635
2017-08-28 00:46 hgbot Checkin
2017-08-28 00:46 hgbot Note Added: 0098664
2017-08-29 23:08 hgbot Checkin
2017-08-29 23:08 hgbot Note Added: 0098712
2017-08-30 12:25 hgbot Checkin
2017-08-30 12:25 hgbot Note Added: 0098731
2017-08-31 10:23 AugustoMauch Note Added: 0098744
2017-08-31 10:23 AugustoMauch Status resolved => new
2017-08-31 10:23 AugustoMauch Resolution fixed => open
2017-08-31 10:50 hgbot Checkin
2017-08-31 10:50 hgbot Note Added: 0098745
2017-09-01 12:34 AugustoMauch Status new => scheduled
2017-09-01 12:34 AugustoMauch Status scheduled => resolved
2017-09-01 12:34 AugustoMauch Note Added: 0098774
2017-09-01 12:34 AugustoMauch Status resolved => closed
2017-09-01 12:34 AugustoMauch Fixed in Version => RR17Q4


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker