From f650cb8e4bdbfc34210cb624eabc1b93deca8ced Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Tue, 30 Jul 2019 17:46:15 +0530 Subject: [PATCH] style: Indent and missing semicolon --- .../bom_comparison_tool.js | 29 ++++++++----------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/erpnext/manufacturing/page/bom_comparison_tool/bom_comparison_tool.js b/erpnext/manufacturing/page/bom_comparison_tool/bom_comparison_tool.js index eeecdf69ae..11648226a8 100644 --- a/erpnext/manufacturing/page/bom_comparison_tool/bom_comparison_tool.js +++ b/erpnext/manufacturing/page/bom_comparison_tool/bom_comparison_tool.js @@ -112,18 +112,19 @@ erpnext.BOMComparisonTool = class BOMComparisonTool { let df = frappe.meta.get_docfield(doctype, fieldname); let html = changes.map(change => { - let [fieldname, idx, item_code, changes] = change; + let [fieldname,, item_code, changes] = change; let df = frappe.meta.get_docfield(doctype, fieldname); let child_doctype = df.options; let values_changed = this.get_changed_values(child_doctype, changes); return values_changed.map((change, i) => { let [fieldname, value1, value2] = change; + let th = i === 0 + ? `${item_code}` + : ''; return ` - ${i === 0 - ? `${item_code}` - : ''} + ${th} ${frappe.meta.get_label(child_doctype, fieldname)} ${value1} ${value2} @@ -155,23 +156,17 @@ erpnext.BOMComparisonTool = class BOMComparisonTool { let html = rows.map(row => { let [, doc] = row; - return ` - - - ${fields.map(df => { - return `${doc[df.fieldname]}` - }).join('')} - - `; + let cells = fields + .map(df => `${doc[df.fieldname]}`) + .join(''); + return `${cells}`; }).join(''); + let header = fields.map(df => `${df.label}`).join(''); return `

${$.format(title, [df.label])}

- ${fields.map(df => { - return `` - }).join('')} - + ${header} ${html}
${df.label}
`; @@ -206,7 +201,7 @@ erpnext.BOMComparisonTool = class BOMComparisonTool { return true; }); } -} +}; function group_items(array, fn) { return array.reduce((acc, item) => {