DBA Data[Home] [Help]

APPS.PA_CMT_UTILS dependencies on AP_PAYMENT_HIST_DISTS

Line 387: ap_payment_hist_dists paydist,

383: select count(*),
384: SUM(dist.pa_quantity*(SUM(nvl(paydist.paid_base_amount,paydist.amount))/(nvl(dist.base_amount,dist.amount))))
385: into l_inv_num, l_tot_inv_qty
386: from ap_invoice_distributions_all dist,
387: ap_payment_hist_dists paydist,
388: ap_invoices_all inv
389: where dist.po_distribution_id = p_po_dist
390: and dist.charge_applicable_to_dist_id is null --R12 change
391: and dist.related_id is null -- R12 change

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

394: and inv.invoice_id = dist.invoice_id
395: and dist.invoice_distribution_id = paydist.invoice_distribution_id
396: and NVL(inv.source,'X') <> 'PPA'
397: -- 4905546
398: -- ap_payment_hist_dists has discounts and cash records. we need to include quantity
399: -- only for the payment otherwise quantity would double because of discount.
400: -- adding the criteria to filter discounts for payment.
401: and paydist.pay_dist_lookup_code = 'CASH'
402: group by dist.invoice_distribution_id,NVL(dist.base_amount,dist.amount), dist.pa_quantity;

Line 409: ap_payment_hist_dists paydist,

405: select count(*),
406: SUM(sat.pa_quantity*(SUM(nvl(paydist.paid_base_amount,paydist.amount))/(nvl(sat.base_amount,sat.amount))))
407: into l_inv_num2, l_tot_inv_qty2
408: from ap_self_assessed_tax_dist_all sat,
409: ap_payment_hist_dists paydist,
410: ap_invoices_all inv
411: where sat.po_distribution_id = p_po_dist
412: and sat.charge_applicable_to_dist_id is null
413: and sat.related_id is null

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

698: --l_discount_start_date := nvl(fnd_profile.value_specific('PA_DISC_PULL_START_DATE'),'2051/01/01') ; /* Bug 4474213 */
699: --l_system_discount := fnd_date.canonical_to_date(l_discount_start_date);
700:
701: -- 4905546
702: -- ap_payment_hist_dists has discounts and cash records. we need to include quantity
703: -- only for the payment otherwise quantity would double because of discount.
704: -- adding the criteria to filter discounts for payment.
705:
706:

Line 716: from ap_payment_hist_dists paydist

712: select sum( decode(p_denom_amt_flag, /* Bug 4015448. Added Dummy Sum */
713: 'Y', paydist.amount,
714: 'N', nvl(paydist.paid_base_amount,paydist.amount)))
715: into l_pay_amt
716: from ap_payment_hist_dists paydist
717: where paydist.invoice_distribution_id = p_inv_dist_id
718: and NVL(paydist.pa_addition_flag,'N') <> 'N'
719: and paydist.pay_dist_lookup_code = 'CASH';
720:

Line 733: from ap_payment_hist_dists paydist1,

729: select sum( decode(p_denom_amt_flag, /* Bug 4015448. Added Dummy Sum */
730: 'Y', paydist1.amount,
731: 'N', nvl(paydist1.paid_base_amount,paydist1.amount)))
732: into l_disc_amt
733: from ap_payment_hist_dists paydist1,
734: ap_payment_hist_dists paydist2
735: where paydist1.invoice_distribution_id = p_inv_dist_id
736: and paydist2.invoice_distribution_id = p_inv_dist_id
737: and paydist2.invoice_distribution_id = paydist1.invoice_distribution_id

Line 734: ap_payment_hist_dists paydist2

730: 'Y', paydist1.amount,
731: 'N', nvl(paydist1.paid_base_amount,paydist1.amount)))
732: into l_disc_amt
733: from ap_payment_hist_dists paydist1,
734: ap_payment_hist_dists paydist2
735: where paydist1.invoice_distribution_id = p_inv_dist_id
736: and paydist2.invoice_distribution_id = p_inv_dist_id
737: and paydist2.invoice_distribution_id = paydist1.invoice_distribution_id
738: and paydist2.payment_history_id = paydist1.payment_history_id

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

825: --l_discount_start_date := nvl(fnd_profile.value_specific('PA_DISC_PULL_START_DATE'),'2051/01/01') ; /* Bug 4474213 */
826: --l_system_discount := fnd_date.canonical_to_date(l_discount_start_date);
827:
828: -- 4905546
829: -- ap_payment_hist_dists has discounts and cash records. we need to include quantity
830: -- only for the payment otherwise quantity would double because of discount.
831: -- adding the criteria to filter discounts for payment.
832: --
833: -- Bug : 4962731

Line 841: from ap_payment_hist_dists paydist

837: select sum( decode(p_denom_amt_flag, /* Bug 4015448. Added Dummy Sum */
838: 'Y', paydist.amount,
839: 'N', nvl(paydist.paid_base_amount,paydist.amount)))
840: into l_pay_amt
841: from ap_payment_hist_dists paydist
842: where paydist.invoice_distribution_id = p_inv_dist_id
843: and paydist.pay_dist_lookup_code = 'CASH'
844: and NVL(paydist.pa_addition_flag,'N') <> 'N' ;
845:

Line 860: from ap_payment_hist_dists paydist1,

856: select sum( decode(p_denom_amt_flag, /* Bug 4015448. Added Dummy Sum */
857: 'Y', paydist1.amount,
858: 'N', nvl(paydist1.paid_base_amount,paydist1.amount)))
859: into l_disc_amt
860: from ap_payment_hist_dists paydist1,
861: ap_payment_hist_dists paydist2
862: where paydist1.invoice_distribution_id = p_inv_dist_id
863: and paydist2.invoice_distribution_id = p_inv_dist_id
864: and paydist2.invoice_distribution_id = paydist1.invoice_distribution_id

Line 861: ap_payment_hist_dists paydist2

857: 'Y', paydist1.amount,
858: 'N', nvl(paydist1.paid_base_amount,paydist1.amount)))
859: into l_disc_amt
860: from ap_payment_hist_dists paydist1,
861: ap_payment_hist_dists paydist2
862: where paydist1.invoice_distribution_id = p_inv_dist_id
863: and paydist2.invoice_distribution_id = p_inv_dist_id
864: and paydist2.invoice_distribution_id = paydist1.invoice_distribution_id
865: and paydist2.payment_history_id = paydist1.payment_history_id