Wednesday 26 February 2014

AutoInvoice Import Error : Tax lines with the same Tax Regime and Tax cannot be allocated to the same transaction line more than once.

When importing invoices via the AR Interfaces , in cases where 1 invoice line is associated to multiple tax lines Oracle can throw an error : Tax lines with the same Tax Regime and Tax cannot be allocated to the same transaction line more than once if the TAX setup is incorrect.

For 1 invoice lines we will be having 2 or more tax lines each having its own tax_rate_codes.

For each of these tax rates we cannot have the same combination of regime and Tax. Multiple tax allocations is only possible if tax lines belong to combination of different regimes and tax.

In case of such an issue the TAX setups need to be checked and corrective measures need to be taken

AutoInvoice Error : When the receipt method is of type Automatic, you must either supply a valid bank account or ensure that a primary bank account for the currency code of the transaction has been set up for the Bill To customer

When importing an invoice via the AutoInvoice Import Program we can get an error message : When the receipt method is of type Automatic, you must either supply a valid bank account or ensure that a primary bank account for the currency code of the transaction has been set up for the Bill To customer

This error occurs when the Invoice line in AR Interface has a receipt method id , but on the Customer Bill TO for which we wish to import the record there is no active bank record present.
If an Automatic receipt method is specified then the Customer BILL TO  needs to have an active bank account else this error will be thrown.

SQL :
select hcsu.location,ieb.bank_account_name,ieb.bank_account_num,hps.party_site_number
from apps.hz_cust_site_uses_all hcsu,
     apps.iby_external_payers_all iep,
     apps.iby_pmt_instr_uses_all pmt,
     apps.iby_ext_bank_accounts ieb,
     apps.hz_cust_acct_sites_All hcas,
     apps.hz_party_sites hps
where hcsu.site_use_id = iep.ACCT_SITE_USE_ID
and hcsu.org_id = iep.org_id
and iep.ext_payer_id = pmt.ext_pmt_party_id
and pmt.instrument_id = ieb.ext_bank_account_id
and hcsu.site_use_code = 'BILL_TO'
and hcsu.cust_acct_site_id = hcas.cust_Acct_site_id
and hcas.party_site_id = hps.party_site_id
and hcsu.org_id = hcas.org_id
and pmt.payment_function = 'CUSTOMER_PAYMENT'
order by 1

Date Issue in Oracle YY vs RR format

During my last data migration for customer banks we found an issue in the data post migration. The Customer Bank accounts got created with an incorrect start date.
For Eg : if the start date was 1-Jan-1970 , the bank account got  created with a start date 1-Jan-2070.

The reason for this was the date format being used :

We had used : 
TO_DATE ('01-JAN-70', 'DD/MON/YY') -->  this converts the date to 1-Jan-2070

The correct way to include the dates will be to use the typecast : TO_DATE ('01-JAN-70', 'DD/MON/RR')
 The RR format works as expected. For the dates between 00-49 , Oracle will translate them to year 2000 to 2049. for the values 50-99 Oracle will translate them to 1950 to 1999.


Depending on the business need the respective typecast can be used.

The basic difference between the YY and RR date formats is as  below :
In 'YY' format, a 2-digit year is assumed to be in the 100 consecutive years starting with the most recent xx00 and ending with the next xx99.
In 'RR' format, a 2-digit year is assumed to be in the 100 consecutive years starting with the most recent xx50 and ending with the next xx49. That is, the window of possible dates is shifted by 50 years.