style: Fix formatting issues

This commit is contained in:
Suraj Shetty 2021-02-01 20:34:21 +05:30
parent 62442d1c52
commit 723bd9676d
2 changed files with 30 additions and 29 deletions

View File

@ -19,18 +19,22 @@ frappe.ui.form.on('Course Scheduling Tool', {
} }
const { course_schedules } = r.message; const { course_schedules } = r.message;
if (course_schedules) { if (course_schedules) {
/* eslint-disable indent */ const course_schedules_html = course_schedules.map(c => `
const html = `<table class="table table-bordered"> <tr>
<caption>${__('Following course schedules were created')}</caption> <td><a href="/app/course-schedule/${c.name}">${c.name}</a></td>
<thead><tr><th>${__("Course")}</th><th>${__("Date")}</th></tr></thead> <td>${c.schedule_date}</td>
<tbody> </tr>
${course_schedules.map(c => `).join('');
`<tr><td><a href="/app/course-schedule/${c.name}">${c.name}</a></td>
<td>${c.schedule_date}</td></tr>` const html = `
).join('')} <table class="table table-bordered">
</tbody> <caption>${__('Following course schedules were created')}</caption>
</table>`; <thead><tr><th>${__("Course")}</th><th>${__("Date")}</th></tr></thead>
/* eslint-disable indent */ <tbody>
${course_schedules_html}
</tbody>
</table>
`;
frappe.msgprint(html); frappe.msgprint(html);
} }

View File

@ -312,15 +312,15 @@ erpnext.PointOfSale.Payment = class {
const margin = i % 2 === 0 ? 'pr-2' : 'pl-2'; const margin = i % 2 === 0 ? 'pr-2' : 'pl-2';
const amount = p.amount > 0 ? format_currency(p.amount, currency) : ''; const amount = p.amount > 0 ? format_currency(p.amount, currency) : '';
return ( return (`
`<div class="payment-mode-wrapper"> <div class="payment-mode-wrapper">
<div class="mode-of-payment" data-mode="${mode}" data-payment-type="${payment_type}"> <div class="mode-of-payment" data-mode="${mode}" data-payment-type="${payment_type}">
${p.mode_of_payment} ${p.mode_of_payment}
<div class="${mode}-amount pay-amount">${amount}</div> <div class="${mode}-amount pay-amount">${amount}</div>
<div class="${mode} mode-of-payment-control"></div> <div class="${mode} mode-of-payment-control"></div>
</div>
</div> </div>
</div>` `);
);
}).join('') }).join('')
}`); }`);
@ -367,15 +367,12 @@ erpnext.PointOfSale.Payment = class {
const shortcuts = this.get_cash_shortcuts(flt(grand_total)); const shortcuts = this.get_cash_shortcuts(flt(grand_total));
this.$payment_modes.find('.cash-shortcuts').remove(); this.$payment_modes.find('.cash-shortcuts').remove();
this.$payment_modes.find('[data-payment-type="Cash"]').find('.mode-of-payment-control').after( let shortcuts_html = shortcuts.map(s => {
`<div class="cash-shortcuts"> return `<div class="shortcut" data-value="${s}">${format_currency(s, currency, 0)}</div>`;
${ }).join('');
shortcuts.map(s => {
return `<div class="shortcut" data-value="${s}">${format_currency(s, currency, 0)}</div>`; this.$payment_modes.find('[data-payment-type="Cash"]').find('.mode-of-payment-control')
}).join('') .after(`<div class="cash-shortcuts">${shortcuts_html}</div>`);
}
</div>`
);
} }
get_cash_shortcuts(grand_total) { get_cash_shortcuts(grand_total) {