src-db/database/model/views/C_INVOICE_WEEK.xml
changeset 9910 6767429386d8
parent 7031 2aac4501bbd5
child 9911 444911e2b851
equal deleted inserted replaced
9909:56a1306e07a0 9910:6767429386d8
     1 <?xml version="1.0"?>
     1 <?xml version="1.0"?>
     2   <database name="VIEW C_INVOICE_WEEK">
     2   <database name="VIEW C_INVOICE_WEEK">
     3     <view name="C_INVOICE_WEEK"><![CDATA[SELECT c_invoiceline_v2.ad_client_id, c_invoiceline_v2.ad_org_id, c_invoiceline_v2.salesrep_id, TRUNC(c_invoiceline_v2.dateinvoiced, 'DY') AS dateinvoiced, sum(c_invoiceline_v2.linenetamt) AS linenetamt, sum(c_invoiceline_v2.linelistamt) AS linelistamt, sum(c_invoiceline_v2.linelimitamt) AS linelimitamt, sum(c_invoiceline_v2.linediscountamt) AS linediscountamt, 
     3     <view name="C_INVOICE_WEEK"><![CDATA[SELECT c_invoiceline_v2.ad_client_id, c_invoiceline_v2.ad_org_id,  c_invoiceline_v2.salesrep_id,  TRUNC(c_invoiceline_v2.dateinvoiced, 'DY') AS dateinvoiced,  sum(c_invoiceline_v2.linenetamt) AS linenetamt,  sum(c_invoiceline_v2.linelistamt) AS linelistamt,  sum(c_invoiceline_v2.linelimitamt) AS linelimitamt,  sum(c_invoiceline_v2.linediscountamt) AS linediscountamt,  CASE sum(c_invoiceline_v2.linelistamt) WHEN 0 THEN 0 ELSE round((sum(c_invoiceline_v2.linelistamt) - sum(c_invoiceline_v2.linenetamt)) / sum(c_invoiceline_v2.linelistamt) * 100, 2) END AS linediscount,  sum(c_invoiceline_v2.lineoverlimitamt) AS lineoverlimitamt,  CASE sum(c_invoiceline_v2.linenetamt) WHEN 0 THEN 0 ELSE 100 - round((sum(c_invoiceline_v2.linenetamt) - sum(c_invoiceline_v2.lineoverlimitamt)) / sum(c_invoiceline_v2.linenetamt) * 100, 2) END AS lineoverlimit FROM c_invoiceline_v2 GROUP BY c_invoiceline_v2.ad_client_id, c_invoiceline_v2.ad_org_id, c_invoiceline_v2.salesrep_id, TRUNC(c_invoiceline_v2.dateinvoiced, 'DY')]]></view>
     4 CASE sum(c_invoiceline_v2.linelistamt)
       
     5 WHEN 0 THEN 0
       
     6 ELSE round((sum(c_invoiceline_v2.linelistamt) - sum(c_invoiceline_v2.linenetamt)) / sum(c_invoiceline_v2.linelistamt) * 100, 2)
       
     7 END AS linediscount, sum(c_invoiceline_v2.lineoverlimitamt) AS lineoverlimitamt, 
       
     8 CASE sum(c_invoiceline_v2.linenetamt)
       
     9 WHEN 0 THEN 0
       
    10 ELSE 100 - round((sum(c_invoiceline_v2.linenetamt) - sum(c_invoiceline_v2.lineoverlimitamt)) / sum(c_invoiceline_v2.linenetamt) * 100, 2)
       
    11 END AS lineoverlimit
       
    12 FROM c_invoiceline_v2
       
    13 GROUP BY c_invoiceline_v2.ad_client_id, c_invoiceline_v2.ad_org_id, c_invoiceline_v2.salesrep_id, TRUNC(c_invoiceline_v2.dateinvoiced, 'DY')]]></view>
       
    14   </database>
     4   </database>