Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

IMPORTANTE: TWMS.AtualizarPesoVariavelCargaConsolidada ( Ajuste as quantidade na 1196 )

Dependendo do parâmetro SEPARACAO_FORMAS_IMPRESSAO_212:

...

Passando a Empresa, Carga e PP_ORIGEM := 3

Code Block
UPDATE PLAN_SEP_MAPA_MERC_1196 
SET QTD_FATURADA_CX_1196 = 0
, QTD_FATURADA_UN_1196 = NVL((SELECT SUM (QTD_SEP_UN_541) QTD 
                              FROM PED_CONF_MERC_541 
                              JOIN PED_CONF_538 
                              ON EMPRESA_PF_538 = EMPRESA_PF_541 
                              AND NUM_PED_CONF_PK_538 = NUM_PED_CONF_PF_541 
                              AND CARREG_538 = :CARGA 
WHERE EMPRESA_PF_541 = EMPRESA_PF_1196 
AND MERC_PF_541 = MERC_PF_1196 
AND NOT EXISTS (SELECT 1 
                FROM PLAN_SEP_800 
                JOIN PLAN_SEP_EQUIPAM_MERC_802 
                ON EMPRESA_PF_802 = EMPRESA_PF_800 
                AND SEQ_PLANILHA_PF_802 = SEQ_PLANILHA_PK_800 
                WHERE EMPRESA_PEDCONF_FK_800 = EMPRESA_PF_538 
                AND NUM_PEDCONF_FK_800 = NUM_PED_CONF_PK_538)), 0) + NVL((SELECT SUM(CASE WHEN SITUACAO_802 = '3' THEN QTD_CONFERIDA_802 ELSE QTD_FATURADA_802 END) FROM PED_CONF_538, PLAN_SEP_800, PLAN_SEP_EQUIPAM_MERC_802 WHERE EMPRESA_PF_538 = EMPRESA_PF_1196 AND CARREG_538 = :CARGA AND EMPRESA_PEDCONF_FK_800 = EMPRESA_PF_538 AND NUM_PEDCONF_FK_800 = NUM_PED_CONF_PK_538 AND EMPRESA_PF_802 = EMPRESA_PF_800 AND SEQ_PLANILHA_PF_802 = SEQ_PLANILHA_PK_800 AND MERC_PF_802 = MERC_PF_1196 ), 0) , QTD_UNIDADE_1196 = NVL((SELECT SUM (QTD_SEP_UN_541) QTD FROM PED_CONF_MERC_541 JOIN PED_CONF_538 ON EMPRESA_PF_538 = EMPRESA_PF_541 AND NUM_PED_CONF_PK_538 = NUM_PED_CONF_PF_541 AND CARREG_538 = :CARGA WHERE EMPRESA_PF_541 = EMPRESA_PF_1196 AND MERC_PF_541 = MERC_PF_1196 AND NOT EXISTS (SELECT 1 FROM PLAN_SEP_800 JOIN PLAN_SEP_EQUIPAM_MERC_802 ON EMPRESA_PF_802 = EMPRESA_PF_800 AND SEQ_PLANILHA_PF_802 = SEQ_PLANILHA_PK_800 WHERE EMPRESA_PEDCONF_FK_800 = EMPRESA_PF_538 AND NUM_PEDCONF_FK_800 = NUM_PED_CONF_PK_538)), 0) + NVL((SELECT SUM(CASE WHEN SITUACAO_802 = '3' THEN QTD_CONFERIDA_802 ELSE QTD_FATURADA_802 END) FROM PED_CONF_538, PLAN_SEP_800, PLAN_SEP_EQUIPAM_MERC_802 WHERE EMPRESA_PF_538 = EMPRESA_PF_1196 AND CARREG_538 = :CARGA AND EMPRESA_PEDCONF_FK_800 = EMPRESA_PF_538 AND NUM_PEDCONF_FK_800 = NUM_PED_CONF_PK_538 AND EMPRESA_PF_802 = EMPRESA_PF_800 AND SEQ_PLANILHA_PF_802 = SEQ_PLANILHA_PK_800 AND MERC_PF_802 = MERC_PF_1196 ), 0) WHERE (EMPRESA_PF_1196, SEQ_PLANILHA_PF_1196) IN (SELECT EMPRESA_PF_1195, SEQ_PLANILHA_PK_1195 FROM PLAN_SEP_MAPA_1195 WHERE EMPRESA_PF_1195 = :EMPRESA AND CARGA_1195 = :CARGA) 
AND MERC_PF_1196 IN (SELECT MERC_PF_468 
                     FROM MERC_EMPRESA_468 
                     WHERE EMPRESA_PF_468 = :EMPRESA 
                    AND SN_PESO_VARIAVEL_468 = 'S');

Code Block
UPDATE PLAN_SEP_MAPA_MERC_1196 
SET N_OS_PAGINA_1196 = 59610 
WHERE N_OS_PAGINA_1196 = 0 
AND EMPRESA_PF_1196 = 1 
AND SEQ_PLANILHA_PF_1196 = 78828 
AND MERC_PF_1196 = 16409 
AND NUM_PEDCONF_FK_1196 = '000000A' 
AND CEP_FK_1196 = '0' 
AND CLI_FK_1196 = 0 
AND ID_BAIRRO_FK_1196 = 0 
AND NUM_PALETE_1196 = 0 
AND GRAU1_END_1196 = '01';

Code Block
INSERT INTO PLAN_SEP_MAPA_PAGINA_OS_1236 (SEQ_PLANILHA_PF_1236, N_OS_PAGINA_1236, N_PAGINA_1236, SN_PAGINA_REENTREGA_1236) 
VALUES (78828,59610,1,'N');

Code Block
UPDATE PLAN_SEP_MAPA_MERC_1196 SET N_OS_PAGINA_1196 = 59610 
WHERE N_OS_PAGINA_1196 = 0 
AND EMPRESA_PF_1196 = 1 
AND SEQ_PLANILHA_PF_1196 = 78828 
AND MERC_PF_1196 = 10165 
AND NUM_PEDCONF_FK_1196 = '000000A' 
AND CEP_FK_1196 = '0' 
AND CLI_FK_1196 = 0 
AND ID_BAIRRO_FK_1196 = 0 
AND NUM_PALETE_1196 = 0 
AND GRAU1_END_1196 = '01';

Code Block
UPDATE PLAN_SEP_MAPA_MERC_1196 
SET N_OS_PAGINA_1196 = 59610 
WHERE N_OS_PAGINA_1196 = 0 
AND EMPRESA_PF_1196 = 1 
AND SEQ_PLANILHA_PF_1196 = 78828 
AND MERC_PF_1196 = 16504 
AND NUM_PEDCONF_FK_1196 = '000000A' 
AND CEP_FK_1196 = '0' 
AND CLI_FK_1196 = 0 
AND ID_BAIRRO_FK_1196 = 0 
AND NUM_PALETE_1196 = 0 
AND GRAU1_END_1196 = '02';

Code Block
DECLARE PP_EMPRESA NUMBER; PP_ORIGEM VARCHAR2 (32767); PP_NUMPEDCONF VARCHAR2 (32767); PP_CARGA VARCHAR2 (32767); 
BEGIN 
PP_EMPRESA := 1; 
PP_ORIGEM := 3; 
PP_NUMPEDCONF := '000000A'; 
PP_CARGA := 00127800; 
ESTALO_PROC.P_LIST_SEPAR_COLETOR (PP_EMPRESA, PP_ORIGEM, PP_NUMPEDCONF, PP_CARGA); 
COMMIT; 
END;

Rotina 365 - Cancelamento do Mapa Consolidado

...