From fc712cecba4e343fc5be821c6cc9bb07c1f3e617 Mon Sep 17 00:00:00 2001 From: "Denise D." Date: Sat, 1 Aug 2026 11:27:26 +0200 Subject: [PATCH] minor changes --- file.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/file.js b/file.js index 0bea12a..a77f6ef 100644 --- a/file.js +++ b/file.js @@ -65,7 +65,7 @@ async function attachPdfToAccount(sfdc, tempFiles, isDryRun = false) { const userID = result.text.match(/Codice fiscale:\s*([A-Za-z0-9]+)/i); const codiceFiscale = userID ? userID[1].trim() : null; if (codiceFiscale) { - const cfSoql = `SELECT Id, Name, CF__c FROM Account WHERE CF__c='${codiceFiscale }' ORDER BY CreatedDate ASC LIMIT 1`; + const cfSoql = `SELECT Id, Name, CF__c FROM Account WHERE CF__c='${ codiceFiscale }' ORDER BY CreatedDate ASC LIMIT 1`; const cfResult = await sfdc.query(cfSoql); if (cfResult && cfResult.records && cfResult.records.length > 0) { @@ -95,7 +95,7 @@ async function attachPdfToAccount(sfdc, tempFiles, isDryRun = false) { // in this query, we prioritize the accounts that have the CF (e.g. if a client has two accounts and in one of them // they don't have the CF but on the other one they do, we consider the latter) - const nameSoql = `SELECT Id, Name, CF__c FROM Account WHERE (${conditions.join(' OR ')}) ORDER BY CF__c DESC NULLS LAST, CreatedDate ASC LIMIT 1`; + const nameSoql = `SELECT Id, Name, CF__c FROM Account WHERE (${ conditions.join(' OR ') }) ORDER BY CF__c DESC NULLS LAST, CreatedDate ASC LIMIT 1`; const nameResult = await sfdc.query(nameSoql); if (nameResult && nameResult.records && nameResult.records.length > 0) { @@ -153,7 +153,7 @@ async function processPage(pdfDoc, pageIndex, tempFiles) { newDoc.addPage(copiedPage); const pdfBytes = await newDoc.save(); - const filepath = path.join(os.tmpdir(), `fileTemp_page_${pageIndex}.pdf`); + const filepath = path.join(os.tmpdir(), `fileTemp_page_${ pageIndex }.pdf`); fs.writeFileSync(filepath, pdfBytes); tempFiles.push(filepath); } @@ -172,7 +172,6 @@ async function splitExcelFile(inputFile) { await workbook.xlsx.readFile(inputFile); const worksheet = workbook.getWorksheet(1); - const headerRow = worksheet.getRow(1).actualCellCount; //number of columns of the table numRows = (worksheet.actualRowCount) - 1; // since it counts the row that represents the header, I need to subtract -1 // to get the actual number of rows that contains the data