mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-10 05:48:15 +00:00
Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-30091
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
from frappe import _
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +9,7 @@ def get_data():
|
||||
},
|
||||
'transactions': [
|
||||
{
|
||||
'label': ['Movement'],
|
||||
'label': _('Movement'),
|
||||
'items': ['Asset Movement']
|
||||
}
|
||||
]
|
||||
|
||||
@@ -48,7 +48,7 @@ frappe.ui.form.on('Asset Maintenance', {
|
||||
<div class='col-sm-3 small'>
|
||||
<a onclick="frappe.set_route('List', 'Asset Maintenance Log',
|
||||
{'asset_name': '${d.asset_name}','maintenance_status': '${d.maintenance_status}' });">
|
||||
${d.maintenance_status} <span class="badge">${d.count}</span>
|
||||
${__(d.maintenance_status)} <span class="badge">${d.count}</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>`).appendTo(rows);
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
import frappe
|
||||
from dateutil.relativedelta import relativedelta
|
||||
|
||||
from frappe.tests.utils import FrappeTestCase
|
||||
from frappe.utils import now_datetime
|
||||
|
||||
from erpnext.hr.doctype.attendance.attendance import mark_attendance
|
||||
from erpnext.hr.doctype.employee.test_employee import make_employee
|
||||
from erpnext.hr.report.monthly_attendance_sheet.monthly_attendance_sheet import execute
|
||||
|
||||
|
||||
class TestMonthlyAttendanceSheet(FrappeTestCase):
|
||||
def setUp(self):
|
||||
self.employee = make_employee("test_employee@example.com")
|
||||
frappe.db.delete('Attendance', {'employee': self.employee})
|
||||
|
||||
def test_monthly_attendance_sheet_report(self):
|
||||
now = now_datetime()
|
||||
previous_month = now.month - 1
|
||||
previous_month_first = now.replace(day=1).replace(month=previous_month).date()
|
||||
|
||||
company = frappe.db.get_value('Employee', self.employee, 'company')
|
||||
|
||||
# mark different attendance status on first 3 days of previous month
|
||||
mark_attendance(self.employee, previous_month_first, 'Absent')
|
||||
mark_attendance(self.employee, previous_month_first + relativedelta(days=1), 'Present')
|
||||
mark_attendance(self.employee, previous_month_first + relativedelta(days=2), 'On Leave')
|
||||
|
||||
filters = frappe._dict({
|
||||
'month': previous_month,
|
||||
'year': now.year,
|
||||
'company': company,
|
||||
})
|
||||
report = execute(filters=filters)
|
||||
employees = report[1][0]
|
||||
datasets = report[3]['data']['datasets']
|
||||
absent = datasets[0]['values']
|
||||
present = datasets[1]['values']
|
||||
leaves = datasets[2]['values']
|
||||
|
||||
# ensure correct attendance is reflect on the report
|
||||
self.assertIn(self.employee, employees)
|
||||
self.assertEqual(absent[0], 1)
|
||||
self.assertEqual(present[1], 1)
|
||||
self.assertEqual(leaves[2], 1)
|
||||
@@ -345,8 +345,7 @@ def run_query(filters, extra_fields, extra_joins, extra_filters, as_dict=1):
|
||||
/* against number or, if empty, party against number */
|
||||
%(temporary_against_account_number)s as 'Gegenkonto (ohne BU-Schlüssel)',
|
||||
|
||||
/* disable automatic VAT deduction */
|
||||
'40' as 'BU-Schlüssel',
|
||||
'' as 'BU-Schlüssel',
|
||||
|
||||
gl.posting_date as 'Belegdatum',
|
||||
gl.voucher_no as 'Belegfeld 1',
|
||||
|
||||
Reference in New Issue
Block a user