src/org/openbravo/erpReports/RptMA_CCP_Measures_data.xsql
changeset 35426 9141b6a4a4e8
parent 35410 41c88f9c32e6
parent 35425 fa495023e638
child 35427 e36d52a51aee
equal deleted inserted replaced
35410:41c88f9c32e6 35426:9141b6a4a4e8
     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="RptMACCPMeasuresData" package="org.openbravo.erpReports">
       
    26    <SqlClassComment></SqlClassComment>
       
    27    <SqlMethod name="select" type="preparedStatement" return="multiple">
       
    28       <SqlMethodComment></SqlMethodComment>
       
    29       <Sql>
       
    30       <![CDATA[
       
    31         select s.Measuredate as measuredate, TO_CHAR(cg.frecuency, 'HH:MI') as frecuency, s.MA_MEASURE_SHIFT_ID as shiftid, g.MA_MEASURE_GROUP_ID as groupid, g.MA_CCP_GROUP_ID, cg.NAME as grupo, (CASE s.shift WHEN 'M' THEN 'MaƱana' ELSE 'Tarde' END) as shift, cg.seqno, REPLACE(s.observation, CHR(10), '') AS observation, (CASE WHEN s.AD_User_ID IS NULL THEN ' ' ELSE TO_CHAR(u.Name) END) as uname
       
    32         from AD_User u right join MA_Measure_Shift s on u.AD_User_ID  = s.AD_User_ID, MA_Measure_Group g, MA_CCP_Group cg
       
    33         where s.MA_MEASURE_SHIFT_ID = g.MA_MEASURE_SHIFT_ID
       
    34           and g.MA_CCP_GROUP_ID = cg.MA_CCP_GROUP_ID
       
    35           AND 1=1
       
    36         order by s.MA_Measure_Shift_ID, cg.seqno
       
    37       ]]>
       
    38       </Sql>
       
    39       <Parameter name="maCcpGroupId" optional="true" type="argument" after="AND 1=1">
       
    40       <![CDATA[ AND s.MA_Measure_Shift_ID IN ]]>
       
    41       </Parameter>
       
    42    </SqlMethod>
       
    43    <SqlMethod name="set" type="constant" return="multiple">
       
    44       <SqlMethodComment></SqlMethodComment>
       
    45       <Sql></Sql>
       
    46   </SqlMethod>
       
    47 </SqlClass>