Skip to content
Permalink
Browse files

Merge pull request #2 from directman66/directman66-patch-2

Update mercury.class.php
  • Loading branch information...
directman66 committed Sep 21, 2018
2 parents f43dc33 + bc46ae6 commit 6d88f6b242d23ebfe9d564428c295830423a7d85
Showing with 7 additions and 0 deletions.
  1. +7 −0 modules/mercury/mercury.class.php
@@ -283,6 +283,12 @@ function admin(&$out) {
$this->indata_edit($out, $this->id);
}
if ($this->view_mode=='getrates') {
$this->getrates($this->id);
}
}
@@ -294,6 +300,7 @@ function getrates($id) {
$cmd_rec = SQLSelectOne("SELECT * FROM mercury_devices where ID='$id'");
$objectname='Mercury_'.$cmd_rec['ID'];
pmesg($objectname);
$now=time();
$cmd_rec['MONTH_WATT']=round(getHistorySum($objectname.'.rashodt1', $now-2629743 ,$now))+round(getHistorySum($objectname.'.rashodt2', $now-2629743 ,$now));
$cmd_rec['MONTH_RUB']=(round(getHistorySum($objectname.'.rashodt1', $now-2629743 ,$now)*SETTINGS_APPMERCURY_T1))+(round(getHistorySum($objectname.'.rashodt2', $now-2629743 ,$now)*SETTINGS_APPMERCURY_T2));

0 comments on commit 6d88f6b

Please sign in to comment.
You can’t perform that action at this time.