代码:
today = datetime.datetime.today().strftime('%Y-%m-%d')
archives = employee.payroll_archive_ids
nums=0.0
for archive in archives:
if archive.code=='BS001':
if archive.expired_date:
if today>=archive.effective_date and today<=archive.expired_date:
nums = archive.amount
else:
if today>=archive.effective_date:
nums = archive.amount
result = '{:,.2f}'.format(nums)
代码:
today = datetime.datetime.today().strftime('%Y-%m-%d')
archives = employee.payroll_archive_ids
nums=0.0
for archive in archives:
if archive.code=='BS001':
if archive.expired_date:
if today>=archive.effective_date and today<=archive.expired_date:
nums = archive.amount
else:
if today>=archive.effective_date:
nums = archive.amount
result = '{:,.2f}'.format(nums)