About Me

My photo
Oracle Apps - Techno Functional consultant
Showing posts with label BANKS. Show all posts
Showing posts with label BANKS. Show all posts

Thursday, March 22

BANK RECONCILIATION STATEMENTS


Reconciling Bank Statements Automatically

You can use the Auto Reconciliation program to automatically reconcile any bank statement in Oracle Cash Management. There are three versions of the program:
Auto Reconciliation: Use this program to reconcile any bank statement that has already been entered in Cash Management. 
Bank Statement Import: Use this program to import an electronic bank statement after loading the bank statement file into the Bank Statement Open Interface tables.
Bank Statement Import and Auto Reconciliation:Use this program to import and reconcile a bank statement in the same run.
You can run these programs from the Submit Request window, the Reconcile Bank Statements window, or the Bank Statement Interface window. You can also import and automatically reconcile a bank statement from the Bank Statement Loader program, by using the option of Load, Import and Auto Reconciliation.
After you run the program, you can review the Auto Reconciliation Execution Report to identify any reconciliation errors that need to be corrected. This report is produced automatically, or you can run it whenever needed. You can also review reconciliation errors online. 
After you automatically reconcile a bank statement and correct any reconciliation errors, you can run the Bank Statement Detail Report or use the View Bank Statements window to review reconciled and unreconciled statement lines. If lines remained unreconciled, you can:
Update the bank statement and rerun the Auto Reconciliation program.
Reconcile the statement lines manually.
Once you have reviewed your reconciliation results, you can transfer the accounting entries to your general ledger from Oracle Payables and Oracle Receivables. If you use Oracle General Ledger, you can reconcile you General Ledger cash account balance to your bank account balance by running the GL Reconciliation Report.


 


Reconciliation Process:
Bank transactions entered directly into GL or generated from Payables, Receivables or Payroll can be reconciled with CM.

1. Loading the Bank Statement:
The transactions can be reconciled manually or automatically by loading an electronic statement directly into CM. Loading is done using the bank statement open interface where a bank statement in the requisite flat file format is uploaded into CM tables. The automatic reconciliation looks for certain match criteria to determine whether a transaction and a bank statement line are one and the same.

2. Reconciling Journal Entries:
The journal entries entered directly in GL can be reconciled with the bank statement. The Auto reconciliation program matches a journal line description with the bank statement line transaction number.

3. Reconciling Payments:
Supplier payments entered in Payables can be reconciled to the bank statement lines in CM. The payment status against each check is updated as “Reconciled”.

4. Reconciling Receipts:
Receipts created in Receivables can also be reconciled to the bank statement lines in CM. CM updates the status of the receipts to “Reconciled” and creates appropriate accounting entries for transferring to GL. Payables and Receivables can generate reconciliation accounting entries for cash clearing, bank charges and foreign currency gain or loss.

5. Reconciling other Transactions:
Certain transactions like bank charges, interest credits, specific exchange rate applied against foreign currency transactions, customer receipts returned due to bounces etc, are known only when the bank statement is received. These would not have been initiated from Oracle Applications. CM is the primary point of entry for these transactions.

Importing Bank Statements and Validation:
Use CM’s Reconciliation programs to:
•Validate the information in the bank statement open interface tables
•Import the validated bank statement information
•Perform an automatic reconciliation after the import process completes

The Auto Reconciliation program performs the following validations on loading bank statement information into the bank statement open interface tables:
•Bank statement header validation
•Control total validation
•Statement line validation
•Multicurrency validation

Reconciling Bank Statements Automatically:
Use Auto Reconciliation program to automatically reconcile any bank statement in Oracle CM. There are three versions:
1. Auto Reconciliation: Use this program to reconcile any bank statement that has already been entered in CM.
2. Bank Statement Import: Use this program to import an electronic bank statement after loading the bank file with a SQL*Loader script.
3. Bank Statement Import and Auto Reconciliation: Use this program to import and reconcile a bank statement in the same run. After the program has been run, review the Auto Reconciliation Execution Report to identify any reconciliation errors that need to be corrected and re-run the program again if corrections are done.

Introduction

The procedures for performing period-end processing in Oracle Cash Management Release 11i.

Business Requirements

