kabucek Posted September 10, 2008 Share Posted September 10, 2008 hello @LL, is this piece of code correct ? $showTotalShippingPrice=number_format($totalShippingPrice,2); //calc tax if(strtolower($memberDataArray['state'])=='il') { // Patch by someone // Fixes "divide by zero" error. if(!isset($discountedProdPrice) || $discountedProdPrice <= 0) { $discountedProdPrice = 1; } if(!isset($totalProdPrice) || $totalProdPrice <= 0) { $totalProdPrice = 1; } $discountFraction=$discountedProdPrice/$totalProdPrice; $taxExclusionDiscountTotal=$taxExclusionRetailTotal; $taxableAmount=$discountedProdPrice-$taxExclusionDiscountTotal; $taxableAmount=number_format($taxableAmount,2); $taxRate=.085; $taxRate=.09; $tmp=$taxRate*100; $showTaxRate=number_Format($tmp, 2)."%"; $totalTax=number_format(($taxableAmount)*$taxRate, 2); $totalTax=max(0,$totalTax); //with discounts, total tax can go negative $showTotalTax=$totalTax; if ($taxExclusionDiscountTotal>0) { $taxExclusionNotificationString=" - <SPAN style=color:green><SPAN style=font-size:120%>+</SPAN> $dollarSign$taxExclusionDiscountTotal non-taxable</SPAN>, $dollarSign$taxableAmount taxable at $showTaxRate "; } else { $taxExclusionNotificationString=" - $showTaxRate "; } if ($nonTaxableItemFound=='true') { $promotionMsg.=" <DIV class=processMsgSuccess>'+' (plus sign) signifies non-taxable item</DIV> "; } } else { $totalTax=0; $showTotalTax=number_format($totalTax, 2); } thanks Quote Link to comment https://forums.phpfreaks.com/topic/123628-tax-issue-in-php/ Share on other sites More sharing options...
kenrbnsn Posted September 10, 2008 Share Posted September 10, 2008 What's it supposed to do? Do you get any errors? Please explain your question more. Ken Quote Link to comment https://forums.phpfreaks.com/topic/123628-tax-issue-in-php/#findComment-638416 Share on other sites More sharing options...
kabucek Posted September 10, 2008 Author Share Posted September 10, 2008 it suppose to charge tax in our form but it doesn't display tax fee when someone is trying to register Quote Link to comment https://forums.phpfreaks.com/topic/123628-tax-issue-in-php/#findComment-638417 Share on other sites More sharing options...
Maq Posted September 10, 2008 Share Posted September 10, 2008 Try echoing out some of your vars to see if there is actually values, or correct values, in them. Also, if you surround your code with the <?php ... ?> then in the code tags it will be easier to read. Quote Link to comment https://forums.phpfreaks.com/topic/123628-tax-issue-in-php/#findComment-638428 Share on other sites More sharing options...
tibberous Posted September 10, 2008 Share Posted September 10, 2008 You should sent that to your accountant Quote Link to comment https://forums.phpfreaks.com/topic/123628-tax-issue-in-php/#findComment-638449 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.