mirror of
https://github.com/frappe/books.git
synced 2024-12-23 03:19: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 {
|
export default {
|
||||||
name: 'PaymentFor',
|
name: 'PaymentFor',
|
||||||
label: 'Payment For',
|
label: 'Payment For',
|
||||||
@ -11,8 +17,8 @@ export default {
|
|||||||
label: 'Reference Type',
|
label: 'Reference Type',
|
||||||
placeholder: 'Type',
|
placeholder: 'Type',
|
||||||
fieldtype: 'Select',
|
fieldtype: 'Select',
|
||||||
options: ['SalesInvoice', 'PurchaseInvoice'],
|
options: Object.keys(referenceTypeMap),
|
||||||
map: { SalesInvoice: 'Invoice', PurchaseInvoice: 'Bill' },
|
map: referenceTypeMap,
|
||||||
required: 1,
|
required: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user