Openbravo Issue Tracking System - Retail Modules
View Issue Details
0030778Retail ModulesWeb POSpublic2015-09-07 11:162015-09-29 13:33
jorge-garcia 
jorge-garcia 
urgentmajoralways
closedfixed 
5
 
RR15Q4 
adrianromero
Automated tests
https://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/4c6043023025 [^]
No
0030778: Cash UP Partial crashes
Cash UP Partial crashes trying to access the report

When selecting the Partial Cash Up menu option, an exception error message is shown and the window does not show any other information. This can be seen in current live environments for PI and STABLE branches, while last published release (RR15Q3) works fine.
1) Login in the Web POS
2) Go to the Partial CashUP Menu
3) See that a javascript error occurs
No tags attached.
has duplicate defect 0030862 closed Retail Menu entry "Partial Cash Up" shows an exception and does not work 
related to defect 0030960 closed javierRodriguez Cash up and cash up partial could be improved 
blocks defect 0030802 closed migueldejuana When a service name content is in executed service name(different from compared service) fails 
png Partial+Cash+Up.png (87,200) 2015-09-17 19:06
https://issues.openbravo.com/file_download.php?file_id=8457&type=bug
png

diff cashup_vs_cashuppartial.diff (2,862) 2015-09-28 18:04
https://issues.openbravo.com/file_download.php?file_id=8487&type=bug
Issue History
2015-09-07 11:16jorge-garciaNew Issue
2015-09-07 11:16jorge-garciaAssigned To => jorge-garcia
2015-09-07 11:16jorge-garciaTriggers an Emergency Pack => No
2015-09-09 13:56jorge-garciaRelationship addedblocks 0030802
2015-09-17 19:04OrekariaRelationship addedhas duplicate 0030862
2015-09-17 19:06OrekariaFile Added: Partial+Cash+Up.png
2015-09-17 19:09OrekariaDescription Updatedbug_revision_view_page.php?rev_id=9456#r9456
2015-09-18 15:16OrekariaRegression level => Automated tests
2015-09-21 11:58OrekariaRegression introduced by commit => https://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/4c6043023025 [^]
2015-09-25 12:47hgbotCheckin
2015-09-25 12:47hgbotNote Added: 0080639
2015-09-25 12:47hgbotStatusnew => resolved
2015-09-25 12:47hgbotResolutionopen => fixed
2015-09-25 12:47hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/9c0f979ec5e016e06fedcd7113f0c4f6abd0b6b4 [^]
2015-09-25 13:56OrekariaReview Assigned To => adrianromero
2015-09-28 18:04adrianromeroNote Added: 0080673
2015-09-28 18:04adrianromeroStatusresolved => new
2015-09-28 18:04adrianromeroResolutionfixed => open
2015-09-28 18:04adrianromeroFile Added: cashup_vs_cashuppartial.diff
2015-09-29 13:31marvintmStatusnew => scheduled
2015-09-29 13:33marvintmNote Added: 0080702
2015-09-29 13:33marvintmStatusscheduled => resolved
2015-09-29 13:33marvintmFixed in Version => RR15Q4
2015-09-29 13:33marvintmResolutionopen => fixed
2015-09-29 13:33marvintmStatusresolved => closed
2015-09-29 16:04adrianromeroRelationship addedrelated to 0030960

Notes
(0080639)
hgbot   
2015-09-25 12:47   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 9c0f979ec5e016e06fedcd7113f0c4f6abd0b6b4
Author: Jorge Garcia <jorge.garcia <at> openbravo.com>
Date: Tue Sep 22 08:43:20 2015 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/9c0f979ec5e016e06fedcd7113f0c4f6abd0b6b4 [^]

Fixed issue 30778: Cash UP Partial crashes

The problem was that the cashup partial tries to start from the step 5
(step CashKeep) instead of the step 6 (step PostPrint&Close).

Some functionality has changed and the cashup partial doesn't show the real
info in the report and in the ticket.

---
M web/org.openbravo.retail.posterminal/js/closecash/model/cashup-model.js
---
(0080673)
adrianromero   
2015-09-28 18:04   
This fix overwrites a long function in class CashupPartial called *getCountCashSummary()* This function is the same as the overwritten function on class Cashup with just few changes as it can be seen in the attached file cashup_vs_cashuppartial.diff. this function can be easily refactored reducing the number of lines and complexity of the fix significantly the following way:

Instead of overwriting *getCountCashSummary()*, create few functions to represent the differences in class Cashup and overwrite in class CashupPartial these functions. For example a new function *getTotalQtyToKeep()* can be created invoked from *getCountCashSummary()* the following way:

In class Cashup:

getTotalQtyToKeep: function () {
  return _.reduce(this.get('paymentList').models, function (total, model) {
        if (model.get('qtyToKeep')) {
          var cQtyToKeep = OB.UTIL.currency.toDefaultCurrency(model.get('paymentMethod').currency, model.get('qtyToKeep'));
          return OB.DEC.add(total, cQtyToKeep);
        } else {
          return total;
        }
      }, 0);
},

In class CashupPartial

getTotalQtyToKeep: function () {
  return OB.DEC.Zero;
},
(0080702)
marvintm   
2015-09-29 13:33   
The refactor of the function makes all the sense, but we are very close to the freeze of the current release, so we will leave the current version for now, and we will do the refactor for 16Q1.

A related issue has been reported for the refactor:
https://issues.openbravo.com/view.php?id=30960 [^]