fix: only create leave application ledger on intermediate allocation expiry
This commit is contained in:
parent
b16d395a8f
commit
283d2c5ca2
@ -370,11 +370,12 @@ class LeaveApplication(Document):
|
|||||||
''' splits leave application into two ledger entries to consider expiry of allocation '''
|
''' splits leave application into two ledger entries to consider expiry of allocation '''
|
||||||
args = dict(
|
args = dict(
|
||||||
from_date=self.from_date,
|
from_date=self.from_date,
|
||||||
to_date=self.to_date,
|
to_date=expiry_date,
|
||||||
leaves=(date_diff(expiry_date, self.from_date) + 1) * -1
|
leaves=(date_diff(expiry_date, self.from_date) + 1) * -1
|
||||||
)
|
)
|
||||||
create_leave_ledger_entry(self, args, submit)
|
create_leave_ledger_entry(self, args, submit)
|
||||||
|
|
||||||
|
if expiry_date != self.to_date:
|
||||||
start_date = add_days(expiry_date, 1)
|
start_date = add_days(expiry_date, 1)
|
||||||
args.update(dict(
|
args.update(dict(
|
||||||
from_date=start_date,
|
from_date=start_date,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user