Skip to content

Commit

Permalink
Merge ace8492 into 780e496
Browse files Browse the repository at this point in the history
  • Loading branch information
pauboixsom committed Oct 11, 2022
2 parents 780e496 + ace8492 commit 465ddd2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 3 additions & 2 deletions scripts/genkwh_mtc.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@ def getMongoTimeCurve(database, sourceName, filter, firstDate, lastDate):
source.timefield,
source.creationfield,
)
if source.get('intname',False):
filter = filter and long(filter)
if source.get('intname',False): #aqui nomes memberrightusage te true
if not hasattr(filter, '__iter__'):
filter = filter and long(filter)

return mtc.get(
start=firstDate,
Expand Down
9 changes: 7 additions & 2 deletions scripts/genkwh_rights_vs_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,13 @@ def main(member_code, date_from, date_to):
showAssignmentsData(assgnments_id)

#Comprovar drets gastats a Mongo

kwh_gastats = getCurveMongo(member_id, localisodate(date_from), localisodate(date_to))
filter = {
"name": long(member_id),
"regularization": {
"$exists": False
}
}
kwh_gastats = getCurveMongo(filter, localisodate(date_from), localisodate(date_to))

#Comprovar drets gastats a les factures
kwh_invoices = getInvoiceKwh(member_code, date_from, date_to)
Expand Down

0 comments on commit 465ddd2

Please sign in to comment.