2
0
mirror of https://github.com/frappe/books.git synced 2025-01-10 18:24:40 +00:00
books/models/baseModels/Payment/PaymentList.js

37 lines
757 B
JavaScript

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: `<Badge class="text-xs" color="${color}">${status}</Badge>`,
components: { Badge },
};
},
},
'paymentType',
'date',
'amount',
],
};