DBA Data[Home] [Help]

APPS.PA_CMT_UTILS dependencies on AP_PAYMENT_HIST_DISTS

Line 370: ap_payment_hist_dists paydist,

366: select count(*),
367: SUM(dist.pa_quantity*(SUM(nvl(paydist.paid_base_amount,paydist.amount))/(nvl(dist.base_amount,dist.amount))))
368: into l_inv_num, l_tot_inv_qty
369: from ap_invoice_distributions_all dist,
370: ap_payment_hist_dists paydist,
371: ap_invoices_all inv
372: where dist.po_distribution_id = p_po_dist
373: and dist.charge_applicable_to_dist_id is null --R12 change
374: and dist.related_id is null -- R12 change

Line 381: -- ap_payment_hist_dists has discounts and cash records. we need to include quantity

377: and inv.invoice_id = dist.invoice_id
378: and dist.invoice_distribution_id = paydist.invoice_distribution_id
379: and NVL(inv.source,'X') <> 'PPA'
380: -- 4905546
381: -- ap_payment_hist_dists has discounts and cash records. we need to include quantity
382: -- only for the payment otherwise quantity would double because of discount.
383: -- adding the criteria to filter discounts for payment.
384: and paydist.pay_dist_lookup_code = 'CASH'
385: group by dist.invoice_distribution_id,NVL(dist.base_amount,dist.amount), dist.pa_quantity;

Line 604: -- ap_payment_hist_dists has discounts and cash records. we need to include quantity

600: --l_discount_start_date := nvl(fnd_profile.value_specific('PA_DISC_PULL_START_DATE'),'2051/01/01') ; /* Bug 4474213 */
601: --l_system_discount := fnd_date.canonical_to_date(l_discount_start_date);
602:
603: -- 4905546
604: -- ap_payment_hist_dists has discounts and cash records. we need to include quantity
605: -- only for the payment otherwise quantity would double because of discount.
606: -- adding the criteria to filter discounts for payment.
607:
608:

Line 618: from ap_payment_hist_dists paydist

614: select sum( decode(p_denom_amt_flag, /* Bug 4015448. Added Dummy Sum */
615: 'Y', paydist.amount,
616: 'N', nvl(paydist.paid_base_amount,paydist.amount)))
617: into l_pay_amt
618: from ap_payment_hist_dists paydist
619: where paydist.invoice_distribution_id = p_inv_dist_id
620: and NVL(paydist.pa_addition_flag,'N') <> 'N'
621: and paydist.pay_dist_lookup_code = 'CASH';
622:

Line 635: from ap_payment_hist_dists paydist1,

631: select sum( decode(p_denom_amt_flag, /* Bug 4015448. Added Dummy Sum */
632: 'Y', paydist1.amount,
633: 'N', nvl(paydist1.paid_base_amount,paydist1.amount)))
634: into l_disc_amt
635: from ap_payment_hist_dists paydist1,
636: ap_payment_hist_dists paydist2
637: where paydist1.invoice_distribution_id = p_inv_dist_id
638: and paydist2.invoice_distribution_id = p_inv_dist_id
639: and paydist2.invoice_distribution_id = paydist1.invoice_distribution_id

Line 636: ap_payment_hist_dists paydist2

632: 'Y', paydist1.amount,
633: 'N', nvl(paydist1.paid_base_amount,paydist1.amount)))
634: into l_disc_amt
635: from ap_payment_hist_dists paydist1,
636: ap_payment_hist_dists paydist2
637: where paydist1.invoice_distribution_id = p_inv_dist_id
638: and paydist2.invoice_distribution_id = p_inv_dist_id
639: and paydist2.invoice_distribution_id = paydist1.invoice_distribution_id
640: and paydist2.payment_history_id = paydist1.payment_history_id

Line 718: -- ap_payment_hist_dists has discounts and cash records. we need to include quantity

714: --l_discount_start_date := nvl(fnd_profile.value_specific('PA_DISC_PULL_START_DATE'),'2051/01/01') ; /* Bug 4474213 */
715: --l_system_discount := fnd_date.canonical_to_date(l_discount_start_date);
716:
717: -- 4905546
718: -- ap_payment_hist_dists has discounts and cash records. we need to include quantity
719: -- only for the payment otherwise quantity would double because of discount.
720: -- adding the criteria to filter discounts for payment.
721: --
722: -- Bug : 4962731

Line 730: from ap_payment_hist_dists paydist

726: select sum( decode(p_denom_amt_flag, /* Bug 4015448. Added Dummy Sum */
727: 'Y', paydist.amount,
728: 'N', nvl(paydist.paid_base_amount,paydist.amount)))
729: into l_pay_amt
730: from ap_payment_hist_dists paydist
731: where paydist.invoice_distribution_id = p_inv_dist_id
732: and paydist.pay_dist_lookup_code = 'CASH'
733: and NVL(paydist.pa_addition_flag,'N') <> 'N' ;
734:

Line 749: from ap_payment_hist_dists paydist1,

745: select sum( decode(p_denom_amt_flag, /* Bug 4015448. Added Dummy Sum */
746: 'Y', paydist1.amount,
747: 'N', nvl(paydist1.paid_base_amount,paydist1.amount)))
748: into l_disc_amt
749: from ap_payment_hist_dists paydist1,
750: ap_payment_hist_dists paydist2
751: where paydist1.invoice_distribution_id = p_inv_dist_id
752: and paydist2.invoice_distribution_id = p_inv_dist_id
753: and paydist2.invoice_distribution_id = paydist1.invoice_distribution_id

Line 750: ap_payment_hist_dists paydist2

746: 'Y', paydist1.amount,
747: 'N', nvl(paydist1.paid_base_amount,paydist1.amount)))
748: into l_disc_amt
749: from ap_payment_hist_dists paydist1,
750: ap_payment_hist_dists paydist2
751: where paydist1.invoice_distribution_id = p_inv_dist_id
752: and paydist2.invoice_distribution_id = p_inv_dist_id
753: and paydist2.invoice_distribution_id = paydist1.invoice_distribution_id
754: and paydist2.payment_history_id = paydist1.payment_history_id