asterisk2billing.org
http://forum.asterisk2billing.org/

Refill in customer native currency
http://forum.asterisk2billing.org/viewtopic.php?f=18&t=12471
Page 1 of 1

Author:  mangust [ Wed May 25, 2016 12:10 pm ]
Post subject:  Refill in customer native currency

Hi,

I am trying to improve customer announced balances.

Issue is:
base currency is USD
customer currency GBP
then Cronjobs/currencies_update_yahoo.php runs from cron. Customer who has £1, getting wrong random balance announcement: £0.99 £1.03
It is correct, but wrong for customer to hear.

I wrote a patch then customer get topup via our own API £1 he will hear his balance increased by £1, not £0.99 not £1.03 but exactly £1. It is stable, works and balances stored in base currency without braking any other functionality.

Now I want:
1. add ability A2B_entity_logrefill.php to enter value in users currency. It require read cc_card before update, recalculate, write cc_card.
initially I modified common/lib/Form/Class.FormBO.php static function add_card_refill. It update balance correctly. However I think it is a hook that is called after insert cc_logrefill. cc_logrefill still getting value entered in the form.
I need help here.


2. I am already able to show correct balance that customer will hear on A2B_card_info.php. But would like to show on A2B_entity_card.php
I found some code admin/Public/form_data/FG_var_card.inc. Something around line 137:

$show_fields['credit'] = array("<acronym title=\"".gettext("BALANCE")."\">".gettext("BA")."</acronym>", "credit", "5%", "center", "sort", "5", "", "", "", "", "", "display_2bill");

I need to show: CONCAT(credit/announce_exchange.' '.currency) where credit, announce_exchange, currency are all columns of cc_card table.

display_2bill located in Misc.php, that has no access to other columns. How can I do it?

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/