|
@eduardo_Argal:
In org.openbravo.erpCommon.ad_reports.ReportAcctRedirectUtility.doPost() system determines the URL to display after clicking in the link shown in the left upper corner of the entry.
Here, the following information is provided through the JavaScript link[1] in the html page of the General Ledger Journal window:
- FIN_Finacc_Transaction_ID corresponding to the transaction posted in this entry
- AD_Table_Id for the FIN_Finacc_Transaction table
- DocBaseType for transactions: 'FAT'
With all this information, ReportAcctRedirectUtility servlet builds the URL to be shown.
In case the table is transactions one, the convertTableException function changes it for the financial account one.
Afterwards, the ReportAcctRedirectUtilityData.select() query is executed. This query, with the information provided, throws TWO results: one for the Financial Account tab, and one for the Transactions tab:
select t.name as tableName, tb.name as tabName, w.name as windowName, c.name as columnName
from ad_table t, ad_tab tb, ad_window w, ad_column c
where t.ad_table_id = tb.ad_table_id
and tb.ad_window_id = w.ad_window_id
and t.ad_table_id = c.ad_table_id
and c.iskey = 'Y'
and t.ad_table_id = 'B129E53BC0E747879F7BA17F0AECEC32' --financial account
AND (CASE (SELECT MAX(ISSOTRX) FROM C_DOCTYPE D
WHERE D.DOCBASETYPE = 'FAT'
AND D.AD_CLIENT_ID = 'FF8080812AFBCB14012AFBD3E373001F')
WHEN 'N' THEN COALESCE(T.PO_WINDOW_ID, T.AD_WINDOW_ID)
ELSE T.AD_WINDOW_ID END) = W.AD_WINDOW_ID
------
TableName-TabName-WindowName-ColumnName
FIN_Financial_Account-Account-Financial Account-Account
FIN_Financial_Account-Transactions-Financial Account-Account
This makes that, sometimes, the link navigates to the financial account tab, and other times to the transactions one.
This happens because in AD, we have two tabs defined for the table financial account:
select name, ad_tab_id from ad_tab where ad_table_id='B129E53BC0E747879F7BA17F0AECEC32';
---------------
Name-AdTabId
Account-2845D761A8394468BD3BA4710AA888D4
Transactions-5B9941AC1F6A4529A76FCA7CDA0A7D7A
I guess this was done for one purpose during the APR development. How can we avoid this, without modifying the APR behavior?
[1]: submitPage('DEFAULT', document.frmSecondary, --FIN_Finacc_Transaction_ID-, '4D8C3B3C31D1410DA046140C9F024D17', 'FAT');return false; |
|