CREATE OR REPLACE TRIGGER LOG_SUP_FORNECEDOR
AFTER UPDATE OR INSERT OR DELETE ON FORNECEDOR  FOR EACH ROW
DECLARE
   V_TIPO         VARCHAR2(1);
   V_DSREMOTEADDR VARCHAR2(15);
   V_DSREMOTEHOST VARCHAR2(15);
   V_DSSERVERRDM  VARCHAR2(20);
   V_DSSERVMETHOD VARCHAR2(30);
   V_DSREMOTEOPER VARCHAR2(12);
   V_DESC         VARCHAR2(1000);
   V_ITPESQ       VARCHAR2(40);
   V_NMOPERADOR   VARCHAR2(40);
BEGIN
   /* IDTIPOOPER - '1' - Inclusao, '2' - Alteracao, '3' - Exclusao*/
   V_TIPO       := '0';
   V_DESC       := '';
   V_ITPESQ     := '';
   V_NMOPERADOR := '';

   NMUSUARIO(V_NMOPERADOR);
   WEBTUNNING(V_DSREMOTEADDR,
              V_DSREMOTEHOST,
              V_DSSERVERRDM,
              V_DSSERVMETHOD,
              V_DSREMOTEOPER);
   IF DELETING THEN
      IF :OLD.NRINSJURFORN IS NOT NULL THEN
         V_DESC := V_DESC || ' InscJuridica=' || :OLD.NRINSJURFORN;
      END IF;

      IF :OLD.CDTPBAIXAPAG IS NOT NULL THEN
         V_DESC := V_DESC || ' CodTpBaixaPgar=' || :OLD.CDTPBAIXAPAG;
      END IF;

      IF :OLD.IDTIPOFORN IS NOT NULL THEN
         V_DESC := V_DESC || ' IdTpForne=' || :OLD.IDTIPOFORN;
      END IF;

      IF :OLD.CDCSTDIG1ENT IS NOT NULL THEN
         V_DESC := V_DESC || ' Cod1DigCST=' || :OLD.CDCSTDIG1ENT;
      END IF;

      IF :OLD.NMFANTFORN IS NOT NULL THEN
         V_DESC := V_DESC || ' NmFantasia=' || :OLD.NMFANTFORN;
      END IF;

      IF :OLD.NMRAZSOCFORN IS NOT NULL THEN
         V_DESC := V_DESC || ' NmRazSocial=' || :OLD.NMRAZSOCFORN;
      END IF;

      IF :OLD.IDTPDESCFORN IS NOT NULL THEN
         V_DESC := V_DESC || ' TpDescricao=' || :OLD.IDTPDESCFORN;
      END IF;

      IF :OLD.IDENDEMISFOR IS NOT NULL THEN
         V_DESC := V_DESC || ' IdEndEmissao=' || :OLD.IDENDEMISFOR;
      END IF;

      IF :OLD.IDENDCFOPFOR IS NOT NULL THEN
         V_DESC := V_DESC || ' IdEndCFOP=' || :OLD.IDENDCFOPFOR;
      END IF;

      IF :OLD.VRPEDESCFORN IS NOT NULL THEN
         V_DESC := V_DESC || ' VrPercDesconto=' || :OLD.VRPEDESCFORN;
      END IF;

      IF :OLD.IDTPFRETFORN IS NOT NULL THEN
         V_DESC := V_DESC || ' TpFrete=' || :OLD.IDTPFRETFORN;
      END IF;

      IF :OLD.IDSITUCADA IS NOT NULL THEN
         V_DESC := V_DESC || ' Situacao=' || :OLD.IDSITUCADA;
      END IF;

      IF :OLD.CDQUALIF IS NOT NULL THEN
         V_DESC := V_DESC || ' CodQualif=' || :OLD.CDQUALIF;
      END IF;

      IF :OLD.DTVALQUALIF IS NOT NULL THEN
         V_DESC := V_DESC || ' DtValidQualif=' || :OLD.DTVALQUALIF;
      END IF;

      IF :OLD.CDFORMPGTO IS NOT NULL THEN
         V_DESC := V_DESC || ' FormaPgto=' || :OLD.CDFORMPGTO;
      END IF;

      IF :OLD.IDTPFORPGTFO IS NOT NULL THEN
         V_DESC := V_DESC || ' TpFormaPgto=' || :OLD.IDTPFORPGTFO;
      END IF;

      IF :OLD.NRPARCPGTOFO IS NOT NULL THEN
         V_DESC := V_DESC || ' NrParcelaPgto=' || :OLD.NRPARCPGTOFO;
      END IF;

      IF :OLD.NRDIAPGFIXFO IS NOT NULL THEN
         V_DESC := V_DESC || ' DiasPgto=' || :OLD.NRDIAPGFIXFO;
      END IF;

      IF :OLD.IDUTDIAPGTFO IS NOT NULL THEN
         V_DESC := V_DESC || ' UtilDiasPgto=' || :OLD.IDUTDIAPGTFO;
      END IF;

      IF :OLD.CDTIPCOB IS NOT NULL THEN
         V_DESC := V_DESC || ' TpCobranca=' || :OLD.CDTIPCOB;
      END IF;

      IF :OLD.VRMINAUTFOR IS NOT NULL THEN
         V_DESC := V_DESC || ' VrMinAutForn=' || :OLD.VRMINAUTFOR;
      END IF;

      IF :OLD.QTMINAUTFOT IS NOT NULL THEN
         V_DESC := V_DESC || ' QtMinAutForn=' || :OLD.QTMINAUTFOT;
      END IF;

      IF :OLD.SGUNIDADE IS NOT NULL THEN
         V_DESC := V_DESC || ' Unidade=' || :OLD.SGUNIDADE;
      END IF;

      IF :OLD.IDGERAFDTENT IS NOT NULL THEN
         V_DESC := V_DESC || ' GeraAFDtEntr=' || :OLD.IDGERAFDTENT;
      END IF;

      IF :OLD.NRITEMAF IS NOT NULL THEN
         V_DESC := V_DESC || ' NrItemAF=' || :OLD.NRITEMAF;
      END IF;

      IF :OLD.IDGERCONTPGT IS NOT NULL THEN
         V_DESC := V_DESC || ' GerCtaAPagar=' || :OLD.IDGERCONTPGT;
      END IF;

      IF :OLD.VRPERPIFORN IS NOT NULL THEN
         V_DESC := V_DESC || ' VrPercPI/DSV=' || :OLD.VRPERPIFORN;
      END IF;

      IF :OLD.DSEMAILCOT IS NOT NULL THEN
         V_DESC := V_DESC || ' Email=' || :OLD.DSEMAILCOT;
      END IF;

      IF :OLD.DSMAILCOTCOP IS NOT NULL THEN
         V_DESC := V_DESC || ' EmailCop=' || :OLD.DSMAILCOTCOP;
      END IF;

      IF :OLD.IDUTILZIPAF IS NOT NULL THEN
         V_DESC := V_DESC || ' UtilEnvioZipAF=' || :OLD.IDUTILZIPAF;
      END IF;

      IF :OLD.IDTPENVAFFOR IS NOT NULL THEN
         V_DESC := V_DESC || ' EnvioAF=' || :OLD.IDTPENVAFFOR;
      END IF;

      IF :OLD.IDUTILEDINF IS NOT NULL THEN
         V_DESC := V_DESC || ' UtilIntegNF/EDI=' || :OLD.IDUTILEDINF;
      END IF;

      IF :OLD.IDOBRIGAEAN IS NOT NULL THEN
         V_DESC := V_DESC || ' ObrigaEAN=' || :OLD.IDOBRIGAEAN;
      END IF;

      IF :OLD.VRFRETEFORN IS NOT NULL THEN
         V_DESC := V_DESC || ' VrFrete=' || :OLD.VRFRETEFORN;
      END IF;

      IF :OLD.CDCONTCTBL IS NOT NULL THEN
         V_DESC := V_DESC || ' CodCtaCtbl=' || :OLD.CDCONTCTBL;
      END IF;

      IF :OLD.CDGRUPOFISC IS NOT NULL THEN
         V_DESC := V_DESC || ' GrupoFiscal=' || :OLD.CDGRUPOFISC;
      END IF;

      IF :OLD.CDAJUCTPAG IS NOT NULL THEN
         V_DESC := V_DESC || ' CodTpAjuste=' || :OLD.CDAJUCTPAG;
      END IF;

      IF :OLD.DTINIVRPDESC IS NOT NULL THEN
         V_DESC := V_DESC || ' DtInicial=' || :OLD.DTINIVRPDESC;
      END IF;   

      IF :OLD.CDFORNERELACAF IS NOT NULL THEN
         V_DESC := V_DESC || ' Forn.Relac.(AF)=' || :OLD.CDFORNERELACAF;
      END IF;

      IF :OLD.IDFORNIMPXML IS NOT NULL THEN
         V_DESC := V_DESC || ' FornImpXML=' || :OLD.IDFORNIMPXML;
      END IF;

      IF :OLD.CDDIGVERIFINTFOR IS NOT NULL THEN
         V_DESC := V_DESC || ' DigVerif=' || :OLD.CDDIGVERIFINTFOR;
      END IF;

      IF :OLD.IDTIPODOCINTFOR IS NOT NULL THEN
         V_DESC := V_DESC || ' TipoDoc=' || :OLD.IDTIPODOCINTFOR;
      END IF;
	  
      IF :OLD.IDIMPLOTEXML IS NOT NULL THEN
         V_DESC := V_DESC || ' ImpLoteXML=' || :OLD.IDIMPLOTEXML;
      END IF;

      IF :OLD.IDTPENVAFNORMAL IS NOT NULL THEN
         V_DESC := V_DESC || ' IdTpEnvAFNormal=' || :OLD.IDTPENVAFNORMAL;
      END IF;      

      V_TIPO   := '3';
      V_ITPESQ := :OLD.CDFORNECED;
   ELSE
      IF UPDATING THEN
         IF (NVL(:OLD.NRINSJURFORN,'!')     <> NVL(:NEW.NRINSJURFORN,'!'))     OR
            (NVL(:OLD.CDTPBAIXAPAG,'!')     <> NVL(:NEW.CDTPBAIXAPAG,'!'))     OR
            (NVL(:OLD.IDTIPOFORN,'!')       <> NVL(:NEW.IDTIPOFORN,'!'))       OR
            (NVL(:OLD.CDCSTDIG1ENT,'!')     <> NVL(:NEW.CDCSTDIG1ENT,'!'))     OR
            (NVL(:OLD.NMFANTFORN,'!')       <> NVL(:NEW.NMFANTFORN,'!'))       OR
            (NVL(:OLD.NMRAZSOCFORN,'!')     <> NVL(:NEW.NMRAZSOCFORN,'!'))     OR
            (NVL(:OLD.IDTPDESCFORN,'!')     <> NVL(:NEW.IDTPDESCFORN,'!'))     OR
            (NVL(:OLD.IDENDEMISFOR,'!')     <> NVL(:NEW.IDENDEMISFOR,'!'))     OR
            (NVL(:OLD.IDENDCFOPFOR,'!')     <> NVL(:NEW.IDENDCFOPFOR,'!'))     OR
            (NVL(:OLD.VRPEDESCFORN,0)       <> NVL(:NEW.VRPEDESCFORN,0))       OR
            (NVL(:OLD.IDTPFRETFORN,'!')     <> NVL(:NEW.IDTPFRETFORN,'!'))     OR
            (NVL(:OLD.IDSITUCADA,'!')       <> NVL(:NEW.IDSITUCADA,'!'))       OR
            (NVL(:OLD.CDQUALIF,'!')         <> NVL(:NEW.CDQUALIF,'!'))         OR
            (NVL(:OLD.DTVALQUALIF,SYSDATE)  <> NVL(:NEW.DTVALQUALIF,SYSDATE))  OR
            (NVL(:OLD.CDFORMPGTO,'!')       <> NVL(:NEW.CDFORMPGTO,'!'))       OR
            (NVL(:OLD.IDTPFORPGTFO,'!')     <> NVL(:NEW.IDTPFORPGTFO,'!'))     OR
            (NVL(:OLD.NRPARCPGTOFO,0)       <> NVL(:NEW.NRPARCPGTOFO,0))       OR
            (NVL(:OLD.NRDIAPGFIXFO,0)       <> NVL(:NEW.NRDIAPGFIXFO,0))       OR
            (NVL(:OLD.IDUTDIAPGTFO,'!')     <> NVL(:NEW.IDUTDIAPGTFO,'!'))     OR
            (NVL(:OLD.CDTIPCOB,'!')         <> NVL(:NEW.CDTIPCOB,'!'))         OR
            (NVL(:OLD.VRMINAUTFOR,0)        <> NVL(:NEW.VRMINAUTFOR,0))        OR
            (NVL(:OLD.QTMINAUTFOT,0)        <> NVL(:NEW.QTMINAUTFOT,0))        OR
            (NVL(:OLD.SGUNIDADE,'!')        <> NVL(:NEW.SGUNIDADE,'!'))        OR
            (NVL(:OLD.IDGERAFDTENT,'!')     <> NVL(:NEW.IDGERAFDTENT,'!'))     OR
            (NVL(:OLD.NRITEMAF,0)           <> NVL(:NEW.NRITEMAF,0))           OR
            (NVL(:OLD.IDGERCONTPGT,'!')     <> NVL(:NEW.IDGERCONTPGT,'!'))     OR
            (NVL(:OLD.VRPERPIFORN,0)        <> NVL(:NEW.VRPERPIFORN,0))        OR
            (NVL(:OLD.DSEMAILCOT,'!')       <> NVL(:NEW.DSEMAILCOT,'!'))       OR
            (NVL(:OLD.DSMAILCOTCOP,'!')     <> NVL(:NEW.DSMAILCOTCOP,'!'))     OR
            (NVL(:OLD.IDUTILZIPAF,'!')      <> NVL(:NEW.IDUTILZIPAF,'!'))      OR
            (NVL(:OLD.IDTPENVAFFOR,'!')     <> NVL(:NEW.IDTPENVAFFOR,'!'))     OR
            (NVL(:OLD.IDUTILEDINF,'!')      <> NVL(:NEW.IDUTILEDINF,'!'))      OR
            (NVL(:OLD.IDOBRIGAEAN,'!')      <> NVL(:NEW.IDOBRIGAEAN,'!'))      OR
            (NVL(:OLD.VRFRETEFORN,0)        <> NVL(:NEW.VRFRETEFORN,0))        OR
            (NVL(:OLD.CDCONTCTBL,'!')       <> NVL(:NEW.CDCONTCTBL,'!'))       OR
            (NVL(:OLD.CDGRUPOFISC,'!')      <> NVL(:NEW.CDGRUPOFISC,'!'))      OR
            (NVL(:OLD.CDAJUCTPAG,'!')       <> NVL(:NEW.CDAJUCTPAG,'!'))       OR
            (NVL(:OLD.DTINIVRPDESC,SYSDATE) <> NVL(:NEW.DTINIVRPDESC,SYSDATE)) OR
            (NVL(:OLD.CDFORNERELACAF, '!')  <> NVL(:NEW.CDFORNERELACAF, '!'))  OR
            (NVL(:OLD.CDDIGVERIFINTFOR, '!') <> NVL(:NEW.CDDIGVERIFINTFOR, '!')) OR
            (NVL(:OLD.IDTIPODOCINTFOR, '!')  <> NVL(:NEW.IDTIPODOCINTFOR, '!'))  OR
            (NVL(:OLD.IDFORNIMPXML,'!')      <> NVL(:NEW.IDFORNIMPXML,'!'))      OR
            (NVL(:OLD.IDTPENVAFNORMAL,'!')   <> NVL(:NEW.IDTPENVAFNORMAL,'!'))   OR
			   (NVL(:OLD.IDIMPLOTEXML,'!')      <> NVL(:NEW.IDIMPLOTEXML,'!')) THEN
            
            IF (NVL(:NEW.NRINSJURFORN,'!') <> NVL(:OLD.NRINSJURFORN,'!')) THEN
            	V_DESC := V_DESC || ' InscJuridica=' || :NEW.NRINSJURFORN;
            END IF;

            IF(NVL(:NEW.CDTPBAIXAPAG,'!') <> NVL(:OLD.CDTPBAIXAPAG,'!')) THEN
               V_DESC := V_DESC || ' CodTpBaixaPgar=' || :NEW.CDTPBAIXAPAG;
            END IF;

            IF(NVL(:NEW.IDTIPOFORN,'!') <> NVL(:OLD.IDTIPOFORN,'!')) THEN
               V_DESC := V_DESC || ' IdTpForne=' || :NEW.IDTIPOFORN;
            END IF;

            IF(NVL(:NEW.CDCSTDIG1ENT,'!') <> NVL(:OLD.CDCSTDIG1ENT,'!')) THEN
               V_DESC := V_DESC || ' Cod1DigCST=' || :NEW.CDCSTDIG1ENT;
            END IF;

            IF(NVL(:NEW.NMFANTFORN,'!') <> NVL(:OLD.NMFANTFORN,'!')) THEN
               V_DESC := V_DESC || ' NmFantasia=' || :NEW.NMFANTFORN;
            END IF;

            IF(NVL(:NEW.NMRAZSOCFORN,'!') <> NVL(:OLD.NMRAZSOCFORN,'!')) THEN
               V_DESC := V_DESC || ' NmRazSocial=' || :NEW.NMRAZSOCFORN;
            END IF;

            IF(NVL(:NEW.IDTPDESCFORN,'!') <> NVL(:OLD.IDTPDESCFORN,'!')) THEN
               V_DESC := V_DESC || ' TpDescricao=' || :NEW.IDTPDESCFORN;
            END IF;

            IF(NVL(:NEW.IDENDEMISFOR,'!') <> NVL(:OLD.IDENDEMISFOR,'!')) THEN
               V_DESC := V_DESC || ' IdEndEmissao=' || :NEW.IDENDEMISFOR;
            END IF;

            IF(NVL(:NEW.IDENDCFOPFOR,'!') <> NVL(:OLD.IDENDCFOPFOR,'!')) THEN
               V_DESC := V_DESC || ' IdEndCFOP=' || :NEW.IDENDCFOPFOR;
            END IF;

            IF (NVL(:NEW.VRPEDESCFORN,0) <> NVL(:OLD.VRPEDESCFORN,0)) THEN
               V_DESC := V_DESC || ' VrPercDesconto=' || :NEW.VRPEDESCFORN;
            END IF;

            IF(NVL(:NEW.IDTPFRETFORN,'!') <> NVL(:OLD.IDTPFRETFORN,'!')) THEN
               V_DESC := V_DESC || ' TpFrete=' || :NEW.IDTPFRETFORN;
            END IF;

            IF(NVL(:NEW.IDSITUCADA,'!') <> NVL(:OLD.IDSITUCADA,'!')) THEN
               V_DESC := V_DESC || ' Situacao=' || :NEW.IDSITUCADA;
            END IF;

            IF(NVL(:NEW.CDQUALIF,'!') <> NVL(:OLD.CDQUALIF,'!')) THEN
               V_DESC := V_DESC || ' CodQualif=' || :NEW.CDQUALIF;
            END IF;

            IF (NVL(:NEW.DTVALQUALIF,SYSDATE) <> NVL(:OLD.DTVALQUALIF,SYSDATE)) THEN
               V_DESC := V_DESC || ' DtValidQualif=' || :NEW.DTVALQUALIF;
            END IF;

            IF(NVL(:NEW.CDFORMPGTO,'!') <> NVL(:OLD.CDFORMPGTO,'!')) THEN
               V_DESC := V_DESC || ' FormaPgto=' || :NEW.CDFORMPGTO;
            END IF;

            IF(NVL(:NEW.IDTPFORPGTFO,'!') <> NVL(:OLD.IDTPFORPGTFO,'!')) THEN
               V_DESC := V_DESC || ' TpFormaPgto=' || :NEW.IDTPFORPGTFO;
            END IF;

            IF (NVL(:NEW.NRPARCPGTOFO,0) <> NVL(:OLD.NRPARCPGTOFO,0)) THEN
               V_DESC := V_DESC || ' NrParcelaPgto=' || :NEW.NRPARCPGTOFO;
            END IF;

            IF (NVL(:NEW.NRDIAPGFIXFO,0) <> NVL(:OLD.NRDIAPGFIXFO,0)) THEN
               V_DESC := V_DESC || ' DiasPgto=' || :NEW.NRDIAPGFIXFO;
            END IF;

            IF(NVL(:NEW.IDUTDIAPGTFO,'!') <> NVL(:OLD.IDUTDIAPGTFO,'!')) THEN
               V_DESC := V_DESC || ' UtilDiasPgto=' || :NEW.IDUTDIAPGTFO;
            END IF;

            IF(NVL(:NEW.CDTIPCOB,'!') <> NVL(:OLD.CDTIPCOB,'!')) THEN
               V_DESC := V_DESC || ' TpCobranca=' || :NEW.CDTIPCOB;
            END IF;

            IF (NVL(:NEW.VRMINAUTFOR,0) <> NVL(:OLD.VRMINAUTFOR,0)) THEN
               V_DESC := V_DESC || ' VrMinAutForn=' || :NEW.VRMINAUTFOR;
            END IF;

            IF (NVL(:NEW.QTMINAUTFOT,0) <> NVL(:OLD.QTMINAUTFOT,0)) THEN
               V_DESC := V_DESC || ' QtMinAutForn=' || :NEW.QTMINAUTFOT;
            END IF;

            IF(NVL(:NEW.SGUNIDADE,'!') <> NVL(:OLD.SGUNIDADE,'!')) THEN
               V_DESC := V_DESC || ' Unidade=' || :NEW.SGUNIDADE;
            END IF;

            IF(NVL(:NEW.IDGERAFDTENT,'!') <> NVL(:OLD.IDGERAFDTENT,'!')) THEN
               V_DESC := V_DESC || ' GeraAFDtEntr=' || :NEW.IDGERAFDTENT;
            END IF;

            IF (NVL(:NEW.NRITEMAF,0) <> NVL(:OLD.NRITEMAF,0)) THEN
               V_DESC := V_DESC || ' NrItemAF=' || :NEW.NRITEMAF;
            END IF;

            IF(NVL(:NEW.IDGERCONTPGT,'!') <> NVL(:OLD.IDGERCONTPGT,'!')) THEN
               V_DESC := V_DESC || ' GerCtaAPagar=' || :NEW.IDGERCONTPGT;
            END IF;

            IF (NVL(:NEW.VRPERPIFORN,0) <> NVL(:OLD.VRPERPIFORN,0)) THEN
               V_DESC := V_DESC || ' VrPercPI/DSV=' || :NEW.VRPERPIFORN;
            END IF;

            IF(NVL(:NEW.DSEMAILCOT,'!') <> NVL(:OLD.DSEMAILCOT,'!')) THEN
               V_DESC := V_DESC || ' Email=' || :NEW.DSEMAILCOT;
            END IF;

            IF(NVL(:NEW.DSMAILCOTCOP,'!') <> NVL(:OLD.DSMAILCOTCOP,'!')) THEN
               V_DESC := V_DESC || ' EmailCop=' || :NEW.DSMAILCOTCOP;
            END IF;

            IF(NVL(:NEW.IDUTILZIPAF,'!') <> NVL(:OLD.IDUTILZIPAF,'!')) THEN
               V_DESC := V_DESC || ' UtilEnvioZipAF=' || :NEW.IDUTILZIPAF;
            END IF;

            IF(NVL(:NEW.IDTPENVAFFOR,'!') <> NVL(:OLD.IDTPENVAFFOR,'!')) THEN
               V_DESC := V_DESC || ' EnvioAF=' || :NEW.IDTPENVAFFOR;
            END IF;

            IF(NVL(:NEW.IDUTILEDINF,'!') <> NVL(:OLD.IDUTILEDINF,'!')) THEN
               V_DESC := V_DESC || ' UtilIntegNF/EDI=' || :NEW.IDUTILEDINF;
            END IF;

            IF(NVL(:NEW.IDOBRIGAEAN,'!') <> NVL(:OLD.IDOBRIGAEAN,'!')) THEN
               V_DESC := V_DESC || ' ObrigaEAN=' || :NEW.IDOBRIGAEAN;
            END IF;

            IF (NVL(:NEW.VRFRETEFORN,0) <> NVL(:OLD.VRFRETEFORN,0)) THEN
               V_DESC := V_DESC || ' VrFrete=' || :NEW.VRFRETEFORN;
            END IF;

            IF(NVL(:NEW.CDCONTCTBL,'!') <> NVL(:OLD.CDCONTCTBL,'!')) THEN
               V_DESC := V_DESC || ' CodCtaCtbl=' || :NEW.CDCONTCTBL;
            END IF;

            IF(NVL(:NEW.CDGRUPOFISC,'!') <> NVL(:OLD.CDGRUPOFISC,'!')) THEN
               V_DESC := V_DESC || ' GrupoFiscal=' || :NEW.CDGRUPOFISC;
            END IF;

            IF(NVL(:NEW.CDAJUCTPAG,'!') <> NVL(:OLD.CDAJUCTPAG,'!')) THEN
               V_DESC := V_DESC || ' CodTpAjuste=' || :NEW.CDAJUCTPAG;
            END IF;

            IF(NVL(:NEW.DTINIVRPDESC,SYSDATE) <> NVL(:OLD.DTINIVRPDESC,SYSDATE)) THEN
               V_DESC := V_DESC || ' DtInicial=' || :NEW.DTINIVRPDESC;
            END IF;

            IF(NVL(:NEW.CDFORNERELACAF,'!') <> NVL(:OLD.CDFORNERELACAF,'!')) THEN
               V_DESC := V_DESC || ' Forn.Relac.(AF)=' || :NEW.CDFORNERELACAF;
            END IF; 

            IF(NVL(:NEW.IDFORNIMPXML,'!') <> NVL(:OLD.IDFORNIMPXML,'!')) THEN
               V_DESC := V_DESC || ' FornImpXML=' || :NEW.IDFORNIMPXML;
            END IF;

            IF(NVL(:NEW.CDDIGVERIFINTFOR,'!') <> NVL(:OLD.CDDIGVERIFINTFOR,'!')) THEN
               V_DESC := V_DESC || ' DigVerif=' || :NEW.CDDIGVERIFINTFOR;
            END IF;

            IF(NVL(:NEW.IDTIPODOCINTFOR,'!') <> NVL(:OLD.IDTIPODOCINTFOR,'!')) THEN
               V_DESC := V_DESC || ' TipoDoc=' || :NEW.IDTIPODOCINTFOR;
            END IF;

            IF(NVL(:NEW.IDIMPLOTEXML,'!') <> NVL(:OLD.IDIMPLOTEXML,'!')) THEN
               V_DESC := V_DESC || ' ImpLoteXML=' || :NEW.IDIMPLOTEXML;
            END IF;

            IF(NVL(:NEW.IDTPENVAFNORMAL,'!') <> NVL(:OLD.IDTPENVAFNORMAL,'!')) THEN
               V_DESC := V_DESC || ' IdTpEnvAFNormal=' || :NEW.IDTPENVAFNORMAL;
            END IF;

            V_TIPO   := '2';
            V_ITPESQ := :OLD.CDFORNECED;
         END IF;
      ELSE
         IF (NVL(:NEW.NRINSJURFORN,'!') <> NVL(:OLD.NRINSJURFORN,'!')) THEN
            V_DESC := V_DESC || ' InscJuridica=' || :NEW.NRINSJURFORN;
         END IF;

         IF(NVL(:NEW.CDTPBAIXAPAG,'!') <> NVL(:OLD.CDTPBAIXAPAG,'!')) THEN
            V_DESC := V_DESC || ' CodTpBaixaPgar=' || :NEW.CDTPBAIXAPAG;
         END IF;

         IF(NVL(:NEW.IDTIPOFORN,'!') <> NVL(:OLD.IDTIPOFORN,'!')) THEN
            V_DESC := V_DESC || ' IdTpForne=' || :NEW.IDTIPOFORN;
         END IF;

         IF(NVL(:NEW.CDCSTDIG1ENT,'!') <> NVL(:OLD.CDCSTDIG1ENT,'!')) THEN
            V_DESC := V_DESC || ' Cod1DigCST=' || :NEW.CDCSTDIG1ENT;
         END IF;

         IF(NVL(:NEW.NMFANTFORN,'!') <> NVL(:OLD.NMFANTFORN,'!')) THEN
            V_DESC := V_DESC || ' NmFantasia=' || :NEW.NMFANTFORN;
         END IF;

         IF(NVL(:NEW.NMRAZSOCFORN,'!') <> NVL(:OLD.NMRAZSOCFORN,'!')) THEN
            V_DESC := V_DESC || ' NmRazSocial=' || :NEW.NMRAZSOCFORN;
         END IF;

         IF(NVL(:NEW.IDTPDESCFORN,'!') <> NVL(:OLD.IDTPDESCFORN,'!')) THEN
            V_DESC := V_DESC || ' TpDescricao=' || :NEW.IDTPDESCFORN;
         END IF;

         IF(NVL(:NEW.IDENDEMISFOR,'!') <> NVL(:OLD.IDENDEMISFOR,'!')) THEN
            V_DESC := V_DESC || ' IdEndEmissao=' || :NEW.IDENDEMISFOR;
         END IF;

         IF(NVL(:NEW.IDENDCFOPFOR,'!') <> NVL(:OLD.IDENDCFOPFOR,'!')) THEN
            V_DESC := V_DESC || ' IdEndCFOP=' || :NEW.IDENDCFOPFOR;
         END IF;

         IF (NVL(:NEW.VRPEDESCFORN,0) <> NVL(:OLD.VRPEDESCFORN,0)) THEN
            V_DESC := V_DESC || ' VrPercDesconto=' || :NEW.VRPEDESCFORN;
         END IF;

         IF(NVL(:NEW.IDTPFRETFORN,'!') <> NVL(:OLD.IDTPFRETFORN,'!')) THEN
            V_DESC := V_DESC || ' TpFrete=' || :NEW.IDTPFRETFORN;
         END IF;

         IF(NVL(:NEW.IDSITUCADA,'!') <> NVL(:OLD.IDSITUCADA,'!')) THEN
            V_DESC := V_DESC || ' Situacao=' || :NEW.IDSITUCADA;
         END IF;

         IF(NVL(:NEW.CDQUALIF,'!') <> NVL(:OLD.CDQUALIF,'!')) THEN
            V_DESC := V_DESC || ' CodQualif=' || :NEW.CDQUALIF;
         END IF;

         IF (NVL(:NEW.DTVALQUALIF,SYSDATE) <> NVL(:OLD.DTVALQUALIF,SYSDATE)) THEN
            V_DESC := V_DESC || ' DtValidQualif=' || :NEW.DTVALQUALIF;
         END IF;

         IF(NVL(:NEW.CDFORMPGTO,'!') <> NVL(:OLD.CDFORMPGTO,'!')) THEN
            V_DESC := V_DESC || ' FormaPgto=' || :NEW.CDFORMPGTO;
         END IF;

         IF(NVL(:NEW.IDTPFORPGTFO,'!') <> NVL(:OLD.IDTPFORPGTFO,'!')) THEN
            V_DESC := V_DESC || ' TpFormaPgto=' || :NEW.IDTPFORPGTFO;
         END IF;

         IF (NVL(:NEW.NRPARCPGTOFO,0) <> NVL(:OLD.NRPARCPGTOFO,0)) THEN
            V_DESC := V_DESC || ' NrParcelaPgto=' || :NEW.NRPARCPGTOFO;
         END IF;

         IF (NVL(:NEW.NRDIAPGFIXFO,0) <> NVL(:OLD.NRDIAPGFIXFO,0)) THEN
            V_DESC := V_DESC || ' DiasPgto=' || :NEW.NRDIAPGFIXFO;
         END IF;

         IF(NVL(:NEW.IDUTDIAPGTFO,'!') <> NVL(:OLD.IDUTDIAPGTFO,'!')) THEN
            V_DESC := V_DESC || ' UtilDiasPgto=' || :NEW.IDUTDIAPGTFO;
         END IF;

         IF(NVL(:NEW.CDTIPCOB,'!') <> NVL(:OLD.CDTIPCOB,'!')) THEN
            V_DESC := V_DESC || ' TpCobranca=' || :NEW.CDTIPCOB;
         END IF;

         IF (NVL(:NEW.VRMINAUTFOR,0) <> NVL(:OLD.VRMINAUTFOR,0)) THEN
            V_DESC := V_DESC || ' VrMinAutForn=' || :NEW.VRMINAUTFOR;
         END IF;

         IF (NVL(:NEW.QTMINAUTFOT,0) <> NVL(:OLD.QTMINAUTFOT,0)) THEN
            V_DESC := V_DESC || ' QtMinAutForn=' || :NEW.QTMINAUTFOT;
         END IF;

         IF(NVL(:NEW.SGUNIDADE,'!') <> NVL(:OLD.SGUNIDADE,'!')) THEN
            V_DESC := V_DESC || ' Unidade=' || :NEW.SGUNIDADE;
         END IF;

         IF(NVL(:NEW.IDGERAFDTENT,'!') <> NVL(:OLD.IDGERAFDTENT,'!')) THEN
            V_DESC := V_DESC || ' GeraAFDtEntr=' || :NEW.IDGERAFDTENT;
         END IF;

         IF (NVL(:NEW.NRITEMAF,0) <> NVL(:OLD.NRITEMAF,0)) THEN
            V_DESC := V_DESC || ' NrItemAF=' || :NEW.NRITEMAF;
         END IF;

         IF(NVL(:NEW.IDGERCONTPGT,'!') <> NVL(:OLD.IDGERCONTPGT,'!')) THEN
            V_DESC := V_DESC || ' GerCtaAPagar=' || :NEW.IDGERCONTPGT;
         END IF;

         IF (NVL(:NEW.VRPERPIFORN,0) <> NVL(:OLD.VRPERPIFORN,0)) THEN
            V_DESC := V_DESC || ' VrPercPI/DSV=' || :NEW.VRPERPIFORN;
         END IF;

         IF(NVL(:NEW.DSEMAILCOT,'!') <> NVL(:OLD.DSEMAILCOT,'!')) THEN
            V_DESC := V_DESC || ' Email=' || :NEW.DSEMAILCOT;
         END IF;

         IF(NVL(:NEW.DSMAILCOTCOP,'!') <> NVL(:OLD.DSMAILCOTCOP,'!')) THEN
            V_DESC := V_DESC || ' EmailCop=' || :NEW.DSMAILCOTCOP;
         END IF;

         IF(NVL(:NEW.IDUTILZIPAF,'!') <> NVL(:OLD.IDUTILZIPAF,'!')) THEN
            V_DESC := V_DESC || ' UtilEnvioZipAF=' || :NEW.IDUTILZIPAF;
         END IF;

         IF(NVL(:NEW.IDTPENVAFFOR,'!') <> NVL(:OLD.IDTPENVAFFOR,'!')) THEN
            V_DESC := V_DESC || ' EnvioAF=' || :NEW.IDTPENVAFFOR;
         END IF;

         IF(NVL(:NEW.IDUTILEDINF,'!') <> NVL(:OLD.IDUTILEDINF,'!')) THEN
            V_DESC := V_DESC || ' UtilIntegNF/EDI=' || :NEW.IDUTILEDINF;
         END IF;

         IF(NVL(:NEW.IDOBRIGAEAN,'!') <> NVL(:OLD.IDOBRIGAEAN,'!')) THEN
            V_DESC := V_DESC || ' ObrigaEAN=' || :NEW.IDOBRIGAEAN;
         END IF;

         IF (NVL(:NEW.VRFRETEFORN,0) <> NVL(:OLD.VRFRETEFORN,0)) THEN
            V_DESC := V_DESC || ' VrFrete=' || :NEW.VRFRETEFORN;
         END IF;

         IF(NVL(:NEW.CDCONTCTBL,'!') <> NVL(:OLD.CDCONTCTBL,'!')) THEN
            V_DESC := V_DESC || ' CodCtaCtbl=' || :NEW.CDCONTCTBL;
         END IF;

         IF(NVL(:NEW.CDGRUPOFISC,'!') <> NVL(:OLD.CDGRUPOFISC,'!')) THEN
            V_DESC := V_DESC || ' GrupoFiscal=' || :NEW.CDGRUPOFISC;
         END IF;

         IF(NVL(:NEW.CDAJUCTPAG,'!') <> NVL(:OLD.CDAJUCTPAG,'!')) THEN
            V_DESC := V_DESC || ' CodTpAjuste=' || :NEW.CDAJUCTPAG;
         END IF;

         IF(NVL(:NEW.DTINIVRPDESC,SYSDATE) <> NVL(:OLD.DTINIVRPDESC,SYSDATE)) THEN
            V_DESC := V_DESC || ' DtInicial=' || :NEW.DTINIVRPDESC;
         END IF;

         IF(NVL(:NEW.CDFORNERELACAF,'!') <> NVL(:OLD.CDFORNERELACAF,'!')) THEN
               V_DESC := V_DESC || ' Forn.Relac.(AF)=' || :NEW.CDFORNERELACAF;
         END IF;

         IF(NVL(:NEW.IDFORNIMPXML,'!') <> NVL(:OLD.IDFORNIMPXML,'!')) THEN
            V_DESC := V_DESC || ' FornImpXML=' || :NEW.IDFORNIMPXML;
         END IF;

         IF(NVL(:NEW.CDDIGVERIFINTFOR,'!') <> NVL(:OLD.CDDIGVERIFINTFOR,'!')) THEN
            V_DESC := V_DESC || ' DigVerif=' || :NEW.CDDIGVERIFINTFOR;
         END IF;

         IF(NVL(:NEW.IDTIPODOCINTFOR,'!') <> NVL(:OLD.IDTIPODOCINTFOR,'!')) THEN
            V_DESC := V_DESC || ' TipoDoc=' || :NEW.IDTIPODOCINTFOR;
         END IF;

         IF(NVL(:NEW.IDIMPLOTEXML,'!') <> NVL(:OLD.IDIMPLOTEXML,'!')) THEN
            V_DESC := V_DESC || ' ImpLoteXML=' || :NEW.IDIMPLOTEXML;
         END IF;

         IF(NVL(:NEW.IDTPENVAFNORMAL,'!') <> NVL(:OLD.IDTPENVAFNORMAL,'!')) THEN
            V_DESC := V_DESC || ' IdTpEnvAFNormal=' || :NEW.IDTPENVAFNORMAL;
         END IF;

         V_TIPO   := '1';
         V_ITPESQ := :NEW.CDFORNECED;
      END IF;
   END IF;

   V_DESC := SUBSTR(V_DESC, 1, 300);
   IF V_TIPO <> '0' THEN
      IF NOT V_DESC IS NULL THEN
         INSERT INTO LOGOPERA
            (NMTABELA,     DTOPERACAO,   NMRESPOPER,  IDTIPOOPER,   DSOPERACAO, CDPESQITEM,
             DSRDMUSUOPER, DSENDUSUOPER, DSNMUSUOPER, DSMETUSUOPER, CDORESPOPER)
         VALUES
            ('FORNECEDOR',  SYSDATE,        NVL(V_NMOPERADOR,' '), V_TIPO,         V_DESC,  V_ITPESQ,
             V_DSSERVERRDM, V_DSREMOTEADDR, V_DSREMOTEHOST,        V_DSSERVMETHOD, V_DSREMOTEOPER);
      END IF;
   END IF;
END;
/