Commit 545f22da by aa.gusti

anggaran

1 parent a8bf1b39
......@@ -23,7 +23,7 @@ tahun = now.strftime('%Y')
def calculate():
rows = EisDBSession.query(EisAnggaran).filter_by(tahun = str(tahun)).\
order_by(EisAnggaran.kode.desc())
order_by(EisAnggaran.departemen_kd, EisAnggaran.kode.desc())
old_level = 0
levels = {}
murnis = {}
......@@ -33,7 +33,7 @@ def calculate():
old_level = row.level_id
key = 'a'+str(row.level_id)
#print(row.kode, row.level_id, old_level, key, row.murni)
print(row.kode, row.level_id, old_level, key, row.murni)
#JIKA level sama dengan sebelumnya jumlahkan
if row.level_id == old_level:
if not key in murnis:
......@@ -99,7 +99,7 @@ def import_anggaran():
anggaran.perubahan = row.ang_perubahan
EisDBSession.add(anggaran)
EisDBSession.flush()
validate_parent(row.kd_opd, row.nm_opd, row.kd_rekening)
validate_parent(row.kd_opd.strip(), row.nm_opd.strip(), row.kd_rekening.strip())
EisDBSession.commit()
import_anggaran()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!