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_CUS_FIN_BLOQ_MOVTO | |
for insert or update on MGFIN.FIN_MOVIMENTO | |
compound trigger | |
TYPE TYP_CUS_RC_FINMOV IS RECORD( | |
ORG_TAB_IN_CODIGO MGFIN.FIN_MOVIMENTO.ORG_TAB_IN_CODIGO%TYPE, | |
ORG_PAD_IN_CODIGO MGFIN.FIN_MOVIMENTO.ORG_PAD_IN_CODIGO%TYPE, | |
ORG_IN_CODIGO MGFIN.FIN_MOVIMENTO.ORG_IN_CODIGO%TYPE, | |
ORG_TAU_ST_CODIGO MGFIN.FIN_MOVIMENTO.ORG_TAU_ST_CODIGO%TYPE, | |
agn_tab_in_codigo MGFIN.FIN_MOVIMENTO.agn_tab_in_codigo%TYPE, |
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 "MGCLI"."T_CLI_EST_ITENSPEDPROGR" | |
FOR INSERT OR UPDATE ON MGADM.EST_ITENSPEDPROGRAMADOS | |
COMPOUND TRIGGER | |
vOrigem MGCLI.MAIL_LOG_GENERICO.BI_ST_ORIGEM%TYPE := 'MGCLI.T_CLI_EST_ITENSPEDPROGR'; | |
TYPE TYP_CLI_RC_ITNPDCPROG IS RECORD ( | |
ORG_TAB_IN_CODIGO MGADM.EST_ITENSPEDPROGRAMADOS.ORG_TAB_IN_CODIGO%TYPE, | |
ORG_PAD_IN_CODIGO MGADM.EST_ITENSPEDPROGRAMADOS.ORG_PAD_IN_CODIGO%TYPE, | |
ORG_IN_CODIGO MGADM.EST_ITENSPEDPROGRAMADOS.ORG_IN_CODIGO%TYPE, |
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 PROCEDURE P_EST_RECEBNFE_AGUARDANDO AS | |
vAGN_IN_CODIGO MGADM.EST_RECEBIMENTONFE.AGN_IN_CODIGO%TYPE; | |
vHOST_NAME VARCHAR(250); | |
BEGIN | |
/** | |
AGS - 14/05/2017 - | |
Atualizar dados dos registros não baixados no Gerenciador de NFe com informações da Chave para identificar: | |
Nota Fiscal / Série / Modelo | |
Agente (CNPJ / UF) | |
*/ |
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 MGCLI.T_CLI_FIN_MOVIMENTO | |
for insert or update on MGFIN.FIN_MOVIMENTO | |
compound trigger | |
vOwner sys.all_objects.owner%type := 'MGCLI'; | |
vObjeto sys.all_objects.object_name%type := 'T_CLI_FIN_MOVIMENTO'; | |
type typ_cli_rc_movimentos is record( | |
ORG_TAB_IN_CODIGO mgfin.fin_movimento.org_tab_in_codigo%type, | |
ORG_PAD_IN_CODIGO mgfin.fin_movimento.org_pad_in_codigo%type, |
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 MGCLI.T_CLI_VEN_NOTAFISCAL | |
BEFORE INSERT OR UPDATE ON MGVEN.VEN_NOTAFISCAL | |
REFERENCING OLD AS OLD NEW AS NEW | |
FOR EACH ROW | |
BEGIN | |
IF UPDATING THEN | |
BEGIN | |
/** | |
Motivo: Macar para reescriturar após alteraçã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 MGCLI.T_CLI_EST_RECEBIMENTO | |
BEFORE INSERT OR UPDATE ON MGADM.EST_RECEBIMENTO | |
REFERENCING OLD AS OLD NEW AS NEW | |
FOR EACH ROW | |
BEGIN | |
/** | |
Quem: AGS([email protected]) | |
Quando: 07/07/2018 | |
Motivo: Nao permitir CTe com Entrada antes da Emissã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 FORCE EDITIONABLE VIEW "MGCLI"."CLI_VW_EST_MOVSUM_RESERVA" ("RN", "FIL_IN_CODIGO", "PRO_IN_CODIGO", "MVS_IN_RESERVA", "MVS_RE_QUANTIDADE", "RSV_CH_ORIGEM", "RSV_CH_ORIGEMDESC", "RSV_ST_DOCUMENTO", "RSV_DT_DOCUMENTO", "RSV_DT_MOVIMENTO", "RSV_ST_SITUACAO") AS | |
SELECT | |
"RN", | |
"FIL_IN_CODIGO", | |
"PRO_IN_CODIGO", | |
"MVS_IN_RESERVA", | |
"MVS_RE_QUANTIDADE", | |
"RSV_CH_ORIGEM", | |
CASE rsv_ch_origem | |
WHEN 'B' THEN |
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
#Import-Module posh-git <# You need to install https://github.com/dahlbyk/posh-git #> | |
#oh-my-posh --init --shell pwsh --config 'https://gist.githubusercontent.com/shanselman/1f69b28bfcc4f7716e49eb5bb34d7b2c/raw/8e9c9a8736ff4e9e5a863c20833d614549ccbc32/ohmyposhv3-v2.json' | Invoke-Expression | |
<# | |
# https://ohmyposh.dev/docs/migrating | |
Import-Module oh-my-posh | |
#> | |
#Set-PoshPrompt -Theme Paradox |
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 PROCEDURE P_CLI_VEN_NF_SEQUENCIA | |
--(pRC OUT SYS_REFCURSOR) IS | |
AS | |
BEGIN | |
FOR cTDF IN ( | |
SELECT | |
TD.FIL_IN_CODIGO, TD.SER_ST_CODIGO, TD.TDF_IN_CODIGO, TD.NOT_IN_NUMERO_MIN, TD.NOT_IN_NUMERO_MAX, TD.NOT_IN_NUMERO_MIN_RECENT | |
FROM ( | |
SELECT S.FIL_IN_CODIGO, S.SER_ST_CODIGO, S.TDF_IN_CODIGO, S.TDF_IN_NDOCINI, S.TDF_IN_NDOCFINAL, |
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
declare | |
v_max_len_ncm_extenso integer; | |
v_achou_pai CHAR := 'N'; | |
v_pai_ncm_tab_in mgtrf.trf_ncm.ncm_tab_in_codigo%type; | |
v_pai_ncm_pad_in mgtrf.trf_ncm.ncm_pad_in_codigo%type; | |
v_pai_ncm_in mgtrf.trf_ncm.ncm_in_codigo%type; | |
v_pai_ncm_ext mgtrf.trf_ncm.ncm_st_extenso%type; | |
begin | |
begin | |
select max(length(ncm_st_extenso)) |