Oracle Cash Management is an enterprise cash management solution that helps you effectively manage and control the cash cycle. It provides comprehensive bank reconciliation and flexible cash forecasting.
The Bank Reconciliation process enables the verification of entries on the Bank Statement by reconciling that information with system transactions in Oracle Payables, Oracle Receivables and Oracle General Ledger.
During the Bank Reconciliation process miscellaneous transactions can be created for bank-originated entries, such as bank charges and interest.
Cash forecasting is a planning tool that helps anticipate the flow of cash in and out of the enterprise, allowing the projection of cash needs and evaluation of the company's liquidity position.

Steps

Procedures

The following steps are taken in performing period-end processing for Oracle Cash Management:

Load Bank Statements

Detailed information from each bank statement, including bank account information, deposits received by the bank, and checks cleared needs to be entered to Cash Management. Bank statements can be either manual entered or loaded electronicly from information received directly from your bank.
For organizations with high transaction volumes Bank Statements should be loaded and reconciled on a daily basis.
Refer to: Entering Bank Statements Manually and Loading Bank Statement Open Interface

Reconcile Bank Statements

Once detailed bank statement information has been entered into Cash Management, the information must be reconciled with the accounting transactions.
Cash Management provides two methods to undertake reconciliations:
  • Automatic - Bank statement details are automatically matched and reconciled with accounting transactions. This method is ideally suited for bank accounts which have high volumes of transactions.
    • Refer to: Reconciling Bank Statements Automatically
  • Manual - This method requires a manual match of bank statement details with accounting transactions. The method is ideally suited to reconciling bank accounts which have a small volume of monthly transactions. The manual reconciliation method can also be used to reconcile any bank statement details which couldn't be reconciled automatically.
    • Refer to: Reconciling Bank Statements Manually

Create Miscellaneous Transactions

During the reconciliation process miscellaneous transactions for bank originated entries, such as bank charges and errors can be created. Oracle Payables payments or Oracle Receivables receipts can also be manually created.
Note: The automatic reconciliation process can be set up to create miscellaneous transactions automatically.
Attention: If you create transactions during the reconciliation process you will need to re-run your GL posting routine from Oracle Receivables to ensure all information is transferred to the General Ledger

Review Auto Reconciliation Execution Report

Once the reconciliation process has been completed, reviewing the reconciliation results is recommended.
This report shows import and reconciliation errors that occurred when running the Auto Reconciliation program. Cash Management automatically produces this report during the automatic reconciliation process. You may also request it as needed from the Submit Request window.
This report includes either statement import errors, which prevented the automatic loading of your bank statement, or your reconciliation exceptions found during the automatic reconciliation process.

Resolve Exceptions on the Auto Reconciliation Execution Report

Resolve the exceptions on the Auto Reconciliation Execution report by either re-running the import process or by manually reconciling the exceptions.

Run Bank Statement Detail Report

This report shows statement and transaction information for a specific bank account statement, including bank statement header information, statement line detail, and reconciled transaction detail. This report lists any un-reconciled transactions separately with their current status, and the statement totals for each type of transaction, including the amount entered, reconciled, un-reconciled, over-reconciled and under-reconciled, and gives you the option to only select un-reconciled statement lines.

Run Transactions Available for Reconciliation Report

This report shows all transactions available for reconciliation for a specific bank account. It lists detailed transaction information for your Available Receipts, Available Payment, and Available Journal Entries for reconciliation. Detailed information includes the Customer, Supplier or Batch Name, Transaction Date, Payment Method, Transaction Number, Currency, and Amount.
This report only lists void payments if the Show Void Payments option on the Systems Parameters window is checked. It does not list reversed receipts due to user error nor does it list the associated original receipts that were not reconciled. This report groups transactions by status so that void or reversed transactions are separate from regular transactions.

Resolve Un-reconciled Statement Lines

Resolve the un-reconciled statement lines by manually reconciling the Statement lines to the available transactions.

Run the GL Reconciliation Report

Use this report to reconcile the General Ledger cash account to a bank statement balance.
This report lists a balance and an adjusted balance for the bank statement. It also lists a separate adjustment amount for un-reconciled receipts, payments, and journal entries, as well as bank errors.
Warning: To ensure that this report is accurate, you must first perform these tasks:
  • Reconcile all statements in Cash Management.
  • Transfer journal entry transactions from Oracle Payables and Oracle Receivables to your General Ledger.
  • Post journals in General Ledger.

Run the Account Analysis Report for the General Ledger Cash Account

Run the Account Analysis Report from General Ledger for the General Ledger Cash Account Flex field and sort by Source.
Ensure that only bank account related transactions have been posted to this account by checking the Source of the transactions. Valid sources will include Payables and Receivables. Transactions entered directly via General Ledger will have a Source of Manual or possibly Spreadsheet if ADI is used.

