|
|
@ -1832,7 +1832,8 @@ class TestSalesInvoice(unittest.TestCase): |
|
|
|
|
|
|
|
create_internal_customer( |
|
|
|
customer_name="_Test Internal Customer", |
|
|
|
represents_company="_Test Company 1" |
|
|
|
represents_company="_Test Company 1", |
|
|
|
allowed_to_interact_with="Wind Power LLC" |
|
|
|
) |
|
|
|
|
|
|
|
if not frappe.db.exists("Supplier", "_Test Internal Supplier"): |
|
|
@ -1994,6 +1995,8 @@ class TestSalesInvoice(unittest.TestCase): |
|
|
|
|
|
|
|
def test_internal_transfer_gl_entry(self): |
|
|
|
## Create internal transfer account |
|
|
|
from erpnext.selling.doctype.customer.test_customer import create_internal_customer |
|
|
|
|
|
|
|
account = create_account(account_name="Unrealized Profit", |
|
|
|
parent_account="Current Liabilities - TCP1", company="_Test Company with perpetual inventory") |
|
|
|
|
|
|
@ -2551,29 +2554,6 @@ def get_taxes_and_charges(): |
|
|
|
"row_id": 1 |
|
|
|
}] |
|
|
|
|
|
|
|
def create_internal_customer(customer_name, represents_company, allowed_to_interact_with): |
|
|
|
if not frappe.db.exists("Customer", customer_name): |
|
|
|
customer = frappe.get_doc({ |
|
|
|
"customer_group": "_Test Customer Group", |
|
|
|
"customer_name": customer_name, |
|
|
|
"customer_type": "Individual", |
|
|
|
"doctype": "Customer", |
|
|
|
"territory": "_Test Territory", |
|
|
|
"is_internal_customer": 1, |
|
|
|
"represents_company": represents_company |
|
|
|
}) |
|
|
|
|
|
|
|
customer.append("companies", { |
|
|
|
"company": allowed_to_interact_with |
|
|
|
}) |
|
|
|
|
|
|
|
customer.insert() |
|
|
|
customer_name = customer.name |
|
|
|
else: |
|
|
|
customer_name = frappe.db.get_value("Customer", customer_name) |
|
|
|
|
|
|
|
return customer_name |
|
|
|
|
|
|
|
def create_internal_supplier(supplier_name, represents_company, allowed_to_interact_with): |
|
|
|
if not frappe.db.exists("Supplier", supplier_name): |
|
|
|
supplier = frappe.get_doc({ |
|
|
|