Tax advisory job

Salam aleykoum m,

I hope you are doing well,

I have a question regarding a new job opportunity. I would like to know if it’s halal or haram, before I start.

I asked a lot of imams around me, unfortunately nobody was able to help me. May Allah rewards you for your help.

The new job is tax advisor. We are helping the companies for all the taxes matters, the purpose is to pay the minimum amount of tax in a legal way. The tax system is regulated by the law and it’s not easy for the companies to understand the law, that’s why they request our services.

The problem is that sometimes the law encourage the riba. For exemple if you finance your real estate investment by debt (with interest) you will pay less taxes then if you finance by equity.
Is it haram to say this to the client as it’s the law that promote the riba and not us, we are just indicate to him what the law says. Furthermore, we have nothing to win if he finance it by riba or not.

I also would like to say that in the contract that we sign with the client we clarify that our work only addresses the tax purposes, we are not liable for the rest(for exemple if it’s interesting in a economic point of view, or legal point of view, or religious point of view). We do not mention the religious point of view, but we clearly mention that we are liable only of the tax aspect.

Consequently for me it’s not an advice because he is asking what is the way to pay the less taxes, the answer can only be what the law says, I don’t have the choice to tell him something else (otherwise it’s liying). Am I wrong ?
He is not asking what is the best for me (to stay far from riba as it’s a war with Allah and his messenger).

In addition, I have an other question. In this job, we never advice the client to have a debt with a bank or with a third party. We only advice him to have intercompany loans for taxes purposes. I mean for exemple a couple (or multiple) of partners hold a company A, and this company A hold a company B. If the company A gives a loan to the company B with interest (it’s mandatory legally) is it riba ? Or is it a cash transfer regarding ?

Because here there is no winner or loser in this transaction. Nobody will benefit or lose money for this transaction. It’s only for tax purposes. I am wrong ? Is it riba ?

Sorry for my English. And many thanks for your work and for the time that you will take to read an answer.
May Allah reward you with the Jannah. BarakAllah oufik.