From 51f7ca856b544f0eed500b0d2ae9c89743e7f82a Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 9 Mar 2022 16:51:58 +0530 Subject: [PATCH 1/4] =?UTF-8?q?revert:=20BU=20Schl=C3=BCssel=20(a21f76f)?= =?UTF-8?q?=20(#30142)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 363ed9ccba3f848908113e6d728735a1c894aec8) Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com> --- erpnext/regional/report/datev/datev.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/erpnext/regional/report/datev/datev.py b/erpnext/regional/report/datev/datev.py index adc77e8921c..5d6e8dff3fa 100644 --- a/erpnext/regional/report/datev/datev.py +++ b/erpnext/regional/report/datev/datev.py @@ -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', From f721a2929f88d3309ba730a552d40dc3f9eccf2a Mon Sep 17 00:00:00 2001 From: hrzzz Date: Fri, 25 Feb 2022 16:56:23 -0300 Subject: [PATCH 2/4] fix(translation) - correction for translation (cherry picked from commit 16de29a3cb13b771d41f3b26a2d80de8d2871b92) # Conflicts: # erpnext/assets/doctype/asset/asset_dashboard.py --- erpnext/assets/doctype/asset/asset_dashboard.py | 6 +++++- .../assets/doctype/asset_maintenance/asset_maintenance.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/erpnext/assets/doctype/asset/asset_dashboard.py b/erpnext/assets/doctype/asset/asset_dashboard.py index c9efe3d0848..461a67dbfc6 100644 --- a/erpnext/assets/doctype/asset/asset_dashboard.py +++ b/erpnext/assets/doctype/asset/asset_dashboard.py @@ -1,4 +1,8 @@ +<<<<<<< HEAD +======= +from frappe import _ +>>>>>>> 16de29a3cb (fix(translation) - correction for translation) def get_data(): return { @@ -7,7 +11,7 @@ def get_data(): }, 'transactions': [ { - 'label': ['Movement'], + 'label': _('Movement'), 'items': ['Asset Movement'] } ] diff --git a/erpnext/assets/doctype/asset_maintenance/asset_maintenance.js b/erpnext/assets/doctype/asset_maintenance/asset_maintenance.js index 52996e93475..5c03b98873b 100644 --- a/erpnext/assets/doctype/asset_maintenance/asset_maintenance.js +++ b/erpnext/assets/doctype/asset_maintenance/asset_maintenance.js @@ -48,7 +48,7 @@ frappe.ui.form.on('Asset Maintenance', {
- ${d.maintenance_status} ${d.count} + ${__(d.maintenance_status)} ${d.count}
`).appendTo(rows); From 4b4b1048436c745892226f5c52471e858377346d Mon Sep 17 00:00:00 2001 From: Marica Date: Wed, 9 Mar 2022 17:29:38 +0530 Subject: [PATCH 3/4] fix: Merge conflicts --- erpnext/assets/doctype/asset/asset_dashboard.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/erpnext/assets/doctype/asset/asset_dashboard.py b/erpnext/assets/doctype/asset/asset_dashboard.py index 461a67dbfc6..c81b611a418 100644 --- a/erpnext/assets/doctype/asset/asset_dashboard.py +++ b/erpnext/assets/doctype/asset/asset_dashboard.py @@ -1,8 +1,5 @@ -<<<<<<< HEAD - -======= from frappe import _ ->>>>>>> 16de29a3cb (fix(translation) - correction for translation) + def get_data(): return { From d68cf1885f3c005bd08affd33c1fd3816b27f958 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 9 Mar 2022 17:32:29 +0530 Subject: [PATCH 4/4] test: Added test for monthly attendance report (backport #29989) (#30143) Co-authored-by: Rucha Mahabal Co-authored-by: Chillar Anand --- .../test_monthly_attendance_sheet.py | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 erpnext/hr/report/monthly_attendance_sheet/test_monthly_attendance_sheet.py diff --git a/erpnext/hr/report/monthly_attendance_sheet/test_monthly_attendance_sheet.py b/erpnext/hr/report/monthly_attendance_sheet/test_monthly_attendance_sheet.py new file mode 100644 index 00000000000..b196fb5b989 --- /dev/null +++ b/erpnext/hr/report/monthly_attendance_sheet/test_monthly_attendance_sheet.py @@ -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)