mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 03:39:11 +00:00
chore: Clean up imports (#27302)
* chore: Added isort to pre-commit config * chore: Sort imports with isort * chore: Clean up imports with pycln * chore: Sort imports with isort * chore: Fix import issues * chore: Clean up sider issues * chore: Remove import errors from flake8 ignore list * chore: Clean up lint issues
This commit is contained in:
@@ -3,12 +3,15 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
from frappe import _, bold
|
||||
from frappe.utils import getdate, date_diff, comma_and, formatdate
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import comma_and, date_diff, formatdate, getdate
|
||||
|
||||
from erpnext.hr.utils import validate_active_employee
|
||||
|
||||
|
||||
class AdditionalSalary(Document):
|
||||
def on_submit(self):
|
||||
if self.ref_doctype == "Employee Advance" and self.ref_docname:
|
||||
|
||||
@@ -2,12 +2,19 @@
|
||||
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import unittest
|
||||
import frappe, erpnext
|
||||
from frappe.utils import nowdate, add_days
|
||||
|
||||
import frappe
|
||||
from frappe.utils import add_days, nowdate
|
||||
|
||||
import erpnext
|
||||
from erpnext.hr.doctype.employee.test_employee import make_employee
|
||||
from erpnext.payroll.doctype.salary_component.test_salary_component import create_salary_component
|
||||
from erpnext.payroll.doctype.salary_slip.test_salary_slip import make_employee_salary_slip, setup_test
|
||||
from erpnext.payroll.doctype.salary_slip.test_salary_slip import (
|
||||
make_employee_salary_slip,
|
||||
setup_test,
|
||||
)
|
||||
from erpnext.payroll.doctype.salary_structure.test_salary_structure import make_salary_structure
|
||||
|
||||
|
||||
|
||||
@@ -3,13 +3,26 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.utils import date_diff, getdate, rounded, add_days, cstr, cint, flt
|
||||
from frappe.model.document import Document
|
||||
from erpnext.payroll.doctype.payroll_period.payroll_period import get_payroll_period_days, get_period_factor
|
||||
from erpnext.payroll.doctype.salary_structure_assignment.salary_structure_assignment import get_assigned_salary_structure
|
||||
from erpnext.hr.utils import get_sal_slip_total_benefit_given, get_holiday_dates_for_employee, get_previous_claimed_amount, validate_active_employee
|
||||
from frappe.utils import add_days, cint, cstr, date_diff, getdate, rounded
|
||||
|
||||
from erpnext.hr.utils import (
|
||||
get_holiday_dates_for_employee,
|
||||
get_previous_claimed_amount,
|
||||
get_sal_slip_total_benefit_given,
|
||||
validate_active_employee,
|
||||
)
|
||||
from erpnext.payroll.doctype.payroll_period.payroll_period import (
|
||||
get_payroll_period_days,
|
||||
get_period_factor,
|
||||
)
|
||||
from erpnext.payroll.doctype.salary_structure_assignment.salary_structure_assignment import (
|
||||
get_assigned_salary_structure,
|
||||
)
|
||||
|
||||
|
||||
class EmployeeBenefitApplication(Document):
|
||||
def validate(self):
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
class TestEmployeeBenefitApplication(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class EmployeeBenefitApplicationDetail(Document):
|
||||
pass
|
||||
|
||||
@@ -3,14 +3,21 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.utils import flt
|
||||
from frappe.model.document import Document
|
||||
from erpnext.payroll.doctype.employee_benefit_application.employee_benefit_application import get_max_benefits
|
||||
from frappe.utils import flt
|
||||
|
||||
from erpnext.hr.utils import get_previous_claimed_amount, validate_active_employee
|
||||
from erpnext.payroll.doctype.employee_benefit_application.employee_benefit_application import (
|
||||
get_max_benefits,
|
||||
)
|
||||
from erpnext.payroll.doctype.payroll_period.payroll_period import get_payroll_period
|
||||
from erpnext.payroll.doctype.salary_structure_assignment.salary_structure_assignment import get_assigned_salary_structure
|
||||
from erpnext.payroll.doctype.salary_structure_assignment.salary_structure_assignment import (
|
||||
get_assigned_salary_structure,
|
||||
)
|
||||
|
||||
|
||||
class EmployeeBenefitClaim(Document):
|
||||
def validate(self):
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
class TestEmployeeBenefitClaim(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -3,11 +3,14 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
|
||||
from erpnext.hr.utils import validate_active_employee
|
||||
|
||||
|
||||
class EmployeeIncentive(Document):
|
||||
def validate(self):
|
||||
validate_active_employee(self.employee)
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
|
||||
class TestEmployeeIncentive(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class EmployeeOtherIncome(Document):
|
||||
pass
|
||||
|
||||
@@ -6,5 +6,6 @@ from __future__ import unicode_literals
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
|
||||
class TestEmployeeOtherIncome(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class EmployeeTaxExemptionCategory(Document):
|
||||
pass
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
|
||||
class TestEmployeeTaxExemptionCategory(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -3,13 +3,20 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
from frappe import _
|
||||
from frappe.utils import flt
|
||||
from frappe.model.mapper import get_mapped_doc
|
||||
from erpnext.hr.utils import validate_tax_declaration, get_total_exemption_amount, validate_active_employee, \
|
||||
calculate_annual_eligible_hra_exemption, validate_duplicate_exemption_for_payroll_period
|
||||
from frappe.utils import flt
|
||||
|
||||
from erpnext.hr.utils import (
|
||||
calculate_annual_eligible_hra_exemption,
|
||||
get_total_exemption_amount,
|
||||
validate_active_employee,
|
||||
validate_duplicate_exemption_for_payroll_period,
|
||||
validate_tax_declaration,
|
||||
)
|
||||
|
||||
|
||||
class EmployeeTaxExemptionDeclaration(Document):
|
||||
def validate(self):
|
||||
|
||||
@@ -3,11 +3,15 @@
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe, erpnext
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
|
||||
import erpnext
|
||||
from erpnext.hr.doctype.employee.test_employee import make_employee
|
||||
from erpnext.hr.utils import DuplicateDeclarationError
|
||||
|
||||
|
||||
class TestEmployeeTaxExemptionDeclaration(unittest.TestCase):
|
||||
def setUp(self):
|
||||
make_employee("employee@taxexepmtion.com")
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class EmployeeTaxExemptionDeclarationCategory(Document):
|
||||
pass
|
||||
|
||||
@@ -3,12 +3,18 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
|
||||
from frappe.model.document import Document
|
||||
from frappe import _
|
||||
from frappe.utils import flt
|
||||
from erpnext.hr.utils import validate_tax_declaration, get_total_exemption_amount, validate_active_employee, \
|
||||
calculate_hra_exemption_for_period, validate_duplicate_exemption_for_payroll_period
|
||||
|
||||
from erpnext.hr.utils import (
|
||||
calculate_hra_exemption_for_period,
|
||||
get_total_exemption_amount,
|
||||
validate_active_employee,
|
||||
validate_duplicate_exemption_for_payroll_period,
|
||||
validate_tax_declaration,
|
||||
)
|
||||
|
||||
|
||||
class EmployeeTaxExemptionProofSubmission(Document):
|
||||
def validate(self):
|
||||
|
||||
@@ -3,9 +3,15 @@
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
from erpnext.payroll.doctype.employee_tax_exemption_declaration.test_employee_tax_exemption_declaration import create_exemption_category, create_payroll_period
|
||||
|
||||
import frappe
|
||||
|
||||
from erpnext.payroll.doctype.employee_tax_exemption_declaration.test_employee_tax_exemption_declaration import (
|
||||
create_exemption_category,
|
||||
create_payroll_period,
|
||||
)
|
||||
|
||||
|
||||
class TestEmployeeTaxExemptionProofSubmission(unittest.TestCase):
|
||||
def setup(self):
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class EmployeeTaxExemptionProofSubmissionDetail(Document):
|
||||
pass
|
||||
|
||||
@@ -3,10 +3,12 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.utils import flt
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import flt
|
||||
|
||||
|
||||
class EmployeeTaxExemptionSubCategory(Document):
|
||||
def validate(self):
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
|
||||
class TestEmployeeTaxExemptionSubCategory(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -3,12 +3,16 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from math import floor
|
||||
|
||||
import frappe
|
||||
from frappe import _, bold
|
||||
from frappe.utils import flt, get_datetime, get_link_to_form
|
||||
|
||||
from erpnext.accounts.general_ledger import make_gl_entries
|
||||
from erpnext.controllers.accounts_controller import AccountsController
|
||||
from math import floor
|
||||
|
||||
|
||||
class Gratuity(AccountsController):
|
||||
def validate(self):
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'reference_name',
|
||||
|
||||
@@ -3,15 +3,20 @@
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
from frappe.utils import add_days, flt, get_datetime, getdate
|
||||
|
||||
from erpnext.hr.doctype.employee.test_employee import make_employee
|
||||
from erpnext.payroll.doctype.salary_slip.test_salary_slip import make_employee_salary_slip, make_earning_salary_component, \
|
||||
make_deduction_salary_component
|
||||
from erpnext.payroll.doctype.gratuity.gratuity import get_last_salary_slip
|
||||
from erpnext.regional.united_arab_emirates.setup import create_gratuity_rule
|
||||
from erpnext.hr.doctype.expense_claim.test_expense_claim import get_payable_account
|
||||
from frappe.utils import getdate, add_days, get_datetime, flt
|
||||
from erpnext.payroll.doctype.gratuity.gratuity import get_last_salary_slip
|
||||
from erpnext.payroll.doctype.salary_slip.test_salary_slip import (
|
||||
make_deduction_salary_component,
|
||||
make_earning_salary_component,
|
||||
make_employee_salary_slip,
|
||||
)
|
||||
from erpnext.regional.united_arab_emirates.setup import create_gratuity_rule
|
||||
|
||||
test_dependencies = ["Salary Component", "Salary Slip", "Account"]
|
||||
class TestGratuity(unittest.TestCase):
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class GratuityApplicableComponent(Document):
|
||||
pass
|
||||
|
||||
@@ -3,9 +3,11 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class GratuityRule(Document):
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'gratuity_rule',
|
||||
|
||||
@@ -6,5 +6,6 @@ from __future__ import unicode_literals
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
|
||||
class TestGratuityRule(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class GratuityRuleSlab(Document):
|
||||
pass
|
||||
|
||||
@@ -3,9 +3,12 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
#import frappe
|
||||
import erpnext
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class IncomeTaxSlab(Document):
|
||||
def validate(self):
|
||||
|
||||
@@ -6,5 +6,6 @@ from __future__ import unicode_literals
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
|
||||
class TestIncomeTaxSlab(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class IncomeTaxSlabOtherCharges(Document):
|
||||
pass
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class PayrollEmployeeDetail(Document):
|
||||
pass
|
||||
|
||||
@@ -3,15 +3,30 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe, erpnext
|
||||
from frappe.model.document import Document
|
||||
|
||||
import frappe
|
||||
from dateutil.relativedelta import relativedelta
|
||||
from frappe.utils import cint, flt, add_days, getdate, add_to_date, DATE_FORMAT, date_diff, comma_and
|
||||
from frappe import _
|
||||
from frappe.desk.reportview import get_filters_cond, get_match_cond
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import (
|
||||
DATE_FORMAT,
|
||||
add_days,
|
||||
add_to_date,
|
||||
cint,
|
||||
comma_and,
|
||||
date_diff,
|
||||
flt,
|
||||
getdate,
|
||||
)
|
||||
|
||||
import erpnext
|
||||
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
|
||||
get_accounting_dimensions,
|
||||
)
|
||||
from erpnext.accounts.utils import get_fiscal_year
|
||||
from erpnext.hr.doctype.employee.employee import get_holiday_list_for_employee
|
||||
from frappe.desk.reportview import get_match_cond, get_filters_cond
|
||||
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import get_accounting_dimensions
|
||||
|
||||
|
||||
class PayrollEntry(Document):
|
||||
def onload(self):
|
||||
@@ -529,7 +544,8 @@ def get_end_date(start_date, frequency):
|
||||
def get_month_details(year, month):
|
||||
ysd = frappe.db.get_value("Fiscal Year", year, "year_start_date")
|
||||
if ysd:
|
||||
import calendar, datetime
|
||||
import calendar
|
||||
import datetime
|
||||
diff_mnt = cint(month)-cint(ysd.month)
|
||||
if diff_mnt<0:
|
||||
diff_mnt = 12-int(ysd.month)+cint(month)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from __future__ import unicode_literals
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
|
||||
@@ -1,19 +1,37 @@
|
||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import unittest
|
||||
import erpnext
|
||||
|
||||
import frappe
|
||||
from dateutil.relativedelta import relativedelta
|
||||
from erpnext.accounts.utils import get_fiscal_year, getdate, nowdate
|
||||
from frappe.utils import add_months
|
||||
from erpnext.payroll.doctype.payroll_entry.payroll_entry import get_start_end_dates, get_end_date
|
||||
|
||||
import erpnext
|
||||
from erpnext.accounts.utils import get_fiscal_year, getdate, nowdate
|
||||
from erpnext.hr.doctype.employee.test_employee import make_employee
|
||||
from erpnext.payroll.doctype.salary_slip.test_salary_slip import get_salary_component_account, \
|
||||
make_earning_salary_component, make_deduction_salary_component, create_account, make_employee_salary_slip
|
||||
from erpnext.payroll.doctype.salary_structure.test_salary_structure import make_salary_structure, create_salary_structure_assignment
|
||||
from erpnext.loan_management.doctype.loan.test_loan import create_loan, make_loan_disbursement_entry, create_loan_type, create_loan_accounts
|
||||
from erpnext.loan_management.doctype.process_loan_interest_accrual.process_loan_interest_accrual import process_loan_interest_accrual_for_term_loans
|
||||
from erpnext.loan_management.doctype.loan.test_loan import (
|
||||
create_loan,
|
||||
create_loan_accounts,
|
||||
create_loan_type,
|
||||
make_loan_disbursement_entry,
|
||||
)
|
||||
from erpnext.loan_management.doctype.process_loan_interest_accrual.process_loan_interest_accrual import (
|
||||
process_loan_interest_accrual_for_term_loans,
|
||||
)
|
||||
from erpnext.payroll.doctype.payroll_entry.payroll_entry import get_end_date, get_start_end_dates
|
||||
from erpnext.payroll.doctype.salary_slip.test_salary_slip import (
|
||||
create_account,
|
||||
get_salary_component_account,
|
||||
make_deduction_salary_component,
|
||||
make_earning_salary_component,
|
||||
make_employee_salary_slip,
|
||||
)
|
||||
from erpnext.payroll.doctype.salary_structure.test_salary_structure import (
|
||||
create_salary_structure_assignment,
|
||||
make_salary_structure,
|
||||
)
|
||||
|
||||
test_dependencies = ['Holiday List']
|
||||
|
||||
|
||||
@@ -3,12 +3,15 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.utils import date_diff, getdate, formatdate, cint, month_diff, flt, add_months
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import add_months, cint, date_diff, flt, formatdate, getdate, month_diff
|
||||
|
||||
from erpnext.hr.utils import get_holiday_dates_for_employee
|
||||
|
||||
|
||||
class PayrollPeriod(Document):
|
||||
def validate(self):
|
||||
self.validate_dates()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from __future__ import unicode_literals
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
|
||||
class TestPayrollPeriod(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class PayrollPeriodDate(Document):
|
||||
pass
|
||||
|
||||
@@ -3,11 +3,13 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.custom.doctype.property_setter.property_setter import make_property_setter
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import cint
|
||||
from frappe.custom.doctype.property_setter.property_setter import make_property_setter
|
||||
from frappe import _
|
||||
|
||||
|
||||
class PayrollSettings(Document):
|
||||
def validate(self):
|
||||
|
||||
@@ -6,5 +6,6 @@ from __future__ import unicode_literals
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
|
||||
class TestPayrollSettings(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -3,11 +3,15 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import getdate
|
||||
|
||||
from erpnext.hr.utils import validate_active_employee
|
||||
|
||||
|
||||
class RetentionBonus(Document):
|
||||
def validate(self):
|
||||
validate_active_employee(self.employee)
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
|
||||
class TestRetentionBonus(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -3,9 +3,11 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe.model.document import Document
|
||||
from frappe.model.naming import append_number_if_name_exists
|
||||
|
||||
|
||||
class SalaryComponent(Document):
|
||||
def validate(self):
|
||||
self.validate_abbr()
|
||||
|
||||
@@ -3,9 +3,10 @@
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
|
||||
# test_records = frappe.get_test_records('Salary Component')
|
||||
|
||||
class TestSalaryComponent(unittest.TestCase):
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class SalaryDetail(Document):
|
||||
pass
|
||||
|
||||
@@ -2,27 +2,51 @@
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
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, formatdate, get_first_day
|
||||
import datetime
|
||||
import math
|
||||
|
||||
import frappe
|
||||
from frappe import _, msgprint
|
||||
from frappe.model.naming import make_autoname
|
||||
|
||||
from frappe import msgprint, _
|
||||
from erpnext.payroll.doctype.payroll_entry.payroll_entry import get_start_end_dates
|
||||
from erpnext.hr.doctype.employee.employee import get_holiday_list_for_employee
|
||||
from erpnext.hr.utils import get_holiday_dates_for_employee
|
||||
from erpnext.utilities.transaction_base import TransactionBase
|
||||
from frappe.utils import (
|
||||
add_days,
|
||||
cint,
|
||||
cstr,
|
||||
date_diff,
|
||||
flt,
|
||||
formatdate,
|
||||
get_first_day,
|
||||
getdate,
|
||||
money_in_words,
|
||||
rounded,
|
||||
)
|
||||
from frappe.utils.background_jobs import enqueue
|
||||
from erpnext.payroll.doctype.additional_salary.additional_salary import get_additional_salaries
|
||||
from erpnext.payroll.doctype.payroll_period.payroll_period import get_period_factor, get_payroll_period
|
||||
from erpnext.payroll.doctype.employee_benefit_application.employee_benefit_application import get_benefit_component_amount
|
||||
from erpnext.payroll.doctype.employee_benefit_claim.employee_benefit_claim import get_benefit_claim_amount, get_last_payroll_period_benefits
|
||||
from erpnext.loan_management.doctype.loan_repayment.loan_repayment import calculate_amounts, create_repayment_entry
|
||||
from erpnext.accounts.utils import get_fiscal_year
|
||||
from erpnext.hr.utils import validate_active_employee
|
||||
from six import iteritems
|
||||
|
||||
import erpnext
|
||||
from erpnext.accounts.utils import get_fiscal_year
|
||||
from erpnext.hr.utils import get_holiday_dates_for_employee, validate_active_employee
|
||||
from erpnext.loan_management.doctype.loan_repayment.loan_repayment import (
|
||||
calculate_amounts,
|
||||
create_repayment_entry,
|
||||
)
|
||||
from erpnext.payroll.doctype.additional_salary.additional_salary import get_additional_salaries
|
||||
from erpnext.payroll.doctype.employee_benefit_application.employee_benefit_application import (
|
||||
get_benefit_component_amount,
|
||||
)
|
||||
from erpnext.payroll.doctype.employee_benefit_claim.employee_benefit_claim import (
|
||||
get_benefit_claim_amount,
|
||||
get_last_payroll_period_benefits,
|
||||
)
|
||||
from erpnext.payroll.doctype.payroll_entry.payroll_entry import get_start_end_dates
|
||||
from erpnext.payroll.doctype.payroll_period.payroll_period import (
|
||||
get_payroll_period,
|
||||
get_period_factor,
|
||||
)
|
||||
from erpnext.utilities.transaction_base import TransactionBase
|
||||
|
||||
|
||||
class SalarySlip(TransactionBase):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(SalarySlip, self).__init__(*args, **kwargs)
|
||||
|
||||
@@ -2,20 +2,34 @@
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import unittest
|
||||
import frappe
|
||||
import erpnext
|
||||
import calendar
|
||||
import random
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
from frappe.utils import (
|
||||
add_days,
|
||||
add_months,
|
||||
cstr,
|
||||
flt,
|
||||
get_first_day,
|
||||
get_last_day,
|
||||
getdate,
|
||||
nowdate,
|
||||
)
|
||||
|
||||
import erpnext
|
||||
from erpnext.accounts.utils import get_fiscal_year
|
||||
from frappe.utils import getdate, nowdate, add_days, add_months, flt, get_first_day, get_last_day, cstr
|
||||
from erpnext.payroll.doctype.salary_structure.salary_structure import make_salary_slip
|
||||
from erpnext.payroll.doctype.payroll_entry.payroll_entry import get_month_details
|
||||
from erpnext.hr.doctype.employee.test_employee import make_employee
|
||||
from erpnext.hr.doctype.leave_allocation.test_leave_allocation import create_leave_allocation
|
||||
from erpnext.hr.doctype.leave_type.test_leave_type import create_leave_type
|
||||
from erpnext.payroll.doctype.employee_tax_exemption_declaration.test_employee_tax_exemption_declaration \
|
||||
import create_payroll_period, create_exemption_category
|
||||
from erpnext.payroll.doctype.employee_tax_exemption_declaration.test_employee_tax_exemption_declaration import (
|
||||
create_exemption_category,
|
||||
create_payroll_period,
|
||||
)
|
||||
from erpnext.payroll.doctype.payroll_entry.payroll_entry import get_month_details
|
||||
from erpnext.payroll.doctype.salary_structure.salary_structure import make_salary_slip
|
||||
|
||||
|
||||
class TestSalarySlip(unittest.TestCase):
|
||||
def setUp(self):
|
||||
@@ -154,7 +168,9 @@ class TestSalarySlip(unittest.TestCase):
|
||||
self.assertEqual(ss.gross_pay, 78000)
|
||||
|
||||
def test_payment_days(self):
|
||||
from erpnext.payroll.doctype.salary_structure.test_salary_structure import create_salary_structure_assignment
|
||||
from erpnext.payroll.doctype.salary_structure.test_salary_structure import (
|
||||
create_salary_structure_assignment,
|
||||
)
|
||||
|
||||
no_of_days = self.get_no_of_days()
|
||||
# Holidays not included in working days
|
||||
@@ -231,8 +247,15 @@ class TestSalarySlip(unittest.TestCase):
|
||||
self.assertTrue(email_queue)
|
||||
|
||||
def test_loan_repayment_salary_slip(self):
|
||||
from erpnext.loan_management.doctype.loan.test_loan import create_loan_type, create_loan, make_loan_disbursement_entry, create_loan_accounts
|
||||
from erpnext.loan_management.doctype.process_loan_interest_accrual.process_loan_interest_accrual import process_loan_interest_accrual_for_term_loans
|
||||
from erpnext.loan_management.doctype.loan.test_loan import (
|
||||
create_loan,
|
||||
create_loan_accounts,
|
||||
create_loan_type,
|
||||
make_loan_disbursement_entry,
|
||||
)
|
||||
from erpnext.loan_management.doctype.process_loan_interest_accrual.process_loan_interest_accrual import (
|
||||
process_loan_interest_accrual_for_term_loans,
|
||||
)
|
||||
from erpnext.payroll.doctype.salary_structure.test_salary_structure import make_salary_structure
|
||||
|
||||
applicant = make_employee("test_loan_repayment_salary_slip@salary.com", company="_Test Company")
|
||||
@@ -386,8 +409,7 @@ class TestSalarySlip(unittest.TestCase):
|
||||
for doc in delete_docs:
|
||||
frappe.db.sql("delete from `tab%s` where employee='%s'" % (doc, employee))
|
||||
|
||||
from erpnext.payroll.doctype.salary_structure.test_salary_structure import \
|
||||
make_salary_structure, create_salary_structure_assignment
|
||||
from erpnext.payroll.doctype.salary_structure.test_salary_structure import make_salary_structure
|
||||
|
||||
salary_structure = make_salary_structure("Stucture to test tax", "Monthly",
|
||||
other_details={"max_benefits": 100000}, test_tax=True,
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class SalarySlipLeave(Document):
|
||||
pass
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class SalarySlipTimesheet(Document):
|
||||
pass
|
||||
|
||||
@@ -2,13 +2,15 @@
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe, erpnext
|
||||
|
||||
from frappe.utils import flt, cint, cstr
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.model.mapper import get_mapped_doc
|
||||
from frappe.model.document import Document
|
||||
from six import iteritems
|
||||
from frappe.model.mapper import get_mapped_doc
|
||||
from frappe.utils import cint, cstr, flt
|
||||
|
||||
import erpnext
|
||||
|
||||
|
||||
class SalaryStructure(Document):
|
||||
def validate(self):
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from __future__ import unicode_literals
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
|
||||
@@ -2,17 +2,24 @@
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
import erpnext
|
||||
from frappe.utils.make_random import get_random
|
||||
from frappe.utils import nowdate, add_years, get_first_day, date_diff
|
||||
from erpnext.payroll.doctype.salary_structure.salary_structure import make_salary_slip
|
||||
from erpnext.payroll.doctype.salary_slip.test_salary_slip import make_earning_salary_component,\
|
||||
make_deduction_salary_component, make_employee_salary_slip, create_tax_slab
|
||||
from erpnext.hr.doctype.employee.test_employee import make_employee
|
||||
from erpnext.payroll.doctype.employee_tax_exemption_declaration.test_employee_tax_exemption_declaration import create_payroll_period
|
||||
|
||||
import frappe
|
||||
from frappe.utils import add_years, date_diff, get_first_day, nowdate
|
||||
from frappe.utils.make_random import get_random
|
||||
|
||||
import erpnext
|
||||
from erpnext.hr.doctype.employee.test_employee import make_employee
|
||||
from erpnext.payroll.doctype.employee_tax_exemption_declaration.test_employee_tax_exemption_declaration import (
|
||||
create_payroll_period,
|
||||
)
|
||||
from erpnext.payroll.doctype.salary_slip.test_salary_slip import (
|
||||
create_tax_slab,
|
||||
make_deduction_salary_component,
|
||||
make_earning_salary_component,
|
||||
make_employee_salary_slip,
|
||||
)
|
||||
from erpnext.payroll.doctype.salary_structure.salary_structure import make_salary_slip
|
||||
|
||||
test_dependencies = ["Fiscal Year"]
|
||||
|
||||
|
||||
@@ -3,10 +3,12 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.utils import getdate
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import getdate
|
||||
|
||||
|
||||
class DuplicateAssignment(frappe.ValidationError): pass
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
|
||||
class TestSalaryStructureAssignment(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class TaxableSalarySlab(Document):
|
||||
pass
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
|
||||
def get_context(context):
|
||||
# do your magic here
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
from frappe.utils import formatdate
|
||||
import itertools
|
||||
from frappe import _, get_all
|
||||
|
||||
|
||||
def execute(filters=None):
|
||||
columns = [
|
||||
{
|
||||
|
||||
@@ -2,9 +2,13 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe, erpnext
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
|
||||
import erpnext
|
||||
|
||||
|
||||
def execute(filters=None):
|
||||
data = get_data(filters)
|
||||
columns = get_columns(filters) if len(data) else []
|
||||
|
||||
@@ -2,9 +2,15 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe, erpnext
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from erpnext.regional.report.provident_fund_deductions.provident_fund_deductions import get_conditions
|
||||
|
||||
import erpnext
|
||||
from erpnext.regional.report.provident_fund_deductions.provident_fund_deductions import (
|
||||
get_conditions,
|
||||
)
|
||||
|
||||
|
||||
def execute(filters=None):
|
||||
mode_of_payments = get_payment_modes()
|
||||
|
||||
@@ -2,9 +2,13 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe, erpnext
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
|
||||
import erpnext
|
||||
|
||||
|
||||
def execute(filters=None):
|
||||
columns = get_columns(filters)
|
||||
data = get_data(filters)
|
||||
|
||||
@@ -2,9 +2,13 @@
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe, erpnext
|
||||
from frappe.utils import flt
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.utils import flt
|
||||
|
||||
import erpnext
|
||||
|
||||
|
||||
def execute(filters=None):
|
||||
if not filters: filters = {}
|
||||
|
||||
Reference in New Issue
Block a user