only validate party account and ref doc party account in selected case (#10863)

* only validate party account and ref doc party account in selected case

* fix for fee structure test

* fix the assessment result test
This commit is contained in:
Manas Solanki 2017-09-21 12:01:20 +05:30 committed by Nabin Hait
parent b2dca79d89
commit 1c1dd08a34
6 changed files with 21 additions and 15 deletions

View File

@ -221,9 +221,9 @@ class PaymentEntry(AccountsController):
elif self.party_type=="Employee":
ref_party_account = ref_doc.payable_account
if ref_party_account != self.party_account:
frappe.throw(_("{0} {1} is associated with {2}, but Party Account is {3}")
.format(d.reference_doctype, d.reference_name, ref_party_account, self.party_account))
if ref_party_account != self.party_account:
frappe.throw(_("{0} {1} is associated with {2}, but Party Account is {3}")
.format(d.reference_doctype, d.reference_name, ref_party_account, self.party_account))
if ref_doc.docstatus != 1:
frappe.throw(_("{0} {1} must be submitted")

View File

@ -20,8 +20,9 @@ QUnit.test('Test: Assessment Result', function(assert){
() => cur_frm.refresh(),
() => frappe.timeout(1),
() => {
for(i = 0; i < $('tbody tr').size() * 4; i = (i + 4))
student_list.push($(`tbody td:eq("${i}")`).text());
$("tbody tr").each( function(i, input){
student_list.push($(input).data().student);
});
},
// Looping through each student in the list and setting up their score

View File

@ -14,8 +14,8 @@
}
],
"total_amount": 50000,
"debit_to": "_Test Receivable - _TC",
"against_income_account": "Sales - _TC",
"receivable_account": "_Test Receivable - _TC",
"income_account": "Sales - _TC",
"cost_center": "_Test Cost Center - _TC",
"company": "_Test Company"
},
@ -34,8 +34,8 @@
}
],
"total_amount": 50000,
"debit_to": "_Test Receivable - _TC",
"against_income_account": "Sales - _TC",
"receivable_account": "_Test Receivable - _TC",
"income_account": "Sales - _TC",
"cost_center": "_Test Cost Center - _TC",
"company": "_Test Company"
}

View File

@ -93,7 +93,7 @@
"label": "Student Name",
"length": 0,
"no_copy": 0,
"options": "student.student_name",
"options": "student.title",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@ -1276,7 +1276,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
"modified": "2017-09-19 16:45:14.313744",
"modified": "2017-09-20 23:17:09.819606",
"modified_by": "Administrator",
"module": "Schools",
"name": "Fees",

View File

@ -52,8 +52,13 @@ class Fees(AccountsController):
where g.name = sg.guardian and sg.parent = %s and sg.parenttype = 'Student'
""", self.student)
student_emails.append(frappe.db.get_value("Student", self.student, "student_email_id"))
return ", ".join(list(set(student_emails)))
student_email_id = frappe.db.get_value("Student", self.student, "student_email_id")
if student_email_id:
student_emails.append(student_email_id)
if student_emails:
return ", ".join(list(set(student_emails)))
else:
return None
def calculate_total(self):

View File

@ -19,8 +19,8 @@ class TestFees(unittest.TestCase):
fee.posting_date = nowdate()
fee.due_date = nowdate()
fee.student = student
fee.debit_to = "_Test Receivable - _TC"
fee.against_income_account = "Sales - _TC"
fee.receivable_account = "_Test Receivable - _TC"
fee.income_account = "Sales - _TC"
fee.cost_center = "_Test Cost Center - _TC"
fee.company = "_Test Company"