Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add tax to total 1

Status
Not open for further replies.

SjrH

IS-IT--Management
Jun 24, 2003
747
0
0
GB
Hi,

Can anyone advise me as to how I can add 17.5% (vat) to the total in the code below?

function showFees() {
global $config, $mosConfig_live_site;
$this->msg = $this->msg."\n\t <div class='PaymentContainer'><h3>"._PAY_CHOSEN_OPTIONS."</h3>";
$this->msg = $this->msg. "\n\t <table id='Payment'>";
foreach($this->feesOptions as $option => $payment ) {
$this->fees = $this->fees + $payment;
$payment = $config->getCurrencyFormat($payment);
$this->msg = $this->msg. "\n\t\t <tr> ";
$this->msg = $this->msg. "\n\t\t\t <td class='PayOption'>";
$this->msg = $this->msg. "\n\t\t\t {$option}";
$this->msg = $this->msg. "\n\t\t\t </td>";
$this->msg = $this->msg. "\n\t\t\t <td class='PayFees'>";
$this->msg = $this->msg. "\n\t\t\t {$payment}";
$this->msg = $this->msg. "\n\t\t\t </td>";
$this->msg = $this->msg. "\n\t\t </tr> ";
}

$this->total = $this->fees;
$this->fees = $config->getCurrencyFormat($this->fees);

$this->msg = $this->msg. "\n\t\t <tr> ";
$this->msg = $this->msg. "\n\t\t\t <td>";
$this->msg = $this->msg. "\n\t\t\t\t "._PAY_TOTAL_AMOUNT;
$this->msg = $this->msg. "\n\t\t\t </td>";
$this->msg = $this->msg. "\n\t\t\t <td id='PayTotal'>";
$this->msg = $this->msg. "\n\t\t\t\t {$this->fees}";
$this->msg = $this->msg. "\n\t\t\t </td>";
$this->msg = $this->msg. "\n\t\t </tr> ";
$this->msg = $this->msg. "\n\t</table>";

Apologies if this is obvious! PHP is new to me!


Thanks :)
 
Code:
$this->vatinclusive = (float) $this->fees * 1.175; //for uk vat
$this->fees = $config->getCurrencyFormat($this->fees);
$this->vatinclusive = $config->getCurrencyFormat($this->vatinclusive);

Code:
       $this->msg = $this->msg. "\n\t\t\t\t {$this->fees} ({$this->vatinclusive} incl VAT)";
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top