Different currency in journal entry

hello everyone,
I made two new forms inside journal entry specifically in account entries, which are debit and credit in other currency that is different from the account’s currency because that is what I was told to do, so that the new currency that the customer paid with would be saved as it is.
but I’m missing some logic in the client script and got lost .
can someone help me and tell me a way to do that ?