diff --git a/services/db/localDB02StructureVn2008.sql b/services/db/localDB02StructureVn2008.sql index 1fc6d417a..82b2e0d5d 100644 --- a/services/db/localDB02StructureVn2008.sql +++ b/services/db/localDB02StructureVn2008.sql @@ -906,32 +906,15 @@ BEGIN CALL pbx.phoneIsValid (NEW.fax); END IF; - -- Actualiza el crédito +-- Actualiza el crédito - SELECT Id_Trabajador INTO vEmployee - FROM Trabajadores WHERE user_id = account.userGetId(); - - IF vEmployee IS NULL THEN - SET vEmployee = 20; - END IF; - - IF !(NEW.Credito <=> OLD.Credito) AND IFNULL(NEW.Credito, 0) >= 0 + IF !(NEW.Credito <=> OLD.Credito) AND IFNULL(NEW.Credito, 0) >= 0 THEN - INSERT INTO credit SET - Id_Cliente = NEW.Id_Cliente, - amount = NEW.Credito, - Id_Trabajador = vEmployee; - END IF; - - -- Avisar al comercial si ha llegado la documentación sepa/core - - IF NEW.sepavnl AND !OLD.sepavnl THEN - SET vText = 'Sepa de VNL'; - END IF; - - IF NEW.corevnl AND !OLD.corevnl THEN - SET vText = 'Core de VNL'; - END IF; + INSERT INTO credit SET + Id_Cliente = NEW.Id_Cliente, + amount = NEW.Credito, + Id_Trabajador = account.userGetId(); + END IF; IF vText IS NOT NULL THEN