Review the Account Analysis Report

Review the Account Analysis Report to ensure that only bank account related transactions have been posted to the General Ledger Cash Account by checking the Source of the transactions. Valid sources will include Payables and Receivables. Transactions entered directly via General Ledger will have a Source of Manual or possibly Spreadsheet if ADI is used.

Correct any Invalid Entries to the General Ledger Cash Account (Optional)

Reverse or amend any journals incorrectly posted to the General Ledger Cash Account, which were highlighted during the review of the Account Analysis Report.
To prevent invalid journal entries to the General Ledger Cash Account it should be protected by enabling security rules in Oracle Financials.

Perform the Bank Reconciliation

Use these reports to reconcile the General Ledger cash account period-end balance to the Bank Statement period-end balance.

Wednesday, September 14

Creating a R12 Supplier Bank accounts Using API

After the Supplier or Supplier Site is validated and a row entered in the various AP and HZ tables, a Payee is created in IBY (the new Payments application) for the Supplier or Supplier Site. If the Payee is successfully created, we then check to see if there are any corresponding rows in IBY_TEMP_EXT_BANK_ACCTS. If there are, we call an IBY API to create the Bank Account and associate it with the Payee. So to import supplier bank accounts during Supplier and Supplier Site Open Interface, you can populate the IBY_TEMP_EXT_BANK_ACCTS table. A row in IBY_TEMP_EXT_BANK_ACCTS is said to be associated with the Supplier or Supplier Site if the column IBY_TEMP_EXT_BANK_ACCTS. calling_app_unique_ref1 is equal to either AP_SUPPLIERS_INT.vendor_interface_id for Suppliers or IBY_TEMP_EXT_BANK_ACCTS.calling_app_unique_ref2 is equal to AP_SUPPLIER_SITES_INT.vendor_site_interface_id for Supplier Sites. The bank and bank branch referenced in IBY_TEMP_EXT_BANK_ACCTS must already exist in the system. There is no functionality in the Bank Account Import to create the bank and/or bank branch. This functionality associates the new supplier to an existing bank and/or bank branch.

Some information
The supplier bank account information is in the table: IBY_EXT_BANK_ACCOUNTS, the bank and bank branches information is in the table HZ_PARTIES.
Creating a supplier in AP now creates a record in HZ_PARTIES. In the create Supplier screen, you will notice that that Registry_id is the party_number in HZ_Parties.
The table hz_party_usg_assignments table stores the party_usage_code SUPPLIER, and also contains the given party_id for that supplier. Running this query will return if customer was a SUPPLIER or CUSTOMER
Payment related details of supplier are also inserted in iby_external_payees_all as well as iby_ext_party_pmt_mthds
IBY_EXT_BANK_ACCOUNTS, the bank and bank branches information is in the table: HZ_PARTIES.
The master record that replaces PO_VENDORS is now AP_SUPPLIERS. PO_VENDORS is a view that joins AP_SUPPLIERS and HZ_PARTIES.
The table that hold mappings between AP_SUPPLIERS.VENDOR_ID and HZ_PARTIES.PARTY_ID is PO_SUPPLIER_MAPPINGS. Query by party_id.
The bank branch number can be found in the table: HZ_ORGANIZATION_PROFILES .The HZ_ORGANIZATION_PROFILES table stores a variety of information about a party. This table gets populated when a party of the Organization type is created.


For Importing internal and external bank account we can use the following API's

1. API to create External Customer Bank IBY_EXT_BANKACCT_PUB.create_ext_bank

2. Bank Branch
IBY_EXT_BANKACCT_PUB.create_ext_bank_branch

3. Customer Bank Account
IBY_EXT_BANKACCT_PUB.create_ext_bank_acct

4. Instrument Assignment
IBY_FNDCPT_SETUP_PUB.Set_Payer_Instr_Assignment

5. Payer Attributes
IBY_FNDCPT_SETUP_PUB.Set_Payer_Attributes

6. For the Branch Address
hz_location_v2pub.create_location
hz_party_site_v2pub.create_party_site

7. Contacts
HZ_PARTY_V2PUB.create_person
hz_party_contact_v2pub.create_org_contact
hz_party_contact_v2pub.create_org_contact_role
HZ_CONTACT_POINT_V2PUB.create_contact_point


