Refactor data retrieval in Views class to use mapped attributes for improved clarity

1 parent 2d04ace0
......@@ -174,11 +174,11 @@ class Views(BaseView):
amt = trx = acc = accTrx = 0
for r in qry:
mapped = r._mapping
step = r.get(step,"")
bayar = r.get("bayar", 0)
denda = r.get("denda", 0)
step = mapped.get("step","")
bayar = mapped.get("bayar", 0)
denda = mapped.get("denda", 0)
pokok = bayar - denda
tx = r.get("trx",0)
tx = mapped.get("trx",0)
daily.append((step, pokok))
dailyTrx.append((step, tx))
acc += pokok
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!