Skip to content

Commit

Permalink
Fix: Localtaxes unit prices precision
Browse files Browse the repository at this point in the history
  • Loading branch information
simnandez committed Sep 5, 2012
1 parent 185c03e commit 9c08abb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion ChangeLog
Expand Up @@ -10,7 +10,8 @@ English Dolibarr ChangeLog
- Fix: Edition of percentage of an event.
- Fix: Minor look fix for theme bureau2crea.
- Fix: Start and end date not saved at project creation
- Fix: Default vat is zero for customer invoices if company does not use vat
- Fix: Default vat is zero for customer invoices if company does not use vat
- Fix: Localtaxes unit prices precision



Expand Down
8 changes: 4 additions & 4 deletions htdocs/core/lib/price.lib.php
@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2002-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -95,8 +95,8 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $txlocalta
$result[9] = price2num(($result[0] * ( 1 + ( $txlocaltax1 / 100))) - $result[0], 'MT');
$result[2] = price2num($result[2] + $result[9], 'MT');

$result[11] = price2num(($result[3] * ( 1 + ( $txlocaltax1 / 100))) - $pu, 'MT');
$result[5] = price2num($result[5] + $result[11], 'MT');
$result[11] = price2num(($result[3] * ( 1 + ( $txlocaltax1 / 100))) - $pu, 'MU');
$result[5] = price2num($result[5] + $result[11], 'MU');

}
else
Expand All @@ -110,7 +110,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $txlocalta
{
$result[15] = price2num(($result[6] * ( 1 + ( $txlocaltax2 / 100))) - $result[6], 'MT');
$result[10] = price2num(($result[0] * ( 1 + ( $txlocaltax2 / 100))) - $result[0], 'MT');
$result[12] = price2num(($result[3] * ( 1 + ( $txlocaltax2 / 100))) - $pu, 'MT');
$result[12] = price2num(($result[3] * ( 1 + ( $txlocaltax2 / 100))) - $pu, 'MU');

//If Country is Spain, localtax2 (IRPF) will be subtracted
if ($mysoc->country_code=='ES')
Expand Down

0 comments on commit 9c08abb

Please sign in to comment.