Oracle Table Involved
IBY_EXTERNAL_PAYEES_ALL : This stores supplier information and customer information
IBY_EXT_BANK_ACCOUNTS : This storage for bank accounts
IBY_EXT_PARTY_PMT_MTHDS : This storage for payment method usage rules.
IBY_CREDITCARD : stores the credit card information for a customer
IBY_EXT_BANK_ACCOUNTS :This Stores external bank accounts . These records have bank_account_type = Supplier
IBY_ACCOUNT_OWNERS :stores the joint account owners of a bank account
IBY_PMT_INSTR_USES_ALL : This stores data from AP_BANK_ACCOUNT_USES_ALL for payment instruments assignments .

Link between Supplier And Banks and TCA table
The link between PO_VENDORS and HZ_PARTIES is PO_VENDORS.party_id. The link between PO_VENDOR_SITES_ALL and HZ_PARTY_SITES is PO_VENDOR_SITES_ALL.party_site_id.
When a Supplier is created Record will be Inserted in HZ_PARTIES. When the Supplier Site is created Record will be Inserted in HZ_PARTY_SITES. When Address is created it will be stored in HZ_LOCATIONS
When a bank Is Created, the banking information will be stored in IBY_EXT_BANK_ACCOUNTS IBY_EXT_BANK_ACCOUNTS.BANK_id = hz_paties.party_id
When the Bank is assigned to Vendors then it will be updated in HZ_CODE_ASSIGNMENTS.
HZ_CODE_ASSIGNMENTS.owner_table_id = IBY_EXT_BANK_ACCOUNTS.branch_id.
The PARTY_SITE_ID column is the link between the tables IBY_EXTERNAL_PAYEES_ALL & PO_VENDOR_SITES_ALL

