Browse Source

[FIX] complete restriction

Gogs 7 years ago
parent
commit
ad73590f36
2 changed files with 6 additions and 2 deletions
  1. 1 1
      src/App.vue
  2. 5 1
      src/store/actions.js

+ 1 - 1
src/App.vue

@@ -1,6 +1,6 @@
 <template lang="pug">
     .pos
-        form-wizard(title='' subtitle='' finishButtonText='Finalizar' color='#7c7bad' nextButtonText='Continuar' backButtonText='Volver' @on-complete="createSale')
+        form-wizard(title='' subtitle='' finishButtonText='Finalizar' color='#7c7bad' nextButtonText='Continuar' backButtonText='Volver' @on-complete='createSale')
             tab-content(title="Qué productos necesita?" :before-change="checkCart")
                 product-step
             tab-content(title="Quién es el cliente?" :before-change="checkCustomer")

+ 5 - 1
src/store/actions.js

@@ -92,7 +92,11 @@ const actions = {
      * @param {*} param0 
      */
     [CHECK_AMOUNT_RECEIVED] ({ getters, dispatch }) {
-        return (getters.paymentType === 'cash' && getters.initialPayment >= getters.cartTotal)  || dispatch(NOTIFY, 'El monto recibido no puede ser menor al monto a pagar')
+        if (getters.paymentType == 'cash') {
+            return getters.initialPayment >= getters.cartTotal || dispatch(NOTIFY, 'El monto recibido no puede ser menor al monto a pagar')
+        } else {
+            return getters.initialPayment < getters.cartTotal || dispatch(NOTIFY, 'El monto recibido no puede ser igual o mayor al monto a pagar')
+        }
     },
     /**
      *