# HG changeset patch
# User Adrián Romero <adrianromero@openbravo.com>
# Date 1528985548 -7200
#      Thu Jun 14 16:12:28 2018 +0200
# Node ID c3f9989d1057a87c03509012339c552a7a133b5a
# Parent  2a5871725dd61b65cd8c7270f1c585319a7d2304
[MultiChange] Fixes cashup event rate using the same rate comming from payment method cashup

diff --git a/src/org/openbravo/retail/posterminal/ProcessCashMgmt.java b/src/org/openbravo/retail/posterminal/ProcessCashMgmt.java
--- a/src/org/openbravo/retail/posterminal/ProcessCashMgmt.java
+++ b/src/org/openbravo/retail/posterminal/ProcessCashMgmt.java
@@ -1,6 +1,6 @@
 /*
  ************************************************************************************
- * Copyright (C) 2012-2016 Openbravo S.L.U.
+ * Copyright (C) 2012-2018 Openbravo S.L.U.
  * Licensed under the Openbravo Commercial License version 1.0
  * You may obtain a copy of the License at http://www.openbravo.com/legal/obcl.html
  * or in the legal folder of this module distribution.
@@ -91,7 +91,7 @@
         paymentcashupEvent.setAmount(amount);
         paymentcashupEvent.setType(type);
         paymentcashupEvent.setCurrency(jsonsent.getString("isocode"));
-        paymentcashupEvent.setRate(origAmount.divide(amount, 2, BigDecimal.ROUND_HALF_UP));
+        paymentcashupEvent.setRate(paymentmethodcashup.getRate());
         OBDal.getInstance().save(paymentcashupEvent);
       }
     }
