import Badge from '@/components/Badge'; import { t } from 'frappe'; export default { doctype: 'Payment', title: t`Payments`, columns: [ 'party', { label: t`Status`, fieldname: '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 }, }; }, }, 'paymentType', 'date', 'amount', ], };