diff --git a/loopback/locale/es.json b/loopback/locale/es.json index d4f3733b0..54ead9ee8 100644 --- a/loopback/locale/es.json +++ b/loopback/locale/es.json @@ -67,7 +67,6 @@ "Tag value cannot be blank": "El valor del tag no puede quedar en blanco", "ORDER_EMPTY": "Cesta vacía", "You don't have enough privileges to do that": "No tienes permisos para cambiar esto", - "You can't create a ticket for a client that has a debt": "No puedes crear un ticket para un client con deuda", "NO SE PUEDE DESACTIVAR EL CONSIGNAT": "NO SE PUEDE DESACTIVAR EL CONSIGNAT", "Error. El NIF/CIF está repetido": "Error. El NIF/CIF está repetido", "Street cannot be empty": "Dirección no puede estar en blanco", diff --git a/modules/ticket/back/methods/ticket/new.js b/modules/ticket/back/methods/ticket/new.js index db25fe715..7522fbbcc 100644 --- a/modules/ticket/back/methods/ticket/new.js +++ b/modules/ticket/back/methods/ticket/new.js @@ -49,13 +49,6 @@ module.exports = Self => { if (!address.client().isActive) throw new UserError(`You can't create a ticket for a inactive client`); - - let clientFk = address.clientFk; - let query = `SELECT vn.clientGetDebt(?, CURDATE()) AS debt`; - let clientDebt = await Self.rawSql(query, [clientFk]); - - if (address.client().credit - clientDebt[0].debt <= 0) - throw new UserError(`You can't create a ticket for a client that has a debt`); } if (!params.shipped && params.landed) {