[cz] Pozor je chyba ve vypoctu DPH !

Svetluska

No avatar

2006-08-20 22:30

I kdyz jiz nepracuji s Quick cart, dovoluji si ostatni upozornit na chybu ve vypoctu s DPH. Castka DPH je pocitana z celkové ceny, nikoliv z ceny produktu bez DPH. Nevim jestli to chapete ale zde uvedu příklad. Pokud mate zbozi např. za 11200 Kc včetně 19%DPH je v objednávce uvedena následující cena 9072 bez DPH . To je spatne. Pokud bych mel produkt bez dane za 9072 bez DPH + 19% DPH, tak DPH je 1723 kc , nikoliv 2128 kc, jak to pocita modul na dane a vysledkem bude spravná cena 10795 vcetne DPH . Pokud ma byt cena s DPH 11200 kc nemuze byt cena 9072 bez DPH... Chapete ? Nebo se mam vratit na zakladku zopakovat matematiku?

larryonov

No avatar

2006-08-21 10:51

Jo hele, on ma pravdu, zkuste si hodit do quick.cartu cenu z nejakyho duveryhodnyho obchodu (ja zkusil treba alzac) a to DPH je vypocitany fakt spatne! bo nevi nekdo jak spravne nastavit taxanddiscounts?

larryonov

No avatar

2006-08-22 14:11

Hele, takze sem ten bug od Svetlusky prelozil, a poslal to wizzudovi, snad se to da pochopit ;)
(btw snad tu matiku fakt aspon trochu davame a nedelame tady mezinarodni ostudu..)
------------------------------------------------------------------------------------------------------------ --

Hi, there is a bug in taxanddiscounts plugin (error in VAT), example:

If I have product for 11200 CZK including 19% VAT, in order it is written 9072 without WAT - this is bad.

=>
If I would have product for 9072 CZK + 19% VAT, so VAT is 1723 (NOT 2128) and total amount is 10795 CZK (NOT 11200)

So, if total amount would be 11200 CZK, price without VAT cant be 9072 CZK..

wizzud

No avatar

2006-08-22 15:33

As I have tried to explain in the notes that come with the plugin, in order to display the amount of tax that has already been included in the product prices it is necessary to set the tax amount to a negative value equivalent to the actual tax rate as a percentage of 100+that tax rate.

Examples are available in the User Guide section of the documentation, under the headings 'Example - No Discount' and 'Example - Tax Rebate'.

For example, given the figures quoted above, to display the 19% tax that has already been added to the product prices you would have to set the tax rate to '-15.966'. This is calculated from

-1 * (<tax rate> / (100 + <tax rate>) ) * 100

ie. -1 * ( 19 / (100+19) ) * 100
ie. -19*100/119

The '-1' at the beginning simply makes the tax calculator take the result AWAY from the product prices instead of adding it as it usually would.
The '19/(100+19)' calculates the fractional amount added to the non-taxed price to get the taxed price.
The '100' at the end converts what precedes it into a percentage.

So...
For a product price (untaxed) of 9412 CZK, the price including tax at 19% would be 11200 CZK.
Working backwards from 11200 CZK, the TAD plugin calculates the tax charged on 11200 CZK as (-19*100/119)% of 11200, which equals -11200*19/119, which equals -1788 CZK. Add 9412 (the original price) and 1788 (the reverse-calculated tax) and you get back to 11200!

[There will be some rounding errors creeping in due to the 3 decimal places limit on the tax rate that can be entered in teh TAD's configuration settings.]

larryonov

No avatar

2006-08-22 17:32

Solved, thx to wizzud!

---

Proste dejte velikost dane, vypliva to nejak z tech vyse uvedenych vypoctu, ne 19%, ale

-15.966

larryonov

No avatar

2006-08-22 18:37

jo a jeste neco, jaxem tady kdysi doporucoval hodit do config/general.php setlocale(LC_ALL, 'cs_CZ'); , taxem to musel zase smazat, protoze me to kvuli ty zaporny dani vubec nevim proc blblo, hodil jsem to do plugins/../htmlorderdetail.php dovnitr tamty funkce, ktera odesila mail...a zda se, ze uz to je zase v poradku

larryonov

No avatar

2006-08-22 18:40

sakra, kdyz sem to tam dal, tak to ten skript nejak nerespektuje, a zase blbne odesilani zacatecnich velkych pismen s diakritikou

~sonar

No avatar

2006-08-23 11:41

Ja pouzivam zasadne pouze plugin SendOrderToClient namisto htmlMailOrderDetail. Do scriptu namisto radku:

@mail( $sTo, $sTitle, $sEmailContent, 'FROM: '.EMAIL );

jsem pridal funkci na prevod kodovani:

function Win2Iso($text) {
return StrTr($text, "\x8A\x8D\x8E\x9A\x9D\x9E", "\xA9\xAB\xAE\xB9\xBB\xBE");
};

@mail( $sTo, Win2Iso($sTitle), Win2Iso($sEmailContent), 'FROM: '.EMAIL );

a je to super.

~panavis

No avatar

2006-08-23 11:50

ono by se ten převod kodovani s malou upravou dal pouzit i v htmlMailOrderDetail

to sonar - a jinak to mas odemne :-)

Svetluska

No avatar

2006-08-23 20:37

Ono jde o to, ze vetsina lidi co pouziva Quickcart tam dava tu dan 19%... Ted se to alespon dostalo do povedomi lidi a snad si to opravi.

P.S. Taky jsem to mohl napsat primo v anglictine, abych "larryonovi" usetril praci s prekladem... díky Pavel

Back to top
about us | contact