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:
parent
5a6d08edef
commit
0b5e250597
@ -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,
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user