Magento Tax Calculation Incorrect - magento

Hi currently running into an issue with magento 1.9 tax calculations.
I have a product setup as £10.82 with VAT of 20% to be added. The price including VAT is £12.98.
When 1 product is added to the cart everything is ok but if I add 7 the total should be £90.86 but its showing as:
Subtotal - £75.74
VAT - £15.15
Total - £90.89
Therefore 3p of VAT extra is added. Please advise on how I can fix this.

This is not a bug. Total £90.89 is correct but if you want total sum without "extra" 3p of VAT, you can select a different method of calculating VAT.
£10,82 * 20% = £2,164 = £2,16
total: 7 * (£10,82+£2,16) = £90,86
vs
7 * £10,82 = £75,74
£75,74 * 20% = £15,148 = £15,15
total: £75,74 + £15,15 = £90,89
Check Tax Calculation Method in Settings.

Related

Magento table rate shipping - exclude some regions from shipping

I have setup a table rate shipping in Magento 1.9. I need to exclude some region from shipping.
For eg., In CSV there are 2 rows, in this format:
Country code - Region - postal - thrashhold - shipping cost
1. FR - Corsica - * - 0 - 18
2. * - * - * - 0 - 50
Currently, If I select France - Corsica in shipping calculator, then it returns shipping cost as 18, which is correct. If I select France - any other region then it shows shipping cost 50, which is not as requirement. Is it possible to restrict other regions, if I select France - any other region?
As per your CSV format condition on 2nd line is applied for all the location except FR-Corsica.You need to remove the second line then It must work as expected.
I think, I got it. I need to remove the regions from tables: directory_country_region and directory_country_region_name, then it wont give option to select other regions of France. Then the shipping can be restricted for these regions.
Only change order of rows
Example:
Country code - Region - postal - thrashhold - shipping cost
1. * - * - * - 0 - 50
2. FR - Corsica - * - 0 - 18

Magento different product price starting the second product

I'm working on a software online store width magento CE 1.9
the license pricing is a bit tricky:
each software product has a price for the first license, each additional license of the same product is cheaper.
for example:
1 license (Product Quantity:1) 200$
2 licenses (Product Quantity:2) 200$ (main price of first license) + 20$ (price of additional license) = 220$
3 licenses (Product Quantity:3) 200$ + 2 x 20$ = 240$
4 licenses (Product Quantity:4) 200$ + 3 x 20$ = 260$
i already tried Tier Prices, but this would only allow reducing the price of all licenses.
Many thanks in advance!
Is there any limit on the number of items you can sell? Because if you limit for example the number of licenses to be purchased to max 6, by doing some simple maths you find out that you can apply the following prices and use Tier Prices:
Price single license: 200$
+-----+---------+
| Qty | Price |
+-----+---------+
| 2 | 110$ | = (200+20)/2 <--- The divider is #items
| 3 | 80$ | = (200+20*2)/3
| 4 | 65$ | = (200+20*3)/4
| 5 | 56$ | = (200+20*4)/5
| 6 | 50$ | = (200+20*5)/6
+-----+---------+
But after six numbers don't round that nicely, so this is just a partial solution. Hope it helps you anyway. :)

Stata: foreach creates too many variables -

