-- eseguire come utente DBCGO


-- aggiunta valori LOV per visualizzazione report GESTIONE REPORT ---
INSERT INTO DBCGO_LOV  VALUES(SEQ_LOV.NEXTVAL, 'REPORT','DDV','DELIBERA DONATING VIRTUALI',NULL);
INSERT INTO DBCGO_LOV  VALUES(SEQ_LOV.NEXTVAL, 'REPORT','TDDV','MNP TIM DONOR DATI VIRTUALI',NULL);
INSERT INTO DBCGO_LOV  VALUES(SEQ_LOV.NEXTVAL, 'REPORT','TDDRV','MNP TIM DONOR DATI RIFIUTI VIRTUALI',NULL);
INSERT INTO DBCGO_LOV  VALUES(SEQ_LOV.NEXTVAL, 'REPORT','TRDV','MNP TIM RECIPIENT DATI VIRTUALI',NULL);
INSERT INTO DBCGO_LOV  VALUES(SEQ_LOV.NEXTVAL, 'REPORT','TRDRV','MNP TIM RECIPIENT DATI RIFIUTI VIRTUALI',NULL);
INSERT INTO DBCGO_LOV  VALUES(SEQ_LOV.NEXTVAL, 'REPORT','MIV','MOBILITA INTEROPERATORE VIRTUALI',NULL);
INSERT INTO DBCGO_LOV  VALUES(SEQ_LOV.NEXTVAL, 'REPORT','CRV','RECIPIENT CANALE VIRTUALI',NULL);


-- aggiunta valori LOV per relazionare i nuovi report creati sopra
-- DDV - ND
 INSERT INTO DBCGO_LOV_REF   SELECT 
(SELECT lov_id FROM DBCGO_LOV WHERE name='DDV' AND lov_name='REPORT' ) lov_id,
   (SELECT lov_id FROM DBCGO_LOV WHERE name='ND' AND lov_name='REPORT_ID') lov_id_ref
    FROM dual;

-- MIV - 12314
INSERT INTO DBCGO_LOV  VALUES(SEQ_LOV.NEXTVAL, 'REPORT_ID','12314','12314',NULL);

 INSERT INTO DBCGO_LOV_REF   SELECT 
(SELECT lov_id FROM DBCGO_LOV WHERE name='MIV' AND lov_name='REPORT' ) lov_id,
   (SELECT lov_id FROM DBCGO_LOV WHERE name='12314' AND lov_name='REPORT_ID') lov_id_ref
    FROM dual;

-- TDDRV e TDDV - 12315
INSERT INTO DBCGO_LOV  VALUES(SEQ_LOV.NEXTVAL, 'REPORT_ID','12315','12315',NULL);

  INSERT INTO DBCGO_LOV_REF   SELECT 
(SELECT lov_id FROM DBCGO_LOV WHERE name ='TDDRV' AND lov_name='REPORT' ) lov_id,
   (SELECT lov_id FROM DBCGO_LOV WHERE name='12315' AND lov_name='REPORT_ID') lov_id_ref
    FROM dual;
	
 INSERT INTO DBCGO_LOV_REF   SELECT 
(SELECT lov_id FROM DBCGO_LOV WHERE name = 'TDDV' AND lov_name='REPORT' ) lov_id,
   (SELECT lov_id FROM DBCGO_LOV WHERE name='12315' AND lov_name='REPORT_ID') lov_id_ref
    FROM dual;


-- TDDRV e TDDV - 12316
INSERT INTO DBCGO_LOV  VALUES(SEQ_LOV.NEXTVAL, 'REPORT_ID','12316','12316',NULL);


 INSERT INTO DBCGO_LOV_REF   SELECT 
(SELECT lov_id FROM DBCGO_LOV WHERE name = 'TRDV' AND lov_name='REPORT' ) lov_id,
   (SELECT lov_id FROM DBCGO_LOV WHERE name='12316' AND lov_name='REPORT_ID') lov_id_ref
    FROM dual;
	
 INSERT INTO DBCGO_LOV_REF   SELECT 
