src-db/database/sourcedata/OBCQL_WIDGET_QUERY.xml
author RM packaging bot <staff.rm@openbravo.com>
Fri, 26 Jun 2015 13:40:13 +0000
changeset 27164 60ba8db95a9d
parent 19172 b6cf1812e397
permissions -rw-r--r--
CI: update AD_MODULE to version 27038
<?xml version='1.0' encoding='UTF-8'?>
<data>
<!--11D052605994493E905FF9A45591D84D--><OBCQL_WIDGET_QUERY>
<!--11D052605994493E905FF9A45591D84D-->  <OBCQL_WIDGET_QUERY_ID><![CDATA[11D052605994493E905FF9A45591D84D]]></OBCQL_WIDGET_QUERY_ID>
<!--11D052605994493E905FF9A45591D84D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
<!--11D052605994493E905FF9A45591D84D-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
<!--11D052605994493E905FF9A45591D84D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
<!--11D052605994493E905FF9A45591D84D-->  <OBKMO_WIDGET_CLASS_ID><![CDATA[7EE694CFF8B94B4C9B9CE69C9D292CC4]]></OBKMO_WIDGET_CLASS_ID>
<!--11D052605994493E905FF9A45591D84D-->  <HQL><![CDATA[select q.documentStatus as Status, case when count(*) > 0 then round((cast((count(*) *100) as big_decimal)/
  (select count(*)
  from Order q2
  where q2.documentStatus in ('CA', 'CJ') 
    and q2.organization.id IN (:organizationList)
    and @optional_filters@))) else round(cast(0 as big_decimal)) end || '%' as Percentage,
  count(*) as Total
from Order q
where q.documentStatus in ('CA', 'CJ')
  and q.organization.id IN (:organizationList)
  and @optional_filters@
group by q.documentStatus]]></HQL>
<!--11D052605994493E905FF9A45591D84D-->  <TYPE><![CDATA[HQL]]></TYPE>
<!--11D052605994493E905FF9A45591D84D--></OBCQL_WIDGET_QUERY>

</data>