modules/org.openbravo.client.querylist/src-db/database/sourcedata/OBCQL_WIDGET_QUERY.xml
author Mikel Irurita <mikel.irurita@openbravo.com>
Thu, 03 Feb 2011 09:31:31 +0100
changeset 10349 91555b05f01d
parent 9973 c82872d3f44c
child 10354 0ee185c69279
permissions -rw-r--r--
[OBCQL] Included org filter, org optional parameter and currency column.
Include filtering for only readable organizations and the organization column in max view.
Include a new organization optional paratmeter.
Include currency column in widget view at last position.
harpreet@9091
     1
<?xml version='1.0' encoding='UTF-8'?>
harpreet@9091
     2
<data>
mikel@9334
     3
<!--1EF87E8E961A4E5BA3B41E1AB772B47C--><OBCQL_WIDGET_QUERY>
mikel@9334
     4
<!--1EF87E8E961A4E5BA3B41E1AB772B47C-->  <OBCQL_WIDGET_QUERY_ID><![CDATA[1EF87E8E961A4E5BA3B41E1AB772B47C]]></OBCQL_WIDGET_QUERY_ID>
mikel@9334
     5
<!--1EF87E8E961A4E5BA3B41E1AB772B47C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
mikel@9334
     6
<!--1EF87E8E961A4E5BA3B41E1AB772B47C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
mikel@9334
     7
<!--1EF87E8E961A4E5BA3B41E1AB772B47C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
mikel@9334
     8
<!--1EF87E8E961A4E5BA3B41E1AB772B47C-->  <OBKMO_WIDGET_CLASS_ID><![CDATA[147D825456D54D0486C3D7072531C5C9]]></OBKMO_WIDGET_CLASS_ID>
mikel@9334
     9
<!--1EF87E8E961A4E5BA3B41E1AB772B47C-->  <HQL><![CDATA[select inv.id as invoiceId, inv.documentNo as documentNo,
gorkaion@9469
    10
       inv.businessPartner.id as businessPartnerId, inv.businessPartner.name as businessPartnerName,
gorkaion@9495
    11
       inv.invoiceDate as invoiceDate, inv.grandTotalAmount as grandTotalAmount,
mikel@10349
    12
       inv.currency.iSOCode as currency, inv.paymentTerms.name as paymentTerms,
mikel@10349
    13
       inv.outstandingAmount as outstandingAmount, inv.daysTillDue as daysTillDue,
mikel@10349
    14
       inv.dueAmount as dueAmount, inv.organization.name as organizationName
mikel@9334
    15
from Invoice as inv
mikel@9334
    16
where inv.businessPartner.name like :businessPartnerName
mikel@9334
    17
      and inv.documentNo like :documentNo
mikel@9334
    18
      and inv.processed = true
mikel@9334
    19
      and inv.paymentComplete = false
mikel@9334
    20
      and inv.salesTransaction = true
mikel@9334
    21
      and inv.client.id = :client
mikel@10349
    22
      and inv.organization.id in (:organizationList)
mikel@10349
    23
      and inv.organization.name like :organizationName
gorkaion@9705
    24
      and @optional_filters@
mikel@9334
    25
order by inv.invoiceDate]]></HQL>
mikel@9334
    26
<!--1EF87E8E961A4E5BA3B41E1AB772B47C--></OBCQL_WIDGET_QUERY>
mikel@9334
    27
mikel@9334
    28
<!--58BCB96595FA45678CC1423402238309--><OBCQL_WIDGET_QUERY>
mikel@9334
    29
<!--58BCB96595FA45678CC1423402238309-->  <OBCQL_WIDGET_QUERY_ID><![CDATA[58BCB96595FA45678CC1423402238309]]></OBCQL_WIDGET_QUERY_ID>
mikel@9334
    30
<!--58BCB96595FA45678CC1423402238309-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
mikel@9334
    31
<!--58BCB96595FA45678CC1423402238309-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
mikel@9334
    32
<!--58BCB96595FA45678CC1423402238309-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
mikel@9334
    33
<!--58BCB96595FA45678CC1423402238309-->  <OBKMO_WIDGET_CLASS_ID><![CDATA[34F279BBB85945519DC38F21573106C0]]></OBKMO_WIDGET_CLASS_ID>
mikel@9334
    34
