Skip to content
Snippets Groups Projects
Commit 544bd277 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Merge pull request #1611 from guerinaxel/patch-3

Correcting log use for commonobject.class.php
parents ff46adf2 1dbcd215
No related branches found
No related tags found
No related merge requests found
......@@ -1615,7 +1615,7 @@ abstract class CommonObject
//print 'Line '.$i.' rowid='.$obj->rowid.' vat_rate='.$obj->vatrate.' total_ht='.$obj->total_ht.' total_tva='.$obj->total_tva.' total_ttc='.$obj->total_ttc.' total_ht_by_vats='.$total_ht_by_vats[$obj->vatrate].' total_tva_by_vats='.$total_tva_by_vats[$obj->vatrate].' (new calculation = '.$tmpvat.') total_ttc_by_vats='.$total_ttc_by_vats[$obj->vatrate].($diff?" => DIFF":"")."<br>\n";
if ($diff)
{
if (abs($diff) > 0.1) { dol_syslog('','A rounding difference was detected into TOTAL but is too high to be corrected', LOG_WARNING); exit; }
if (abs($diff) > 0.1) { dol_syslog('A rounding difference was detected into TOTAL but is too high to be corrected', LOG_WARNING); exit; }
$sqlfix="UPDATE ".MAIN_DB_PREFIX.$this->table_element_line." SET ".$fieldtva." = ".($obj->total_tva - $diff).", total_ttc = ".($obj->total_ttc - $diff)." WHERE rowid = ".$obj->rowid;
dol_syslog('We found a difference of '.$diff.' for line rowid = '.$obj->rowid.". We fix the total_vat and total_ttc of line by running sqlfix = ".$sqlfix);
$resqlfix=$this->db->query($sqlfix);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment