Commit fa99ab0d by aa.gusti

rekening

1 parent 6d513d7a
......@@ -73,18 +73,18 @@ def validate_parent(tabel, departemen_kd, departemen_nm, rekening, tanggal):
continue
induk = EisDBSession.query(tabel).\
filter_by(tahun=str(row.tahun),
kode=row.kode,
departemen_kd = departemen_kd,
kode=row.kode.strip(),
departemen_kd = departemen_kd.strip(),
).first()
if not induk:
induk = tabel()
induk.tahun = str(tahun)
induk.kode = row.kode
induk.departemen_kd = departemen_kd
induk.kode = row.kode.strip()
induk.departemen_kd = departemen_kd.strip()
induk.tanggal = tanggal
induk.departemen_nm = departemen_nm
induk.departemen_nm = departemen_nm.strip()
induk.level_id = row.kode.count('.')
induk.nama = row.nama
induk.nama = row.nama.strip()
EisDBSession.add(induk)
EisDBSession.flush()
......@@ -97,19 +97,19 @@ def import_ap(all=False):
for row in query.all():
eis = EisDBSession.query(EisApPayment).\
filter_by(tahun = str(row.tahun),
kode = row.kd_rekening,
departemen_kd = row.kd_opd,
kode = row.kd_rekening.strip(),
departemen_kd = row.kd_opd.strip(),
tanggal = row.tanggal,
).first()
if not eis:
eis = EisApPayment()
eis.tahun = str(row.tahun)
eis.kode = row.kd_rekening
eis.departemen_kd = row.kd_opd
eis.kode = row.kd_rekening.strip()
eis.departemen_kd = row.kd_opd.strip()
eis.tanggal = row.tanggal
eis.level_id = row.kd_rekening.count('.')
eis.nama = row.nm_rekening
eis.departemen_nm = row.nm_opd
eis.nama = row.nm_rekening.strip()
eis.departemen_nm = row.nm_opd.strip()
eis.jumlah = row.realisasi
EisDBSession.add(eis)
EisDBSession.flush()
......@@ -124,19 +124,19 @@ def import_by(all=False):
for row in query.filter(Realisasi.kd_rekening.like('6.%')).all():
eis = EisDBSession.query(EisByPayment).\
filter_by(tahun = str(row.tahun),
rekening_kd = row.kd_rekening,
departemen_kd = row.kd_opd,
rekening_kd = row.kd_rekening.strip(),
departemen_kd = row.kd_opd.strip(),
tanggal = tanggal,
).first()
if not eis:
eis = EisByPayment()
eis.tahun = str(row.tahun)
eis.kode = row.kd_rekening
eis.departemen_kd = row.kd_opd
eis.kode = row.kd_rekening.strip()
eis.departemen_kd = row.kd_opd.strip()
eis.tanggal = tanggal
eis.level_id = row.kd_rekening.count('.')
eis.nama = row.nm_rekening
eis.departemen_nm = row.nm_opd
eis.nama = row.nm_rekening.strip()
eis.departemen_nm = row.nm_opd.strip()
eis.jumlah = row.realisai
EisDBSession.add(eis)
EisDBSession.flush()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!