Module Import Fix (#21433)
This commit is contained in:
parent
131452ca94
commit
f34faa9181
@ -7,7 +7,7 @@ import frappe
|
||||
from frappe.utils import getdate, nowdate
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import cstr, get_datetime, format_date
|
||||
from frappe.utils import cstr, get_datetime, formatdate
|
||||
|
||||
class Attendance(Document):
|
||||
def validate(self):
|
||||
@ -52,16 +52,16 @@ class Attendance(Document):
|
||||
if d.half_day_date == getdate(self.attendance_date):
|
||||
self.status = 'Half Day'
|
||||
frappe.msgprint(_("Employee {0} on Half day on {1}")
|
||||
.format(self.employee, format_date(self.attendance_date)))
|
||||
.format(self.employee, formatdate(self.attendance_date)))
|
||||
else:
|
||||
self.status = 'On Leave'
|
||||
frappe.msgprint(_("Employee {0} is on Leave on {1}")
|
||||
.format(self.employee, format_date(self.attendance_date)))
|
||||
.format(self.employee, formatdate(self.attendance_date)))
|
||||
|
||||
if self.status in ("On Leave", "Half Day"):
|
||||
if not leave_record:
|
||||
frappe.msgprint(_("No leave record found for employee {0} on {1}")
|
||||
.format(self.employee, format_date(self.attendance_date)), alert=1)
|
||||
.format(self.employee, formatdate(self.attendance_date)), alert=1)
|
||||
elif self.leave_type:
|
||||
self.leave_type = None
|
||||
self.leave_application = None
|
||||
|
@ -5,7 +5,7 @@ from __future__ import unicode_literals
|
||||
import frappe, erpnext
|
||||
import datetime, math
|
||||
|
||||
from frappe.utils import add_days, cint, cstr, flt, getdate, rounded, date_diff, money_in_words, format_date
|
||||
from frappe.utils import add_days, cint, cstr, flt, getdate, rounded, date_diff, money_in_words, formatdate
|
||||
from frappe.model.naming import make_autoname
|
||||
|
||||
from frappe import msgprint, _
|
||||
@ -329,7 +329,7 @@ class SalarySlip(TransactionBase):
|
||||
if d.status in ('Half Day', 'On Leave') and d.leave_type and d.leave_type not in lwp_leave_types:
|
||||
continue
|
||||
|
||||
if format_date(d.attendance_date, "yyyy-mm-dd") in holidays:
|
||||
if formatdate(d.attendance_date, "yyyy-mm-dd") in holidays:
|
||||
if d.status == "Absent" or \
|
||||
(d.leave_type and d.leave_type in lwp_leave_types and not lwp_leave_types[d.leave_type]):
|
||||
continue
|
||||
|
Loading…
x
Reference in New Issue
Block a user