test: Update test cases for currency change validation

(cherry picked from commit 60915e874d)

# Conflicts:
#	erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py
#	erpnext/healthcare/doctype/patient_appointment/patient_appointment.py
#	erpnext/healthcare/doctype/therapy_plan/therapy_plan.py
#	erpnext/non_profit/doctype/membership/membership.py
This commit is contained in:
Deepesh Garg
2021-08-21 23:05:48 +05:30
committed by Mergify
parent 9d43a90eb0
commit 8f969fbd66
6 changed files with 57 additions and 1 deletions

View File

@@ -22,6 +22,7 @@ from erpnext.healthcare.utils import (
manage_fee_validity,
)
from erpnext.hr.doctype.employee.employee import is_holiday
<<<<<<< HEAD
class MaximumCapacityError(frappe.ValidationError):
@@ -31,6 +32,11 @@ class MaximumCapacityError(frappe.ValidationError):
class OverlapError(frappe.ValidationError):
pass
=======
from erpnext.healthcare.doctype.healthcare_settings.healthcare_settings import get_receivable_account, get_income_account
from erpnext.healthcare.utils import check_fee_validity, get_service_item_and_practitioner_charge, manage_fee_validity
from erpnext import get_company_currency
>>>>>>> 60915e874d (test: Update test cases for currency change validation)
class PatientAppointment(Document):
def validate(self):
@@ -251,7 +257,13 @@ def invoice_appointment(appointment_doc):
def create_sales_invoice(appointment_doc):
sales_invoice = frappe.new_doc("Sales Invoice")
sales_invoice.patient = appointment_doc.patient
<<<<<<< HEAD
sales_invoice.customer = frappe.get_value("Patient", appointment_doc.patient, "customer")
=======
sales_invoice.customer = frappe.get_value('Patient', appointment_doc.patient, 'customer')
sales_invoice.currency = frappe.get_value('Customer', sales_invoice.customer, 'default_currency') \
or get_company_currency(appointment_doc.currency)
>>>>>>> 60915e874d (test: Update test cases for currency change validation)
sales_invoice.appointment = appointment_doc.name
sales_invoice.due_date = getdate()
sales_invoice.company = appointment_doc.company

View File

@@ -4,8 +4,13 @@
import frappe
from frappe.model.document import Document
<<<<<<< HEAD
from frappe.utils import flt
=======
from frappe.utils import flt, today
from erpnext import get_company_currency
>>>>>>> 60915e874d (test: Update test cases for currency change validation)
class TherapyPlan(Document):
def validate(self):
@@ -71,7 +76,13 @@ def make_sales_invoice(reference_name, patient, company, therapy_plan_template):
si = frappe.new_doc("Sales Invoice")
si.company = company
si.patient = patient
<<<<<<< HEAD
si.customer = frappe.db.get_value("Patient", patient, "customer")
=======
si.customer = frappe.db.get_value('Patient', patient, 'customer')
si.currency = frappe.get_value('Customer', si.customer, 'default_currency') \
or get_company_currency(si.company)
>>>>>>> 60915e874d (test: Update test cases for currency change validation)
item = frappe.db.get_value("Therapy Plan Template", therapy_plan_template, "linked_item")
price_list, price_list_currency = frappe.db.get_values(