Changes
Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
co-authored by
renee-png
parent
8103b6b3c2
commit
c7524e0597
@@ -208,7 +208,7 @@ const IMPORTERS: ImporterConfig[] = [
|
||||
transform: (r, ctx) => {
|
||||
const cid = r._clientext ? ctx.clientByExt.get(String(r._clientext)) : null;
|
||||
const cidByName = r._clientname ? ctx.clientByName.get(String(r._clientname).toLowerCase()) : null;
|
||||
r.client_id = cid ?? cidByName ?? null;
|
||||
r.client_id = cid ?? cidByName ?? ctx.defaultClientId ?? null;
|
||||
delete r._clientext; delete r._clientname;
|
||||
if (!r.client_id) return null;
|
||||
if (!r.first_name && r._ownername) {
|
||||
@@ -216,6 +216,10 @@ const IMPORTERS: ImporterConfig[] = [
|
||||
r.first_name = first_name; r.last_name = last_name;
|
||||
}
|
||||
delete r._ownername;
|
||||
// Allow address-only rows: synthesize a placeholder owner name from the address
|
||||
if (!r.first_name) {
|
||||
r.first_name = r.address || r.unit_number || "Unit";
|
||||
}
|
||||
if (!r.last_name) r.last_name = "";
|
||||
return r;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user