Wednesday 13 January 2016

package xxota.oracle.apps.ota.admin.resource.webui;

import oracle.apps.fnd.framework.OAApplicationModule;
import oracle.apps.fnd.framework.OAViewObject;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.ota.admin.resource.webui.MaintainResourceBookingsCO;
import oracle.apps.ota.lov.server.ResBookingNamesVOImpl;
import oracle.apps.ota.lov.server.LovAMImpl;

public class xxMaintainResourceBookingsCO extends MaintainResourceBookingsCO {
    public xxMaintainResourceBookingsCO() {
    }

    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
      {
     
          OAApplicationModule am = pageContext.getApplicationModule(webBean);
       
          LovAMImpl lam=(LovAMImpl)am.findApplicationModule("LovAM");
       
         ResBookingNamesVOImpl shipvo =(ResBookingNamesVOImpl)lam.getResourceNamesVO();
          String ClassStartTime1 =
                          pageContext.getParameter("ClassStartTime1");
          String ClassEndDate1 =
                          pageContext.getParameter("ClassEndDate1");                          
         String condSql =null;    
                      if ("ClassName".equals(pageContext.getLovInputSourceId())) {
                             try{
                         condSql="SELECT      distinct                    SRL.name,                    TSR.supplied_resource_id,                    PER.full_name,                    TSR.vendor_id,                    ven.vendor_name,                    TSR.training_center_id,                    ota_general.get_org_name (TSR.training_center_id)                       Training_center_name,                    TSR.location_id,                    ota_general.get_location_code (TSR.location_id) Location,                    TSR.resource_type,                    TSR.start_date,                    TSR.end_date,                    TSR.cost,                    TSR.currency_code,                    TSR.cost_unit,                    TSR.consumable_flag,                    TSR.special_instruction,                    CASE                    WHEN (to_char("+ClassStartTime1+",'DD-MON-YYYY') between REQUIRED_DATE_FROM and REQUIRED_DATE_TO                         OR to_char("+ClassEndDate1+",'DD-MON-YYYY') between REQUIRED_DATE_FROM and REQUIRED_DATE_TO)                    AND  TIMEZONE_CODE= 'Asia/Calcutta'                    THEN 'Not Allowed'                    ELSE 'Allowed'                    END Status                    FROM   OTA_SUPPLIABLE_RESOURCES TSR,                    OTA_SUPPLIABLE_RESOURCES_TL SRL,                    per_all_people_f per,                    po_vendors ven,                    ota_resource_bookings orb            WHERE       SRL.SUPPLIED_RESOURCE_ID = TSR.SUPPLIED_RESOURCE_ID                    AND tsr.SUPPLIED_RESOURCE_ID = orb.SUPPLIED_RESOURCE_ID(+)                    AND SRL.LANGUAGE = USERENV ('LANG')                    AND TSR.BUSINESS_GROUP_ID =                          ota_general.get_business_group_id                    AND per.person_id(+) = tsr.trainer_id                    AND tsr.start_date BETWEEN per.effective_start_date(+)                                           AND  per.effective_end_date(+)                    AND ven.vendor_id(+) = TSR.vendor_id";
                     shipvo.setFullSqlMode(shipvo.FULLSQL_MODE_AUGMENTATION);

                     shipvo.setQuery(condSql);
                 }
                 catch(Exception e){
             
                 }
                  }
     
        super.processFormRequest(pageContext, webBean);

   
      }

}

No comments:

Post a Comment