src-db/database/model/views/C_DEBT_PAYMENT_V.xml
changeset 9910 6767429386d8
parent 7031 2aac4501bbd5
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 C_DEBT_PAYMENT_V">
     2   <database name="VIEW C_DEBT_PAYMENT_V">
     3     <view name="C_DEBT_PAYMENT_V"><![CDATA[SELECT c_debt_payment.c_debt_payment_id, c_debt_payment.ad_client_id, c_debt_payment.ad_org_id, c_debt_payment.isactive, c_debt_payment.created, c_debt_payment.createdby, c_debt_payment.updated, c_debt_payment.updatedby, c_debt_payment.isreceipt, c_debt_payment.c_settlement_cancel_id, c_debt_payment.c_settlement_generate_id, c_debt_payment.description, c_debt_payment.c_invoice_id, c_debt_payment.c_bpartner_id, c_debt_payment.c_currency_id, c_debt_payment.c_cashline_id, c_debt_payment.c_bankaccount_id, c_debt_payment.c_cashbook_id, c_debt_payment.paymentrule, c_debt_payment.ispaid, c_debt_payment.dateplanned, c_debt_payment.ismanual, c_debt_payment.isvalid, c_debt_payment.c_bankstatementline_id, c_debt_payment.changesettlementcancel, c_debt_payment.cancel_processed, c_debt_payment.generate_processed, c_debt_payment.c_withholding_id, c_debt_payment.withholdingamount, 
     3     <view name="C_DEBT_PAYMENT_V"><![CDATA[SELECT c_debt_payment.c_debt_payment_id, c_debt_payment.ad_client_id,  c_debt_payment.ad_org_id, c_debt_payment.isactive, c_debt_payment.created,  c_debt_payment.createdby, c_debt_payment.updated, c_debt_payment.updatedby,  c_debt_payment.isreceipt, c_debt_payment.c_settlement_cancel_id,  c_debt_payment.c_settlement_generate_id, c_debt_payment.description,  c_debt_payment.c_invoice_id, c_debt_payment.c_bpartner_id,  c_debt_payment.c_currency_id, c_debt_payment.c_cashline_id,  c_debt_payment.c_bankaccount_id, c_debt_payment.c_cashbook_id,  c_debt_payment.paymentrule, c_debt_payment.ispaid,  c_debt_payment.dateplanned, c_debt_payment.ismanual, c_debt_payment.isvalid,  c_debt_payment.c_bankstatementline_id,  c_debt_payment.changesettlementcancel, c_debt_payment.cancel_processed,  c_debt_payment.generate_processed, c_debt_payment.c_withholding_id,  c_debt_payment.withholdingamount,  CASE c_debt_payment.isreceipt WHEN 'Y' THEN c_debt_payment.amount ELSE c_debt_payment.amount * (-1) END AS amount,  CASE c_debt_payment.isreceipt WHEN 'Y' THEN c_debt_payment.writeoffamt ELSE c_debt_payment.writeoffamt * (-1) END AS writeoffamt,  CASE c_debt_payment.isreceipt WHEN 'Y' THEN 1 ELSE (-1) END AS multiplierap,  CASE WHEN c_debt_payment.c_invoice_id IS NOT NULL THEN c_invoice.dateinvoiced WHEN c_debt_payment.c_settlement_generate_id IS NOT NULL THEN c_settlement.datetrx ELSE to_date(now()) END AS docdate,  c_debt_payment.glitemamt, c_debt_payment.c_order_id, c_debt_payment.status FROM c_debt_payment LEFT JOIN c_invoice ON c_debt_payment.c_invoice_id = c_invoice.c_invoice_id LEFT JOIN c_settlement ON c_debt_payment.c_settlement_generate_id = c_settlement.c_settlement_id]]></view>
     4 CASE c_debt_payment.isreceipt
       
     5 WHEN 'Y' THEN c_debt_payment.amount
       
     6 ELSE c_debt_payment.amount * (-1)
       
     7 END AS amount, 
       
     8 CASE c_debt_payment.isreceipt
       
     9 WHEN 'Y' THEN c_debt_payment.writeoffamt
       
    10 ELSE c_debt_payment.writeoffamt * (-1)
       
    11 END AS writeoffamt, 
       
    12 CASE c_debt_payment.isreceipt
       
    13 WHEN 'Y' THEN 1
       
    14 ELSE (-1)
       
    15 END AS multiplierap, 
       
    16 CASE
       
    17 WHEN c_debt_payment.c_invoice_id IS NOT NULL THEN c_invoice.dateinvoiced
       
    18 WHEN c_debt_payment.c_settlement_generate_id IS NOT NULL THEN c_settlement.datetrx
       
    19 ELSE to_date(now())
       
    20 END AS docdate, c_debt_payment.glitemamt, c_debt_payment.c_order_id, c_debt_payment.status
       
    21 FROM c_debt_payment
       
    22 LEFT JOIN c_invoice ON c_debt_payment.c_invoice_id = c_invoice.c_invoice_id
       
    23 LEFT JOIN c_settlement ON c_debt_payment.c_settlement_generate_id = c_settlement.c_settlement_id]]></view>
       
    24   </database>
     4   </database>