[{"id":"30c577c1.ce10e8","type":"inject","z":"5400a130.bbd76","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":200,"wires":[["a2596d30.bc2a3"]]},{"id":"a2596d30.bc2a3","type":"split","z":"5400a130.bbd76","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":310,"y":280,"wires":[["26c10aea.f47826","332cb41b.26293c"]]},{"id":"26c10aea.f47826","type":"debug","z":"5400a130.bbd76","name":"after split","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":480,"y":220,"wires":[]},{"id":"332cb41b.26293c","type":"switch","z":"5400a130.bbd76","name":"Check Debit","property":"payload.Debit","propertyType":"msg","rules":[{"t":"null"},{"t":"nnull"}],"checkall":"false","repair":false,"outputs":2,"x":490,"y":280,"wires":[["bb323284.efa04"],["85323343.d245d"]]},{"id":"bb323284.efa04","type":"change","z":"5400a130.bbd76","name":"Converter","rules":[{"t":"set","p":"payslip.Numero","pt":"msg","to":"\"BCUSA\"\t& $moment($$.payload.Date, \"MM/DD/YY\").format(\"YY\")\t& \"PR\"\t& $replace($moment($$.payload.Date, \"MM/DD/YY\").format(\"MMDDYYYY\"), \"/\", \"\")","tot":"jsonata"},{"t":"set","p":"payslip.Date","pt":"msg","to":"$moment($$.payload.Date, \"MM/DD/YY\").format(\"DD/MM/YYYY\")","tot":"jsonata"},{"t":"set","p":"payslip[\"Code Journal\"]","pt":"msg","to":"GS","tot":"str"},{"t":"set","p":"payslip.Exercice","pt":"msg","to":"24","tot":"num"},{"t":"set","p":"payslip.Compte","pt":"msg","to":"payload[\"Account Number\"]","tot":"msg"},{"t":"set","p":"payslip.Libelle","pt":"msg","to":"payload[\"Account Name\"]","tot":"msg"},{"t":"set","p":"payslip.Debit","pt":"msg","to":"","tot":"str"},{"t":"set","p":"payslip.Credit","pt":"msg","to":"payload.Credit","tot":"msg"},{"t":"set","p":"payslip.Devise","pt":"msg","to":"","tot":"str"},{"t":"set","p":"payslip.Piece","pt":"msg","to":"","tot":"str"},{"t":"set","p":"payslip.Affaire","pt":"msg","to":"B000030","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":240,"wires":[["454a87cbe3d047c3"]]},{"id":"85323343.d245d","type":"change","z":"5400a130.bbd76","name":"Converter","rules":[{"t":"set","p":"payslip.Numero","pt":"msg","to":"\"BCUSA\"\t& $moment($$.payload.Date, \"MM/DD/YY\").format(\"YY\")\t& \"PR\"\t& $replace($moment($$.payload.Date, \"MM/DD/YY\").format(\"MMDDYYYY\"), \"/\", \"\")","tot":"jsonata"},{"t":"set","p":"payslip.Date","pt":"msg","to":"$moment($$.payload.Date, \"MM/DD/YY\").format(\"DD/MM/YYYY\")","tot":"jsonata"},{"t":"set","p":"payslip[\"Code Journal\"]","pt":"msg","to":"GS","tot":"str"},{"t":"set","p":"payslip.Exercice","pt":"msg","to":"24","tot":"num"},{"t":"set","p":"payslip.Compte","pt":"msg","to":"payload[\"Account Number\"]","tot":"msg"},{"t":"set","p":"payslip.Libelle","pt":"msg","to":"payload[\"Account Name\"]","tot":"msg"},{"t":"set","p":"payslip.Debit","pt":"msg","to":"payload.Debit","tot":"msg"},{"t":"set","p":"payslip.Credit","pt":"msg","to":"","tot":"str"},{"t":"set","p":"payslip.Devise","pt":"msg","to":"","tot":"str"},{"t":"set","p":"payslip.Piece","pt":"msg","to":"","tot":"str"},{"t":"set","p":"payslip.Affaire","pt":"msg","to":"B000030","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":320,"wires":[["454a87cbe3d047c3"]]},{"id":"454a87cbe3d047c3","type":"junction","z":"5400a130.bbd76","x":780,"y":280,"wires":[["a3901add2cc10d26","d0bdeb00.eeb068"]]},{"id":"a3901add2cc10d26","type":"change","z":"5400a130.bbd76","name":"move payslip -> payload","rules":[{"t":"move","p":"payload","pt":"msg","to":"original","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payslip","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":930,"y":280,"wires":[["1099c5bd6ca4440e","9d9a1204226fa1fe"]]},{"id":"d0bdeb00.eeb068","type":"debug","z":"5400a130.bbd76","name":"After convert","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":890,"y":340,"wires":[]},{"id":"1099c5bd6ca4440e","type":"join","z":"5400a130.bbd76","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":1160,"y":280,"wires":[["c4da4c63.3e4cf","52d3872a922b517e"]]},{"id":"9d9a1204226fa1fe","type":"debug","z":"5400a130.bbd76","name":"After move","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1010,"y":220,"wires":[]},{"id":"c4da4c63.3e4cf","type":"csv","z":"5400a130.bbd76","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":1310,"y":280,"wires":[["9438380f.a113d8"]]},{"id":"52d3872a922b517e","type":"debug","z":"5400a130.bbd76","name":"After join","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1140,"y":340,"wires":[]},{"id":"9438380f.a113d8","type":"debug","z":"5400a130.bbd76","name":"In CSV format","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1340,"y":220,"wires":[]}]