You can find on the top of the flow my original work and underside your flow which I've adapted with my new version :
[{"id":"99e019d5.6f0748","type":"tab","label":"Payrolls","disabled":false,"info":"# Pay slips\n\n---\n\n## Context\n\nThis flow aims to **convert U.S. payrolls** into the format accepted by Akuiteo, the Braincube ERP.\n\nThe goal of this program is to **lighten the workload for U.S. accountants** that actually convert this files manually before import them into Akuiteo.\n\n---\n\n*Pierre Demay*"},{"id":"88afbed.6d18c4","type":"inject","z":"99e019d5.6f0748","name":"Initialization","props":[],"repeat":"","crontab":"","once":false,"onceDelay":"1","topic":"","x":270,"y":220,"wires":[["82817428.553bd8"]]},{"id":"82817428.553bd8","type":"file in","z":"99e019d5.6f0748","name":"Payrolls","filename":"/Users/pierre.demay/Downloads/payroll.csv","filenameType":"str","format":"utf8","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":400,"y":300,"wires":[["c54bd09e.bae91"]]},{"id":"c54bd09e.bae91","type":"csv","z":"99e019d5.6f0748","name":"","sep":",","hdrin":true,"hdrout":"none","multi":"mult","ret":"\\n","temp":"","skip":"2","strings":true,"include_empty_strings":"","include_null_values":"","x":510,"y":380,"wires":[["3c85a2f7.61c58e"]]},{"id":"3c85a2f7.61c58e","type":"split","z":"99e019d5.6f0748","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":670,"y":380,"wires":[["6c104440.bdd89c"]]},{"id":"6c104440.bdd89c","type":"switch","z":"99e019d5.6f0748","name":"Check Totals","property":"payload[\"Account Number\"]","propertyType":"msg","rules":[{"t":"neq","v":"Totals","vt":"str"}],"checkall":"false","repair":false,"outputs":1,"x":830,"y":440,"wires":[["41c67a30.b3b1b4"]]},{"id":"d1e7d6bf.c81308","type":"file","z":"99e019d5.6f0748","name":"Converted payrolls","filename":"convert_payroll.csv","filenameType":"msg","appendNewline":true,"createDir":false,"overwriteFile":"true","encoding":"none","x":1550,"y":440,"wires":[[]]},{"id":"49acb3e9.6d52fc","type":"debug","z":"99e019d5.6f0748","name":"In CSV format","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1540,"y":500,"wires":[]},{"id":"609ed4e2.c3687c","type":"debug","z":"99e019d5.6f0748","name":"After convert","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1370,"y":320,"wires":[]},{"id":"41c67a30.b3b1b4","type":"change","z":"99e019d5.6f0748","name":"Converter","rules":[{"t":"set","p":"payload","pt":"msg","to":"$$.payload.{\t \"EC_NUMERO\": $moment($.Date, \"MM/DD/YY\").format(\"[BCUSA]YY[PR]MMDDYYYY\"),\t \"EC_DATE\": $moment($.Date, \"MM/DD/YY\").format(\"DD/MM/YYYY\"),\t \"EC_CODE_JOURNAL\":\"GS\",\t \"EC_EXERCICE\":24,\t \"LI_COMPTE\": $.\"Account Number\",\t \"LI_LIBELLE\": $.\"Account Name\",\t \"LI_DEBIT\": $.Debit ? $.Debit : \"\",\t \"LI_CREDIT\": $.Credit ? $.Credit : \"\",\t \"LI_DEVISE\":\"USD\",\t \"LI_PIECE\":\"\",\t \"LI_AFFAIRE\":\"\"\t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1020,"y":440,"wires":[["9e408c43e92333db"]]},{"id":"4adff48d.dca0dc","type":"csv","z":"99e019d5.6f0748","name":"","sep":",","hdrin":"","hdrout":"all","multi":"mult","ret":"\\n","temp":"EC_NUMERO,EC_DATE,EC_CODE_JOURNAL,EC_EXERCICE,LI_COMPTE,LI_LIBELLE,LI_DEBIT,LI_CREDIT,LI_DEVISE,LI_PIECE,LI_AFFAIRE","skip":"0","strings":true,"include_empty_strings":true,"include_null_values":true,"x":1350,"y":440,"wires":[["49acb3e9.6d52fc"]]},{"id":"8c31afa3.d689c","type":"join","z":"99e019d5.6f0748","name":"","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1190,"y":440,"wires":[["4adff48d.dca0dc","6c7a3826.4cb128"]]},{"id":"6c7a3826.4cb128","type":"debug","z":"99e019d5.6f0748","name":"After join","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1360,"y":380,"wires":[]},{"id":"9e408c43e92333db","type":"function","z":"99e019d5.6f0748","name":"Project finder","func":"if (msg.payload.LI_COMPTE.toString().substr(0, 1) == \"1\") {\n msg.payload.LI_AFFAIRE = \"B000030\";\n return msg;\n} else if (msg.payload.LI_COMPTE.toString().substr(0, 1) == \"2\") {\n msg.payload.LI_AFFAIRE = \"B000030\";\n return msg;\n} else if (msg.payload.LI_COMPTE.toString().substr(0, 4) == \"6500\") {\n msg.payload.LI_AFFAIRE = \"B000031\";\n return msg;\n} else if (msg.payload.LI_COMPTE.toString().substr(0, 4) == \"6501\") {\n msg.payload.LI_AFFAIRE = \"B000040\";\n return msg;\n} else if (msg.payload.LI_COMPTE.toString().substr(0, 4) == \"6510\") {\n msg.payload.LI_AFFAIRE = \"B000024\";\n return msg;\n} else if (msg.payload.LI_COMPTE.toString().substr(0, 4) == \"6515\") {\n msg.payload.LI_AFFAIRE = \"B000025\";\n return msg;\n} else if (msg.payload.LI_COMPTE.toString().substr(0, 4) == \"6520\") {\n msg.payload.LI_AFFAIRE = \"B000026\";\n return msg;\n} else if (msg.payload.LI_COMPTE.toString().substr(0, 4) == \"6525\") {\n msg.payload.LI_AFFAIRE = \"???\";\n return msg;\n} else if (msg.payload.LI_COMPTE.toString().substr(0, 4) == \"6530\") {\n msg.payload.LI_AFFAIRE = \"B000029\";\n return msg;\n} else if (msg.payload.LI_COMPTE.toString().substr(0, 4) == \"6600\") {\n msg.payload.LI_AFFAIRE = \"B000031\";\n return msg;\n} else if (msg.payload.LI_COMPTE.toString().substr(0, 4) == \"6603\") {\n msg.payload.LI_AFFAIRE = \"B000031\";\n return msg;\n} else if (msg.payload.LI_COMPTE.toString().substr(0, 4) == \"6608\") {\n msg.payload.LI_AFFAIRE = \"B000029\";\n return msg;\n} else if (msg.payload.LI_COMPTE.toString().substr(0, 4) == \"6609\") {\n msg.payload.LI_AFFAIRE = \"B000040\";\n return msg;\n} else if (msg.payload.LI_COMPTE.toString().substr(0, 4) == \"6610\") {\n msg.payload.LI_AFFAIRE = \"B000024\";\n return msg;\n} else if (msg.payload.LI_COMPTE.toString().substr(0, 4) == \"6615\") {\n msg.payload.LI_AFFAIRE = \"B000025\";\n return msg;\n} else if (msg.payload.LI_COMPTE.toString().substr(0, 4) == \"6620\") {\n msg.payload.LI_AFFAIRE = \"B000026\";\n return msg;\n} else if (msg.payload.LI_COMPTE.toString().substr(0, 4) == \"6625\") {\n msg.payload.LI_AFFAIRE = \"B000040\";\n return msg;\n} else if (msg.payload.LI_COMPTE.toString().substr(0, 4) == \"6700\") {\n msg.payload.LI_AFFAIRE = \"B000031\";\n return msg;\n} else if (msg.payload.LI_COMPTE.toString().substr(0, 4) == \"6715\") {\n msg.payload.LI_AFFAIRE = \"B000025\";\n return msg;\n}","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1110,"y":360,"wires":[["8c31afa3.d689c","609ed4e2.c3687c"]]},{"id":"30c577c1.ce10e8","type":"inject","z":"99e019d5.6f0748","name":"Initialization","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":"1","topic":"","payload":"[{\"Account Number\":6515098,\"Account Name\":\"Payroll Expenses: Gross Wages: Panico, M\",\"Employee\":\"Panico, Miranda S\",\"Debit\":3464.75,\"Date\":\"4/15/24\"},{\"Account Number\":6515102,\"Account Name\":\"Payroll Expenses: Gross Wages: Scheindel, Monika\",\"Employee\":\"Scheindel, Monika M\",\"Debit\":2291.67,\"Date\":\"4/15/24\"}]","payloadType":"json","x":270,"y":540,"wires":[["b47f45eddefb7c5c"]]},{"id":"a2596d30.bc2a3","type":"split","z":"99e019d5.6f0748","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":710,"y":660,"wires":[["26c10aea.f47826","45d3e4c7104128b9"]]},{"id":"26c10aea.f47826","type":"debug","z":"99e019d5.6f0748","name":"Base data","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":840,"y":600,"wires":[]},{"id":"d0bdeb00.eeb068","type":"debug","z":"99e019d5.6f0748","name":"After convert","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1030,"y":600,"wires":[]},{"id":"1099c5bd6ca4440e","type":"join","z":"99e019d5.6f0748","name":"auto join","mode":"auto","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1060,"y":660,"wires":[["c4da4c63.3e4cf","52d3872a922b517e"]]},{"id":"c4da4c63.3e4cf","type":"csv","z":"99e019d5.6f0748","name":"","sep":",","hdrin":"","hdrout":"none","multi":"mult","ret":"\\n","temp":"Numero,Date,Code Journal,Exercice,Compte,Libelle,Debit,Credit,Devise,Piece,Affaire","skip":"0","strings":true,"include_empty_strings":true,"include_null_values":true,"x":1230,"y":660,"wires":[["9438380f.a113d8"]]},{"id":"52d3872a922b517e","type":"debug","z":"99e019d5.6f0748","name":"After join","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1200,"y":600,"wires":[]},{"id":"9438380f.a113d8","type":"debug","z":"99e019d5.6f0748","name":"In CSV format","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1400,"y":660,"wires":[]},{"id":"b47f45eddefb7c5c","type":"file in","z":"99e019d5.6f0748","name":"Payrolls","filename":"/Users/pierre.demay/Downloads/payroll.csv","filenameType":"str","format":"utf8","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":420,"y":600,"wires":[["6b3dcf64453dcbe1"]]},{"id":"6b3dcf64453dcbe1","type":"csv","z":"99e019d5.6f0748","name":"","sep":",","hdrin":true,"hdrout":"none","multi":"mult","ret":"\\n","temp":"","skip":"2","strings":true,"include_empty_strings":"","include_null_values":"","x":550,"y":660,"wires":[["a2596d30.bc2a3"]]},{"id":"45d3e4c7104128b9","type":"change","z":"99e019d5.6f0748","name":"Converter","rules":[{"t":"set","p":"payload","pt":"msg","to":"$$.payload.{\t \"EC_NUMERO\": $moment($.Date, \"MM/DD/YY\").format(\"[BCUSA]YY[PR]MMDDYYYY\"),\t \"EC_DATE\": $moment($.Date, \"MM/DD/YY\").format(\"DD/MM/YYYY\"),\t \"EC_CODE_JOURNAL\":\"GS\",\t \"EC_EXERCICE\":24,\t \"LI_COMPTE\": $.\"Account Number\",\t \"LI_LIBELLE\": $.\"Account Name\",\t \"LI_DEBIT\": $.Debit ? $.Debit : \"\",\t \"LI_CREDIT\": $.Credit ? $.Credit : \"\",\t \"LI_DEVISE\":\"USD\",\t \"LI_PIECE\":\"\",\t \"LI_AFFAIRE\":\"\"\t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":880,"y":660,"wires":[["d0bdeb00.eeb068","1099c5bd6ca4440e"]]},{"id":"cd5796bbb3a63de7","type":"switch","z":"99e019d5.6f0748","name":"Check Totals","property":"payload[\"Account Number\"]","propertyType":"msg","rules":[{"t":"neq","v":"Totals","vt":"str"}],"checkall":"false","repair":false,"outputs":1,"x":790,"y":720,"wires":[[]]},{"id":"d823f7215f31ed92","type":"function","z":"99e019d5.6f0748","name":"Project finder","func":"if (msg.payload.LI_COMPTE.toString().substr(0, 1) == \"1\") {\n msg.payload.LI_AFFAIRE = \"B000030\";\n return msg;\n} else if (msg.payload.LI_COMPTE.toString().substr(0, 1) == \"2\") {\n msg.payload.LI_AFFAIRE = \"B000030\";\n return msg;\n} else if (msg.payload.LI_COMPTE.toString().substr(0, 4) == \"6500\") {\n msg.payload.LI_AFFAIRE = \"B000031\";\n return msg;\n} else if (msg.payload.LI_COMPTE.toString().substr(0, 4) == \"6501\") {\n msg.payload.LI_AFFAIRE = \"B000040\";\n return msg;\n} else if (msg.payload.LI_COMPTE.toString().substr(0, 4) == \"6510\") {\n msg.payload.LI_AFFAIRE = \"B000024\";\n return msg;\n} else if (msg.payload.LI_COMPTE.toString().substr(0, 4) == \"6515\") {\n msg.payload.LI_AFFAIRE = \"B000025\";\n return msg;\n} else if (msg.payload.LI_COMPTE.toString().substr(0, 4) == \"6520\") {\n msg.payload.LI_AFFAIRE = \"B000026\";\n return msg;\n} else if (msg.payload.LI_COMPTE.toString().substr(0, 4) == \"6525\") {\n msg.payload.LI_AFFAIRE = \"???\";\n return msg;\n} else if (msg.payload.LI_COMPTE.toString().substr(0, 4) == \"6530\") {\n msg.payload.LI_AFFAIRE = \"B000029\";\n return msg;\n} else if (msg.payload.LI_COMPTE.toString().substr(0, 4) == \"6600\") {\n msg.payload.LI_AFFAIRE = \"B000031\";\n return msg;\n} else if (msg.payload.LI_COMPTE.toString().substr(0, 4) == \"6603\") {\n msg.payload.LI_AFFAIRE = \"B000031\";\n return msg;\n} else if (msg.payload.LI_COMPTE.toString().substr(0, 4) == \"6608\") {\n msg.payload.LI_AFFAIRE = \"B000029\";\n return msg;\n} else if (msg.payload.LI_COMPTE.toString().substr(0, 4) == \"6609\") {\n msg.payload.LI_AFFAIRE = \"B000040\";\n return msg;\n} else if (msg.payload.LI_COMPTE.toString().substr(0, 4) == \"6610\") {\n msg.payload.LI_AFFAIRE = \"B000024\";\n return msg;\n} else if (msg.payload.LI_COMPTE.toString().substr(0, 4) == \"6615\") {\n msg.payload.LI_AFFAIRE = \"B000025\";\n return msg;\n} else if (msg.payload.LI_COMPTE.toString().substr(0, 4) == \"6620\") {\n msg.payload.LI_AFFAIRE = \"B000026\";\n return msg;\n} else if (msg.payload.LI_COMPTE.toString().substr(0, 4) == \"6625\") {\n msg.payload.LI_AFFAIRE = \"B000040\";\n return msg;\n} else if (msg.payload.LI_COMPTE.toString().substr(0, 4) == \"6700\") {\n msg.payload.LI_AFFAIRE = \"B000031\";\n return msg;\n} else if (msg.payload.LI_COMPTE.toString().substr(0, 4) == \"6715\") {\n msg.payload.LI_AFFAIRE = \"B000025\";\n return msg;\n}","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":970,"y":720,"wires":[[]]},{"id":"cac9b08bdc2b1c51","type":"comment","z":"99e019d5.6f0748","name":"Between Split and Converter","info":"","x":740,"y":760,"wires":[]},{"id":"164d22d946227d65","type":"comment","z":"99e019d5.6f0748","name":"Between Converter and Join","info":"","x":1020,"y":760,"wires":[]}]
As you can see, I separate two node : a split node and a function node.
The split node is used to ignore the "totals" line from my file, and the function nodeallows me to set LI_AFFAIRE value.
Without them, the join node has no problems but when I link one of this two, it doesn't work anymore.