Het was handiger geweest als je de prijzen ex btw in de tabel had staan ;-)
Maar nu gewoon simpel in 1 query
UPDATE products
SET
price_consument = ROUND((price_consument / 1.19 * 1.21), 2)
[size=xsmall]
Toevoeging op 01/10/2012 21:53:53:[/size]
Overigens krijg je hetzelfde effect als je het datatype van je kolom goed instelt (i.e FLOAT(10,2))
@Ger van Steenderen
Bedankt! Klopt was inderdaad handiger geweest ;-)
Formule klopt niet.
BTW=((BedragMetBTW/(Btw in % / 100 +1)))
oud prijs zonder btw= oudeprijsmetbtw -((oudeprijsmetbtw /(Btw in % / 100 +1)))
De formule van Ger klopt wel.
$Prijs_in_de_tabel;
$prijs_exclusief_btw = $Prijs_in_de_tabel / 1.19 ; // = $Prijs_in_de_tabel / (100% + 19%)
$prijs_inclusief_nieuwe_btw = $prijs_exclusief_btw * 1.21 // = $prijs_exclusief_btw * (100% + 21%)
=>
$prijs_inclusief_nieuwe_btw = $Prijs_in_de_tabel / 1.19 * 1.21