Add in ID_PRO_NAM to integration.

This commit is contained in:
Patrick Fic
2025-08-14 09:32:35 -07:00
parent 09ddb85b8b
commit 1de87a4280
7 changed files with 36 additions and 9 deletions

View File

@@ -54,6 +54,7 @@ async function DecodeEstimate(filePath, includeFilePathInReturnJob = false, clos
...(await DecodeLinFile(extensionlessFilePath, close_date)),
...(await DecodePflFile(extensionlessFilePath,)),
...(await DecodePfmFile(extensionlessFilePath,)),
...(await DecodePfhFile(extensionlessFilePath,)),
...(await DecodeStlFile(extensionlessFilePath,)),
...(includeFilePathInReturnJob ? { filePath } : {})
};
@@ -255,6 +256,21 @@ async function DecodeAd2File(extensionlessFilePath) {
}
async function DecodeVehFile(extensionlessFilePath) {
let dbf;
try {
dbf = await DBFFile.open(`${extensionlessFilePath}.PFH`);
} catch (error) {
log.error("Error opening PFH File.", error);
} finally {
if (!dbf) return {};
let records = await dbf.readRecords(1);
return _.pick(records[0], [
"ID_PRO_NAM"
]);
}
}
async function DecodePfhFile(extensionlessFilePath) {
let dbf;
try {
dbf = await DBFFile.open(`${extensionlessFilePath}V.VEH`);