2019-11-09 01:28:09 +05:30
|
|
|
import Badge from '@/components/Badge';
|
2022-01-24 12:01:14 +05:30
|
|
|
import { t } from 'frappe';
|
2018-10-26 02:26:35 +05:30
|
|
|
|
|
|
|
export default {
|
|
|
|
doctype: 'Payment',
|
2022-02-09 12:29:41 +05:30
|
|
|
title: t`Payments`,
|
2018-10-26 02:26:35 +05:30
|
|
|
columns: [
|
|
|
|
'party',
|
2019-02-18 11:12:04 +05:30
|
|
|
{
|
2022-02-16 11:49:16 +05:30
|
|
|
label: t`Status`,
|
2019-08-14 13:13:49 +05:30
|
|
|
fieldname: 'status',
|
|
|
|
fieldtype: 'Select',
|
|
|
|
size: 'small',
|
2019-11-09 01:28:09 +05:30
|
|
|
render(doc) {
|
2019-12-03 19:02:34 +05:30
|
|
|
let status = 'Draft';
|
|
|
|
let color = 'gray';
|
2022-03-02 11:33:40 +05:30
|
|
|
if (doc.submitted === 1) {
|
2019-11-09 01:28:09 +05:30
|
|
|
color = 'green';
|
2019-12-03 19:02:34 +05:30
|
|
|
status = 'Submitted';
|
2019-02-18 11:12:04 +05:30
|
|
|
}
|
2021-11-21 19:08:04 +05:30
|
|
|
if (doc.cancelled === 1) {
|
|
|
|
color = 'red';
|
|
|
|
status = 'Cancelled';
|
|
|
|
}
|
2019-11-09 01:28:09 +05:30
|
|
|
|
|
|
|
return {
|
|
|
|
template: `<Badge class="text-xs" color="${color}">${status}</Badge>`,
|
2022-01-21 02:27:29 +05:30
|
|
|
components: { Badge },
|
2019-11-09 01:28:09 +05:30
|
|
|
};
|
2022-01-21 02:27:29 +05:30
|
|
|
},
|
2019-02-18 11:12:04 +05:30
|
|
|
},
|
2019-08-14 13:13:49 +05:30
|
|
|
'paymentType',
|
2018-10-26 02:26:35 +05:30
|
|
|
'date',
|
2022-01-21 02:27:29 +05:30
|
|
|
'amount',
|
|
|
|
],
|
2019-07-19 18:54:31 +05:30
|
|
|
};
|