diff --git a/erpnext/public/js/erpnext.bundle.js b/erpnext/public/js/erpnext.bundle.js index 65603a1ed86ac6ab31c0f2e76604bbfb5a1ba4a4..625e38cfca6a03423464dcf65d836b3f10211eea 100644 --- a/erpnext/public/js/erpnext.bundle.js +++ b/erpnext/public/js/erpnext.bundle.js @@ -32,7 +32,7 @@ import "./utils/landed_taxes_and_charges_common.js"; import "./utils/sales_common.js"; import "./controllers/buying.js"; import "./financial_statements.js"; -import "./projects/ProjectManagementView.js"; +import "./projects/pm/ProjectManagementView.js"; // import { sum } from 'frappe/public/utils/util.js' diff --git a/erpnext/public/js/projects/PMTaskAssignmentQuickEntryForm.js b/erpnext/public/js/projects/pm/PMTaskAssignmentQuickEntryForm.js similarity index 100% rename from erpnext/public/js/projects/PMTaskAssignmentQuickEntryForm.js rename to erpnext/public/js/projects/pm/PMTaskAssignmentQuickEntryForm.js diff --git a/erpnext/public/js/projects/PMTimeLogDialog.js b/erpnext/public/js/projects/pm/PMTimeLogDialog.js similarity index 100% rename from erpnext/public/js/projects/PMTimeLogDialog.js rename to erpnext/public/js/projects/pm/PMTimeLogDialog.js diff --git a/erpnext/public/js/projects/PMUtils.js b/erpnext/public/js/projects/pm/PMUtils.js similarity index 100% rename from erpnext/public/js/projects/PMUtils.js rename to erpnext/public/js/projects/pm/PMUtils.js diff --git a/erpnext/public/js/projects/PMViewBaseCalendar.js b/erpnext/public/js/projects/pm/PMViewBaseCalendar.js similarity index 100% rename from erpnext/public/js/projects/PMViewBaseCalendar.js rename to erpnext/public/js/projects/pm/PMViewBaseCalendar.js diff --git a/erpnext/public/js/projects/PMViewCalendar_Assignments.js b/erpnext/public/js/projects/pm/PMViewCalendar_Assignments.js similarity index 100% rename from erpnext/public/js/projects/PMViewCalendar_Assignments.js rename to erpnext/public/js/projects/pm/PMViewCalendar_Assignments.js diff --git a/erpnext/public/js/projects/PMViewCalendar_Timelog.js b/erpnext/public/js/projects/pm/PMViewCalendar_Timelog.js similarity index 100% rename from erpnext/public/js/projects/PMViewCalendar_Timelog.js rename to erpnext/public/js/projects/pm/PMViewCalendar_Timelog.js diff --git a/erpnext/public/js/projects/PMViewEventSource.js b/erpnext/public/js/projects/pm/PMViewEventSource.js similarity index 95% rename from erpnext/public/js/projects/PMViewEventSource.js rename to erpnext/public/js/projects/pm/PMViewEventSource.js index 5ff7a4b0cae250431c2a9acb42c9d39595c2faad..7c5ec46a0c460a652434c47dfd54f0bda9c9580e 100644 --- a/erpnext/public/js/projects/PMViewEventSource.js +++ b/erpnext/public/js/projects/pm/PMViewEventSource.js @@ -57,22 +57,14 @@ const FULLCALENDAR_EVENT_KEYS = [ * Ref.: http://isthe.com/chongo/tech/comp/fnv/ * * @param {string} str the input value - * @param {boolean} [asString=false] set to true to return the hash value as - * 8-digit hex string instead of an integer - * @param {integer} [seed] optionally pass the hash of the previous chunk - * @returns {integer | string} + * @param {number} [hval] optionally pass a seed + * @returns {number} */ -function stringHash32(str, asString, seed) { - let i, l, hval = (seed === undefined) ? 0x811c9dc5 : seed; - - for (i = 0, l = str.length; i < l; i++) { +function stringHash32(str, hval = 0x811c9dc5) { + for (let i = 0, l = str.length; i < l; ++i){ hval ^= str.charCodeAt(i); hval += (hval << 1) + (hval << 4) + (hval << 7) + (hval << 8) + (hval << 24); } - if( asString ){ - // Convert to 8 digit hex string - return ("0000000" + (hval >>> 0).toString(16)).substring(-8); - } return hval >>> 0; } @@ -479,9 +471,7 @@ export class PMViewEventSource { const getValue = (k) => String(info.extendedProps?.[k] ?? ""); const key1 = getValue(this.mainKeys[0]); - const hash1 = stringHash32(key1) % 360; - // const key2 = getValue(this.mainKeys[1]); - // const hash2 = stringHash32(key2) % 60; + const hash1 = (stringHash32(key1) >>> 16) % 360; const hue = Math.round((hash1) % 360); const saturation = 50; diff --git a/erpnext/public/js/projects/ProjectManagementView.js b/erpnext/public/js/projects/pm/ProjectManagementView.js similarity index 100% rename from erpnext/public/js/projects/ProjectManagementView.js rename to erpnext/public/js/projects/pm/ProjectManagementView.js diff --git a/erpnext/public/js/projects/ProjectManagementView.scss b/erpnext/public/js/projects/pm/ProjectManagementView.scss similarity index 100% rename from erpnext/public/js/projects/ProjectManagementView.scss rename to erpnext/public/js/projects/pm/ProjectManagementView.scss diff --git a/erpnext/public/js/projects/eventSources.js b/erpnext/public/js/projects/pm/eventSources.js similarity index 100% rename from erpnext/public/js/projects/eventSources.js rename to erpnext/public/js/projects/pm/eventSources.js diff --git a/erpnext/public/scss/erpnext.bundle.scss b/erpnext/public/scss/erpnext.bundle.scss index 718fb7a2f7c3ca052d9b751db97a6a4612534b09..26bf16a9834affa556d3255227ab03a16d26efdb 100644 --- a/erpnext/public/scss/erpnext.bundle.scss +++ b/erpnext/public/scss/erpnext.bundle.scss @@ -1,4 +1,4 @@ @import "./erpnext"; @import "./call_popup"; @import "./point-of-sale"; -@import "../js/projects/ProjectManagementView"; +@import "../js/projects/pm/ProjectManagementView"; diff --git a/erpnext/templates/pages/subscription.py b/erpnext/templates/pages/subscription.py index 3327200ce1a63c9d079a70b762bc4fc86dff8e23..2c2d7dd995fdad74eeb9835a0ed5068d694e18dc 100644 --- a/erpnext/templates/pages/subscription.py +++ b/erpnext/templates/pages/subscription.py @@ -37,7 +37,9 @@ def get_context(context): context.payment_requests = get_open_payment_requests_for_subscription(frappe.form_dict.name) context.customer = context.doc.get_customer_details(ignore_permissions=True) context.billing_contact = { - "name": " ".join(frappe.db.get_value("Contact", context.doc, ["first_name", "last_name"])), + "name": " ".join( + frappe.db.get_value("Contact", context.doc, ["first_name", "last_name"]) or [""] + ), "email": context.doc.contact_email, }