Openbravo Issue Tracking System - Retail Modules
View Issue Details
0029302Retail ModulesWeb POSpublic2015-03-16 18:532015-06-19 10:40
jecharri 
aaroncalero 
urgentmajoralways
closedfixed 
5
 
RR15Q3RR15Q3 
marvintm
No
0029302: In paymentmethodcashup table one ticket can be added 2 times
In paymentmethodcashup table one ticket can be added 2 times. It seems that under some circumstances is possible to press 2 times done button and this will create the problem with paymentmethod cash up table.
-Go to Web POS
-Do a ticket
-Press in total
-Add the payment
-Press done
-Before the order is saved press F5, you will be able to press again done button and the receipt will be added again to the paymentmethodcashup table
No tags attached.
depends on feature request 0029478RR15Q3 closed aaroncalero Provide an API to do transactional OB.Dal calls 
depends on backport 0030210RR15Q2.3 closed aaroncalero In paymentmethodcashup table one ticket can be added 2 times 
diff transactions_refactor_mobile_core.diff (4,866) 2015-04-20 16:50
https://issues.openbravo.com/file_download.php?file_id=8008&type=bug
diff transactions_refactor_retail_posterminal.diff (20,173) 2015-04-20 16:51
https://issues.openbravo.com/file_download.php?file_id=8009&type=bug
patch Q2.1_posterminal_29302.patch (16,991) 2015-06-16 09:23
https://issues.openbravo.com/file_download.php?file_id=8209&type=bug
Issue History
2015-03-16 18:53jecharriNew Issue
2015-03-16 18:53jecharriAssigned To => marvintm
2015-03-16 18:53jecharriResolution time => 1426719600
2015-03-16 18:53jecharriTriggers an Emergency Pack => No
2015-03-25 15:56aaroncaleroAssigned Tomarvintm => aaroncalero
2015-03-30 14:01jonalegriaesarteTarget VersionRR15Q2 => RR15Q3
2015-04-01 14:23hgbotCheckin
2015-04-01 14:23hgbotNote Added: 0076311
2015-04-01 14:23hgbotStatusnew => resolved
2015-04-01 14:23hgbotResolutionopen => fixed
2015-04-01 14:23hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/c7d219d6065e4fd2ebce51011a459e16574f918e [^]
2015-04-01 16:48hgbotCheckin
2015-04-01 16:48hgbotNote Added: 0076322
2015-04-01 16:48hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/c7d219d6065e4fd2ebce51011a459e16574f918e [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/90a87c12a1a978070d077c146aa241904daf086e [^]
2015-04-01 17:24hgbotCheckin
2015-04-01 17:24hgbotNote Added: 0076326
2015-04-01 18:34aaroncaleroNote Added: 0076339
2015-04-01 18:34aaroncaleroStatusresolved => new
2015-04-01 18:34aaroncaleroResolutionfixed => open
2015-04-01 18:36hgbotCheckin
2015-04-01 18:36hgbotNote Added: 0076340
2015-04-09 09:51hgbotCheckin
2015-04-09 09:51hgbotNote Added: 0076396
2015-04-09 09:51hgbotStatusnew => resolved
2015-04-09 09:51hgbotResolutionopen => fixed
2015-04-09 09:51hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/90a87c12a1a978070d077c146aa241904daf086e [^] => http://code.openbravo.com/retail/backports/3.0RR15Q2/org.openbravo.retail.posterminal/rev/c7d219d6065e4fd2ebce51011a459e16574f918e [^]
2015-04-09 09:51hgbotCheckin
2015-04-09 09:51hgbotNote Added: 0076398
2015-04-09 09:51hgbotFixed in SCM revisionhttp://code.openbravo.com/retail/backports/3.0RR15Q2/org.openbravo.retail.posterminal/rev/c7d219d6065e4fd2ebce51011a459e16574f918e [^] => http://code.openbravo.com/retail/backports/3.0RR15Q2/org.openbravo.retail.posterminal/rev/90a87c12a1a978070d077c146aa241904daf086e [^]
2015-04-09 09:51hgbotCheckin
2015-04-09 09:51hgbotNote Added: 0076399
2015-04-09 09:51hgbotCheckin
2015-04-09 09:51hgbotNote Added: 0076400
2015-04-13 09:08aaroncaleroStatusresolved => new
2015-04-13 09:08aaroncaleroResolutionfixed => open
2015-04-13 10:50hgbotCheckin
2015-04-13 10:50hgbotNote Added: 0076462
2015-04-13 10:50hgbotStatusnew => resolved
2015-04-13 10:50hgbotResolutionopen => fixed
2015-04-13 10:50hgbotFixed in SCM revisionhttp://code.openbravo.com/retail/backports/3.0RR15Q2/org.openbravo.retail.posterminal/rev/90a87c12a1a978070d077c146aa241904daf086e [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/9a2aae52ffdfa9e0c8abb30fe055825fa33ec86e [^]
2015-04-20 16:48adrianromeroNote Added: 0076638
2015-04-20 16:48adrianromeroStatusresolved => new
2015-04-20 16:48adrianromeroResolutionfixed => open
2015-04-20 16:50adrianromeroFile Added: transactions_refactor_mobile_core.diff
2015-04-20 16:51adrianromeroFile Added: transactions_refactor_retail_posterminal.diff
2015-04-22 09:12aaroncaleroRelationship addeddepends on 0029478
2015-04-22 09:17hgbotCheckin
2015-04-22 09:17hgbotNote Added: 0076671
2015-04-22 09:17hgbotStatusnew => resolved
2015-04-22 09:17hgbotResolutionopen => fixed
2015-04-22 09:17hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/9a2aae52ffdfa9e0c8abb30fe055825fa33ec86e [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/9013ba1d307c9485a2141b400cb65ddd0f2cc7e6 [^]
2015-05-13 18:10marvintmReview Assigned To => marvintm
2015-05-13 18:10marvintmStatusresolved => closed
2015-05-13 18:10marvintmFixed in Version => RR15Q3
2015-06-16 09:23OrekariaFile Added: Q2.1_posterminal_29302.patch
2015-06-19 10:39OrekariaStatusclosed => new
2015-06-19 10:39OrekariaResolutionfixed => open
2015-06-19 10:39OrekariaFixed in VersionRR15Q3 =>
2015-06-19 10:39OrekariaStatusnew => scheduled
2015-06-19 10:39OrekariaStatusscheduled => resolved
2015-06-19 10:39OrekariaFixed in Version => RR15Q3
2015-06-19 10:39OrekariaResolutionopen => fixed
2015-06-19 10:40OrekariaStatusresolved => closed

Notes
(0076311)
hgbot   
2015-04-01 14:23   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: c7d219d6065e4fd2ebce51011a459e16574f918e
Author: Aaron Calero <aaron.calero <at> openbravo.com>
Date: Wed Apr 01 14:21:37 2015 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/c7d219d6065e4fd2ebce51011a459e16574f918e [^]

Fixed issue 29302: In paymentmethodcashup table one ticket can be added 2 times

Refactored the ticket closing process to be done in a sql transaction. Now if the user reloads the application while the closing process is active, all the changes done to the local database will be rolled back

---
M web/org.openbravo.retail.posterminal/js/data/dataordersave.js
M web/org.openbravo.retail.posterminal/js/login/model/login-model.js
M web/org.openbravo.retail.posterminal/js/pointofsale/model/pointofsale-model.js
M web/org.openbravo.retail.posterminal/js/utils/cashUpReportUtils.js
---
(0076322)
hgbot   
2015-04-01 16:48   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 90a87c12a1a978070d077c146aa241904daf086e
Author: Aaron Calero <aaron.calero <at> openbravo.com>
Date: Wed Apr 01 16:47:15 2015 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/90a87c12a1a978070d077c146aa241904daf086e [^]

Fixed issue 29302: Added missing transactional Dal calls

---
M web/org.openbravo.retail.posterminal/js/utils/cashUpReportUtils.js
---
(0076326)
hgbot   
2015-04-01 17:24   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: a53ee2b45659b5636ba492aa06e4fe5917d9c658
Author: Aaron Calero <aaron.calero <at> openbravo.com>
Date: Wed Apr 01 17:23:50 2015 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/a53ee2b45659b5636ba492aa06e4fe5917d9c658 [^]

Related to issue 29302: Changed the way a new ticket is created with multiorders

After closing the last receipt in a multiorder ticket, a new receipt will be created if the receipt list is empty (this is done automatically when deleting an order). At the moment of finishing closing the multiorder we only need to synchronize the open ticket if needed, in order to update its document number.

---
M web/org.openbravo.retail.posterminal/js/pointofsale/model/pointofsale-model.js
---
(0076339)
aaroncalero   
2015-04-01 18:34   
Multiorders flow is failing because the runSyncProcess is being executed before all the operations inside the transaction have finished.
(0076340)
hgbot   
2015-04-01 18:36   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: d7e7e0a39c29a7a46ae3fd0560676f420d7c514c
Author: Aaron Calero <aaron.calero <at> openbravo.com>
Date: Wed Apr 01 18:29:38 2015 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/d7e7e0a39c29a7a46ae3fd0560676f420d7c514c [^]

Related to issue 29302: Backed out changesets a53ee2b45659, 90a87c12a1a9 and c7d219d6065e until we find a way to apply it correctly to the multiorders flow

---
M web/org.openbravo.retail.posterminal/js/data/dataordersave.js
M web/org.openbravo.retail.posterminal/js/login/model/login-model.js
M web/org.openbravo.retail.posterminal/js/pointofsale/model/pointofsale-model.js
M web/org.openbravo.retail.posterminal/js/utils/cashUpReportUtils.js
---
(0076396)
hgbot   
2015-04-09 09:51   
Repository: retail/backports/3.0RR15Q2/org.openbravo.retail.posterminal
Changeset: c7d219d6065e4fd2ebce51011a459e16574f918e
Author: Aaron Calero <aaron.calero <at> openbravo.com>
Date: Wed Apr 01 14:21:37 2015 +0200
URL: http://code.openbravo.com/retail/backports/3.0RR15Q2/org.openbravo.retail.posterminal/rev/c7d219d6065e4fd2ebce51011a459e16574f918e [^]

Fixed issue 29302: In paymentmethodcashup table one ticket can be added 2 times

Refactored the ticket closing process to be done in a sql transaction. Now if the user reloads the application while the closing process is active, all the changes done to the local database will be rolled back

---
M web/org.openbravo.retail.posterminal/js/data/dataordersave.js
M web/org.openbravo.retail.posterminal/js/login/model/login-model.js
M web/org.openbravo.retail.posterminal/js/pointofsale/model/pointofsale-model.js
M web/org.openbravo.retail.posterminal/js/utils/cashUpReportUtils.js
---
(0076398)
hgbot   
2015-04-09 09:51   
Repository: retail/backports/3.0RR15Q2/org.openbravo.retail.posterminal
Changeset: 90a87c12a1a978070d077c146aa241904daf086e
Author: Aaron Calero <aaron.calero <at> openbravo.com>
Date: Wed Apr 01 16:47:15 2015 +0200
URL: http://code.openbravo.com/retail/backports/3.0RR15Q2/org.openbravo.retail.posterminal/rev/90a87c12a1a978070d077c146aa241904daf086e [^]

Fixed issue 29302: Added missing transactional Dal calls

---
M web/org.openbravo.retail.posterminal/js/utils/cashUpReportUtils.js
---
(0076399)
hgbot   
2015-04-09 09:51   
Repository: retail/backports/3.0RR15Q2/org.openbravo.retail.posterminal
Changeset: a53ee2b45659b5636ba492aa06e4fe5917d9c658
Author: Aaron Calero <aaron.calero <at> openbravo.com>
Date: Wed Apr 01 17:23:50 2015 +0200
URL: http://code.openbravo.com/retail/backports/3.0RR15Q2/org.openbravo.retail.posterminal/rev/a53ee2b45659b5636ba492aa06e4fe5917d9c658 [^]

Related to issue 29302: Changed the way a new ticket is created with multiorders

After closing the last receipt in a multiorder ticket, a new receipt will be created if the receipt list is empty (this is done automatically when deleting an order). At the moment of finishing closing the multiorder we only need to synchronize the open ticket if needed, in order to update its document number.

---
M web/org.openbravo.retail.posterminal/js/pointofsale/model/pointofsale-model.js
---
(0076400)
hgbot   
2015-04-09 09:51   
Repository: retail/backports/3.0RR15Q2/org.openbravo.retail.posterminal
Changeset: d7e7e0a39c29a7a46ae3fd0560676f420d7c514c
Author: Aaron Calero <aaron.calero <at> openbravo.com>
Date: Wed Apr 01 18:29:38 2015 +0200
URL: http://code.openbravo.com/retail/backports/3.0RR15Q2/org.openbravo.retail.posterminal/rev/d7e7e0a39c29a7a46ae3fd0560676f420d7c514c [^]

Related to issue 29302: Backed out changesets a53ee2b45659, 90a87c12a1a9 and c7d219d6065e until we find a way to apply it correctly to the multiorders flow

---
M web/org.openbravo.retail.posterminal/js/data/dataordersave.js
M web/org.openbravo.retail.posterminal/js/login/model/login-model.js
M web/org.openbravo.retail.posterminal/js/pointofsale/model/pointofsale-model.js
M web/org.openbravo.retail.posterminal/js/utils/cashUpReportUtils.js
---
(0076462)
hgbot   
2015-04-13 10:50   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 9a2aae52ffdfa9e0c8abb30fe055825fa33ec86e
Author: Aaron Calero <aaron.calero <at> openbravo.com>
Date: Mon Apr 13 10:38:25 2015 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/9a2aae52ffdfa9e0c8abb30fe055825fa33ec86e [^]

Fixed issue 29302: In paymentmethodcashup table one ticket can be added 2 times

Reapplied changes to the standard order flow to close tickets in a transactional way.

---
M web/org.openbravo.retail.posterminal/js/data/dataordersave.js
M web/org.openbravo.retail.posterminal/js/login/model/login-model.js
M web/org.openbravo.retail.posterminal/js/utils/cashUpReportUtils.js
---
(0076638)
adrianromero   
2015-04-20 16:48   
The code works as expected. but the transactions implementation for WebSQL can be improved:

* Hides the native transaction object adding complexity, is error prone and forces to use two vars: transactionName and finalizationCallback(), when in the original WEBSQL implementation only is required the transaction object. There is no need to make the API more complex. I suggest to use the original transaction construction:

  var db = openDatabase('mydb', '1.0', 'Test DB', 2 * 1024 * 1024);
  db.transaction(function (tx) {
     tx.executeSql('CREATE TABLE IF NOT EXISTS LOGS (id unique, log)');
  });

* Functions xxxxInTransaction() fails when no transaction name supplied, but the general use in POS is that if there is no transaction a new transaction is created. In consequence a lot of code is duplicated to implement the required behaviour. For example, the following piece of code is duplicated several times:

  findIfInTransaction = function (model, whereClause, success, error,
 args) {
    if (trxName) {
      OB.Dal.findInTransaction(trxName, model, whereClause, success, error, args);
    } else {
      OB.Dal.find(model, whereClause, success, error, args);
    }
  };

Please, consider the attached refactor that implements the previous points. As an indicator it reduces 140 lines of code.
(0076671)
hgbot   
2015-04-22 09:17   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 9013ba1d307c9485a2141b400cb65ddd0f2cc7e6
Author: Aaron Calero <aaron.calero <at> openbravo.com>
Date: Wed Apr 22 09:15:53 2015 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/9013ba1d307c9485a2141b400cb65ddd0f2cc7e6 [^]

Fixed issue 29302: In paymentmethodcashup table one ticket can be added 2 times

Applied refactor to remove duplicated code and reduce complexity

---
M web/org.openbravo.retail.posterminal/js/data/dataordersave.js
M web/org.openbravo.retail.posterminal/js/login/model/login-model.js
M web/org.openbravo.retail.posterminal/js/utils/cashUpReportUtils.js
---