Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $prestations = "select * from (
- select
- 'DP' as type_demande,
- dem.description,
- dem.demande_prestation_id as id,
- to_date(dem.creation_date,'DD/MM/YYYY') as dates,
- dem.creation_date as sort_date,
- to_char(dem.creation_date, 'YYYYMMDD') as date_tri,
- per.person_id as id_personne,
- per.full_name as personne,
- typ_prest.libelle as objet,
- gcc.concatenated_segments as ccf,
- sta.meaning as statut,
- decode(lieu_prest.precision_lieu, NULL,lieu_prest.lieu, lieu_prest.lieu||' : '||lieu_prest.precision_lieu ) as ville,
- dem.code_urgence_client as urgence,
- dem.commentaire as commentaire,
- dem.statut_code,
- dem.beneficiaire_id,
- dem.created_by,
- dem.prest_refusee_lue,
- dem.target_business_group_id,
- dem.business_group_id,
- dem.target_business_group_id as BDD_EXE_ID,
- dem.business_group_id as BDD_PROV_ID
- " . ($_GET['dataset'] == 'to_evaluate' ? ', ev.evaluation_prest_id' : '') . "
- from
- xxmi.xxmi_demande_prest dem,
- xxmi_all_people_f per,
- gl_code_combinations_kfv gcc,
- fnd_lookup_values sta,
- xxmi_type_prestation typ_prest,
- xxmi_lieux_presta lieu_prest
- " . ($_GET['dataset'] == 'to_evaluate' ? ', xxmi_evaluation_prest ev' : '') . "
- where
- per.person_id = dem.beneficiaire_id
- and per.current_employee_flag='Y'
- and dem.type_id = typ_prest.type_prestation_id
- and dem.lieu_prestation_code = lieu_prest.lieux_presta_id (+)
- and dem.code_combination_id = gcc.code_combination_id
- and sta.lookup_type = 'XXMI_STATUT'
- and sta.language = 'F'
- and dem.statut_code = sta.lookup_code
- and dem.creation_date >= add_months(trunc(sysdate, 'month'), - 6)
- " . (COUNT($statuses) > 0 ? "and dem.statut_code IN (" . implode(", ", $statuses) . ")" : "") . "
- " . ($_GET['dataset'] == 'to_approve' ? ' and dem.approbateur_id = ' . intval($sData->get_value('user_id')) : '') . "
- " . ($_GET['dataset'] == 'to_evaluate' ? ' and ev.demande_prestation_id = dem.demande_prestation_id ' : '') . "
- and (dem.prest_refusee_lue is null
- or dem.prest_refusee_lue = 'N')
- and dem.beneficiaire_id = ". intval($sData->get_value('person_id'))."
- and dem.created_by = " .intval($sData->get_value('user_id')). "
- order by date_tri asc
- ) WHERE ROWNUM <= " . $nb_max_lignes;
Add Comment
Please, Sign In to add comment