<!--58BCB96595FA45678CC1423402238309-->  <HQL><![CDATA[select inv.id as invoiceId, inv.documentNo as documentNo,
gorkaion@9469
    35
       inv.businessPartner.id as businessPartnerId, inv.businessPartner.name as businessPartnerName,
gorkaion@9495
    36
       inv.invoiceDate as invoiceDate, inv.grandTotalAmount as grandTotalAmount,
mikel@10349
    37
       inv.currency.iSOCode as currency, inv.paymentTerms.name as paymentTerms,
mikel@10349
    38
       inv.outstandingAmount as outstandingAmount, inv.daysTillDue as daysTillDue,
mikel@10349
    39
       inv.dueAmount as dueAmount, inv.organization.name as organizationName
mikel@9334
    40
from Invoice as inv
mikel@9334
    41
where inv.businessPartner.name like :businessPartnerName
mikel@9334
    42
      and inv.documentNo like :documentNo
mikel@9334
    43
      and inv.processed = true
mikel@9334
    44
      and inv.paymentComplete = false
mikel@9334
    45
      and inv.salesTransaction = false
mikel@9334
    46
      and inv.client.id = :client
mikel@10349
    47
      and inv.organization.id in (:organizationList)
mikel@10349
    48
      and inv.organization.name like :organizationName
gorkaion@9705
    49
      and @optional_filters@
mikel@9334
    50
order by inv.invoiceDate]]></HQL>
mikel@9334
    51
<!--58BCB96595FA45678CC1423402238309--></OBCQL_WIDGET_QUERY>
mikel@9334
    52
mikel@9348
    53
<!--E5A0DC8536134185AC8B1897F15DB816--><OBCQL_WIDGET_QUERY>
mikel@9348
    54
<!--E5A0DC8536134185AC8B1897F15DB816-->  <OBCQL_WIDGET_QUERY_ID><![CDATA[E5A0DC8536134185AC8B1897F15DB816]]></OBCQL_WIDGET_QUERY_ID>
mikel@9348
    55
<!--E5A0DC8536134185AC8B1897F15DB816-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
mikel@9348
    56
<!--E5A0DC8536134185AC8B1897F15DB816-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
mikel@9348
    57
<!--E5A0DC8536134185AC8B1897F15DB816-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
mikel@9348
    58
<!--E5A0DC8536134185AC8B1897F15DB816-->  <OBKMO_WIDGET_CLASS_ID><![CDATA[2662490B7D3B4F80AF308C88F6DB68C0]]></OBKMO_WIDGET_CLASS_ID>
mikel@9348
    59
<!--E5A0DC8536134185AC8B1897F15DB816-->  <HQL><![CDATA[select p.id as finpaymentId, p.documentNo as documentNo,
gorkaion@9469
    60
       p.businessPartner.id as businessPartnerId, p.businessPartner.name as businessPartnerName,
mikel@10349
    61
       p.paymentDate as paymentDate, p.amount as amount,
mikel@10349
    62
       p.currency.iSOCode as currency, p.organization.name as organizationName
mikel@9348
    63
from FIN_Payment as p
mikel@9348
    64
where p.businessPartner.name like :businessPartnerName
mikel@9348
    65
      and p.documentNo like :documentNo
mikel@9348
    66
      and p.client.id = :client
mikel@9348
    67
      and p.processed = true
mikel@9348
    68
      and p.receipt = true
mikel@9348
    69
      and p.status = 'RPAE'
mikel@10349
    70
      and p.organization.id in (:organizationList)
mikel@10349
    71
      and p.organization.name like :organizationName
gorkaion@9705
    72
      and @optional_filters@
mikel@9348
    73
order by p.paymentDate]]></HQL>
mikel@9348
    74
<!--E5A0DC8536134185AC8B1897F15DB816--></OBCQL_WIDGET_QUERY>
mikel@9348
    75
pablo@9503
    76
<!--F5DEE669DD8047FB831A12064BB277BE--><OBCQL_WIDGET_QUERY>
pablo@9503
    77
<!--F5DEE669DD8047FB831A12064BB277BE-->  <OBCQL_WIDGET_QUERY_ID><![CDATA[F5DEE669DD8047FB831A12064BB277BE]]></OBCQL_WIDGET_QUERY_ID>
pablo@9503
    78
<!--F5DEE669DD8047FB831A12064BB277BE-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
pablo@9503
    79
<!--F5DEE669DD8047FB831A12064BB277BE-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
pablo@9503
    80
<!--F5DEE669DD8047FB831A12064BB277BE-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
pablo@9503
    81
<!--F5DEE669DD8047FB831A12064BB277BE-->  <OBKMO_WIDGET_CLASS_ID><![CDATA[8267FB3F59D7401980DDDEFF51FE55C3]]></OBKMO_WIDGET_CLASS_ID>
pablo@9503
    82