I created a toy example of my code below.
In this toy example I would like to create a measure of all higher prices minus lower prices within a self-created reference group. So within each reference group, I would like to take each individual and subtract its price value from all higher price values from other individuals in the same group. I do not want to have negative differences. Then I would like to sum all these differences. In creating this code I found some help here:
http://www.stata.com/support/faqs/data-management/try-all-values-with-foreach/
However, the code didn't work perfectly for me, because my dataset is quite large (several 100K obs) and the examples on the website and my code only work until the numlist maximum of 1600 in Stata. (I am using version 12). The toy example with the auto dataset works, due to small size of the dataset.
I would like to ask if someone has an idea how to code this more efficiently, so that I can get around the numlist restriction. I thought about summing the differences directly without saving them in intermediate variables, but that also blow up the numlist restriction.
clear all
sysuse auto
ren headroom refgroup
bysort refgroup : egen pricerank = rank(price)
qui: su pricerank, meanonly
gen test = `r(max)'
su test
foreach i of num 1/`r(max)' {
qui: bys refgroup: gen intermediate`i' = price[_n+`i'] -price if price[_n+`i'] > price
}
egen price_diff = rowmax(intermediate*)
drop intermediate*
If I understand this correctly, this isn't even a problem that requires explicit loops. The sum of all higher prices is just the difference between two cumulative sums. You might need to think through what you want to do if prices are tied.
. clear
. set obs 10
obs was 0, now 10
. gen group = _n > 5
. set seed 2803
. gen price = ceil(1000 * runiform())
. bysort group (price) : gen sumhigherprices = sum(price)
. by group : replace sumhigherprices = sumhigherprices[_N] - sumhigherprices
(10 real changes made)
. list
+--------------------------+
| group price sumhig~s |
|--------------------------|
1. | 0 218 1448 |
2. | 0 264 1184 |
3. | 0 301 883 |
4. | 0 335 548 |
5. | 0 548 0 |
|--------------------------|
6. | 1 125 3027 |
7. | 1 213 2814 |
8. | 1 828 1986 |
9. | 1 988 998 |
10. | 1 998 0 |
+--------------------------+
Edit: For what the OP needs, there is an extra line
. by group : replace sumhigherprices = sumhigherprices - (_N - _n) * price
If I understand the wording of the problem correctly, maybe this can help. It uses joinby (new observations are created and depending on the size of the original database, you may or not hit the Stata hard-limit on number of observations). The code reproduces the results that would follow from the code of the original post. This is a second attempt. The code before this final edit did not provide the sought-after results. The wording of the problem was somewhat difficult for me to understand.
clear all
set more off
* Load data
sysuse auto
* Delete unnecessary vars
ren headroom refgroup
keep refgroup price
* Generate id´s based on rankings (sort)
bysort refgroup (price): gen id = _n
* Pretty list
order refgroup id
sort refgroup id price
list, sepby(refgroup)
* joinby procedure
tempfile main
save "`main'"
rename (price id) =0
joinby refgroup using "`main'"
list, sepby(refgroup)
* Do not compare with itself and drop duplicates
drop if id0 >= id
* Compute differences and max
gen dif = abs(price0 - price)
collapse (max) dif, by(refgroup id0)
list, sepby(refgroup)

Tax rates in Magento for EU and Rest Of World

