Fix some timezone bugs.

This commit is contained in:
MarkBryanMilligan 2021-08-09 12:43:47 -05:00
parent 5a1f97abca
commit cb774d1950
2 changed files with 3 additions and 2 deletions

View File

@ -1,6 +1,7 @@
package com.lanternsoftware.datamodel.currentmonitor; package com.lanternsoftware.datamodel.currentmonitor;
public enum BillingMode { public enum BillingMode {
ANY_DIRECTION,
CONSUMPTION, CONSUMPTION,
PRODUCTION; PRODUCTION;
} }

View File

@ -119,9 +119,9 @@ public class BillingRate {
} }
public boolean isApplicable(BillingMode _mode, int _meter, double _monthKWh, Date _time, TimeZone _tz) { public boolean isApplicable(BillingMode _mode, int _meter, double _monthKWh, Date _time, TimeZone _tz) {
if (mode != _mode) if ((mode != BillingMode.ANY_DIRECTION) && (mode != _mode))
return false; return false;
if (_meter != meter) if ((meter != -1) && (_meter != meter))
return false; return false;
if ((monthKWhStart > 0) && (_monthKWh < monthKWhStart)) if ((monthKWhStart > 0) && (_monthKWh < monthKWhStart))
return false; return false;