diff --git a/models/doctype/Payment/Payment.js b/models/doctype/Payment/Payment.js index c376c585..5bf5e83b 100644 --- a/models/doctype/Payment/Payment.js +++ b/models/doctype/Payment/Payment.js @@ -2,6 +2,11 @@ import frappe, { t } from 'frappe'; import utils from '../../../accounting/utils'; import { DEFAULT_NUMBER_SERIES } from '../../../frappe/utils/consts'; +const paymentTypeMap = { + Receive: t`Receive`, + Pay: t`Pay`, +}; + export default { name: 'Payment', label: t`Payment`, @@ -57,7 +62,8 @@ export default { label: t`Payment Type`, fieldtype: 'Select', placeholder: 'Payment Type', - options: ['Receive', 'Pay'], + options: Object.keys(paymentTypeMap), + map: paymentTypeMap, required: 1, }, { diff --git a/src/sidebarConfig.js b/src/sidebarConfig.js index 5b975b8f..dcb7e02e 100644 --- a/src/sidebarConfig.js +++ b/src/sidebarConfig.js @@ -28,6 +28,11 @@ const config = { route: '/list/SalesInvoice', doctype: 'SalesInvoice', }, + { + label: t`Payments`, + route: '/list/Payment/paymentType/Receive', + doctype: 'Payment', + }, { label: t`Customers`, route: '/list/Customer', @@ -50,6 +55,11 @@ const config = { route: '/list/PurchaseInvoice', doctype: 'PurchaseInvoice', }, + { + label: t`Payments`, + route: '/list/Payment/paymentType/Pay', + doctype: 'Payment', + }, { label: t`Suppliers`, route: '/list/Supplier', @@ -65,13 +75,8 @@ const config = { { icon: 'common-entries', title: t`Common`, - route: '/list/Payment', + route: '/list/JournalEntry', items: [ - { - label: t`Payments`, - route: '/list/Payment', - doctype: 'Payment', - }, { label: t`Journal Entry`, route: '/list/JournalEntry',