modules/org.openbravo.client.widgets/src-db/database/sourcedata/OBCQL_WIDGET_QUERY.xml
author RM packaging bot <staff.rm@openbravo.com>
Sat, 21 Sep 2013 14:17:57 +0200
changeset 21175 158aca8ccebd
parent 20243 c2b83a0a002c
child 30535 1655f1ccceb1
permissions -rw-r--r--
CI: update AD_MODULE to version 21174
asier@10719
     1
<?xml version='1.0' encoding='UTF-8'?>
asier@10719
     2
<data>
sandra@20243
     3
<!--53389C2060AD4DBEA1F9009A3C82B63F--><OBCQL_WIDGET_QUERY>
sandra@20243
     4
<!--53389C2060AD4DBEA1F9009A3C82B63F-->  <OBCQL_WIDGET_QUERY_ID><![CDATA[53389C2060AD4DBEA1F9009A3C82B63F]]></OBCQL_WIDGET_QUERY_ID>
sandra@20243
     5
<!--53389C2060AD4DBEA1F9009A3C82B63F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
sandra@20243
     6
<!--53389C2060AD4DBEA1F9009A3C82B63F-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
sandra@20243
     7
<!--53389C2060AD4DBEA1F9009A3C82B63F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
sandra@20243
     8
<!--53389C2060AD4DBEA1F9009A3C82B63F-->  <OBKMO_WIDGET_CLASS_ID><![CDATA[5B41A19E11494C519BE33BBED6012DAE]]></OBKMO_WIDGET_CLASS_ID>
sandra@20243
     9
<!--53389C2060AD4DBEA1F9009A3C82B63F-->  <HQL><![CDATA[select Organization.name as store, Warehouse.name as warehouse,Organization.id as orgid, Product.searchKey as identifier,Product.name as product,Product.id as pid, ProductCategory.name as category, ProductCategory.id as pcid,UOM.name as uom, sum(ps.quantityOnHand) as qtyonhand,AttributeSetInstance.description as attr,Warehouse.id as whid
sandra@20243
    10
from ProductStockView ps left outer join ps.product as Product
sandra@20243
    11
left outer join ps.storageBin as Locator
sandra@20243
    12
left outer join Locator.warehouse as Warehouse
sandra@20243
    13
left outer join Product.productCategory as ProductCategory
sandra@20243
    14
left outer join Warehouse.organization as Organization
sandra@20243
    15
left outer join ps.uOM as UOM
sandra@20243
    16
left outer join ps.attributeSetValue as AttributeSetInstance
sandra@20243
    17
where ps.client.id=:client
sandra@20243
    18
and ps.organization.id IN (:organizationList)
sandra@20243
    19
and Product.stocked='Y'
sandra@20243
    20
and @optional_filters@
sandra@20243
    21
group by Organization.name, Warehouse.name, Organization.id, Product.searchKey, Product.name, Product.id, ProductCategory.name, ProductCategory.id, UOM.name, AttributeSetInstance.description,Warehouse.id
sandra@20243
    22
order by Warehouse.name, Product.name, sum(ps.quantityOnHand) desc]]></HQL>
sandra@20243
    23
<!--53389C2060AD4DBEA1F9009A3C82B63F-->  <TYPE><![CDATA[HQL]]></TYPE>
sandra@20243
    24
<!--53389C2060AD4DBEA1F9009A3C82B63F--></OBCQL_WIDGET_QUERY>
sandra@20243
    25
asier@10719
    26
<!--CFDF8EE593F04CFE9709F5AD19A3A573--><OBCQL_WIDGET_QUERY>
asier@10719
    27
<!--CFDF8EE593F04CFE9709F5AD19A3A573-->  <OBCQL_WIDGET_QUERY_ID><![CDATA[CFDF8EE593F04CFE9709F5AD19A3A573]]></OBCQL_WIDGET_QUERY_ID>
asier@10719
    28
<!--CFDF8EE593F04CFE9709F5AD19A3A573-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
asier@10719
    29
<!--CFDF8EE593F04CFE9709F5AD19A3A573-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
asier@10719
    30
<!--CFDF8EE593F04CFE9709F5AD19A3A573-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
asier@10719
    31
