mirror of
https://github.com/frappe/books.git
synced 2025-01-08 17:24:05 +00:00
Address Model Added
This commit is contained in:
parent
0ad6223ba8
commit
da08c59f34
120
models/doctype/Address/Address.js
Normal file
120
models/doctype/Address/Address.js
Normal file
@ -0,0 +1,120 @@
|
||||
module.exports = {
|
||||
"name": "Account",
|
||||
"doctype": "DocType",
|
||||
"isSingle": 0,
|
||||
"keywordFields": [
|
||||
"name",
|
||||
"addressType"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "addressTitle",
|
||||
"label": "Address Title",
|
||||
"fieldtype": "Data",
|
||||
"required": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "addressType",
|
||||
"label": "Address Type",
|
||||
"fieldtype": "Select",
|
||||
"options": [
|
||||
"Billing", "Shipping", "Office",
|
||||
"Personal", "Plant", "Postal",
|
||||
"Shop", "Subsidary", "Warehouse",
|
||||
"Current", "Permanent", "Other"
|
||||
]
|
||||
},
|
||||
{
|
||||
"fieldname": "addressLine1",
|
||||
"label": "Address Line 1",
|
||||
"fieldtype": "Data",
|
||||
"required": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "addressLine2",
|
||||
"label": "Address Line 2",
|
||||
"fieldtype": "Data"
|
||||
},
|
||||
{
|
||||
"fieldname": "city",
|
||||
"label": "City / Town",
|
||||
"fieldtype": "Data",
|
||||
"required": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "county",
|
||||
"label": "County",
|
||||
"fieldtype": "Data"
|
||||
},
|
||||
{
|
||||
"fieldname": "state",
|
||||
"label": "State",
|
||||
"fieldtype": "Data"
|
||||
},
|
||||
{
|
||||
"fieldname": "country",
|
||||
"label": "Country",
|
||||
"fieldtype": "Data",
|
||||
"required": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "postalCode",
|
||||
"label": "Postal Code",
|
||||
"fieldtype": "Data"
|
||||
},
|
||||
{
|
||||
"fieldname": "emailAddress",
|
||||
"label": "Email Address",
|
||||
"fieldtype": "Data"
|
||||
},
|
||||
{
|
||||
"fieldname": "phone",
|
||||
"label": "Phone",
|
||||
"fieldtype": "Data"
|
||||
},
|
||||
{
|
||||
"fieldname": "fax",
|
||||
"label": "Fax",
|
||||
"fieldtype": "Data"
|
||||
},
|
||||
{
|
||||
"fieldname": "isPreferredBilling",
|
||||
"label": "Preferred Billing Address",
|
||||
"fieldtype": "Check"
|
||||
},
|
||||
{
|
||||
"fieldname": "isShippingBilling",
|
||||
"label": "Preferred Shipping Address",
|
||||
"fieldtype": "Check"
|
||||
}
|
||||
],
|
||||
|
||||
events: {
|
||||
validate: (doc) => {
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
listSettings: {
|
||||
getFields(list) {
|
||||
return ['name', 'addressType'];
|
||||
},
|
||||
getRowHTML(list, data) {
|
||||
return `<div class="col-11">${list.getNameHTML(data)} (${data.addressType})</div>`;
|
||||
}
|
||||
},
|
||||
|
||||
layout: [
|
||||
// section 1
|
||||
{
|
||||
columns: [
|
||||
{
|
||||
fields: [ "addressTitle", "addressType", "addressLine1",
|
||||
"addressLine2", "city", "county", "state", "country",
|
||||
"postalCode"]
|
||||
},
|
||||
{ fields: [ "emailAddress", "phone", "fax", "isPreferredBilling", "isShippingBilling" ] }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
@ -11,6 +11,7 @@ module.exports = {
|
||||
InvoiceSettings: require('./doctype/InvoiceSettings/InvoiceSettings.js'),
|
||||
Tax: require('./doctype/Tax/Tax.js'),
|
||||
TaxDetail: require('./doctype/TaxDetail/TaxDetail.js'),
|
||||
TaxSummary: require('./doctype/TaxSummary/TaxSummary.js')
|
||||
TaxSummary: require('./doctype/TaxSummary/TaxSummary.js'),
|
||||
Address: require('./doctype/Address/Address.js')
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user