import Badge from '@/components/Badge'; import { t } from 'frappe'; export default { doctype: 'JournalEntry', title: t`Journal Entry`, formRoute: (name) => `/edit/JournalEntry/${name}`, columns: [ 'date', { label: t`Status`, fieldtype: 'Select', size: 'small', render(doc) { let status = 'Draft'; let color = 'gray'; if (doc.submitted === 1) { color = 'green'; status = 'Submitted'; } if (doc.cancelled === 1) { color = 'red'; status = 'Cancelled'; } return { template: `${status}`, components: { Badge }, }; }, }, { label: t`Entry ID`, fieldname: 'name', fieldtype: 'Data', getValue(doc) { return doc.name; }, }, 'entryType', 'referenceNumber', ], };