Openbravo Issue Tracking System - Retail Modules
View Issue Details
0045173Retail ModulesWeb POSpublic2020-10-01 23:592020-10-05 14:10
gorka_gil 
gorka_gil 
highmajorN/A
closedfixed 
5
 
RR21Q1 
No
0045173: Statistics included in cashup stopped working after moving the cashup to indexeddb
After move the cashup from websql to indexeddb, all the statistics included in cashup request stopped working, this included these statistics:
- Number Of Transitions to Online
- Number Of Logclient Errors
- Average Latency in ms
- Average Upload Bandwidth in KB/s
- Average Download Bandwidth in KB/s
In vbs-1 terminal:
- make a cashup just for start a clean new one
- in developer tools set network in offline
- make a new ticket
- restore the online in network
- click on menu and retry connection, so the pos notice the back to online
- create a new cashup

In backend:
- go to touchpoint vbs-1
- go to the sub tab: terminal history status
- open the most recent record

The field number of transitions to online is 0, which is wrong.
No tags attached.
depends on backport 0045175RR20Q4 closed gorka_gil Statistics included in cashup stopped working after moving the cashup to indexeddb 
Issue History
2020-10-01 23:59gorka_gilNew Issue
2020-10-01 23:59gorka_gilAssigned To => gorka_gil
2020-10-01 23:59gorka_gilTriggers an Emergency Pack => No
2020-10-02 02:16hgbotNote Added: 0123484
2020-10-02 10:07gorka_gilNote Added: 0123487
2020-10-02 13:22gorka_gilStatusnew => scheduled
2020-10-05 14:10hgbotResolutionopen => fixed
2020-10-05 14:10hgbotStatusscheduled => closed
2020-10-05 14:10hgbotNote Added: 0123549
2020-10-05 14:10hgbotFixed in Version => RR21Q1
2020-10-05 14:10hgbotNote Added: 0123550

Notes
(0123484)
hgbot   
2020-10-02 02:16   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/119 [^]
(0123487)
gorka_gil   
2020-10-02 10:07   
wiki of terminal status history, just as reference:
- http://wiki.openbravo.com/wiki/Retail:Configuration_Guide#.3DTerminal_status_history.3D [^]
(0123549)
hgbot   
2020-10-05 14:10   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/119 [^]
(0123550)
hgbot   
2020-10-05 14:10   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal [^]
Changeset: 1bdb7c2ca84b8e62edb5f01621b6d93945f3551b
Author: Gorka Gil <gorka.gil@openbravo.com>
Date: 2020-10-05T14:06:36+02:00
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/commit/1bdb7c2ca84b8e62edb5f01621b6d93945f3551b [^]

Fixes ISSUE-45173: fix statistics included in cashup

- after initCashup create localStore variables in case don't exists
- after each ticket, add the statistics to the cashup include in the ticket message
- when doing a cashup include the statistics in the message
- after do a cashup, reset the statistics

When moving the cashup to indexeddb most of the code is inside actions,
and edit the local storage variables cannot be done inside the actions,
so was needed some changes respect how it works before:
- previosly the variables reset was done on init cashup from backend or
  from scratch.
  Now, it is executed in all init cashups, but only set to 0 if the variable
  doesn't exist
- Before, the reset of variables where executed at the beggining of init cashup.
  Now, is executed only after the action has finish in the then of the promise returned
  by the action (for the case that the action was canceled)
- Before, when adding the network statistics to the cashup to send to backend, there was an
  if to check if the variable exists, now it is removed since in the init cashup we ensurei that exists.

---
M web/org.openbravo.retail.posterminal/app/model/business-object/cashup/Cashup.js
M web/org.openbravo.retail.posterminal/app/model/business-object/cashup/CashupUtils.js
M web/org.openbravo.retail.posterminal/app/model/business-object/cashup/actions/CompleteCashupAndCreateNew.js
M web/org.openbravo.retail.posterminal/app/model/business-object/cashup/actions/InitCashup.js
M web/org.openbravo.retail.posterminal/js/closecash/model/cashup/cashup-model.js
M web/org.openbravo.retail.posterminal/js/login/model/login-model.js
M web/org.openbravo.retail.posterminal/js/utils/ticketUtils.js
---