src-db/database/model/views/FIN_PAYMENT_SCHED_INV_V.xml
changeset 9910 6767429386d8
parent 9181 3f3ccc3292c9
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 FIN_PAYMENT_SCHED_INV_V">
     2   <database name="VIEW FIN_PAYMENT_SCHED_INV_V">
     3     <view name="FIN_PAYMENT_SCHED_INV_V"><![CDATA[SELECT ps.fin_payment_schedule_id AS fin_payment_sched_inv_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
     3     <view name="FIN_PAYMENT_SCHED_INV_V"><![CDATA[SELECT ps.fin_payment_schedule_id AS fin_payment_sched_inv_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_invoice_id IS NOT NULL AND psd.fin_payment_schedule_invoice = 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_invoice_id IS NOT NULL AND psd.fin_payment_schedule_invoice = ps.fin_payment_schedule_id) AS numberofpayments,  ps.fin_payment_priority_id, ps.update_payment_plan FROM fin_payment_schedule ps]]></view>
     4 FROM fin_payment p
       
     5 LEFT JOIN fin_payment_detail pd ON pd.fin_payment_id = p.fin_payment_id
       
     6 LEFT JOIN fin_payment_scheduledetail psd ON pd.fin_payment_detail_id = psd.fin_payment_detail_id
       
     7 WHERE ps.c_invoice_id IS NOT NULL AND psd.fin_payment_schedule_invoice = ps.fin_payment_schedule_id) AS lastpayment, (SELECT count(*) AS count
       
     8 FROM fin_payment_detail pd, fin_payment_scheduledetail psd
       
     9 WHERE pd.fin_payment_detail_id = psd.fin_payment_detail_id AND ps.c_invoice_id IS NOT NULL AND psd.fin_payment_schedule_invoice = ps.fin_payment_schedule_id) AS numberofpayments, ps.fin_payment_priority_id, ps.update_payment_plan
       
    10 FROM fin_payment_schedule ps]]></view>
       
    11   </database>
     4   </database>