Hello,
We have a script that returns the monthly fees charged to those users who hold a chequing account. That script is called by a Generated Payment Type and runs on the 1st of the month on all chequing accounts.
The question we have for you is, how do we retrieve the main broker of the user in the script while the " Generated Payment Type" is running on chequing accounts ?
I have attached a few screenshots to help you understand the context.
Thank you for your help.
Main Broker in Generated payment type
Moderators: alexandre, hugo, rmvanarkel
Main Broker in Generated payment type
- Attachments
-
- image(1).png (23.76 KiB) Viewed 58292 times
-
- image(2).png (52.19 KiB) Viewed 58292 times
Re: Main Broker in Generated payment type
I didn't understand the question, as you're already retrieving the main broker with fromUser.mainBroker.The question we have for you is, how do we retrieve the main broker of the user in the script while the " Generated Payment Type" is running on chequing accounts ?
Please, share some additional details.
Luis Fernando Planella Gonzalez
Cyclos development team
Cyclos development team
Re: Main Broker in Generated payment type
Okay let me try again, It is not easy to explain this.
We have a generated payment type which charge X amount to all chequing accounts. X amount is returned by a script. The thing is we want to share (half of the amount charged: X/2) with the mainbroker of the chequing account holder. Therefore we need to retrieve the mainBroker in the script before returning the amount to be charged. I know it is a bit twisted, another alternative would be to have a loop to retrieve all chequing accounts; something like this:
foreach chequing account
balance = balance - 1200
if (user has mainBroker)
mainBroker.Balance = mainBroker.Balance + 1200/2
endif
endforeach
Thanks.
We have a generated payment type which charge X amount to all chequing accounts. X amount is returned by a script. The thing is we want to share (half of the amount charged: X/2) with the mainbroker of the chequing account holder. Therefore we need to retrieve the mainBroker in the script before returning the amount to be charged. I know it is a bit twisted, another alternative would be to have a loop to retrieve all chequing accounts; something like this:
foreach chequing account
balance = balance - 1200
if (user has mainBroker)
mainBroker.Balance = mainBroker.Balance + 1200/2
endif
endforeach
Thanks.
Re: Main Broker in Generated payment type
Ok, so if I understand correctly, all you need is to have a transfer fee in the transfer type "Automated Monthly Account Fees".
It would be configured as follows:
Would that be enough?
It would be configured as follows:
- Will be charged: System
- Will receive: Destination broker
- Amount: 50%
Would that be enough?
Luis Fernando Planella Gonzalez
Cyclos development team
Cyclos development team