2
0
mirror of https://github.com/frappe/books.git synced 2024-12-23 11:29:03 +00:00
books/models/baseModels/JournalEntry/JournalEntryList.js

45 lines
933 B
JavaScript

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: `<Badge class="text-xs" color="${color}">${status}</Badge>`,
components: { Badge },
};
},
},
{
label: t`Entry ID`,
fieldname: 'name',
fieldtype: 'Data',
getValue(doc) {
return doc.name;
},
},
'entryType',
'referenceNumber',
],
};