Question Convert Currency (continued).

Status
Not open for further replies.

ShikiSuen

New member
This thread continues the following thread:

Supposed that there are 2 currencies: Coals and Metals.
Every 10000 Coals can be used for changing into 100 Metal.
Every 100 Metal can be changed for 10000 Coals but there are 20% tax rate for this... Hence 8000 Coals after the change.

How should I configure the transfer event parameters for both currencies?
(I have tested adding transfer event to both currencies, but the configuration is confusing me a lot. Maybe this is due to my bad English in accounting and finance major... (I'm a bachelor of music) .)
 
By the way,
DB eCommerce, which we use here, is single currency only. It uses XenForo's payment API system, so you could hook it up to other merchants by installing payment profile add-ons, though I don't know of any direct hook-ups to credit card companies.
Does this mean that DB Credits are not usable for purchasing products listed in eCommerce?
 
In the currency settings for "Metal", set "Relative Value" to 1.
In the currency settings for "Coal", set "Relative Value" to 100.


View attachment 9837
Thanks for your response.
How should we set up the tax rate? This only applies when using one Metal to change for Coals.
1 metal change for 100 coals but get 20% taxed, hence 80 coals returned.

Also, in the DragonByte eCommerce, is it possible for a customer to pay with mixed currency (some real money plus more than one type of some DragonByte currency virtual money)? If possible, is it able to limit the maximum amount of those virtual money used in each currency in per order?
 
Also, in the DragonByte eCommerce, is it possible for a customer to pay with mixed currency (some real money plus more than one type of some DragonByte currency virtual money)? If possible, is it able to limit the maximum amount of those virtual money used in each currency in per order?
No, this is not possible.

Thanks for your response.
How should we set up the tax rate? This only applies when using one Metal to change for Coals.
1 metal change for 100 coals but get 20% taxed, hence 80 coals returned.
It sounds like you're explaining your current setup, so I'm not sure what you're asking here.
 
No, this is not possible.
Hi Fillip H,

Thank you for the information. I need some more advanced features. Would you like to develop some features for me (based on eCommerce)? I am willing to pay extra for this. Can we discuss this matter in depth?
Thanks.

Best Regards,
Flying
 
It sounds like you're explaining your current setup, so I'm not sure what you're asking here.
I just have no clue how the tax system works.
However, since @Flying changed his idea about the taxing, I decided to hold on this question until Flying think it is of vital necessity in the future.
 
New problem.
I tried transferring 490 coals to metals but it returns MySQL error.
Is there a way to round the input number to the one fully dividable by the conversion rate?
(e.g. Automatically change the input amount from 490 to 400 in this case.)

1619173082945.png
1619173136068.png
 
This is a server issue. This add-on assumes you have a standard MySQL server setup with . as the decimal separator.
 
This is a server issue. This add-on assumes you have a standard MySQL server setup with . as the decimal separator.
We are using MySQL 8.x as the MySQL server.
I tried googling the solution but can't see anything useful.
Could you please tell me how to change this? or should we consult a MySQL specialist instead?
 
It would be better if your database administrator looked into this, the database column is a DECIMAL not INTEGER so there's nothing I can do on my end.
 
It would be better if your database administrator looked into this, the database column is a DECIMAL not INTEGER so there's nothing I can do on my end.
I just checked my MySQLWorkBench and I'm sure that I can fix this as long as you can tell me which database column in which table.
1619185491075.png
 
I assume that tt appears to be a problem between UI.X and DB Credits.
(There are UI.X php files mentioned in the error log.)
Code:
                    UPDATE xf_user
                    SET dbtech_credits_energy_object = GREATEST(0, CAST(dbtech_credits_energy_object AS SIGNED) + ?)
                    WHERE user_id = ?
                
------------

#0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL query err...', 1292, '22007')
#1 src/XF/Db/Mysqli/Statement.php(77): XF\Db\Mysqli\Statement->getException('MySQL query err...', 1292, '22007')
#2 src/XF/Db/AbstractAdapter.php(94): XF\Db\Mysqli\Statement->execute()
#3 src/addons/DBTech/Credits/Entity/Transaction.php(199): XF\Db\AbstractAdapter->query('
                    UPDATE xf...', Array)
#4 src/XF/Mvc/Entity/Entity.php(1266): DBTech\Credits\Entity\Transaction->_postSave()
#5 src/addons/DBTech/Credits/EventTrigger/AbstractHandler.php(677): XF\Mvc\Entity\Entity->save(true, false)
#6 src/addons/DBTech/Credits/EventTrigger/AbstractHandler.php(431): DBTech\Credits\EventTrigger\AbstractHandler->trigger(Object(ThemeHouse\UIX\XF\Entity\User), 3, false, Object(ArrayObject))
#7 src/addons/DBTech/Credits/Pub/Controller/Currency.php(570): DBTech\Credits\EventTrigger\AbstractHandler->apply(3, Array, Object(ThemeHouse\UIX\XF\Entity\User))
#8 src/XF/Mvc/Dispatcher.php(350): DBTech\Credits\Pub\Controller\Currency->actionTransfer(Object(XF\Mvc\ParameterBag))
#9 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass('DBTech\\Credits:...', 'Transfer', Object(XF\Mvc\RouteMatch), Object(DBTech\Credits\Pub\Controller\Currency), NULL)
#10 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(DBTech\Credits\Pub\Controller\Currency), NULL)
#11 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#12 src/XF/App.php(2326): XF\Mvc\Dispatcher->run()
#13 src/XF.php(488): XF\App->run()
#14 index.php(20): XF::runApp('XF\\Pub\\App')
#15 {main}
 
I couldn't say, this isn't an issue that myself nor anyone else is able to replicate. Can you check the dbtech_credits_energy_object column on your xf_user table?
 
Status
Not open for further replies.

DragonByte Credits

XenForo 1.5.3+ XenForo 2.0.x XenForo 2.1.x XenForo 2.2.x
Seller
DragonByte Technologies
Release date
Last update
Total downloads
4,223
Customer rating
5.00 star(s) 4 ratings
Back
Top