<!--F5DEE669DD8047FB831A12064BB277BE-->  <HQL><![CDATA[select ol.salesOrder.id as orderId, ol.salesOrder.orderDate as dateordered,  ol.salesOrder.scheduledDeliveryDate as plannedDeliveryDate,
pablo@9503
    83
ol.salesOrder.documentNo as salesorder, ol.salesOrder.businessPartner.name as bpartner,
pablo@9503
    84
ol.product.name as productname, ol.attributeSetValue.description as attribute, ol.uOM.name as uom,
pablo@9503
    85
ol.orderedQuantity as totalqty, 
pablo@9503
    86
   (select coalesce(sum(po.quantity),0) 
pablo@9503
    87
    from ProcurementPOInvoiceMatch po
pablo@9503
    88
    where po.goodsShipmentLine is not null
pablo@9503
    89
    and po.salesOrderLine = ol) as qtyReceived, 
pablo@9503
    90
   (select ol.orderedQuantity-coalesce(sum(po2.quantity),0) from ProcurementPOInvoiceMatch po2
pablo@9503
    91
    where po2.goodsShipmentLine is not null
pablo@9503
    92
    and po2.salesOrderLine = ol) as qtyPending
pablo@9503
    93
from OrderLine as ol left join ol.attributeSetValue
pablo@9503
    94
where ol.client.id =:client
pablo@9503
    95
and ol.salesOrder.documentStatus='CO'
gorkaion@9973
    96
and ol.salesOrder.salesTransaction=false
pablo@9503
    97
and ol.orderedQuantity <> (select coalesce(sum(po3.quantity),0) 
pablo@9503
    98
                            from ProcurementPOInvoiceMatch po3
pablo@9503
    99
                            where po3.goodsShipmentLine is not null
pablo@9503
   100
                            and po3.salesOrderLine = ol)
pablo@9503
   101
and ol.salesOrder.scheduledDeliveryDate<=now()
pablo@9503
   102
and ol.product.name like :productname
pablo@9503
   103
and ol.salesOrder.businessPartner.name like :suppliername
pablo@9503
   104
and ol.salesOrder.documentNo like :documentno
gorkaion@9705
   105
and @optional_filters@
pablo@9503
   106
order by ol.salesOrder.scheduledDeliveryDate, ol.salesOrder.documentNo]]></HQL>
pablo@9503
   107
<!--F5DEE669DD8047FB831A12064BB277BE--></OBCQL_WIDGET_QUERY>
pablo@9503
   108
mikel@9348
   109
<!--F94AEB4680AD4AD48255071903000A43--><OBCQL_WIDGET_QUERY>
mikel@9348
   110
<!--F94AEB4680AD4AD48255071903000A43-->  <OBCQL_WIDGET_QUERY_ID><![CDATA[F94AEB4680AD4AD48255071903000A43]]></OBCQL_WIDGET_QUERY_ID>
mikel@9348
   111
<!--F94AEB4680AD4AD48255071903000A43-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
mikel@9348
   112
<!--F94AEB4680AD4AD48255071903000A43-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
mikel@9348
   113
<!--F94AEB4680AD4AD48255071903000A43-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
mikel@9348
   114
<!--F94AEB4680AD4AD48255071903000A43-->  <OBKMO_WIDGET_CLASS_ID><![CDATA[F8E4F382BCFB441CADBB4AC693C41C93]]></OBKMO_WIDGET_CLASS_ID>
mikel@9348
   115
<!--F94AEB4680AD4AD48255071903000A43-->  <HQL><![CDATA[select p.id as finpaymentId, p.documentNo as documentNo,
gorkaion@9469
   116
       p.businessPartner.id as businessPartnerId, p.businessPartner.name as businessPartnerName,
mikel@10349
   117
       p.paymentDate as paymentDate, p.amount as amount,
mikel@10349
   118
       p.currency.iSOCode as currency, p.organization.name as organizationName
mikel@9348
   119
from FIN_Payment as p
mikel@9348
   120
where p.businessPartner.name like :businessPartnerName
mikel@9348
   121
      and p.documentNo like :documentNo
mikel@9348
   122
      and p.client.id = :client
mikel@9348
   123
      and p.processed = true
mikel@9348
   124
      and p.receipt = false
mikel@9348
   125
      and p.status = 'RPAE'
mikel@10349
   126
      and p.organization.id in (:organizationList)
mikel@10349
   127
      and p.organization.name like :organizationName
gorkaion@9705
   128
      and @optional_filters@
mikel@9348
   129
order by p.paymentDate]]></HQL>
mikel@9348
   130
<!--F94AEB4680AD4AD48255071903000A43--></OBCQL_WIDGET_QUERY>
mikel@9348
   131
harpreet@9091
   132
</data>