FACT_ACCT of Invoice didn't contain LocTo, LocFrom dimensions

Description

In the Account Schema Dimensions Tab consists additionally two active dimensions: "Location From", "Location To".
Then posting invoice document, for example AR Invoice.
In the FACT_ACCT creates two records (without tax):
1) CR Revenue
2) DR Receivables
In the first record of FACT_ACCT (CR) columns c_locfrom_id, c_locto_id is contain some values.
But in the second record of FACT_ACCT (DR) columns c_locfrom_id, c_locto_id is empty.

This is because code "// Set Locations" in Doc_Invoice.java class run after factLines CR create, but before factLines DR create.

// Set Locations
FactLine[] fLines = fact.getLines();
for (int i = 0; i < fLines.length; i++)
{
if (fLines[i] != null)
{
fLines[i].setLocationFromOrg(fLines[i].getAD_Org_ID(), true); // from Loc
fLines[i].setLocationFromBPartner(getC_BPartner_Location_ID(), false); // to Loc
}
}

This applies not only to AR_Invoice, but also to all other document types (ARI, ARC, ARF, API, APC) in the Doc_Invoice class.

To solve this problem I propose to move code "// Set Locations" after ALL factLines create (DR & CR).

Environment

None

Activity

Show:
Carlos Ruiz
October 13, 2017, 12:46 PM

Attached a patch according to what suggests.

However, I would like to have a review from an accountant about the impact of this.

Assignee

Carlos Ruiz

Reporter

Денис Кузнецов

Labels

Tested By

None

Components

Affects versions

Priority

Major
Configure