chore: Update test cases
This commit is contained in:
@@ -712,7 +712,7 @@ class TestPricingRule(unittest.TestCase):
|
||||
title="_Test Pricing Rule with Min Qty - 2",
|
||||
)
|
||||
|
||||
si = create_sales_invoice(do_not_submit=True, customer="_Test Customer 1", qty=1, currency="USD")
|
||||
si = create_sales_invoice(do_not_submit=True, customer="_Test Customer 1", qty=1)
|
||||
item = si.items[0]
|
||||
item.stock_qty = 1
|
||||
si.save()
|
||||
|
||||
@@ -164,6 +164,7 @@ def create_sales_invoice():
|
||||
sales_invoice.customer = frappe.db.get_value("Patient", patient, "customer")
|
||||
sales_invoice.due_date = getdate()
|
||||
sales_invoice.company = "_Test Company"
|
||||
sales_invoice.currency = "INR"
|
||||
sales_invoice.debit_to = get_receivable_account("_Test Company")
|
||||
|
||||
tests = [insulin_resistance_template, blood_test_template]
|
||||
|
||||
@@ -12,6 +12,7 @@ from frappe.model.document import Document
|
||||
from frappe.model.mapper import get_mapped_doc
|
||||
from frappe.utils import flt, get_link_to_form, get_time, getdate
|
||||
|
||||
from erpnext import get_company_currency
|
||||
from erpnext.healthcare.doctype.healthcare_settings.healthcare_settings import (
|
||||
get_income_account,
|
||||
get_receivable_account,
|
||||
@@ -252,6 +253,9 @@ def create_sales_invoice(appointment_doc):
|
||||
sales_invoice = frappe.new_doc("Sales Invoice")
|
||||
sales_invoice.patient = appointment_doc.patient
|
||||
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)
|
||||
sales_invoice.appointment = appointment_doc.name
|
||||
sales_invoice.due_date = getdate()
|
||||
sales_invoice.company = appointment_doc.company
|
||||
|
||||
@@ -6,6 +6,8 @@ import frappe
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import flt
|
||||
|
||||
from erpnext import get_company_currency
|
||||
|
||||
|
||||
class TherapyPlan(Document):
|
||||
def validate(self):
|
||||
@@ -72,6 +74,9 @@ def make_sales_invoice(reference_name, patient, company, therapy_plan_template):
|
||||
si.company = company
|
||||
si.patient = patient
|
||||
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)
|
||||
|
||||
item = frappe.db.get_value("Therapy Plan Template", therapy_plan_template, "linked_item")
|
||||
price_list, price_list_currency = frappe.db.get_values(
|
||||
|
||||
Reference in New Issue
Block a user