Openbravo Issue Tracking System - Retail Modules
View Issue Details
0039675Retail ModulesSessionspublic2018-11-22 11:472018-12-13 10:42
malsasua 
ranjith_qualiantech_com 
highmajorhave not tried
closedfixed 
5
 
RR19Q1 
marvintm
No
0039675: Business date is changed when login offline is done
when login offline is done, the business date is retrieved from terminal info stored in local database, and it could not be updated to the last business date.
[BO]
. open store -> business date d1
[POS]
. login online user1 ->
    message-> "business date will be changed to d1 is displayed"
           -> the business date in local storage is set to d1
. cashup & logout
. login online user2
. cashup & logout
[BO]
. close store
. open store-> business date d2
[POS]
. login online user1 ->
    message-> "business date will be changed to d2 is displayed"
           -> the business date in local storage is set to d2
. cashup & logout
. login OFFLINE user2
    message-> "business date will be changed to d1 is displayed"
           -> the business date in local storage is set to d1
. cashup & logout

It happens because in login Offline, the business date is retrieved from Terminal info, stored in local database in the table user, and user2 Terminal info is not updated with business date d2.
In this line:
if (!OB.UTIL.isNullOrUndefined(OB.UTIL.localStorage.getItem('businessdate')) && (new Date(OB.UTIL.localStorage.getItem('businessdate')).setHours(0, 0, 0, 0) < new Date(OB.POS.modelterminal.get('terminal').poss_businessdate).setHours(0, 0, 0, 0) || new Date(OB.UTIL.localStorage.getItem('businessdate')).setHours(0, 0, 0, 0) > new Date(OB.POS.modelterminal.get('terminal').poss_businessdate).setHours(0, 0, 0, 0))) {
        var onHidePopup = function() {
...

if you are offline, the business date should not be retrieved from Terminal.

Also, should be added log traces, when business date is set in the terminal, so, we can check what business date has been assigned by cashier
No tags attached.
diff fixReturn.diff (379) 2018-11-28 18:12
https://issues.openbravo.com/file_download.php?file_id=12395&type=bug
Issue History
2018-11-22 11:47malsasuaNew Issue
2018-11-22 11:47malsasuaAssigned To => Retail
2018-11-22 11:47malsasuaResolution time => 1544396400
2018-11-22 11:47malsasuaTriggers an Emergency Pack => No
2018-11-22 12:03malsasuaResolution time1544396400 => 1543100400
2018-11-22 12:29ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2018-11-22 12:29ranjith_qualiantech_comStatusnew => scheduled
2018-11-23 09:26rafarodaIssue Monitored: rafaroda
2018-11-23 09:55hgbotCheckin
2018-11-23 09:55hgbotNote Added: 0108072
2018-11-25 11:51ranjith_qualiantech_comStatusscheduled => resolved
2018-11-25 11:51ranjith_qualiantech_comResolutionopen => fixed
2018-11-28 18:11samuel_nicuesaNote Added: 0108160
2018-11-28 18:12samuel_nicuesaFile Added: fixReturn.diff
2018-12-04 13:26marvintmStatusresolved => new
2018-12-04 13:26marvintmResolutionfixed => open
2018-12-04 13:26marvintmResolution time1543100400 => 1545001200
2018-12-05 12:51ranjith_qualiantech_comStatusnew => scheduled
2018-12-06 11:05hgbotCheckin
2018-12-06 11:05hgbotNote Added: 0108311
2018-12-06 11:05hgbotStatusscheduled => resolved
2018-12-06 11:05hgbotResolutionopen => fixed
2018-12-06 11:05hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.sessions/rev/b584bce4a3a27ad33d649feafb94bf699bdbba49 [^]
2018-12-13 10:42marvintmReview Assigned To => marvintm
2018-12-13 10:42marvintmStatusresolved => closed
2018-12-13 10:42marvintmFixed in Version => RR19Q1

Notes
(0108072)
hgbot   
2018-11-23 09:55   
Repository: erp/pmods/org.openbravo.retail.sessions
Changeset: f5dfdd235e7014b1e6f1b6a883f0b1dd4429c633
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Fri Nov 23 14:24:58 2018 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.sessions/rev/f5dfdd235e7014b1e6f1b6a883f0b1dd4429c633 [^]

Related to issue 39675 : Removed unnecessary condition while checking Business date

* For offline mode, its not necessary to check the terminal is correctly loaded

---
M web/org.openbravo.retail.sessions/js/components/loginhook.js
---
(0108160)
samuel_nicuesa   
2018-11-28 18:11   
Is necessary to add return line (see fixReturn.diff) file
(0108311)
hgbot   
2018-12-06 11:05   
Repository: erp/pmods/org.openbravo.retail.sessions
Changeset: b584bce4a3a27ad33d649feafb94bf699bdbba49
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Thu Dec 06 15:35:15 2018 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.sessions/rev/b584bce4a3a27ad33d649feafb94bf699bdbba49 [^]

Fixed issue 39675 : Added return statement while checking business date with localstorage in offline mode

---
M web/org.openbravo.retail.sessions/js/components/loginhook.js
---