2661:
2662: debug_info := 'CLOSE CURSOR c_get_awt_period';
2663: CLOSE c_get_awt_period;
2664:
2665: debug_info := 'Update ap_awt_buckets';
2666: UPDATE ap_awt_buckets_all
2667: SET gross_amount_to_date = gross_amount_to_date -
2668: NVL(rec_temp.gross_amount,0)
2669: , withheld_amount_to_date = withheld_amount_to_date -
2662: debug_info := 'CLOSE CURSOR c_get_awt_period';
2663: CLOSE c_get_awt_period;
2664:
2665: debug_info := 'Update ap_awt_buckets';
2666: UPDATE ap_awt_buckets_all
2667: SET gross_amount_to_date = gross_amount_to_date -
2668: NVL(rec_temp.gross_amount,0)
2669: , withheld_amount_to_date = withheld_amount_to_date -
2670: NVL(rec_temp.withholding_amount,0)
3569: Period IN VARCHAR2,
3570: TaxCode IN VARCHAR2) IS
3571: SELECT gross_amount_to_date,
3572: withheld_amount_to_date
3573: FROM ap_awt_buckets
3574: WHERE vendor_id = VendorId
3575: AND period_name = Period
3576: AND tax_name = TaxCode
3577: FOR UPDATE;
3575: AND period_name = Period
3576: AND tax_name = TaxCode
3577: FOR UPDATE;
3578:
3579: gross_amt_to_date ap_awt_buckets.gross_amount_to_date%TYPE;
3580: withheld_amt_to_date ap_awt_buckets.withheld_amount_to_date%TYPE;
3581:
3582: DBG_Loc VARCHAR2(30) := 'Update_Bucket';
3583: NOTHING_TO_DO exception;
3576: AND tax_name = TaxCode
3577: FOR UPDATE;
3578:
3579: gross_amt_to_date ap_awt_buckets.gross_amount_to_date%TYPE;
3580: withheld_amt_to_date ap_awt_buckets.withheld_amount_to_date%TYPE;
3581:
3582: DBG_Loc VARCHAR2(30) := 'Update_Bucket';
3583: NOTHING_TO_DO exception;
3584: BEGIN
3613:
3614: IF (c_awt_bucket%FOUND) THEN
3615: debug_info := 'Update the AWT bucket';
3616:
3617: UPDATE ap_awt_buckets
3618: SET gross_amount_to_date = (gross_amt_to_date -
3619: ap_utilities_pkg.ap_round_currency(
3620: rec_awt_dists.awt_gross_amount*
3621: NVL(l_invoice_exchange_rate,1),