modules/org.openbravo.client.widgets/src-db/database/sourcedata/OBCQL_WIDGET_QUERY.xml
author RM packaging bot <staff.rm@openbravo.com>
Thu, 08 Nov 2012 12:18:10 +0100
changeset 18502 9526a6d184a6
parent 13704 f70eb0ef28f6
child 19172 b6cf1812e397
permissions -rw-r--r--
CI: promote changesets from pi to main
asier@10719
     1
<?xml version='1.0' encoding='UTF-8'?>
asier@10719
     2
<data>
asier@10719
     3
<!--CFDF8EE593F04CFE9709F5AD19A3A573--><OBCQL_WIDGET_QUERY>
asier@10719
     4
<!--CFDF8EE593F04CFE9709F5AD19A3A573-->  <OBCQL_WIDGET_QUERY_ID><![CDATA[CFDF8EE593F04CFE9709F5AD19A3A573]]></OBCQL_WIDGET_QUERY_ID>
asier@10719
     5
<!--CFDF8EE593F04CFE9709F5AD19A3A573-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
asier@10719
     6
<!--CFDF8EE593F04CFE9709F5AD19A3A573-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
asier@10719
     7
<!--CFDF8EE593F04CFE9709F5AD19A3A573-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
asier@10719
     8
<!--CFDF8EE593F04CFE9709F5AD19A3A573-->  <OBKMO_WIDGET_CLASS_ID><![CDATA[CD1B06C4ED974B5F905A5A01B097DF4E]]></OBKMO_WIDGET_CLASS_ID>
asier@10719
     9
<!--CFDF8EE593F04CFE9709F5AD19A3A573-->  <HQL><![CDATA[select product.id as id,product.name as pname, sum(orderedQuantity) as qty, product.uOM.name as uom, product.uOM.id as uomid
asier@10719
    10
from OrderLine ol
asier@10719
    11
where ol.salesOrder.documentStatus = 'CO'
asier@10719
    12
and ol.salesOrder.salesTransaction = 'Y'
asier@10719
    13
and @optional_filters@
asier@10719
    14
and ol.client.id = :client
asier@10719
    15
and ol.product.name like :pname
asier@10719
    16
group by product.name, product.uOM.name, product.id, product.uOM.id 
asier@10719
    17
order by sum(orderedQuantity) desc]]></HQL>
asier@10719
    18
<!--CFDF8EE593F04CFE9709F5AD19A3A573--></OBCQL_WIDGET_QUERY>
asier@10719
    19
asier@10719
    20
<!--D2003CD3F9984BF39457BA1F2FFF01C9--><OBCQL_WIDGET_QUERY>
asier@10719
    21
<!--D2003CD3F9984BF39457BA1F2FFF01C9-->  <OBCQL_WIDGET_QUERY_ID><![CDATA[D2003CD3F9984BF39457BA1F2FFF01C9]]></OBCQL_WIDGET_QUERY_ID>
asier@10719
    22
<!--D2003CD3F9984BF39457BA1F2FFF01C9-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
asier@10719
    23
<!--D2003CD3F9984BF39457BA1F2FFF01C9-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
asier@10719
    24
<!--D2003CD3F9984BF39457BA1F2FFF01C9-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
asier@10719
    25
<!--D2003CD3F9984BF39457BA1F2FFF01C9-->  <OBKMO_WIDGET_CLASS_ID><![CDATA[862EEC18D6FC4FA68E7867E3CF337CC7]]></OBKMO_WIDGET_CLASS_ID>
asier@10719
    26
<!--D2003CD3F9984BF39457BA1F2FFF01C9-->  <HQL><![CDATA[select 
asier@10719
    27
       tel.expenseSheet.documentNo as documentNo,
asier@10719
    28
       tel.expenseSheet.id as expenseSheetId,
asier@10719
    29
       tel.description as description,
asier@10719
    30
       case when tel.expenseDate is not null then tel.expenseDate  else tel.expenseSheet.reportDate end as expenseDate,
asier@10719
    31
       tel.product.id as productId,
asier@10719
    32
       tel.product.name as productName,
asier@10719
    33
       tel.quantity as quantity,
asier@10719
    34
       tel.uOM.name as uomName,
asier@10719
    35
       p.id as projectId,
asier@10719
    36
       p.name as projectName,
asier@10719
    37
       tel.expenseSheet.processed as processed
asier@10719
    38
from
asier@10719
    39
	TimeAndExpenseSheetLine as tel
asier@10719
    40
	LEFT JOIN tel.project as p,
asier@10719
    41
	ADUser as u
asier@10719
    42
	where (month(current_date()) = month(tel.expenseDate) or (month(current_date()) = month(tel.expenseSheet.reportDate) and tel.expenseDate = null))
miguel@13704
    43
	and (year(current_date()) = year(tel.expenseDate) or (year(current_date()) = year(tel.expenseSheet.reportDate) and tel.expenseDate = null))
miguel@13704
    44
	and tel.timeSheet = 'Y'
asier@10719
    45
	and tel.client.id=:client
asier@10719
    46
	and tel.expenseSheet.businessPartner=u.businessPartner
asier@10719
    47
	and u.id=:user
miguel@13704
    48
order by  tel.expenseSheet.reportDate, tel.expenseSheet.documentNo]]></HQL>
asier@10719
    49
<!--D2003CD3F9984BF39457BA1F2FFF01C9--></OBCQL_WIDGET_QUERY>
asier@10719
    50
asier@10719
    51
</data>