diff --git a/models/doctype/Party/Party.js b/models/doctype/Party/Party.js index 6aa848b8..e6128ed3 100644 --- a/models/doctype/Party/Party.js +++ b/models/doctype/Party/Party.js @@ -1,3 +1,5 @@ +let { _ } = require('frappejs/utils'); + module.exports = { name: 'Party', label: 'Party', @@ -17,6 +19,16 @@ module.exports = { label: 'Image', fieldtype: 'AttachImage', }, + { + fieldname: 'customer', + label: 'Customer', + fieldtype: 'Check' + }, + { + fieldname: 'supplier', + label: 'Supplier', + fieldtype: 'Check' + }, { fieldname: 'defaultAccount', label: 'Default Account', @@ -29,33 +41,52 @@ module.exports = { }; } }, + { + fieldname: 'outstandingAmount', + label: 'Outstanding Amount', + fieldtype: 'Currency' + }, { fieldname: 'currency', label: 'Currency', fieldtype: 'Link', target: 'Currency', - formula: async doc => { - const { currency } = await frappe.getSingle('AccountingSettings'); - return currency; + placeholder: 'INR' + }, + { + 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: [ - 'address', - 'defaultAccount', - 'currency' - ], + quickEditFields: ['defaultAccount', 'currency', 'email', 'phone', 'address'], getFormTitle(doc) { if (doc.customer) return 'Customer';