Skip to content

Instantly share code, notes, and snippets.

@Adrian-Samuel
Last active October 4, 2019 16:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Adrian-Samuel/efdc1511f825c36903f19577b395e178 to your computer and use it in GitHub Desktop.
Save Adrian-Samuel/efdc1511f825c36903f19577b395e178 to your computer and use it in GitHub Desktop.
Lightspeed Workorder Note Hider
// Make sure you wrap the script in a script tag
// Insert this after the <h1 class="receiptTypeTitle"> in the Sales template
document.addEventListener("DOMContentLoaded", () => {
const lines_with_notes = document.querySelectorAll('.line_note');
lines_with_notes.forEach(line => {
const line_content = line.innerText;
if (/Work order/gi.test(line_content)) {
const firstLine = line_content.split(/\n/g)[0];
line.innerHTML = line_content.replace(line_content, firstLine);
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment