fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [13897] property: fix floatval bug on insert


From: Sigurd Nes
Subject: [Fmsystem-commits] [13897] property: fix floatval bug on insert
Date: Tue, 15 Sep 2015 08:16:34 +0000

Revision: 13897
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=13897
Author:   sigurdne
Date:     2015-09-15 08:16:34 +0000 (Tue, 15 Sep 2015)
Log Message:
-----------
property: fix floatval bug on insert

Modified Paths:
--------------
    trunk/property/inc/class.sotts.inc.php

Modified: trunk/property/inc/class.sotts.inc.php
===================================================================
--- trunk/property/inc/class.sotts.inc.php      2015-09-15 07:06:08 UTC (rev 
13896)
+++ trunk/property/inc/class.sotts.inc.php      2015-09-15 08:16:34 UTC (rev 
13897)
@@ -1458,15 +1458,14 @@
                                        $this->db->query("SELECT sum(amount) AS 
actual_cost FROM fm_tts_payments WHERE ticket_id = {$id}", __LINE__,__FILE__);
                                        $this->db->next_record();
                                        $old_actual_cost = 
$this->db->f('actual_cost');
-                                       $new_actual_cost = $old_actual_cost + 
$ticket['actual_cost'];
+                                       $new_actual_cost =str_replace(',', '.', 
($old_actual_cost + $ticket['actual_cost']));
 
-                                       $this->db->query("UPDATE fm_tts_tickets 
SET actual_cost='" . (float) $new_actual_cost
-                                               . "' WHERE 
id='$id'",__LINE__,__FILE__);
+                                       $this->db->query("UPDATE fm_tts_tickets 
SET actual_cost='{$new_actual_cost}' WHERE id='$id'",__LINE__,__FILE__);
 
                                        $value_set_cost = array
                                        (
                                                'ticket_id'     => $id,
-                                               'amount'        => 
$ticket['actual_cost'],
+                                               'amount'        => 
str_replace(',', '.', $ticket['actual_cost']),
                                                'period'        => 
$ticket['actual_cost_period'],
                                                'created_on'=> time(),
                                                'created_by'=> $this->account




reply via email to

[Prev in Thread] Current Thread [Next in Thread]