Example procedure::
CREATE OR REPLACE
PROCEDURE APPS.xxsup_bank_test_v2
AS
x_bank_rec IBY_EXT_BANKACCT_PUB.ExtBank_rec_type;
x_bank_id NUMBER;
x_return_status VARCHAR2(10);
x_msg_count NUMBER;
x_msg_data VARCHAR2(256);
x_response_rec IBY_FNDCPT_COMMON_PUB.Result_rec_type;
x_bank_branch_rec IBY_EXT_BANKACCT_PUB.ExtBankBranch_rec_type;
x_branch_id NUMBER;
x_acct_id NUMBER;
x_bank_acct_rec IBY_EXT_BANKACCT_PUB.ExtBankAcct_rec_type;
p_ext_payee_tab IBY_DISBURSEMENT_SETUP_PUB.External_Payee_Tab_Type ;
x_ext_payee_id_tab IBY_DISBURSEMENT_SETUP_PUB.Ext_Payee_ID_Tab_Type ;
x_ext_payee_status_tab IBY_DISBURSEMENT_SETUP_PUB.Ext_Payee_Create_Tab_Type ;
l_ext_payee_rec IBY_DISBURSEMENT_SETUP_PUB.External_Payee_Rec_Type ;
l_ext_payee_id_rec_type IBY_DISBURSEMENT_SETUP_PUB.Ext_Payee_ID_Rec_Type ;
p_payee IBY_DISBURSEMENT_SETUP_PUB.PayeeContext_rec_type ;
p_assignment_attribs IBY_FNDCPT_SETUP_PUB.PmtInstrAssignment_rec_type ;
p_instrument IBY_FNDCPT_SETUP_PUB.PmtInstrument_rec_type ;
x_assign_id NUMBER;
BEGIN
dbms_output.put_line('Start of procedure.');
fnd_global.apps_initialize (fnd_global.user_id,
fnd_global.resp_id,
fnd_global.resp_appl_id
);
dbms_output.put_line('Procedure initializad.');
x_bank_rec.bank_name := 'ran_sbi71';
x_bank_rec.bank_number := 23591;
x_bank_rec.institution_type := 'BANK'; -- hz_code_assignments .CLASS_CODE
x_bank_rec.country_code := 'SA' ;
x_msg_count := 0;
x_msg_data := NULL;
x_return_status := NULL;
dbms_output.put_line('before External bank creation.');
IBY_EXT_BANKACCT_PUB.create_ext_bank
(p_api_version => 1.0
,p_init_msg_list => FND_API.G_TRUE
,p_ext_bank_rec => x_bank_rec
,x_bank_id => x_bank_id
,x_return_status => x_return_status
,x_msg_count => x_msg_count
,x_msg_data => x_msg_data
,x_response => x_response_rec
);
dbms_output.put_line('External bank created.');
dbms_output.put_line(' bank id. '||x_bank_id);
dbms_output.put_line('x_return_status: '||x_return_status);
dbms_output.put_line('x_msg_count. '||x_msg_count);
dbms_output.put_line('x_msg_data. '||x_msg_data);
x_bank_branch_rec.bank_party_id := x_bank_id ;
x_bank_branch_rec.branch_name := 'xxran_branch71' ;
x_bank_branch_rec.branch_number := 23592 ;
x_bank_branch_rec.branch_type := 'OTHER' ; --defined in lookup as BANK
-- BRANCH TYPE
x_msg_count := 0;
x_msg_data := NULL;
x_return_status := NULL;
IBY_EXT_BANKACCT_PUB.create_ext_bank_branch
(p_api_version => 1.0
,p_init_msg_list => FND_API.G_TRUE
,p_ext_bank_branch_rec => x_bank_branch_rec
,x_branch_id => x_branch_id
,x_return_status => x_return_status
,x_msg_count => x_msg_count
,x_msg_data => x_msg_data
,x_response => x_response_rec
);
dbms_output.put_line('External bank Branch created.');
dbms_output.put_line('x_branch_id: '||x_branch_id);
dbms_output.put_line('x_return_status: '||x_return_status);
dbms_output.put_line('x_msg_count. '||x_msg_count);
dbms_output.put_line('x_msg_data. '||x_msg_data);
x_bank_acct_rec.country_code := 'SA' ;
x_bank_acct_rec.branch_id := x_branch_id ;
x_bank_acct_rec.bank_id := x_bank_id ;
x_bank_acct_rec.acct_owner_party_id := 325685; --supplier party id
x_bank_acct_rec.currency := 'USD' ;
x_bank_acct_rec.bank_account_name := 'xxran account6';
x_bank_acct_rec.bank_account_num := 23593 ;
x_msg_count := 0;
x_msg_data := NULL;
x_return_status := NULL;
IBY_EXT_BANKACCT_PUB.create_ext_bank_acct
(p_api_version => 1.0
,p_init_msg_list => FND_API.G_TRUE
,p_ext_bank_acct_rec => x_bank_acct_rec
,x_acct_id => x_acct_id
,x_return_status => x_return_status
,x_msg_count => x_msg_count
,x_msg_data => x_msg_data
,x_response => x_response_rec
);
dbms_output.put_line('External bank account created.');
dbms_output.put_line('x_acct_id'||x_acct_id);
dbms_output.put_line('x_return_status'||x_return_status);
dbms_output.put_line('x_msg_count.'||x_msg_count);
dbms_output.put_line('x_msg_data.'||x_msg_data);
l_ext_payee_rec.Payee_Party_Site_Id := 189630;
l_ext_payee_rec.Payee_Party_Id := 325685;
l_ext_payee_rec.payment_function := 'PAYABLES_DISB';
l_ext_payee_rec.payer_org_id := 204;
l_ext_payee_rec.payer_org_type := 'OPERATING_UNIT';
l_ext_payee_rec.Exclusive_Pay_Flag := 'N';
l_ext_payee_rec.Default_Pmt_method := 'XX_REP_VIREMENT';
l_ext_payee_rec.Supplier_Site_Id := 6930;
x_msg_count := 0;
x_msg_data := NULL;
x_return_status := NULL;
p_ext_payee_tab(0) := l_ext_payee_rec;
IBY_DISBURSEMENT_SETUP_PUB.Create_External_Payee(
p_api_version => 1.0,
p_init_msg_list => fnd_api.G_TRUE,
p_ext_payee_tab => p_ext_payee_tab,
x_return_status => x_return_status,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data,
x_ext_payee_id_tab => x_ext_payee_id_tab,
x_ext_payee_status_tab => x_ext_payee_status_tab
);
dbms_output.put_line('External Payee created.');
dbms_output.put_line('x_return_status: '||x_return_status);
dbms_output.put_line('x_msg_count. '||x_msg_count);
dbms_output.put_line('x_msg_data. '||x_msg_data);
p_payee.Supplier_Site_id := 6930;
p_payee.Party_Id := 325685;
p_payee.Party_Site_Id := 189630;
p_payee.Payment_Function := 'PAYABLES_DISB';
p_payee.Org_Id := 204;
p_payee.Org_Type := 'OPERATING_UNIT';
l_ext_payee_id_rec_type := x_ext_payee_id_tab(0);
p_instrument.Instrument_Id := x_acct_id;
p_instrument.Instrument_Type := 'BANKACCOUNT';
p_assignment_attribs.priority := 1;
p_assignment_attribs.Instrument := p_instrument;
x_msg_count := 0;
x_msg_data := NULL;
x_return_status := NULL;
x_response_rec := NULL;
IBY_DISBURSEMENT_SETUP_PUB.Set_Payee_Instr_Assignment(
p_api_version => 1.0,
p_init_msg_list => fnd_api.G_TRUE,
p_commit => fnd_api.G_TRUE,
x_return_status => x_return_status,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data,
p_payee => p_payee,
p_assignment_attribs => p_assignment_attribs,
x_assign_id => x_assign_id,
x_response => x_response_rec
);
dbms_output.put_line('Payee_Instr_Assignment.');
dbms_output.put_line('x_assign_id'||x_assign_id);
dbms_output.put_line('x_return_status'||x_return_status);
dbms_output.put_line('x_msg_count.'||x_msg_count);
dbms_output.put_line('x_msg_data.'||x_msg_data);
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('Error occurred during procedure.');
dbms_output.put_line('sqlcode: '||SQLCODE||' Sqlerrm: '||SUBSTR(sqlerrm,1,255
));
END xxsup_bank_test_v2;
/

