No data or undefined when call from the frontend

So there’s a little too much going on here for me to see exactly what is wrong, but to debug where your issue is perhaps start a little more simply.

The first issue is successfully calling your backend function from the FE, so I would pull it out of that big function and isolate it. If the data is returning then the issue is with your FE function.

Something like in your onReady just start with this and see if you can get your data:

import { calcuTarif } from 'backend/myFunctionFile'

$w.onReady(async function () {

const results = await calcuTarif(hardcode, your, parameters,to,test);
console.log(JSON.stringify(results));
});

Start simply with the debugging and it will be easier to pin down the issue.