src-db/database/model/views/RV_C_INVOICE.xml
author Antonio Moreno <antonio.moreno@openbravo.com>
Wed, 23 Apr 2008 17:34:12 +0000
changeset 756 ae11e4610537
parent 737 database/model/views/RV_C_INVOICE.xml@935386ff0f30
child 776 d1226b967a28
permissions -rw-r--r--
Moved database folder to src-db folder
adrian@94
     1
<?xml version="1.0"?>
adrian@94
     2
  <database name="VIEW RV_C_INVOICE">
antonio@737
     3
    <view name="RV_C_INVOICE"><![CDATA[SELECT i.c_invoice_id, i.ad_client_id, i.ad_org_id, i.isactive, i.created, i.createdby, i.updated, i.updatedby, i.issotrx, i.documentno, i.docstatus, i.docaction, i.isprinted, i.isdiscountprinted, i.processing, i.processed, i.istransferred, i.ispaid, i.c_doctype_id, i.c_doctypetarget_id, i.c_order_id, i.description, i.isapproved, i.salesrep_id, i.dateinvoiced, i.dateprinted, i.dateacct, i.c_bpartner_id, i.c_bpartner_location_id, i.ad_user_id, b.c_bp_group_id, i.poreference, i.dateordered, i.c_currency_id, i.paymentrule, i.c_paymentterm_id, i.m_pricelist_id, i.c_campaign_id, i.c_project_id, i.c_activity_id, i.c_charge_id,
gorka@396
     4
        CASE substr(d.docbasetype, 3)
gorka@396
     5
            WHEN 'C' THEN i.chargeamt * -1
gorka@396
     6
            ELSE i.chargeamt
antonio@737
     7
        END AS chargeamt,
gorka@396
     8
        CASE substr(d.docbasetype, 3)
gorka@396
     9
            WHEN 'C' THEN i.totallines * -1
gorka@396
    10
            ELSE i.totallines
antonio@737
    11
        END AS totallines,
gorka@396
    12
        CASE substr(d.docbasetype, 3)
gorka@396
    13
            WHEN 'C' THEN i.grandtotal * -1
gorka@396
    14
            ELSE i.grandtotal
antonio@737
    15
        END AS grandtotal,
gorka@396
    16
        CASE substr(d.docbasetype, 3)
gorka@396
    17
            WHEN 'C' THEN -1
gorka@396
    18
            ELSE 1
gorka@396
    19
        END AS multiplier
gorka@396
    20
   FROM c_invoice i, c_doctype d, c_bpartner b
gorka@396
    21
  WHERE i.c_doctype_id = d.c_doctype_id AND i.c_bpartner_id = b.c_bpartner_id]]></view>
adrian@94
    22
  </database>