Friday, 4 May 2018

Rounding of WHT in AP (ap_custom_withholding_pkg)

https://aporaclepayables.blogspot.com/2018/05/rounding-of-wht-in-ap.html

-- Begin Custom Code
BEGIN
      SELECT NVL(TR.TAX_RATE,0)
      INTO  p_tax_rate
      FROM AP_AWT_TAX_RATES_ALL TR
      WHERE ORG_ID = FND_PROFILE.VALUE('ORG_ID')
      AND TR.TAX_NAME = p_Tax_Name
      AND RATE_TYPE = 'STANDARD';
 EXCEPTION
   WHEN OTHERS THEN
   NULL;
 END;
   --INSERT INTO xxcs_wht_values
   --values(P_Invoice_exchange_rate, P_Withheld_Amount, p_tax_name,1, p_base_wt_amount,P_BaseCurrCode, p_currcode);
   --p_tax_rate := round(p_tax_rate,2);
 if p_tax_rate >= 1 then
  -- INSERT INTO xxcs_wht_values
  --values (p_tax_rate, P_Withheld_Amount, p_tax_name,2,p_base_wt_amount,P_BaseCurrCode, p_currcode);
  p_orig_inv_amount := (P_Withheld_Amount*100)/p_tax_rate;
--  p_tax_rate := round(p_tax_rate,0);
  P_Withheld_Amount := (p_orig_inv_amount*p_tax_rate)/100;
  P_Base_WT_amount  := P_Withheld_Amount;
  P_Withheld_Amount := ROUND(P_Withheld_Amount,0);
  P_Base_WT_amount  := ROUND(P_Base_WT_amount,0);

--  INSERT INTO xxcs_wht_values
  --values (p_tax_rate, P_Withheld_Amount, p_tax_name,3,p_base_wt_amount,P_BaseCurrCode, p_currcode);

elsif p_tax_rate < 1 and p_tax_rate !=0 then
  p_orig_inv_amount := (P_Withheld_Amount*100)/p_tax_rate;
  P_Withheld_Amount := (p_orig_inv_amount*p_tax_rate)/100;
  P_Base_WT_amount  := P_Withheld_Amount;
end if;

--    null;

-- End Custom Code

-----------------------------------------------------------------------------------------------------------------

For my Case

-- Begin Custom Code
     if nvl(P_Calling_parameter,'') ='HEADER' then
     if (P_Withheld_Amount >= 0 ) THEN
     P_Withheld_Amount := ROUND(P_Unrounded_WT_Amount);
     P_Base_WT_amount  := ROUND(P_Unrounded_WT_Amount);
     ELSE
     P_Withheld_Amount := ROUND(P_Unrounded_WT_Amount);
     P_Base_WT_amount  := ROUND(P_Unrounded_WT_Amount);
     END IF;
  end if;
-- End Custom Code

How to End Date Bank Account?

https://aporaclepayables.blogspot.com/2018/05/how-to-end-date-bank-account.html

To End Date or Inactivate Bank account, first Bank Account use must be end dated before bank account is end dated. Please follow steps as follows:

Step 1: End Date Bank Account Use
 1). Select you Bank Account
2). Click Update
3). Click Account Access
4). Click Access
5). Update Use End Date, This end date to determine when the bank account use is considered inactive.
Repeat steps for all other Use Organizations
Save and Next and Finish.
Once all the Bank account Use Organization is End Dated, then :

Step 2: End Date Bank Account: 
1). Select you Bank Account
2). Click Update
3). Click to Go to Account Information
4). Enter start and end dates or only end date to determine when the bank account is considered inactive.
Save and Next and Finish.