src-db/database/model/views/FIN_PAYMENT_PROP_DETAIL_V.xml
author Eduardo Argal Guibert <eduardo.argal@openbravo.com>
Sat, 03 Apr 2010 15:59:56 +0200
changeset 6917 20af736f8ca9
parent 6912 38c773f35773
child 6920 d41e52c3f49a
permissions -rw-r--r--
wrong views posstgre 8.4
gorkaion@6852
     1
<?xml version="1.0"?>
gorkaion@6852
     2
  <database name="VIEW FIN_PAYMENT_PROP_DETAIL_V">
eduardo@6917
     3
    <view name="FIN_PAYMENT_PROP_DETAIL_V"><![CDATA[SELECT ppd.fin_payment_prop_detail_id AS fin_payment_prop_detail_v_id, ppd.ad_client_id, ppd.ad_org_id, ppd.isactive, ppd.created, ppd.createdby, ppd.updated, ppd.updatedby, psd.fin_payment_scheduledetail_id, ppd.fin_payment_proposal_id, i.documentno AS invoiceno, o.documentno AS orderno, p.documentno AS paymentno, pd.fin_payment_id, COALESCE(psi.duedate, pso.duedate) AS duedate, COALESCE(i.grandtotal, o.grandtotal) AS invoicedamt, COALESCE(psi.expected, pso.expected) AS expected, ppd.amount AS paidamt, COALESCE(p.c_bpartner_id, i.c_bpartner_id, o.c_bpartner_id) as c_bpartner_id, ppd.writeoffamt
gorkaion@6852
     4
   FROM fin_payment_prop_detail ppd, fin_payment_scheduledetail psd
gorkaion@6852
     5
   LEFT JOIN fin_payment_sched_inv_v psi ON psd.fin_payment_schedule_invoice = psi.fin_payment_sched_inv_v_id
gorkaion@6852
     6
   LEFT JOIN c_invoice i ON psi.c_invoice_id = i.c_invoice_id
gorkaion@6852
     7
   LEFT JOIN fin_payment_sched_ord_v pso ON psd.fin_payment_schedule_order = pso.fin_payment_sched_ord_v_id
gorkaion@6852
     8
   LEFT JOIN c_order o ON pso.c_order_id = o.c_order_id
gorkaion@6852
     9
   LEFT JOIN fin_payment_detail pd ON psd.fin_payment_detail_id = pd.fin_payment_detail_id
gorkaion@6852
    10
   LEFT JOIN fin_payment p ON pd.fin_payment_id = p.fin_payment_id
gorkaion@6857
    11
  WHERE ppd.fin_payment_scheduledetail_id = psd.fin_payment_scheduledetail_id]]></view>
gorkaion@6852
    12
  </database>