Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-30091

This commit is contained in:
Marica
2022-03-09 17:33:37 +05:30
committed by GitHub
4 changed files with 49 additions and 4 deletions

View File

@@ -1,3 +1,4 @@
from frappe import _
@@ -8,7 +9,7 @@ def get_data():
},
'transactions': [
{
'label': ['Movement'],
'label': _('Movement'),
'items': ['Asset Movement']
}
]

View File

@@ -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);

View File

@@ -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)

View File

@@ -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',