mirror of
https://github.com/frappe/books.git
synced 2025-01-08 17:24:05 +00:00
fix: Add email, phone, address fields to Party
This commit is contained in:
parent
6656d22cd1
commit
dfd364dc95
@ -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';
|
||||
|
Loading…
Reference in New Issue
Block a user