src-db/database/model/views/FIN_PAYMENT_SCHED_ORD_V.xml
author Antonio Moreno <antonio.moreno@openbravo.com>
Mon, 04 Feb 2013 09:27:53 +0100
changeset 9910 6767429386d8
parent 9181 3f3ccc3292c9
child 9911 444911e2b851
permissions -rw-r--r--
Changes required to support PostgreSQL 9.2
gorkaion@6824
     1
<?xml version="1.0"?>
gorkaion@6824
     2
  <database name="VIEW FIN_PAYMENT_SCHED_ORD_V">
antonio@9910
     3
    <view name="FIN_PAYMENT_SCHED_ORD_V"><![CDATA[SELECT ps.fin_payment_schedule_id AS fin_payment_sched_ord_v_id,  ps.ad_client_id, ps.ad_org_id, ps.isactive, ps.created, ps.createdby,  ps.updated, ps.updatedby, ps.c_invoice_id, ps.c_order_id, ps.duedate,  ps.fin_paymentmethod_id, ps.amount AS expected, ps.paidamt AS received,  ps.outstandingamt AS outstanding, ps.c_currency_id,  (SELECT max(p.paymentdate) AS max FROM fin_payment p LEFT JOIN fin_payment_detail pd ON pd.fin_payment_id = p.fin_payment_id LEFT JOIN fin_payment_scheduledetail psd ON pd.fin_payment_detail_id = psd.fin_payment_detail_id WHERE ps.c_order_id IS NOT NULL AND psd.fin_payment_schedule_order = ps.fin_payment_schedule_id) AS lastpayment,  (SELECT count(*) AS count FROM fin_payment_detail pd, fin_payment_scheduledetail psd WHERE pd.fin_payment_detail_id = psd.fin_payment_detail_id AND ps.c_order_id IS NOT NULL AND psd.fin_payment_schedule_order = ps.fin_payment_schedule_id) AS numberofpayments,  ps.fin_payment_priority_id, ps.update_payment_plan FROM fin_payment_schedule ps]]></view>
gorkaion@6824
     4
  </database>