ci: add pre-commit fixes

This commit is contained in:
Rohan Bansal 2025-06-17 11:45:28 +05:30
parent 517561f1b2
commit bf0c3130e6
9 changed files with 204 additions and 218 deletions

View file

@ -25,11 +25,7 @@
<div class="row">
<label for="bill_no" class="col-sm-3 col-form-label">Invoice Number</label>
<div class="col-sm-8">
<input
type="text"
class="form-control"
id="bill_no"
v-model.number="invoiceData.bill_no" />
<input type="text" class="form-control" id="bill_no" v-model.number="invoiceData.bill_no" />
</div>
</div>
</div>

View file

@ -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,
})
}
},
})
</script>

View file

@ -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}")

View file

@ -16,6 +16,6 @@
<div id="popovers"></div>
<script> window.csrf_token = '{{ csrf_token }}'; </script>
</body>
</html>

View file

@ -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
}

View file

@ -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)
}
},
});
})

View file

@ -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": []
}
"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": []
}

View file

@ -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):

View file

@ -16,6 +16,6 @@
<div id="popovers"></div>
<script> window.csrf_token = '{{ csrf_token }}'; </script>
</body>
</html>