Created
May 27, 2019 20:57
-
-
Save AndyDaSilva52/5ffa67fc2584c482b41728bd376d5b43 to your computer and use it in GitHub Desktop.
#MegaERP - Evita lançar no Lote dos Movimentos de Estoque, espaço em branco no inicio ou final da String, evitando situações em que o Mega considera dois lotes com mesmo texto como diferentes por conta do caractere de espaço
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create or replace TRIGGER T_CLI_EST_MOVTOLOTES_SPACE | |
BEFORE INSERT OR UPDATE OF MVL_ST_LOTEFORNE ON MGADM.EST_LOTESMOVIMENTO | |
REFERENCING OLD AS OLD NEW AS NEW | |
FOR EACH ROW | |
BEGIN | |
BEGIN | |
/** | |
Quem: AGS ([email protected]) | |
Quando: 27/05/2019 | |
Motivo: Evitar de permitir inserir Lote com espaço em branco no inicio ou fim do Lote | |
*/ | |
IF (REGEXP_LIKE(:NEW.MVL_ST_LOTEFORNE, '((^[[:space:]]+)|([[:space:]]+$))')) THEN | |
RAISE_APPLICATION_ERROR(-20101,'Item ['|| :NEW.PRO_IN_CODIGO ||'] ' | |
|| 'tem espaço em branco no início ou fim do Lote ['|| :NEW.MVL_ST_LOTEFORNE ||'], isso não é permitido para que seja possível ter Rastreabilidade.' | |
|| CHR(13) || 'Favor avaliar e ajustar se necessário.' | |
|| CHR(13) || 'Caso haja dúvida, contate o Suporte.' | |
|| CHR(13) || '[MGCLI].[T_CLI_EST_MOVTOLOTES_SPACE]' | |
); | |
END IF; | |
END; | |
END; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment