2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 07:40:55 +00:00

feat: add field to segregate items by purpose

This commit is contained in:
18alantom 2022-03-10 12:04:02 +05:30
parent b4397a9132
commit d9108d5103

View File

@ -1,5 +1,11 @@
import frappe, { t } from 'frappe'; import frappe, { t } from 'frappe';
const itemForMap = {
purchases: t`Purchases`,
sales: t`Sales`,
both: t`Both`,
};
export default { export default {
name: 'Item', name: 'Item',
label: t`Item`, label: t`Item`,
@ -42,6 +48,14 @@ export default {
default: 'Product', default: 'Product',
options: ['Product', 'Service'], options: ['Product', 'Service'],
}, },
{
fieldname: 'for',
label: t`For`,
fieldtype: 'Select',
options: Object.keys(itemForMap),
map: itemForMap,
default: 'both',
},
{ {
fieldname: 'incomeAccount', fieldname: 'incomeAccount',
label: t`Income`, label: t`Income`,
@ -115,6 +129,7 @@ export default {
'rate', 'rate',
'unit', 'unit',
'itemType', 'itemType',
'for',
'tax', 'tax',
'description', 'description',
'incomeAccount', 'incomeAccount',