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

fix: Add email, phone, address fields to Party

This commit is contained in:
Faris Ansari 2019-11-20 00:45:42 +05:30
parent 6656d22cd1
commit dfd364dc95

View File

@ -1,3 +1,5 @@
let { _ } = require('frappejs/utils');
module.exports = { module.exports = {
name: 'Party', name: 'Party',
label: 'Party', label: 'Party',
@ -17,6 +19,16 @@ module.exports = {
label: 'Image', label: 'Image',
fieldtype: 'AttachImage', fieldtype: 'AttachImage',
}, },
{
fieldname: 'customer',
label: 'Customer',
fieldtype: 'Check'
},
{
fieldname: 'supplier',
label: 'Supplier',
fieldtype: 'Check'
},
{ {
fieldname: 'defaultAccount', fieldname: 'defaultAccount',
label: 'Default Account', label: 'Default Account',
@ -29,33 +41,52 @@ module.exports = {
}; };
} }
}, },
{
fieldname: 'outstandingAmount',
label: 'Outstanding Amount',
fieldtype: 'Currency'
},
{ {
fieldname: 'currency', fieldname: 'currency',
label: 'Currency', label: 'Currency',
fieldtype: 'Link', fieldtype: 'Link',
target: 'Currency', target: 'Currency',
formula: async doc => { placeholder: 'INR'
const { currency } = await frappe.getSingle('AccountingSettings'); },
return currency; {
fieldname: 'email',
label: 'Email',
fieldtype: 'Data',
placeholder: 'john@doe.com'
},
{
fieldname: 'phone',
label: 'Phone',
fieldtype: 'Data',
placeholder: 'Phone'
},
{
fieldname: 'address',
label: 'Address',
fieldtype: 'Link',
target: 'Address',
placeholder: _('Click to create'),
inline: true
},
{
fieldname: 'addressDisplay',
label: 'Address Display',
fieldtype: 'Text',
readOnly: true,
formula: doc => {
if (doc.address) {
return doc.getFrom('Address', doc.address, 'addressDisplay');
}
} }
},
{
fieldname: 'customer',
label: 'Customer',
fieldtype: 'Check'
},
{
fieldname: 'supplier',
label: 'Supplier',
fieldtype: 'Check'
} }
], ],
quickEditFields: [ quickEditFields: ['defaultAccount', 'currency', 'email', 'phone', 'address'],
'address',
'defaultAccount',
'currency'
],
getFormTitle(doc) { getFormTitle(doc) {
if (doc.customer) return 'Customer'; if (doc.customer) return 'Customer';