projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cfbc0d9
)
calculate sum separately?
author
ivan
<ivan>
Thu, 19 May 2011 17:39:06 +0000
(17:39 +0000)
committer
ivan
<ivan>
Thu, 19 May 2011 17:39:06 +0000
(17:39 +0000)
FS/bin/freeside-torrus-srvderive
patch
|
blob
|
history
diff --git
a/FS/bin/freeside-torrus-srvderive
b/FS/bin/freeside-torrus-srvderive
index
a89cf39
..
23d2e44
100644
(file)
--- a/
FS/bin/freeside-torrus-srvderive
+++ b/
FS/bin/freeside-torrus-srvderive
@@
-203,14
+203,18
@@
while (1) {
AND other.srv_date = '$srv_date'
AND ABS( $cur - $other_date ) <= 60
";
AND other.srv_date = '$srv_date'
AND ABS( $cur - $other_date ) <= 60
";
+ my $ssth = dbh->prepare($sum) or die $DBI::errstr;
+ $ssth->execute or die $ssth->errstr; #better recovery?
+ my $value = $ssth->fetchrow_arrayref->[0];
my $isql = "
my $isql = "
- INSERT INTO srvexport (
srv_date, srv_time, serviceid, value, intvl
)
- VALUES ( ?, ?, ?,
($sum)
, ? )
+ INSERT INTO srvexport (
srv_date, srv_time, serviceid, value, intvl
)
+ VALUES ( ?, ?, ?,
?
, ? )
";
my @param = ( $srv_date,
time2str('%X', $cur), #srv_time
"$serviceid$dir", #serviceid
";
my @param = ( $srv_date,
time2str('%X', $cur), #srv_time
"$serviceid$dir", #serviceid
+ $value,
300, #intvl ...
);
warn $isql. ' with param '. join(',',@param). "\n"
300, #intvl ...
);
warn $isql. ' with param '. join(',',@param). "\n"