Jump to content

Pay with Credit Balance


Nyan

Recommended Posts

I customized Order Form Template in reference to the following.

http://forum.whmcs.com/showthread.php?31405-Pay-with-Credit-Balance

Template: Six
Order Form Template: Standard Cart

<div class="total-due-today total-due-today-padded">
<span class="amt">{$total}</span>
<span>{$LANG.ordertotalduetoday}</span>
</div>

Change the above code to the following.

{if $clientsdetails.credit > 0}
{assign var="inttotal" value=$total|replace:$currency.suffix:''}
{assign var="inttotal" value=$inttotal|replace:$currency.prefix:''}
<div class="recurring-totals clearfix">
<span class="pull-left">{$LANG.statscreditbalance}:  </span>
<span class="pull-right recurring-charges">{$clientsstats.creditbalance}</span>
</div>
{if $clientsdetails.credit > $inttotal}
<div class="total-due-today total-due-today-padded">
<span class="amt">0</span>
<span>{$LANG.ordertotalduetoday}</span>
</div>
{else}
{assign var="total" value=$inttotal-$clientsdetails.credit}
{assign var="total" value=$total|number_format:0}
<div class="total-due-today total-due-today-padded">
<span class="amt">{$total}</span>
<span>{$LANG.ordertotalduetoday}</span>
</div>
{/if}
{else}
<div class="total-due-today total-due-today-padded">
<span class="amt">{$total}</span>
<span>{$LANG.ordertotalduetoday}</span>
</div>
{/if}

It is calculated correctly if the following settings.
Setup > Payments > Currencies > Format:1234.56

However if the following settings, it is not calculated correctly.
Setup > Payments > Currencies > Format:1,234
or
Setup > Payments > Currencies > Format:1,234.56

Please tell me how to resolve.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated