From 54e115b0300d14bcdc5a1f33096605dce71c3cc9 Mon Sep 17 00:00:00 2001 From: thefalconx33 Date: Wed, 14 Aug 2019 13:13:49 +0530 Subject: [PATCH] [Fixes] #98 UI Issues 05-08-2019 --- fixtures/countryInfo.json | 29 +- models/doctype/Account/Account.js | 29 +- models/doctype/Address/Address.js | 253 ++++++++++-------- models/doctype/Color/Color.js | 16 ++ .../doctype/DashboardChart/DashboardChart.js | 10 +- .../DashboardSettings/DashboardSettings.js | 5 - models/doctype/GSTR3B/GSTR3BPrintView.vue | 3 +- models/doctype/Item/Item.js | 44 +++ models/doctype/JournalEntry/JournalEntry.js | 161 ++++++----- models/doctype/Party/Party.js | 47 +++- models/doctype/Party/PartyList.js | 7 + models/doctype/Payment/Payment.js | 21 +- models/doctype/Payment/PaymentList.js | 11 +- models/doctype/PaymentFor/PaymentFor.js | 57 ++-- .../PurchaseInvoice/PurchaseInvoice.js | 3 +- .../PurchaseInvoice/PurchaseInvoiceList.js | 6 +- models/doctype/SalesInvoice/SalesInvoice.js | 6 +- .../SalesInvoice/SalesInvoiceDocument.js | 5 +- .../doctype/SalesInvoice/SalesInvoiceList.js | 6 +- .../SalesInvoice/SalesInvoicePrint.vue | 22 +- .../SalesInvoiceSettings.js | 6 +- models/index.js | 1 + .../BankReconciliation/BankReconciliation.js | 2 + reports/BankReconciliation/viewConfig.js | 20 +- reports/GeneralLedger/GeneralLedger.js | 2 + reports/GeneralLedger/viewConfig.js | 28 +- reports/GoodsAndServiceTax/BaseViewConfig.js | 24 +- reports/GoodsAndServiceTax/GSTR1.js | 2 + reports/GoodsAndServiceTax/GSTR2.js | 2 + reports/PurchaseRegister/PurchaseRegister.js | 2 + reports/PurchaseRegister/viewConfig.js | 23 +- reports/SalesRegister/SalesRegister.js | 2 + reports/SalesRegister/viewConfig.js | 23 +- reports/TrialBalance/TrialBalance.js | 3 + reports/TrialBalance/viewConfig.js | 21 +- src/components/InvoiceCustomizer.vue | 13 +- src/components/PageHeader.vue | 20 +- src/components/Sidebar.vue | 22 ++ src/main-electron.js | 62 ++++- src/pages/Dashboard.vue | 2 +- src/pages/FormView/FormView.vue | 45 +++- src/pages/ListView/List.vue | 60 +++-- src/pages/ListView/ListFilters.vue | 45 ++++ src/pages/ListView/ListToolbar.vue | 23 +- src/pages/ListView/index.vue | 23 +- src/pages/Report/index.vue | 34 ++- src/pages/Settings/Settings.vue | 6 +- src/pages/SetupWizard/SetupWizard.vue | 5 +- src/router/index.js | 8 +- 49 files changed, 868 insertions(+), 402 deletions(-) create mode 100644 models/doctype/Color/Color.js create mode 100644 models/doctype/Party/PartyList.js create mode 100644 src/pages/ListView/ListFilters.vue diff --git a/fixtures/countryInfo.json b/fixtures/countryInfo.json index 8679cc71..aaa0adcf 100644 --- a/fixtures/countryInfo.json +++ b/fixtures/countryInfo.json @@ -271,7 +271,7 @@ "currency_fraction_units": 100, "currency_name": "Belize Dollar", "currency_symbol": "$", - "date_format": "mm-dd-yyyy", + "date_format": "MM-dd-yyyy", "number_format": "#,###.##", "timezones": [ "America/Belize" @@ -356,7 +356,7 @@ "currency_fraction": "Centavo", "currency_fraction_units": 100, "currency_symbol": "R$", - "date_format": "dd/mm/yyyy", + "date_format": "dd/MM/yyyy", "number_format": "#.###,##", "timezones": [ "America/Araguaina", @@ -463,7 +463,7 @@ "currency_fraction_units": 100, "currency_name": "Canadian Dollar", "currency_symbol": "$", - "date_format": "mm-dd-yyyy", + "date_format": "MM-dd-yyyy", "number_format": "#,###.##", "timezones": [ "America/Atikokan", @@ -563,7 +563,7 @@ "code": "cn", "currency": "CNY", "currency_name": "Yuan Renminbi", - "date_format": "yyyy-mm-dd", + "date_format": "yyyy-MM-dd", "number_format": "#,###.##", "timezones": [ "Asia/Chongqing", @@ -884,7 +884,7 @@ "currency_fraction_units": 100, "currency_symbol": "\u20ac", "number_format": "# ###,##", - "date_format": "dd/mm/yyyy", + "date_format": "dd/MM/yyyy", "timezones": [ "Europe/Paris" ] @@ -1136,7 +1136,7 @@ "currency_fraction_units": 100, "currency_name": "Forint", "currency_symbol": "Ft", - "date_format": "yyyy-mm-dd", + "date_format": "yyyy-MM-dd", "number_format": "#.###", "timezones": [ "Europe/Budapest" @@ -1161,6 +1161,7 @@ "currency_fraction_units": 100, "currency_name": "Indian Rupee", "currency_symbol": "\u20b9", + "date_format": "dd/MM/yyyy", "number_format": "#,##,###.##", "timezones": [ "Asia/Kolkata" @@ -1247,7 +1248,7 @@ "currency_fraction_units": 100, "currency_symbol": "\u20ac", "number_format": "#.###,##", - "date_format": "dd/mm/yyyy", + "date_format": "dd/MM/yyyy", "timezones": [ "Europe/Rome" ], @@ -1471,7 +1472,7 @@ "currency_fraction_units": 100, "currency_name": "Lithuanian Litas", "currency_symbol": "Lt", - "date_format": "yyyy-mm-dd", + "date_format": "yyyy-MM-dd", "number_format": "# ###,##", "timezones": [ "Europe/Vilnius" @@ -1674,7 +1675,7 @@ "currency_fraction_units": 100, "currency_name": "Tugrik", "currency_symbol": "\u20ae", - "date_format": "yyyy-mm-dd", + "date_format": "yyyy-MM-dd", "number_format": "#,###.##", "timezones": [ "Asia/Choibalsan", @@ -1911,7 +1912,7 @@ "currency_fraction": "Cent", "currency_fraction_units": 100, "currency_symbol": "$", - "date_format": "mm-dd-yyyy", + "date_format": "MM-dd-yyyy", "number_format": "#,###.##", "timezones": [ "Pacific/Palau" @@ -1974,7 +1975,7 @@ "currency_fraction_units": 100, "currency_name": "Philippine Peso", "currency_symbol": "\u20b1", - "date_format": "mm-dd-yyyy", + "date_format": "MM-dd-yyyy", "number_format": "#,###.##", "timezones": [ "Asia/Manila" @@ -2278,7 +2279,7 @@ "currency_fraction_units": 100, "currency_name": "Rand", "currency_symbol": "R", - "date_format": "yyyy-mm-dd", + "date_format": "yyyy-MM-dd", "number_format": "# ###.##", "timezones": [ "Africa/Johannesburg" @@ -2398,7 +2399,7 @@ "Taiwan": { "code": "tw", "currency": "TWD", - "date_format": "yyyy-mm-dd", + "date_format": "yyyy-MM-dd", "number_format": "#,###.##" }, "Tajikistan": { @@ -2591,7 +2592,7 @@ "smallest_currency_fraction_value": 0.05, "currency_name": "US Dollar", "currency_symbol": "$", - "date_format": "mm-dd-yyyy", + "date_format": "MM-dd-yyyy", "number_format": "#,###.##", "timezones": [ "America/Adak", diff --git a/models/doctype/Account/Account.js b/models/doctype/Account/Account.js index 2bad659f..ded8be4b 100644 --- a/models/doctype/Account/Account.js +++ b/models/doctype/Account/Account.js @@ -13,26 +13,33 @@ module.exports = { fieldtype: 'Data', required: 1 }, + { + fieldname: 'rootType', + label: 'Root Type', + fieldtype: 'Select', + options: [ + 'Select...', + 'Asset', + 'Liability', + 'Equity', + 'Income', + 'Expense' + ], + required: 1 + }, { fieldname: 'parentAccount', label: 'Parent Account', fieldtype: 'Link', target: 'Account', getFilters: (query, doc) => { - console.log(doc); - return { - isGroup: 1, - rootType: doc.rootType + const filter = { + isGroup: 1 }; + doc.rootType ? (filter.rootType = doc.rootType) : ''; + return filter; } }, - { - fieldname: 'rootType', - label: 'Root Type', - fieldtype: 'Select', - options: ['', 'Asset', 'Liability', 'Equity', 'Income', 'Expense'], - required: 1 - }, { fieldname: 'accountType', label: 'Account Type', diff --git a/models/doctype/Address/Address.js b/models/doctype/Address/Address.js index 06f82142..d51f2c6b 100644 --- a/models/doctype/Address/Address.js +++ b/models/doctype/Address/Address.js @@ -1,124 +1,141 @@ module.exports = { - "name": "Address", - "doctype": "DocType", - "isSingle": 0, - "keywordFields": [ - "name" - ], - pageSettings: { - hideTitle: true + name: 'Address', + doctype: 'DocType', + isSingle: 0, + keywordFields: ['name'], + pageSettings: { + hideTitle: true + }, + fields: [ + { + fieldname: 'name', + label: 'Address Title', + fieldtype: 'Data', + defaultValue: 'Work', + required: 1 }, - // "naming": "autoincrement", - "fields": [ - { - "fieldname": "name", - "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": "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 `
${list.getNameHTML(data)} (${data.addressType})
`; - } + { + 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: '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' + } + ], - layout: [ - // section 1 + // events: { + // validate: (doc) => { + + // } + // }, + + listSettings: { + getFields(list) { + return ['name', 'addressType']; + }, + getRowHTML(list, data) { + return `
${list.getNameHTML(data)} (${ + data.addressType + })
`; + } + }, + + layout: [ + // section 1 + { + columns: [ { - columns: [ - { - fields: [ - "name", "addressType", "addressLine1", - "addressLine2", "city", "country", "state", - "postalCode" - ] - }, - { - fields: [ - "emailAddress", "phone", "fax", "isPreferredBilling", "isShippingBilling" - ] - } - ] + fields: [ + 'name', + 'addressType', + 'addressLine1', + 'addressLine2', + 'city', + 'country', + 'state', + 'postalCode' + ] + }, + { + fields: [ + 'emailAddress', + 'phone', + 'fax', + 'isPreferredBilling', + 'isShippingBilling' + ] } - ] -} \ No newline at end of file + ] + } + ] +}; diff --git a/models/doctype/Color/Color.js b/models/doctype/Color/Color.js new file mode 100644 index 00000000..3d67ad23 --- /dev/null +++ b/models/doctype/Color/Color.js @@ -0,0 +1,16 @@ +module.exports = { + name: 'Color', + doctype: 'DocType', + fields: [ + { + fieldname: 'name', + fieldtype: 'Data', + label: 'Color' + }, + { + fieldname: 'hexvalue', + fieldtype: 'Data', + label: 'Hex Value' + } + ] +}; diff --git a/models/doctype/DashboardChart/DashboardChart.js b/models/doctype/DashboardChart/DashboardChart.js index 5a906124..c384a591 100644 --- a/models/doctype/DashboardChart/DashboardChart.js +++ b/models/doctype/DashboardChart/DashboardChart.js @@ -12,13 +12,15 @@ module.exports = { { fieldname: 'type', fieldtype: 'Select', - options: ['', 'Bar', 'Line', 'Percentage'], - label: 'Chart Type' + options: ['Bar', 'Line', 'Percentage'], + label: 'Chart Type', + defaultValue: 'Bar' }, { fieldname: 'color', - fieldtype: 'Data', - label: 'Color' + fieldtype: 'Link', + label: 'Color', + target: 'Color' } ] }; diff --git a/models/doctype/DashboardSettings/DashboardSettings.js b/models/doctype/DashboardSettings/DashboardSettings.js index 065ca301..11a1e041 100644 --- a/models/doctype/DashboardSettings/DashboardSettings.js +++ b/models/doctype/DashboardSettings/DashboardSettings.js @@ -4,11 +4,6 @@ module.exports = { doctype: 'DocType', isSingle: 1, fields: [ - { - fieldname: 'name', - fieldtype: 'Data', - label: 'Dashboard Name' - }, { fieldname: 'charts', fieldtype: 'Table', diff --git a/models/doctype/GSTR3B/GSTR3BPrintView.vue b/models/doctype/GSTR3B/GSTR3BPrintView.vue index 05e0f11c..eed1bc93 100644 --- a/models/doctype/GSTR3B/GSTR3BPrintView.vue +++ b/models/doctype/GSTR3B/GSTR3BPrintView.vue @@ -6,7 +6,7 @@
-