Skip to content

Commit

Permalink
chore: add shipping address in eway bill test (#27662)
Browse files Browse the repository at this point in the history
  • Loading branch information
nextchamp-saqib authored Sep 27, 2021
1 parent f2fca59 commit b68ac24
Showing 1 changed file with 31 additions and 8 deletions.
39 changes: 31 additions & 8 deletions erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -2352,6 +2352,7 @@ def make_test_address_for_ewaybill():
if not frappe.db.exists('Address', '_Test Address for Eway bill-Billing'):
address = frappe.get_doc({
"address_line1": "_Test Address Line 1",
"address_line2": "_Test Address Line 2",
"address_title": "_Test Address for Eway bill",
"address_type": "Billing",
"city": "_Test City",
Expand All @@ -2373,11 +2374,12 @@ def make_test_address_for_ewaybill():

address.save()

if not frappe.db.exists('Address', '_Test Customer-Address for Eway bill-Shipping'):
if not frappe.db.exists('Address', '_Test Customer-Address for Eway bill-Billing'):
address = frappe.get_doc({
"address_line1": "_Test Address Line 1",
"address_line2": "_Test Address Line 2",
"address_title": "_Test Customer-Address for Eway bill",
"address_type": "Shipping",
"address_type": "Billing",
"city": "_Test City",
"state": "Test State",
"country": "India",
Expand All @@ -2397,9 +2399,34 @@ def make_test_address_for_ewaybill():

address.save()

if not frappe.db.exists('Address', '_Test Customer-Address for Eway bill-Shipping'):
address = frappe.get_doc({
"address_line1": "_Test Address Line 1",
"address_line2": "_Test Address Line 2",
"address_title": "_Test Customer-Address for Eway bill",
"address_type": "Shipping",
"city": "_Test City",
"state": "Test State",
"country": "India",
"doctype": "Address",
"is_primary_address": 1,
"phone": "+910000000000",
"gst_state": "Maharashtra",
"gst_state_number": "27",
"pincode": "410098"
}).insert()

address.append("links", {
"link_doctype": "Customer",
"link_name": "_Test Customer"
})

address.save()

if not frappe.db.exists('Address', '_Test Dispatch-Address for Eway bill-Shipping'):
address = frappe.get_doc({
"address_line1": "_Test Dispatch Address Line 1",
"address_line2": "_Test Dispatch Address Line 2",
"address_title": "_Test Dispatch-Address for Eway bill",
"address_type": "Shipping",
"city": "_Test City",
Expand All @@ -2414,11 +2441,6 @@ def make_test_address_for_ewaybill():
"pincode": "1100101"
}).insert()

address.append("links", {
"link_doctype": "Company",
"link_name": "_Test Company"
})

address.save()

def make_test_transporter_for_ewaybill():
Expand Down Expand Up @@ -2458,7 +2480,8 @@ def make_sales_invoice_for_ewaybill():

si.distance = 2000
si.company_address = "_Test Address for Eway bill-Billing"
si.customer_address = "_Test Customer-Address for Eway bill-Shipping"
si.customer_address = "_Test Customer-Address for Eway bill-Billing"
si.shipping_address_name = "_Test Customer-Address for Eway bill-Shipping"
si.dispatch_address_name = "_Test Dispatch-Address for Eway bill-Shipping"
si.vehicle_no = "KA12KA1234"
si.gst_category = "Registered Regular"
Expand Down

0 comments on commit b68ac24

Please sign in to comment.