other small changes

This commit is contained in:
2026-07-27 16:31:07 +02:00
parent d1b1da1414
commit d648abc6fd
+4 -1
View File
@@ -45,6 +45,9 @@ async function initializeSalesforceConnection() {
console.log('Salesforce connection is ready.'); console.log('Salesforce connection is ready.');
} }
// the pdf files contain the identifying ids of the users such as 'Codice Fiscale' (CF) and we use them to attach
// the page/pages to the specific account that has that id. If CFs are not available we search based on the
// name an lastname of the user
async function attachPdfToAccount(sfdc) { async function attachPdfToAccount(sfdc) {
let parser; let parser;
try { try {
@@ -64,7 +67,7 @@ async function attachPdfToAccount(sfdc) {
conditions.push(`CF__c='${ codiceFiscale }'`); conditions.push(`CF__c='${ codiceFiscale }'`);
} }
// since the name and lastname of the user are reversed, I need to put it in order // since the name and lastname of the user are reversed in some files, we need to put it in order
// to match the name from the database // to match the name from the database
const nameMatch = result.text.match(/Il\s+Sig\.\/La\s+Sig\.ra[ \t]+([A-Za-zÀ-ÿ']+(?:[ \t]+[A-Za-zÀ-ÿ']+)+)/i); const nameMatch = result.text.match(/Il\s+Sig\.\/La\s+Sig\.ra[ \t]+([A-Za-zÀ-ÿ']+(?:[ \t]+[A-Za-zÀ-ÿ']+)+)/i);