src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports_data.xsql
changeset 5703 e7ad8a48210d
parent 4363 83ba2ffb1bfd
child 6702 690d2af86089
equal deleted inserted replaced
5702:ffba35c94a86 5703:e7ad8a48210d
   296         <Parameter name="adClient"/>
   296         <Parameter name="adClient"/>
   297    </SqlMethod>
   297    </SqlMethod>
   298    <SqlMethod name="selectYearsDouble" type="preparedStatement" return="multiple">
   298    <SqlMethod name="selectYearsDouble" type="preparedStatement" return="multiple">
   299       <SqlMethodComment></SqlMethodComment>
   299       <SqlMethodComment></SqlMethodComment>
   300       <Sql><![CDATA[
   300       <Sql><![CDATA[
   301         SELECT O.AD_ORG_ID AS PADRE, Y.C_YEAR_ID AS ID, Y.YEAR AS NAME
   301         SELECT O.AD_ORG_ID AS PADRE, Y.C_YEAR_ID AS ID, Y.YEAR || ' (' || C.NAME || ')' AS NAME
   302         FROM C_YEAR Y, C_CALENDAR C, AD_ORG O
   302         FROM C_YEAR Y, C_CALENDAR C, AD_ORG O
   303         WHERE C.C_CALENDAR_ID = Y.C_CALENDAR_ID
   303         WHERE C.C_CALENDAR_ID = Y.C_CALENDAR_ID
   304           AND C.C_CALENDAR_ID=(SELECT AD_ORG.C_CALENDAR_ID FROM AD_ORG WHERE AD_ORG_GETCALENDAROWNER(O.AD_ORG_ID) = AD_ORG.AD_ORG_ID)
   304           AND C.C_CALENDAR_ID IN (
   305         ORDER BY O.AD_ORG_ID, Y.YEAR
   305                                     SELECT ORG.C_CALENDAR_ID FROM AD_ORG ORG
   306         ]]></Sql>
   306                                     WHERE AD_ISORGINCLUDED(O.AD_ORG_ID, ORG.AD_ORG_ID, '1') <> -1
       
   307                                       AND ORG.C_CALENDAR_ID IS NOT NULL
       
   308                                   UNION
       
   309                                     SELECT ORG.C_CALENDAR_ID FROM AD_ORG ORG
       
   310                                     WHERE AD_ISORGINCLUDED(ORG.AD_ORG_ID,O.AD_ORG_ID, '1') <> -1
       
   311                                       AND ORG.C_CALENDAR_ID IS NOT NULL
       
   312                                  )
       
   313         ORDER BY O.NAME, Y.YEAR
       
   314         ]]></Sql>
       
   315     <Parameter name="Client"  type="replace" optional="true"  after="WHERE AD_ISORGINCLUDED(O.AD_ORG_ID, ORG.AD_ORG_ID, " text="'1'"></Parameter>
       
   316     <Parameter name="Client"  type="replace" optional="true"  after="WHERE AD_ISORGINCLUDED(ORG.AD_ORG_ID,O.AD_ORG_ID, " text="'1'"></Parameter>
   307    </SqlMethod>
   317    </SqlMethod>
   308 </SqlClass>
   318 </SqlClass>