Is it possible determinate transaction fee execution order?

Functionality discussions and feature requests

Moderators: rmvanarkel, hugo, alexandre

Post Reply
fernandobalm
Posts: 4
Joined: Wed Mar 02, 2011 6:53 pm
Location: São Paulo - SP - Brazil
Contact:

Is it possible determinate transaction fee execution order?

Post by fernandobalm »

Friends,

If I have a transaction type with more than one transaction fee associated, is it possible to determinate the order of transaction fees execution?

The reason for this question is that I followed
http://project.cyclos.org/forum/viewtopic.php?t=906 to solve exchange rates problem for my installation. I followed the second suggestion ("Create for every ..."). It worked perfectly, unless one point.

I have some exchange operations where user gives country official money (BRL - R$) and gets physical system money (mirucas). In this case I need three associated payments:
1 - User transfers official country money from his account to system account. Currency of both account is BRL
2 - I created a transaction fee to automatically transfer system money (mirucas) from community account to user account. Currency of both accounts is miruca.
Until here everything is fine (electronic exchange). But when user wants to receive directly physical money in this transaction, to automatize the process, I have one step more.
3 - I created another transaction fee to automatically transfer system money from user account to voucher account. This works as a withdrawal.

The problem is that cyclos apparently is performing the third step (withdrawal) before the second. And in this case, depending on previous member account balance occurs an error, because his account balance becomes negative.

I have the same problem for a loan that is granted in a currency and payed back in a different currency, because to allow this operation I also used the same strategy (I made a transfer from community to user in mirucas and then made an electronic exchange

I think the solution could be determinate transaction fee order, configuring always executing step 2 and after executing step 3 above.

I accept any other suggestions.

Thanks and regards!
Fernando Barreto de Almeida
mailto: fernandobalm@bol.com.br
http://fernandobalm.vilabol.uol.com.br
Telefone: 55 - 11 - 33410224
São Paulo - SP - Brasil
jaime

well...

Post by jaime »

Hi Fernando,
first, congrats for the nice accounting plan you did.
i did faced the same issue as you (also when setting the fee to be deduced from the transaction, the account balance interfered).
i didnt found a nice solution.
cyclos do have a priority flag, but i couldnt make it work, and imho, it would be better if this flag become a priority "number", so before execute, it would parse the priority number and perform in that order.

sorry i couldnt help more.
regards,
rinke
Posts: 87
Joined: Thu Mar 31, 2005 4:54 pm

Post by rinke »

Hi Fernando,

Hmmm, I see your point, but I'm afraid that at the moment there is no way to set the processing order of transaction fees.
You could try to delete your second fee, and then insert it again. The result of that will be that it will be stored in the database in a newer record after the third fee, so it might be executed first.
However, I don't know if this trick would actually work in practice; it depends in what kind of java collection it is stored after being retrieved.
And I suppose that deleting fees in cyclos is not possible after they have been used already. In that case you should disable in stead of delete - which means you got stuck with an unused fee in your fee overview.

All in all not a very nice and clean "solution", and it maybe doesn't even work. I don't know if priority of fee processing is on the list for future versions.

Maybe some other team members can comment on this??
________________________
Rinke Hoekstra
cyclos project team,
STRO.
fernandobalm
Posts: 4
Joined: Wed Mar 02, 2011 6:53 pm
Location: São Paulo - SP - Brazil
Contact:

I followed suggestion. It didn't work. Other suggestions?

Post by fernandobalm »

Rinke,

I've already tried to disable one fee and create again, imagining exactly what you said. :D But It didn't work. I also tried to disable both fees and recreate them first in one order and after in other order. But it also didn't work.

By your answer and Jaime's answer I think what I want is not possible in Cyclos at this moment. :cry: If you have another suggestion to do what I need in other way I would appreciate to hear. :D

Regards and thanks for your answer.
Fernando Barreto de Almeida
mailto: fernandobalm@bol.com.br
http://fernandobalm.vilabol.uol.com.br
Telefone: 55 - 11 - 33410224
São Paulo - SP - Brasil
Post Reply