<!--CFDF8EE593F04CFE9709F5AD19A3A573-->  <OBKMO_WIDGET_CLASS_ID><![CDATA[CD1B06C4ED974B5F905A5A01B097DF4E]]></OBKMO_WIDGET_CLASS_ID>
asier@10719
    32
<!--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
    33
from OrderLine ol
asier@10719
    34
where ol.salesOrder.documentStatus = 'CO'
asier@10719
    35
and ol.salesOrder.salesTransaction = 'Y'
asier@10719
    36
and @optional_filters@
asier@10719
    37
and ol.client.id = :client
asier@10719
    38
and ol.product.name like :pname
asier@10719
    39
group by product.name, product.uOM.name, product.id, product.uOM.id 
asier@10719
    40
order by sum(orderedQuantity) desc]]></HQL>
augusto@19172
    41
<!--CFDF8EE593F04CFE9709F5AD19A3A573-->  <TYPE><![CDATA[HQL]]></TYPE>
asier@10719
    42
<!--CFDF8EE593F04CFE9709F5AD19A3A573--></OBCQL_WIDGET_QUERY>
asier@10719
    43
asier@10719
    44
<!--D2003CD3F9984BF39457BA1F2FFF01C9--><OBCQL_WIDGET_QUERY>
asier@10719
    45
<!--D2003CD3F9984BF39457BA1F2FFF01C9-->  <OBCQL_WIDGET_QUERY_ID><![CDATA[D2003CD3F9984BF39457BA1F2FFF01C9]]></OBCQL_WIDGET_QUERY_ID>
asier@10719
    46
<!--D2003CD3F9984BF39457BA1F2FFF01C9-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
asier@10719
    47
<!--D2003CD3F9984BF39457BA1F2FFF01C9-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
asier@10719
    48
<!--D2003CD3F9984BF39457BA1F2FFF01C9-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
asier@10719
    49
<!--D2003CD3F9984BF39457BA1F2FFF01C9-->  <OBKMO_WIDGET_CLASS_ID><![CDATA[862EEC18D6FC4FA68E7867E3CF337CC7]]></OBKMO_WIDGET_CLASS_ID>
asier@10719
    50
<!--D2003CD3F9984BF39457BA1F2FFF01C9-->  <HQL><![CDATA[select 
asier@10719
    51
       tel.expenseSheet.documentNo as documentNo,
asier@10719
    52
       tel.expenseSheet.id as expenseSheetId,
asier@10719
    53
       tel.description as description,
asier@10719
    54
       case when tel.expenseDate is not null then tel.expenseDate  else tel.expenseSheet.reportDate end as expenseDate,
asier@10719
    55
       tel.product.id as productId,
asier@10719
    56
       tel.product.name as productName,
asier@10719
    57
       tel.quantity as quantity,
asier@10719
    58
       tel.uOM.name as uomName,
asier@10719
    59
       p.id as projectId,
asier@10719
    60
       p.name as projectName,
asier@10719
    61
       tel.expenseSheet.processed as processed
asier@10719
    62
from
asier@10719
    63
	TimeAndExpenseSheetLine as tel
asier@10719
    64
	LEFT JOIN tel.project as p,
asier@10719
    65
	ADUser as u
asier@10719
    66
	where (month(current_date()) = month(tel.expenseDate) or (month(current_date()) = month(tel.expenseSheet.reportDate) and tel.expenseDate = null))
miguel@13704
    67
	and (year(current_date()) = year(tel.expenseDate) or (year(current_date()) = year(tel.expenseSheet.reportDate) and tel.expenseDate = null))
miguel@13704
    68
	and tel.timeSheet = 'Y'
asier@10719
    69
	and tel.client.id=:client
asier@10719
    70
	and tel.expenseSheet.businessPartner=u.businessPartner
asier@10719
    71
	and u.id=:user
miguel@13704
    72
order by  tel.expenseSheet.reportDate, tel.expenseSheet.documentNo]]></HQL>
augusto@19172
    73
<!--D2003CD3F9984BF39457BA1F2FFF01C9-->  <TYPE><![CDATA[HQL]]></TYPE>
asier@10719
    74
<!--D2003CD3F9984BF39457BA1F2FFF01C9--></OBCQL_WIDGET_QUERY>
asier@10719
    75
asier@10719
    76
</data>