Changes
Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
co-authored by
renee-png
parent
30adb4119c
commit
c501a49c08
@@ -573,8 +573,8 @@ const IMPORTERS: ImporterConfig[] = [
|
||||
transform: (r, ctx) => {
|
||||
r.client_id = (r._clientext && ctx.clientByExt.get(String(r._clientext))) || (r._clientname && ctx.clientByName.get(String(r._clientname).toLowerCase())) || null;
|
||||
r.case_id = (r._caseext && ctx.caseByExt.get(String(r._caseext))) || (r._casenum && ctx.caseByNumber.get(String(r._casenum))) || null;
|
||||
delete r._clientext; delete r._clientname; delete r._caseext; delete r._casenum;
|
||||
if (!r.client_id) return null;
|
||||
// Keep hints — async pre-insert step will auto-create an archived client
|
||||
// (and archived case) when no match is found.
|
||||
const s = String(r.status ?? "").toLowerCase();
|
||||
r.status = ["draft", "sent", "paid", "overdue", "void"].includes(s) ? s : "draft";
|
||||
return r;
|
||||
|
||||
Reference in New Issue
Block a user