src/org/openbravo/erpCommon/ad_reports/ReportWorkRequirementDailyEnv_data.xsql
changeset 35444 9feac3af1d2f
parent 35443 f4bdb985e356
child 35445 3358f7883c08
equal deleted inserted replaced
35443:f4bdb985e356 35444:9feac3af1d2f
     1 <?xml version="1.0" encoding="UTF-8" ?>
       
     2 <!--
       
     3  *************************************************************************
       
     4  * The contents of this file are subject to the Openbravo  Public  License
       
     5  * Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
       
     6  * Version 1.1  with a permitted attribution clause; you may not  use this
       
     7  * file except in compliance with the License. You  may  obtain  a copy of
       
     8  * the License at http://www.openbravo.com/legal/license.html 
       
     9  * Software distributed under the License  is  distributed  on  an "AS IS"
       
    10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
       
    11  * License for the specific  language  governing  rights  and  limitations
       
    12  * under the License. 
       
    13  * The Original Code is Openbravo ERP. 
       
    14  * The Initial Developer of the Original Code is Openbravo SLU 
       
    15  * All portions are Copyright (C) 2001-2011 Openbravo SLU 
       
    16  * All Rights Reserved. 
       
    17  * Contributor(s):  ______________________________________.
       
    18  ************************************************************************
       
    19 -->
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 <SqlClass name="ReportWorkRequirementDailyEnvData" package="org.openbravo.erpCommon.ad_reports">
       
    26   <SqlClassComment></SqlClassComment>
       
    27   <SqlMethod name="select" type="preparedStatement" return="multiple">
       
    28     <SqlMethodComment></SqlMethodComment>
       
    29     <Sql>
       
    30     <![CDATA[
       
    31       SELECT pd.Name as prodname, wr.startdate as day, wrp.quantity*wrpp.movementqty/pd.unitsperpallet as quantity, 
       
    32       AD_REF_LIST_V.NAME as dayword, wr.documentno as wrdocno
       
    33       FROM MA_WorkRequirement wr, MA_WRPhase wrp, MA_WRPhaseProduct wrpp, M_Product pd, AD_REF_LIST_V
       
    34       WHERE wr.MA_WORKREQUIREMENT_ID = wrp.MA_WORKREQUIREMENT_ID
       
    35         AND wrp.MA_WRPHASE_ID = wrpp.MA_WRPHASE_ID
       
    36         AND wrpp.M_PRODUCT_ID = pd.M_PRODUCT_ID
       
    37 	AND TO_CHAR(WR.STARTDATE, 'D') = AD_REF_LIST_V.VALUE
       
    38 	AND AD_REF_LIST_V.AD_REFERENCE_ID = '167'
       
    39 	AND AD_REF_LIST_V.AD_LANGUAGE = ?
       
    40         AND wrp.CLOSED = 'N'
       
    41         AND wrpp.PRODUCTIONTYPE = '+'
       
    42         AND wr.AD_CLIENT_ID IN ('1')
       
    43         AND wr.AD_ORG_ID IN ('1')
       
    44         AND 1=1
       
    45       ORDER BY wr.enddate, wrp.SeqNo
       
    46      ]]></Sql>
       
    47     <Parameter name="adLanguageId"/>
       
    48     <Parameter name="adUserClient" type="replace" optional="true" after="AND wr.AD_CLIENT_ID IN (" text="'1'"/>
       
    49     <Parameter name="adUserOrg" type="replace" optional="true" after="AND wr.AD_ORG_ID IN (" text="'1'"/>
       
    50     <Parameter name="parStartDateFrom" optional="true" after="AND 1=1"><![CDATA[AND wr.STARTDATE >= TO_DATE(?)]]></Parameter>
       
    51     <Parameter name="parStartDateTo" optional="true" after="AND 1=1"><![CDATA[AND wr.STARTDATE <= TO_DATE(?)]]></Parameter>
       
    52     <Parameter name="parProcessPlan" optional="true" after="AND 1=1"><![CDATA[AND wr.MA_ProcessPlan_id = ?]]></Parameter>
       
    53   </SqlMethod>
       
    54 </SqlClass>