(SELECT lov_id FROM DBCGO_LOV WHERE name ='TRDRV' AND lov_name='REPORT' ) lov_id,
   (SELECT lov_id FROM DBCGO_LOV WHERE name='12316' AND lov_name='REPORT_ID') lov_id_ref
    FROM dual;

-- MIV - 12317
INSERT INTO DBCGO_LOV  VALUES(SEQ_LOV.NEXTVAL, 'REPORT_ID','12317','12317',NULL);

 INSERT INTO DBCGO_LOV_REF   SELECT 
(SELECT lov_id FROM DBCGO_LOV WHERE name='CRV' AND lov_name='REPORT' ) lov_id,
   (SELECT lov_id FROM DBCGO_LOV WHERE name='12314' AND lov_name='REPORT_ID') lov_id_ref
    FROM dual;

--- INSERIMENTO IN DBCGO_LOV DEL FLAG DI PROGETTO AD HOC ---
INSERT INTO DBCGO_LOV  VALUES(SEQ_LOV.NEXTVAL, 'FLAG_PROGETTO_ADHOC','0','Y',NULL);
INSERT INTO DBCGO_LOV  VALUES(SEQ_LOV.NEXTVAL, 'FLAG_PROGETTO_ADHOC','1','N',NULL);

------------ popolamento tabelle di stato ---------------------------
INSERT INTO DBCGO_STATO_TC ( ID_STATO, DESCR_STATO ) VALUES ( 0, 'IN TRASFERIMENTO'); 
INSERT INTO DBCGO_STATO_TC ( ID_STATO, DESCR_STATO ) VALUES ( 1, 'TRASFERITO'); 

INSERT INTO DBCGO_STATO_REC_VIRT ( ID_STATO, DESCR_STATO, FINALE, VIS_DAY_NUM ) VALUES ( 13, 'ACCETTATA', 0, 360); 
INSERT INTO DBCGO_STATO_DON_VIRT ( ID_STATO, DESCR_STATO, FINALE, VIS_DAY_NUM ) VALUES ( 13, 'ACCETTATA', 0, 360); 

