<?xml version="1.0"?>
<ROWSET>
 <ROW>
  <CODPROCACTDEF>102</CODPROCACTDEF>
  <DENUMIRE>Blocare parteneri fara autorizatie</DENUMIRE>
  <CODINTERN>PKG_ALERTE.DO_ALERTA</CODINTERN>
  <SQL>UPDATE NPART
SET BLOCAT = 1
WHERE EXPIRAREAUTORIZ &lt;= SYSDATE</SQL>
 </ROW>
 <ROW>
  <CODPROCACTDEF>103</CODPROCACTDEF>
  <DENUMIRE>Blocare articole fara autorizatie</DENUMIRE>
  <CODINTERN>PKG_ALERTE.DO_ALERTA</CODINTERN>
  <SQL>UPDATE NARTOBJ
SET BLOCAT = 1
WHERE EXPIRAREAUTORIZ &lt;= SYSDATE</SQL>
 </ROW>
 <ROW>
  <CODPROCACTDEF>101</CODPROCACTDEF>
  <DENUMIRE>Actualizare stare stocuri</DENUMIRE>
  <CODINTERN>PKG_ALERTE.DO_ALERTA</CODINTERN>
  <SQL>begin
  FOR V_REC IN ( SELECT OBJ.CODOBIECT,NS.CODNIRSTOC,OBJ.ZILEVALABIL,P1.NRZILE ZILE_SEZON, P1.NRZILEDIR
                 FROM NARTOBJ OBJ INNER JOIN NIRSTOC NS ON OBJ.CODOBIECT = NS.CODOBIECT AND NVL(OBJ.ZILEVALABIL,0) &lt;&gt; 0
                                  LEFT JOIN PERISABIL1 P1 ON P1.CODPERISABIL = OBJ.CODPERISABIL AND EXTRACT( MONTH FROM SYSDATE) BETWEEN P1.LUNA_INI AND P1.LUNA_FIN
             ) LOOP
       UPDATE NIRSER NSER SET
             NSER.STARE = 2 --restrictionat DI
       WHERE NSER.CODNIRSTOC = V_REC.CODNIRSTOC AND
             SYSDATE BETWEEN
                  (NSER.DATAPROD + V_REC.ZILEVALABIL - V_REC.ZILE_SEZON ) AND
                  ( NSER.DATAPROD + V_REC.ZILEVALABIL - V_REC.NRZILEDIR) AND
             nser.stare NOT IN ( 3, 4); -- blocat manual !!!
       UPDATE NIRSER NSER SET
             NSER.STARE = 3 --restrictionat DD
       WHERE NSER.CODNIRSTOC = V_REC.CODNIRSTOC AND
             SYSDATE BETWEEN
                  (NSER.DATAPROD + V_REC.ZILEVALABIL - V_REC.NRZILEDIR ) AND
                  ( NSER.DATAPROD + V_REC.ZILEVALABIL) AND
             nser.stare NOT IN ( 4); -- blocat manual !!!
      UPDATE NIRSER NSER SET
             NSER.STARE = 4 --blocat
       WHERE NSER.CODNIRSTOC = V_REC.CODNIRSTOC AND
             NSER.DATAPROD + V_REC.ZILEVALABIL  &lt; SYSDATE;
  END LOOP;
END;</SQL>
 </ROW>
 <ROW>
  <CODPROCACTDEF>104</CODPROCACTDEF>
  <DENUMIRE>Blocare parteneri cu datorii mari (lei)</DENUMIRE>
  <CODINTERN>PKG_ALERTE.DO_ALERTA</CODINTERN>
  <SQL>UPDATE NPART SET BLOCAT = 1 WHERE
   codpart in
   (
      Select np.codpart
      from
        iesiri ies
        inner join general g on g.coddoc = ies.codies and g.tipdoc = ies.tipdoc
        inner join obligpif o on o.codgeneral = g.codgeneral
        inner join npart np on np.codpart = ies.partener
        where ies.moneda=0
        group by np.codpart
        having sum(o.rest) &gt; 1000
    )</SQL>
 </ROW>
</ROWSET>
