# HG changeset patch
# User Mario Castello <mario.castello@peoplewalking.com>
# Date 1493759136 21600
#      mar may 02 15:05:36 2017 -0600
# Node ID 7f25aa55bb77304125bad49a664a933154d637d7
# Parent  6f54742280da78404775ab5403609f2d9f2439d6
Fixed issue 0035867: [RR17Q2] Already paid receipts can be completed again through 'Receipts' option

- Added validation for paid receipt

diff --git a/web/org.openbravo.retail.posterminal/js/pointofsale/view/payment.js b/web/org.openbravo.retail.posterminal/js/pointofsale/view/payment.js
--- a/web/org.openbravo.retail.posterminal/js/pointofsale/view/payment.js
+++ b/web/org.openbravo.retail.posterminal/js/pointofsale/view/payment.js
@@ -335,6 +335,13 @@
     if (this.model.get('leftColumnViewManager').isMultiOrder()) {
       return true;
     }
+    if (this.receipt.get('isPaid') && this.receipt.getGross() === 0) {
+      this.$.totalpending.hide();
+      this.$.totalpendinglbl.hide();
+      this.$.exactlbl.setContent(OB.I18N.getLabel('OBPOS_PaymentsExact'));
+      this.$.exactlbl.show();
+      return true;
+    }
     var paymentstatus = this.receipt.getPaymentStatus();
     var symbol = '',
         rate = OB.DEC.One,
