This commit is contained in:
admin
2026-05-14 22:02:06 +09:00
parent 78022b3b15
commit b9f994b1e1
22 changed files with 1225 additions and 126 deletions

33
fix_jan2026.py Normal file
View File

@@ -0,0 +1,33 @@
import psycopg2
import requests
conn = psycopg2.connect(host='192.168.0.61', port=55432, dbname='njts_acct', user='njts_app', password='njts_app2025')
cur = conn.cursor()
# 一時的に承認解除
cur.execute("UPDATE monthly_payroll SET status='calculated' WHERE payroll_id IN (10,11)")
conn.commit()
conn.close()
print("承認解除完了")
# 再計算
for pid in [10, 11]:
r = requests.post('http://192.168.0.61:18000/payroll/calculation/' + str(pid) + '/recalculate', json={})
d = r.json()
if 'detail' in d:
print('id=' + str(pid) + ' ERROR: ' + str(d['detail']))
else:
keys = ['health_insurance', 'care_insurance', 'pension_insurance',
'employment_insurance', 'child_support', 'income_tax', 'resident_tax', 'other_deduction']
comp = sum(float(d.get(k) or 0) for k in keys)
td = float(d.get('total_deduction') or 0)
print('id=' + str(pid) +
' health=' + str(d['health_insurance']) +
' care=' + str(d['care_insurance']) +
' income_tax=' + str(d['income_tax']) +
' total_ded=' + str(td) +
' SUM=' + str(comp) +
' DIFF=' + str(td - comp) +
' net=' + str(d['net_payment']))
print("完了")