diff --git a/landms/patches/custom_fields/custom_fields_json/07_payment_entry.json b/landms/patches/custom_fields/custom_fields_json/07_payment_entry.json index 6eee936..dee4330 100644 --- a/landms/patches/custom_fields/custom_fields_json/07_payment_entry.json +++ b/landms/patches/custom_fields/custom_fields_json/07_payment_entry.json @@ -1,7 +1,6 @@ [ { "name": "Payment Entry-plot", - "idx": 97, "dt": "Payment Entry", "label": "Plot", "fieldname": "plot", @@ -14,7 +13,6 @@ }, { "name": "Payment Entry-plot_number", - "idx": 97, "dt": "Payment Entry", "label": "Plot Number", "fieldname": "plot_number", @@ -26,7 +24,6 @@ }, { "name": "Payment Entry-plot_outstanding_amount", - "idx": 97, "dt": "Payment Entry", "label": "Plot Outstanding Amount", "fieldname": "plot_outstanding_amount", @@ -35,5 +32,17 @@ "read_only": 1, "allow_on_submit": 1, "doctype": "Custom Field" + }, + { + "name": "Payment Entry-mobile_no", + "dt": "Payment Entry", + "label": "Mobile No", + "fieldname": "mobile_no", + "insert_after": "contact_email", + "fieldtype": "Data", + "options": "Phone", + "read_only": 1, + "in_preview": 1, + "doctype": "Custom Field" } ] \ No newline at end of file diff --git a/landms/payment_sync.py b/landms/payment_sync.py index 33b64db..2d61a5f 100644 --- a/landms/payment_sync.py +++ b/landms/payment_sync.py @@ -27,6 +27,10 @@ def validate_payment_entry(doc, method=None): if not doc.get("references"): return + if doc.contact_person and not doc.mobile_no: + contact_info = frappe.get_cached_value("Contact", doc.contact_person, ["mobile_no", "phone"], as_dict=True) + doc.mobile_no = contact_info.get("mobile_no") or contact_info.get("phone") + normalized_rows = [] seen_invoice_rows: dict[tuple[str, str], dict] = {}