src-db/database/model/views/RV_C_INVOICE.xml
changeset 1370 5d68bf7eedb9
parent 1359 108ca01497b9
child 1605 8a0fe0193bef
equal deleted inserted replaced
1369:6a4059ae058f 1370:5d68bf7eedb9
     1 <?xml version="1.0"?>
     1 <?xml version="1.0"?>
     2   <database name="VIEW RV_C_INVOICE">
     2   <database name="VIEW RV_C_INVOICE">
     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.c_doctype_id, i.c_doctypetarget_id, i.c_order_id, i.description, 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, 
     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.c_doctype_id, i.c_doctypetarget_id, i.c_order_id, i.description, 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, 
     4         CASE substr(d.docbasetype, 3)
     4         CASE substr(d.docbasetype, 3)
     5             WHEN 'C' THEN i.chargeamt * -1
     5             WHEN 'C' THEN i.chargeamt * (-1)
     6             ELSE i.chargeamt
     6             ELSE i.chargeamt
     7         END AS chargeamt, 
     7         END AS chargeamt, 
     8         CASE substr(d.docbasetype, 3)
     8         CASE substr(d.docbasetype, 3)
     9             WHEN 'C' THEN i.totallines * -1
     9             WHEN 'C' THEN i.totallines * (-1)
    10             ELSE i.totallines
    10             ELSE i.totallines
    11         END AS totallines, 
    11         END AS totallines, 
    12         CASE substr(d.docbasetype, 3)
    12         CASE substr(d.docbasetype, 3)
    13             WHEN 'C' THEN i.grandtotal * -1
    13             WHEN 'C' THEN i.grandtotal * (-1)
    14             ELSE i.grandtotal
    14             ELSE i.grandtotal
    15         END AS grandtotal, 
    15         END AS grandtotal, 
    16         CASE substr(d.docbasetype, 3)
    16         CASE substr(d.docbasetype, 3)
    17             WHEN 'C' THEN -1
    17             WHEN 'C' THEN (-1)
    18             ELSE 1
    18             ELSE 1
    19         END AS multiplier
    19         END AS multiplier
    20    FROM c_invoice i, c_doctype d, c_bpartner b
    20    FROM c_invoice i, c_doctype d, c_bpartner b
    21   WHERE i.c_doctype_id = d.c_doctype_id AND i.c_bpartner_id = b.c_bpartner_id]]></view>
    21   WHERE i.c_doctype_id = d.c_doctype_id AND i.c_bpartner_id = b.c_bpartner_id]]></view>
    22   </database>
    22   </database>