diff --git a/supplier-portal/src/pages/NewInvoice.vue b/supplier-portal/src/pages/NewInvoice.vue index 9f71c5c..7cd1eab 100644 --- a/supplier-portal/src/pages/NewInvoice.vue +++ b/supplier-portal/src/pages/NewInvoice.vue @@ -25,11 +25,7 @@
- +
diff --git a/supplier-portal/src/pages/SupplierInvoice.vue b/supplier-portal/src/pages/SupplierInvoice.vue index 0b21772..0dc5e89 100644 --- a/supplier-portal/src/pages/SupplierInvoice.vue +++ b/supplier-portal/src/pages/SupplierInvoice.vue @@ -288,14 +288,14 @@ const documents = reactive({}) const invoice = createDocumentResource({ doctype: 'Purchase Invoice', name: supplierInvoiceNumber, - onSuccess: (data) => { + onSuccess: data => { documents.invoice = data documents.address = createDocumentResource({ doctype: 'Address', name: data.supplier_address, - auto: true + auto: true, }) - } + }, }) diff --git a/suppliers_portal/patches/move_invoices_to_erpnext.py b/suppliers_portal/patches/move_invoices_to_erpnext.py index f8b8667..5477a6f 100644 --- a/suppliers_portal/patches/move_invoices_to_erpnext.py +++ b/suppliers_portal/patches/move_invoices_to_erpnext.py @@ -88,9 +88,7 @@ def setup_accounts(): force=True, ) update_account_number(f"1110 - Cash - {abbr}", "Petty Cash", account_number="1110") - update_account_number( - f"Primary Checking - {abbr}", "Primary Checking", account_number="1201" - ) + update_account_number(f"Primary Checking - {abbr}", "Primary Checking", account_number="1201") def create_fiscal_years(): @@ -324,9 +322,7 @@ def import_invoices(): "paid_from": get_account_name("Bank", "Asset"), "reference_no": payment.get("payment_reference_number") or "Note: Missing reference during ERPNext import", - "reference_date": getdate( - payment.get("payment_reference_date") - ), + "reference_date": getdate(payment.get("payment_reference_date")), "references": [ { "reference_doctype": invoice_doc.doctype, @@ -341,6 +337,4 @@ def import_invoices(): payment_doc.insert(ignore_permissions=True) payment_doc.submit() except Exception as e: - print( - f"Error importing payment for invoice {invoice_doc.bill_no}: {e}" - ) + print(f"Error importing payment for invoice {invoice_doc.bill_no}: {e}") diff --git a/suppliers_portal/public/supplier-portal/index.html b/suppliers_portal/public/supplier-portal/index.html index a6d8cb3..8f3a79b 100644 --- a/suppliers_portal/public/supplier-portal/index.html +++ b/suppliers_portal/public/supplier-portal/index.html @@ -16,6 +16,6 @@
- + diff --git a/suppliers_portal/suppliers_portal/custom/purchase_invoice.json b/suppliers_portal/suppliers_portal/custom/purchase_invoice.json index 3bddbcb..2d1de08 100644 --- a/suppliers_portal/suppliers_portal/custom/purchase_invoice.json +++ b/suppliers_portal/suppliers_portal/custom/purchase_invoice.json @@ -1,137 +1,137 @@ { - "custom_fields": [ - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "creation": "2025-05-19 02:22:24.828657", - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "dt": "Purchase Invoice", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "service_date", - "fieldtype": "Date", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "idx": 12, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "due_date", - "is_system_generated": 0, - "is_virtual": 0, - "label": "Service Date", - "length": 0, - "link_filters": null, - "mandatory_depends_on": null, - "modified": "2025-05-19 02:22:24.828657", - "modified_by": "Administrator", - "module": null, - "name": "Purchase Invoice-service_date", - "no_copy": 0, - "non_negative": 0, - "options": null, - "owner": "Administrator", - "permlevel": 0, - "placeholder": null, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "show_dashboard": 0, - "sort_options": 0, - "translatable": 0, - "unique": 0, - "width": null - }, - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "creation": "2025-05-19 02:22:24.721092", - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "dt": "Purchase Invoice", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "site_code", - "fieldtype": "Data", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "idx": 6, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "company", - "is_system_generated": 0, - "is_virtual": 0, - "label": "Site Code", - "length": 0, - "link_filters": null, - "mandatory_depends_on": null, - "modified": "2025-05-19 02:22:24.721092", - "modified_by": "Administrator", - "module": null, - "name": "Purchase Invoice-site_code", - "no_copy": 0, - "non_negative": 0, - "options": null, - "owner": "Administrator", - "permlevel": 0, - "placeholder": null, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "show_dashboard": 0, - "sort_options": 0, - "translatable": 1, - "unique": 0, - "width": null - } - ], - "custom_perms": [], - "doctype": "Purchase Invoice", - "links": [], - "property_setters": [], - "sync_on_migrate": 1 + "custom_fields": [ + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2025-05-19 02:22:24.828657", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Purchase Invoice", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "service_date", + "fieldtype": "Date", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 12, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "due_date", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Service Date", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2025-05-19 02:22:24.828657", + "modified_by": "Administrator", + "module": null, + "name": "Purchase Invoice-service_date", + "no_copy": 0, + "non_negative": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2025-05-19 02:22:24.721092", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Purchase Invoice", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "site_code", + "fieldtype": "Data", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 6, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "company", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Site Code", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2025-05-19 02:22:24.721092", + "modified_by": "Administrator", + "module": null, + "name": "Purchase Invoice-site_code", + "no_copy": 0, + "non_negative": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 1, + "unique": 0, + "width": null + } + ], + "custom_perms": [], + "doctype": "Purchase Invoice", + "links": [], + "property_setters": [], + "sync_on_migrate": 1 } diff --git a/suppliers_portal/suppliers_portal/doctype/site_code/site_code.js b/suppliers_portal/suppliers_portal/doctype/site_code/site_code.js index 8fbbc6b..b6fe717 100644 --- a/suppliers_portal/suppliers_portal/doctype/site_code/site_code.js +++ b/suppliers_portal/suppliers_portal/doctype/site_code/site_code.js @@ -1,7 +1,7 @@ // Copyright (c) 2025, jeowsome15@gmail.com and contributors // For license information, please see license.txt -frappe.ui.form.on("Site Code", { +frappe.ui.form.on('Site Code', { refresh(frm) { if (!frm.doc.__islocal) { frappe.contacts.render_address_and_contact(frm) @@ -9,4 +9,4 @@ frappe.ui.form.on("Site Code", { frappe.contacts.clear_address_and_contact(frm) } }, -}); +}) diff --git a/suppliers_portal/suppliers_portal/doctype/site_code/site_code.json b/suppliers_portal/suppliers_portal/doctype/site_code/site_code.json index ed6bc27..7e7b57a 100644 --- a/suppliers_portal/suppliers_portal/doctype/site_code/site_code.json +++ b/suppliers_portal/suppliers_portal/doctype/site_code/site_code.json @@ -1,62 +1,58 @@ { - "actions": [], - "allow_rename": 1, - "creation": "2025-06-17 01:51:35.709515", - "doctype": "DocType", - "engine": "InnoDB", - "field_order": [ - "site_code", - "column_break_pwyn", - "address_html" - ], - "fields": [ - { - "fieldname": "site_code", - "fieldtype": "Data", - "in_global_search": 1, - "in_list_view": 1, - "in_preview": 1, - "in_standard_filter": 1, - "label": "Site Code", - "no_copy": 1, - "not_nullable": 1, - "reqd": 1, - "unique": 1 - }, - { - "fieldname": "column_break_pwyn", - "fieldtype": "Column Break" - }, - { - "depends_on": "eval: !doc.__islocal", - "fieldname": "address_html", - "fieldtype": "HTML", - "label": "Address HTML", - "read_only": 1 - } - ], - "index_web_pages_for_search": 1, - "links": [], - "modified": "2025-06-17 02:11:43.902766", - "modified_by": "Administrator", - "module": "Suppliers Portal", - "name": "Site Code", - "owner": "Administrator", - "permissions": [ - { - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "System Manager", - "share": 1, - "write": 1 - } - ], - "sort_field": "creation", - "sort_order": "DESC", - "states": [] -} \ No newline at end of file + "actions": [], + "allow_rename": 1, + "creation": "2025-06-17 01:51:35.709515", + "doctype": "DocType", + "engine": "InnoDB", + "field_order": ["site_code", "column_break_pwyn", "address_html"], + "fields": [ + { + "fieldname": "site_code", + "fieldtype": "Data", + "in_global_search": 1, + "in_list_view": 1, + "in_preview": 1, + "in_standard_filter": 1, + "label": "Site Code", + "no_copy": 1, + "not_nullable": 1, + "reqd": 1, + "unique": 1 + }, + { + "fieldname": "column_break_pwyn", + "fieldtype": "Column Break" + }, + { + "depends_on": "eval: !doc.__islocal", + "fieldname": "address_html", + "fieldtype": "HTML", + "label": "Address HTML", + "read_only": 1 + } + ], + "index_web_pages_for_search": 1, + "links": [], + "modified": "2025-06-17 02:11:43.902766", + "modified_by": "Administrator", + "module": "Suppliers Portal", + "name": "Site Code", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + } + ], + "sort_field": "creation", + "sort_order": "DESC", + "states": [] +} diff --git a/suppliers_portal/suppliers_portal/doctype/site_code/site_code.py b/suppliers_portal/suppliers_portal/doctype/site_code/site_code.py index bd8befb..9c41985 100644 --- a/suppliers_portal/suppliers_portal/doctype/site_code/site_code.py +++ b/suppliers_portal/suppliers_portal/doctype/site_code/site_code.py @@ -1,8 +1,8 @@ # Copyright (c) 2025, jeowsome15@gmail.com and contributors # For license information, please see license.txt -from frappe.model.document import Document from frappe.contacts.address_and_contact import delete_contact_and_address, load_address_and_contact +from frappe.model.document import Document class SiteCode(Document): diff --git a/suppliers_portal/www/supplier-portal.html b/suppliers_portal/www/supplier-portal.html index a6d8cb3..8f3a79b 100644 --- a/suppliers_portal/www/supplier-portal.html +++ b/suppliers_portal/www/supplier-portal.html @@ -16,6 +16,6 @@
- +