Demo fixed for Process Payroll and Salary Structure
This commit is contained in:
parent
0702fa2fc6
commit
1c1e2e9cbe
@ -130,7 +130,7 @@ def setup_salary_structure():
|
|||||||
ss.from_date = e.date_of_joining if (e.date_of_joining
|
ss.from_date = e.date_of_joining if (e.date_of_joining
|
||||||
and e.date_of_joining > f.year_start_date) else f.year_start_date
|
and e.date_of_joining > f.year_start_date) else f.year_start_date
|
||||||
ss.to_date = f.year_end_date
|
ss.to_date = f.year_end_date
|
||||||
|
ss.payment_account = frappe.get_value('Account', {'account_type': 'Cash', 'company': erpnext.get_default_company(),'is_group':0}, "name")
|
||||||
ss.append('earnings', {
|
ss.append('earnings', {
|
||||||
'salary_component': 'Basic',
|
'salary_component': 'Basic',
|
||||||
"abbr":'B',
|
"abbr":'B',
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe, erpnext
|
||||||
import random
|
import random
|
||||||
from frappe.utils import random_string, add_days, cint
|
from frappe.utils import random_string, add_days, cint
|
||||||
from erpnext.projects.doctype.timesheet.test_timesheet import make_timesheet
|
from erpnext.projects.doctype.timesheet.test_timesheet import make_timesheet
|
||||||
@ -24,17 +24,13 @@ def work():
|
|||||||
process_payroll.company = frappe.flags.company
|
process_payroll.company = frappe.flags.company
|
||||||
process_payroll.month = prev_month
|
process_payroll.month = prev_month
|
||||||
process_payroll.fiscal_year = year
|
process_payroll.fiscal_year = year
|
||||||
process_payroll.create_sal_slip()
|
process_payroll.from_date = frappe.flags.current_date
|
||||||
|
process_payroll.to_date = add_days(frappe.flags.current_date, random.randint(0, 30))
|
||||||
|
process_payroll.reference_number = "DemoRef23"
|
||||||
|
process_payroll.reference_date = frappe.flags.current_date
|
||||||
|
process_payroll.payment_account = frappe.get_value('Account', {'account_type': 'Cash', 'company': erpnext.get_default_company(),'is_group':0}, "name")
|
||||||
process_payroll.submit_salary_slip()
|
process_payroll.submit_salary_slip()
|
||||||
r = process_payroll.make_journal_entry(frappe.get_value('Account',
|
process_payroll.make_journal_entry()
|
||||||
{'account_name': 'Salary'}))
|
|
||||||
|
|
||||||
journal_entry = frappe.get_doc(r)
|
|
||||||
journal_entry.cheque_no = random_string(10)
|
|
||||||
journal_entry.cheque_date = frappe.flags.current_date
|
|
||||||
journal_entry.posting_date = frappe.flags.current_date
|
|
||||||
journal_entry.insert()
|
|
||||||
journal_entry.submit()
|
|
||||||
|
|
||||||
if frappe.db.get_global('demo_hr_user'):
|
if frappe.db.get_global('demo_hr_user'):
|
||||||
make_timesheet_records()
|
make_timesheet_records()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user