2
0
mirror of https://github.com/frappe/books.git synced 2024-12-22 19:09:01 +00:00

refactor: DRY, use map keys for select

This commit is contained in:
18alantom 2021-12-28 17:33:52 +05:30
parent 5a6d08edef
commit 0b5e250597

View File

@ -1,3 +1,9 @@
import { _ } from 'frappejs/utils';
const referenceTypeMap = {
SalesInvoice: _('Invoice'),
PurchaseInvoice: _('Bill'),
};
export default {
name: 'PaymentFor',
label: 'Payment For',
@ -11,8 +17,8 @@ export default {
label: 'Reference Type',
placeholder: 'Type',
fieldtype: 'Select',
options: ['SalesInvoice', 'PurchaseInvoice'],
map: { SalesInvoice: 'Invoice', PurchaseInvoice: 'Bill' },
options: Object.keys(referenceTypeMap),
map: referenceTypeMap,
required: 1,
},
{