INSERT INTO DBCGO_STATO_MAPPING_DON_RECV ( ID_STATO, DESCR, ID_STATO_DONOR, ID_STATO_REC_VIRT,ID_STATO_TC ) VALUES ( 1, 'ACQUISITA', 1, 1, NULL); 
INSERT INTO DBCGO_STATO_MAPPING_DON_RECV ( ID_STATO, DESCR, ID_STATO_DONOR, ID_STATO_REC_VIRT,ID_STATO_TC ) VALUES ( 2, 'PRESA IN CARICO', 3, 4, NULL); 
INSERT INTO DBCGO_STATO_MAPPING_DON_RECV ( ID_STATO, DESCR, ID_STATO_DONOR, ID_STATO_REC_VIRT,ID_STATO_TC ) VALUES ( 3, 'VALIDATA', 7,6, NULL); 
INSERT INTO DBCGO_STATO_MAPPING_DON_RECV ( ID_STATO, DESCR, ID_STATO_DONOR, ID_STATO_REC_VIRT,ID_STATO_TC ) VALUES ( 4, 'ACCETTATA', 9, 13, NULL); 
INSERT INTO DBCGO_STATO_MAPPING_DON_RECV ( ID_STATO, DESCR, ID_STATO_DONOR, ID_STATO_REC_VIRT,ID_STATO_TC ) VALUES ( 5, 'IN CESSAZIONE', 14,8, NULL); 
INSERT INTO DBCGO_STATO_MAPPING_DON_RECV ( ID_STATO, DESCR, ID_STATO_DONOR, ID_STATO_REC_VIRT,ID_STATO_TC ) VALUES ( 6, 'CESSATA', 15,10, NULL); 
INSERT INTO DBCGO_STATO_MAPPING_DON_RECV ( ID_STATO, DESCR, ID_STATO_DONOR, ID_STATO_REC_VIRT,ID_STATO_TC ) VALUES ( 7, 'EVASA', 16,12, NULL); 
INSERT INTO DBCGO_STATO_MAPPING_DON_RECV ( ID_STATO, DESCR, ID_STATO_DONOR, ID_STATO_REC_VIRT,ID_STATO_TC ) VALUES ( 8, 'RIFIUTATA', 10,7, NULL); 
INSERT INTO DBCGO_STATO_MAPPING_DON_RECV ( ID_STATO, DESCR, ID_STATO_DONOR, ID_STATO_REC_VIRT,ID_STATO_TC ) VALUES ( 9, 'SCARTATA (Don)', 4,NULL, NULL); 
INSERT INTO DBCGO_STATO_MAPPING_DON_RECV ( ID_STATO, DESCR, ID_STATO_DONOR, ID_STATO_REC_VIRT,ID_STATO_TC ) VALUES ( 10, 'VALIDATA KO (Don)', 8, NULL, NULL); 
INSERT INTO DBCGO_STATO_MAPPING_DON_RECV ( ID_STATO, DESCR, ID_STATO_DONOR, ID_STATO_REC_VIRT,ID_STATO_TC ) VALUES ( 11, 'ACCODATA (RVirt)', NULL,3, NULL); 
INSERT INTO DBCGO_STATO_MAPPING_DON_RECV ( ID_STATO, DESCR, ID_STATO_DONOR, ID_STATO_REC_VIRT,ID_STATO_TC ) VALUES ( 12, 'IN ATTIVAZIONE (RVirt)', NULL,11, NULL); 
INSERT INTO DBCGO_STATO_MAPPING_DON_RECV ( ID_STATO, DESCR, ID_STATO_DONOR, ID_STATO_REC_VIRT,ID_STATO_TC ) VALUES ( 13, 'IN TRASFERIMENTO', NULL,NULL,0); 
INSERT INTO DBCGO_STATO_MAPPING_DON_RECV ( ID_STATO, DESCR, ID_STATO_DONOR, ID_STATO_REC_VIRT,ID_STATO_TC ) VALUES ( 14, 'TRASFERITO', NULL,NULL,1); 