You can get the related party_id, vendor_site_id and party_site_id by using the following query.
SELECT
hp.party_id,
hp.party_name,
apss.vendor_site_id,
hps.party_site_id
FROM
hz_parties hp,
hz_party_sites hps,
ap_suppliers aps,
ap_supplier_sites_all apss
WHERE
hp.party_id = aps.party_id
AND hp.party_id = hps.party_id
AND aps.vendor_id = apss.vendor_id
ORDER BY
HP.CREATION_DATE DESC


Query to get bank details with supplier details

SELECT
HZP.PARTY_NAME "VENDOR NAME" ,
APS.SEGMENT1 "VENDOR NUMBER" ,
ASS.VENDOR_SITE_CODE "SITE CODE" ,
IEB.BANK_ACCOUNT_NUM "ACCOUNT NUMBER" ,
IEB.BANK_ACCOUNT_NAME "ACCOUNT NAME" ,
HZPBANK.PARTY_NAME "BANK NAME" ,
HOPBRANCH.BANK_OR_BRANCH_NUMBER "BANK NUMBER" ,
HZPBRANCH.PARTY_NAME "BRANCH NAME" ,
HOPBRANCH.BANK_OR_BRANCH_NUMBER "BRANCH NUMBER"
FROM
HZ_PARTIES HZP ,
AP_SUPPLIERS APS ,
HZ_PARTY_SITES SITE_SUPP ,
AP_SUPPLIER_SITES_ALL ASS ,
IBY_EXTERNAL_PAYEES_ALL IEP ,
IBY_PMT_INSTR_USES_ALL IPI ,
IBY_EXT_BANK_ACCOUNTS IEB ,
HZ_PARTIES HZPBANK ,
HZ_PARTIES HZPBRANCH ,
HZ_ORGANIZATION_PROFILES HOPBANK ,
HZ_ORGANIZATION_PROFILES HOPBRANCH
WHERE
HZP.PARTY_ID = APS.PARTY_ID
AND HZP.PARTY_ID = SITE_SUPP.PARTY_ID
AND SITE_SUPP.PARTY_SITE_ID = ASS.PARTY_SITE_ID
AND ASS.VENDOR_ID = APS.VENDOR_ID
AND IEP.PAYEE_PARTY_ID = HZP.PARTY_ID
AND IEP.PARTY_SITE_ID = SITE_SUPP.PARTY_SITE_ID
AND IEP.SUPPLIER_SITE_ID = ASS.VENDOR_SITE_ID
AND IEP.EXT_PAYEE_ID = IPI.EXT_PMT_PARTY_ID
AND IPI.INSTRUMENT_ID = IEB.EXT_BANK_ACCOUNT_ID
AND IEB.BANK_ID = HZPBANK.PARTY_ID
AND IEB.BANK_ID = HZPBRANCH.PARTY_ID
AND HZPBRANCH.PARTY_ID = HOPBRANCH.PARTY_ID
AND HZPBANK.PARTY_ID = HOPBANK.PARTY_ID
ORDER BY
1,3