Fixed
Details
Assignee
Carlos RuizCarlos RuizReporter
Simbarashe MusabaikeSimbarashe MusabaikeLabels
Components
Affects versions
Priority
Minor
Details
Details
Assignee
Carlos Ruiz
Carlos RuizReporter
Simbarashe Musabaike
Simbarashe MusabaikeLabels
Components
Affects versions
Priority
Created April 4, 2012 at 8:52 PM
Updated March 13, 2014 at 2:20 PM
Resolved August 30, 2012 at 11:33 AM
line 257 i suggest it should be changed from AND i.C_Region_ID=l.C_Region_ID to
AND (i.C_Region_ID=l.C_Region_ID OR (l.C_Region_ID IS NULL AND i.C_Region_ID IS NULL)) to en-corporate null values. Because it seems to return no match when Location C_Region_id and ImportBPartner C_Region_id are both are null as for my case.
The line is on
247. Existing Location ? Exact Match
248. sql = new StringBuffer ("UPDATE I_BPartner i "
249. + "SET C_BPartner_Location_ID=(SELECT C_BPartner_Location_ID"
250. + " FROM C_BPartner_Location bpl INNER JOIN C_Location l ON (bpl.C_Location_ID=l.C_Location_ID)"
251. + " WHERE i.C_BPartner_ID=bpl.C_BPartner_ID AND bpl.AD_Client_ID=i.AD_Client_ID"
252. + " AND (i.Address1=l.Address1 OR (i.Address1 IS NULL AND l.Address1 IS NULL))"
253. + " AND (i.Address2=l.Address2 OR (i.Address2 IS NULL AND l.Address2 IS NULL))"
254. + " AND (i.City=l.City OR (i.City IS NULL AND l.City IS NULL))"
255. + " AND (i.Postal=l.Postal OR (i.Postal IS NULL AND l.Postal IS NULL))"
256. + " AND (i.Postal_Add=l.Postal_Add OR (l.Postal_Add IS NULL AND l.Postal_Add IS NULL))"
257. + " AND i.C_Region_ID=l.C_Region_ID "
258. + " AND (i.C_Country_ID=l.C_Country_ID) group by bpl.c_bpartner_location_id) " +
259. " WHERE C_BPartner_ID IS NOT NULL AND C_BPartner_Location_ID IS NULL"
260. + " AND I_IsImported='N'").append(clientCheck);
261. no = DB.executeUpdateEx(sql.toString(), get_TrxName());
262. log.fine("Found Location=" + no);