INSERT INTO DBCGO_STATO_MAPPING_REC_DONV ( ID_STATO, DESCR, ID_STATO_RECIPIENT, id_stato_DON_virt,ID_STATO_TC ) VALUES ( 1, 'ACQUISITA', 2, 1, NULL); 
INSERT INTO DBCGO_STATO_MAPPING_REC_DONV ( ID_STATO, DESCR, ID_STATO_RECIPIENT, id_stato_DON_virt,ID_STATO_TC ) VALUES ( 2, 'INVIATA/LAVORABILE', 4,2, NULL); 
INSERT INTO DBCGO_STATO_MAPPING_REC_DONV ( ID_STATO, DESCR, ID_STATO_RECIPIENT, id_stato_DON_virt,ID_STATO_TC ) VALUES ( 3, 'PRESA IN CARICO', 6,4, NULL); 
INSERT INTO DBCGO_STATO_MAPPING_REC_DONV ( ID_STATO, DESCR, ID_STATO_RECIPIENT, id_stato_DON_virt,ID_STATO_TC ) VALUES ( 4, 'VALIDATA', 8,6, NULL); 
INSERT INTO DBCGO_STATO_MAPPING_REC_DONV ( ID_STATO, DESCR, ID_STATO_RECIPIENT, id_stato_DON_virt,ID_STATO_TC ) VALUES ( 5, 'ACCETTATA', 10,13, NULL); 
INSERT INTO DBCGO_STATO_MAPPING_REC_DONV ( ID_STATO, DESCR, ID_STATO_RECIPIENT, id_stato_DON_virt,ID_STATO_TC ) VALUES ( 6, 'ATTESA EVASIONE', 11,8, NULL); 
INSERT INTO DBCGO_STATO_MAPPING_REC_DONV ( ID_STATO, DESCR, ID_STATO_RECIPIENT, id_stato_DON_virt,ID_STATO_TC ) VALUES ( 7, 'EVASA', 12,11, NULL); 
INSERT INTO DBCGO_STATO_MAPPING_REC_DONV ( ID_STATO, DESCR, ID_STATO_RECIPIENT, id_stato_DON_virt,ID_STATO_TC ) VALUES ( 8, 'RIFIUTATA', 7,7, NULL); 
INSERT INTO DBCGO_STATO_MAPPING_REC_DONV ( ID_STATO, DESCR, ID_STATO_RECIPIENT, id_stato_DON_virt,ID_STATO_TC ) VALUES ( 9, 'ACCODATA', 3,3, NULL); 
INSERT INTO DBCGO_STATO_MAPPING_REC_DONV ( ID_STATO, DESCR, ID_STATO_RECIPIENT, id_stato_DON_virt,ID_STATO_TC ) VALUES ( 10, 'ANNULLATA (Rec)', 9, NULL, NULL); 
INSERT INTO DBCGO_STATO_MAPPING_REC_DONV ( ID_STATO, DESCR, ID_STATO_RECIPIENT, id_stato_DON_virt,ID_STATO_TC ) VALUES ( 11, 'SCARTA PIC (Rec)', 5, NULL, NULL); 
INSERT INTO DBCGO_STATO_MAPPING_REC_DONV ( ID_STATO, DESCR, ID_STATO_RECIPIENT, id_stato_DON_virt,ID_STATO_TC ) VALUES ( 12, 'IN VALIDAZIONE (DVirt)', NULL,5, NULL); 
INSERT INTO DBCGO_STATO_MAPPING_REC_DONV ( ID_STATO, DESCR, ID_STATO_RECIPIENT, id_stato_DON_virt,ID_STATO_TC ) VALUES ( 13, 'CESSATA (DVirt)', NULL,10, NULL); 
INSERT INTO DBCGO_STATO_MAPPING_REC_DONV ( ID_STATO, DESCR, ID_STATO_RECIPIENT, id_stato_DON_virt,ID_STATO_TC ) VALUES ( 14, 'IN TRASFERIMENTO', NULL,NULL,0); 
INSERT INTO DBCGO_STATO_MAPPING_REC_DONV ( ID_STATO, DESCR, ID_STATO_RECIPIENT, id_stato_DON_virt,ID_STATO_TC ) VALUES ( 15, 'TRASFERITO', NULL,NULL,1); 


-- aggiunta valori LOV per filtro GESTIONE PRIORITA : Trasferimento con sblocco ---
INSERT INTO DBCGO_LOV  VALUES(SEQ_LOV.NEXTVAL, 'TRASFERIMENTO_CON_SBLOCCO','NULL','null',NULL);
INSERT INTO DBCGO_LOV  VALUES(SEQ_LOV.NEXTVAL, 'TRASFERIMENTO_CON_SBLOCCO','CSS','Credito Sopra Soglia',NULL);
INSERT INTO DBCGO_LOV  VALUES(SEQ_LOV.NEXTVAL, 'TRASFERIMENTO_CON_SBLOCCO','CA','Credito Anomalo',NULL);







----------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------
---------------------------- seconda consegna kit luglio 2010 --------------------------------------------------------------------
INSERT INTO DBCGO_LOV  VALUES(SEQ_LOV.NEXTVAL, 'AOM_RECIPIENT','TIMG','TIM',NULL);
INSERT INTO DBCGO_LOV  VALUES(SEQ_LOV.NEXTVAL, 'AOM_DONOR','TIMG','TIM',NULL);


INSERT INTO DBCGO_STATO_REC_VIRT_M2M ( ID_STATO, DESCR_STATO, FINALE, VIS_DAY_NUM ) VALUES ( 13, 'ACCETTATA', 0, 360); 






COMMIT;