As a UK VAT registered business selling outwith the UK I have created a tax rate based on the UK VAT rate for all EU countries. Out-with the EU no VAT will be charged so am I correct in thinking I don't have to create any further rates, and that a user buying from the Rest Of World will just not have no tax rule applied so no VAT will be added nor will a tax element appear in their invoice breakdown (VAT breakdown is enabled in the config)?
An up to date CSV for EU tax rates in 2014 that works with Magento 1.9.0.1 (note that this is the current UK VAT rate of 20%). You should not be charging VAT when you ship to countries outside of the EU zone- ignore their billing address, it is where you send the items that counts. It should also be noted that Iceland, Liechtenstein, Norway and Switzerland are exempt from UK VAT.
Code,Country,State,Zip/Post Code,Rate,Zip/Post is Range,Range From,Range To,default
GB,GB,*,,20.0000,,,,VAT
AL,AL,*,,20.0000,,,,VAT
AD,AD,*,,20.0000,,,,VAT
AT,AT,*,,20.0000,,,,VAT
BY,BY,*,,20.0000,,,,VAT
BE,BE,*,,20.0000,,,,VAT
BA,BA,*,,20.0000,,,,VAT
BG,BG,*,,20.0000,,,,VAT
HR,HR,*,,20.0000,,,,VAT
CY,CY,*,,20.0000,,,,VAT
CZ,CZ,*,,20.0000,,,,VAT
DK,DK,*,,20.0000,,,,VAT
EE,EE,*,,20.0000,,,,VAT
FO,FO,*,,20.0000,,,,VAT
FI,FI,*,,20.0000,,,,VAT
FR,FR,*,,20.0000,,,,VAT
DE,DE,*,,20.0000,,,,VAT
GI,GI,*,,20.0000,,,,VAT
GR,GR,*,,20.0000,,,,VAT
HU,HU,*,,20.0000,,,,VAT
IS,IS,*,,0.0000,,,,VAT
IE,IE,*,,20.0000,,,,VAT
IT,IT,*,,20.0000,,,,VAT
LV,LV,*,,20.0000,,,,VAT
LB,LB,*,,20.0000,,,,VAT
LI,LI,*,,0.0000,,,,VAT
LT,LT,*,,20.0000,,,,VAT
LU,LU,*,,20.0000,,,,VAT
MT,MT,*,,20.0000,,,,VAT
MD,MD,*,,20.0000,,,,VAT
MC,MC,*,,20.0000,,,,VAT
ME,ME,*,,20.0000,,,,VAT
NL,NL,*,,20.0000,,,,VAT
NO,NO,*,,0.0000,,,,VAT
PL,PL,*,,20.0000,,,,VAT
PT,PT,*,,20.0000,,,,VAT
RO,RO,*,,20.0000,,,,VAT
RS,RS,*,,20.0000,,,,VAT
SK,SK,*,,20.0000,,,,VAT
SI,SI,*,,20.0000,,,,VAT
ES,ES,*,,20.0000,,,,VAT
SJ,SJ,*,,20.0000,,,,VAT
SE,SE,*,,20.0000,,,,VAT
CH,CH,*,,0.0000,,,,VAT
TR,TR,*,,20.0000,,,,VAT
UA,UA,*,,20.0000,,,,VAT
VA,VA,*,,20.0000,,,,VAT
To my understanding, both those answers are incorrect. I'm fairly certain that as UK businesses we have to charge UK VAT only to the UK and other members of the EU, and zero rate to any country outside the EU. Both answers include non-EU countries in the csv, including AL (Albania), AD (Andorra), BY (Belarus), BA (Bosnia & Herzegovina), etc, etc.
Here's my edited list, although I'm not sure about VA (Vatican City), it seems to officially not be part of the EU, so in theory zero rated, can anyone clarify? (Not that I've ever had an order from there!)
Code,Country,State,Zip/Post Code,Rate,Zip/Post is Range,Range From,Range To,default
GB,GB,*,,20.0000,,,,VAT
AT,AT,*,,20.0000,,,,VAT
BE,BE,*,,20.0000,,,,VAT
BG,BG,*,,20.0000,,,,VAT
CY,CY,*,,20.0000,,,,VAT
CZ,CZ,*,,20.0000,,,,VAT
DK,DK,*,,20.0000,,,,VAT
EE,EE,*,,20.0000,,,,VAT
FI,FI,*,,20.0000,,,,VAT
FR,FR,*,,20.0000,,,,VAT
DE,DE,*,,20.0000,,,,VAT
GI,GI,*,,20.0000,,,,VAT
GR,GR,*,,20.0000,,,,VAT
HR,HR,*,,20.0000,,,,VAT
HU,HU,*,,20.0000,,,,VAT
IE,IE,*,,20.0000,,,,VAT
IT,IT,*,,20.0000,,,,VAT
LV,LV,*,,20.0000,,,,VAT
LI,LI,*,,0.0000,,,,VAT
LT,LT,*,,20.0000,,,,VAT
LU,LU,*,,20.0000,,,,VAT
MT,MT,*,,20.0000,,,,VAT
MC,MC,*,,20.0000,,,,VAT
NL,NL,*,,20.0000,,,,VAT
NO,NO,*,,0.0000,,,,VAT
PL,PL,*,,20.0000,,,,VAT
PT,PT,*,,20.0000,,,,VAT
RO,RO,*,,20.0000,,,,VAT
SK,SK,*,,20.0000,,,,VAT
SI,SI,*,,20.0000,,,,VAT
ES,ES,*,,20.0000,,,,VAT
SE,SE,*,,20.0000,,,,VAT
CH,CH,*,,0.0000,,,,VAT
VA,VA,*,,20.0000,,,,VAT

price filter problem in magento

In magento sidebar basically how the price filter option is working, i went through all the templte and block files under my custom design.
I am getting this ranges by default.
1. $0.00 - $10,000.00 (1027)
2. $10,000.00 - $20,000.00 (3)
3. $20,000.00 - $30,000.00 (1)
These limits are automatically taken but i want give my own ranges, but they are using only one template file called filter.phtml if i touch that then all other filter options are having problem. How can i customize this price filter as per my own set of ranges?
I need something like this
# $40.00 - $60.00 (155)
# $60.00 - $80.00 (150)
# $80.00 - $100.00 (153)
# $100.00 - $200.00 (248)
# $200.00 - $300.00 (100)
# $300.00 - $400.00 (43)
# $400.00 - $500.00 (20)
# $500.00 - $600.00 (6)
# $600.00 - $700.00 (6)
# $700.00 - $800.00 (2)
If you look in filter.phtml, you will see that it is using the block Mage_Catalog_Block_Layer_Filter_xxx where xxx is the attribute type. Which in turn leads you to the model: Mage_Catalog_Model_Layer_Filter_Price.
Inside app/code/core/Mage/Catalog/Model/Layer/Filter/Price.php, you will see the method getPriceRange() which calculates the price breaks.
You can override that model by copying it into app/code/local/Mage/Catalog/Model/Layer/Filter and adjusting that method so that it calculates the ranges per your requirements.
Good luck.
JD

Resources