From 86d0ef3d063ab69c610128e767fe4786385a759b Mon Sep 17 00:00:00 2001 From: thefalconx33 Date: Thu, 1 Aug 2019 17:22:58 +0530 Subject: [PATCH] - Dashboard - SearchBar - Invoice & Bill Rename --- fixtures/invoicePrint.js | 2 +- models/doctype/Account/importCOA.js | 101 +++---- models/doctype/Bill/BillDocument.js | 4 - models/doctype/BillSettings/BillSettings.js | 18 -- .../doctype/DashboardChart/DashboardChart.js | 24 ++ .../DashboardSettings/DashboardSettings.js | 19 ++ models/doctype/GSTR3B/GSTR3BDocument.js | 17 +- .../InvoiceSettings/InvoiceSettings.js | 42 --- models/doctype/Party/Party.js | 11 +- models/doctype/Payment/PaymentServer.js | 2 +- .../PurchaseInvoice.js} | 9 +- .../PurchaseInvoiceDocument.js | 4 + .../PurchaseInvoiceList.js} | 4 +- .../PurchaseInvoiceServer.js} | 6 +- .../PurchaseInvoiceItem.js} | 3 +- .../PurchaseInvoiceSettings.js | 18 ++ models/doctype/PurchaseOrder/PurchaseOrder.js | 26 +- .../PurchaseOrderItem/PurchaseOrderItem.js | 4 +- .../PurchaseOrderSettings.js | 4 +- .../SalesInvoice.js} | 9 +- .../SalesInvoiceDocument.js} | 2 +- .../SalesInvoiceList.js} | 4 +- .../SalesInvoicePrint.vue} | 6 +- .../SalesInvoiceServer.js} | 6 +- .../Templates/AddressDetails.js | 0 .../Templates/CompanyAddress.vue | 0 .../Templates/CustomerAddress.vue | 0 .../Templates/InvoiceStyles.js | 0 .../Templates/InvoiceTemplate1.vue | 0 .../Templates/InvoiceTemplate2.vue | 0 .../Templates/InvoiceTemplate3.vue | 0 .../SalesInvoiceItem.js} | 2 +- .../SalesInvoiceSettings.js | 42 +++ models/index.js | 14 +- package.json | 1 + .../AccountsReceivablePayable.js | 264 ++++++++++-------- reports/GeneralLedger/GeneralLedgerView.js | 2 +- reports/GeneralLedger/viewConfig.js | 2 +- reports/GoodsAndServiceTax/BaseGSTR.js | 4 +- reports/PurchaseRegister/PurchaseRegister.js | 83 +++--- .../PurchaseRegister/PurchaseRegisterView.js | 36 +-- reports/PurchaseRegister/viewConfig.js | 42 +++ reports/SalesRegister/SalesRegisterView.js | 2 +- reports/SalesRegister/viewConfig.js | 31 +- reports/view.js | 1 + server/postStart.js | 8 +- src/components/DashboardCard.vue | 26 ++ src/components/InvoiceCustomizer.vue | 6 +- src/components/PageHeader.vue | 12 +- src/components/SearchBar.vue | 152 ++++++++++ src/components/SearchInput.vue | 39 --- src/components/Sidebar.vue | 5 +- src/pages/Dashboard.vue | 119 ++++++++ src/pages/DataImport/index.vue | 2 +- src/pages/Desk.vue | 15 +- src/pages/FormView/FormView.vue | 8 +- src/pages/ListView/ListRow.vue | 4 +- src/pages/ListView/ListToolbar.vue | 12 +- src/pages/ListView/index.vue | 8 +- src/pages/ListView/listConfig.js | 8 +- src/pages/PrintView/index.vue | 6 +- src/pages/Report/index.vue | 6 +- src/pages/ReportList.vue | 14 +- src/pages/Settings/Settings.vue | 22 +- src/router/index.js | 3 +- src/sidebarConfig.js | 50 ++-- 66 files changed, 922 insertions(+), 474 deletions(-) delete mode 100644 models/doctype/Bill/BillDocument.js delete mode 100644 models/doctype/BillSettings/BillSettings.js create mode 100644 models/doctype/DashboardChart/DashboardChart.js create mode 100644 models/doctype/DashboardSettings/DashboardSettings.js delete mode 100644 models/doctype/InvoiceSettings/InvoiceSettings.js rename models/doctype/{Bill/Bill.js => PurchaseInvoice/PurchaseInvoice.js} (94%) create mode 100644 models/doctype/PurchaseInvoice/PurchaseInvoiceDocument.js rename models/doctype/{Bill/BillList.js => PurchaseInvoice/PurchaseInvoiceList.js} (90%) rename models/doctype/{Bill/BillServer.js => PurchaseInvoice/PurchaseInvoiceServer.js} (90%) rename models/doctype/{BillItem/BillItem.js => PurchaseInvoiceItem/PurchaseInvoiceItem.js} (95%) create mode 100644 models/doctype/PurchaseInvoiceSettings/PurchaseInvoiceSettings.js rename models/doctype/{Invoice/Invoice.js => SalesInvoice/SalesInvoice.js} (95%) rename models/doctype/{Invoice/InvoiceDocument.js => SalesInvoice/SalesInvoiceDocument.js} (97%) rename models/doctype/{Invoice/InvoiceList.js => SalesInvoice/SalesInvoiceList.js} (91%) rename models/doctype/{Invoice/InvoicePrint.vue => SalesInvoice/SalesInvoicePrint.vue} (90%) rename models/doctype/{Invoice/InvoiceServer.js => SalesInvoice/SalesInvoiceServer.js} (91%) rename models/doctype/{Invoice => SalesInvoice}/Templates/AddressDetails.js (100%) rename models/doctype/{Invoice => SalesInvoice}/Templates/CompanyAddress.vue (100%) rename models/doctype/{Invoice => SalesInvoice}/Templates/CustomerAddress.vue (100%) rename models/doctype/{Invoice => SalesInvoice}/Templates/InvoiceStyles.js (100%) rename models/doctype/{Invoice => SalesInvoice}/Templates/InvoiceTemplate1.vue (100%) rename models/doctype/{Invoice => SalesInvoice}/Templates/InvoiceTemplate2.vue (100%) rename models/doctype/{Invoice => SalesInvoice}/Templates/InvoiceTemplate3.vue (100%) rename models/doctype/{InvoiceItem/InvoiceItem.js => SalesInvoiceItem/SalesInvoiceItem.js} (98%) create mode 100644 models/doctype/SalesInvoiceSettings/SalesInvoiceSettings.js create mode 100644 reports/PurchaseRegister/viewConfig.js create mode 100644 src/components/DashboardCard.vue create mode 100644 src/components/SearchBar.vue delete mode 100644 src/components/SearchInput.vue create mode 100644 src/pages/Dashboard.vue diff --git a/fixtures/invoicePrint.js b/fixtures/invoicePrint.js index 790dc5e6..ca11e852 100644 --- a/fixtures/invoicePrint.js +++ b/fixtures/invoicePrint.js @@ -1,7 +1,7 @@ module.exports = { doctype: "PrintFormat", name: "Standard Invoice Format", - for: "Invoice", + for: "SalesInvoice", template: `

{{ doc.name }}

diff --git a/models/doctype/Account/importCOA.js b/models/doctype/Account/importCOA.js index 50a1b4c2..2b4284ed 100644 --- a/models/doctype/Account/importCOA.js +++ b/models/doctype/Account/importCOA.js @@ -3,67 +3,72 @@ const path = require('path'); const fs = require('fs'); const countries = require('../../../fixtures/countryInfo.json'); const standardCOA = require('../../../fixtures/verified/standardCOA.json'); -const accountFields = ['accountType', 'rootType', 'isGroup', 'account_type', 'root_type', 'is_group']; +const accountFields = [ + 'accountType', + 'rootType', + 'isGroup', + 'account_type', + 'root_type', + 'is_group' +]; async function importAccounts(children, parent, rootType, rootAccount) { - for (let accountName in children) { - const child = children[accountName]; + for (let accountName in children) { + const child = children[accountName]; - if (rootAccount) { - rootType = child.rootType || child.root_type; - } - - if (!accountFields.includes(accountName)) { - let isGroup = identifyIsGroup(child); - const doc = frappe.newDoc({ - doctype: 'Account', - name: accountName, - parentAccount: parent, - isGroup, - rootType, - balance: 0, - accountType: child.accountType - }) - - await doc.insert() - - await importAccounts(child, accountName, rootType) - } + if (rootAccount) { + rootType = child.rootType || child.root_type; } + + if (!accountFields.includes(accountName)) { + let isGroup = identifyIsGroup(child); + const doc = frappe.newDoc({ + doctype: 'Account', + name: accountName, + parentAccount: parent, + isGroup, + rootType, + balance: 0, + accountType: child.accountType || child.account_type + }); + + await doc.insert(); + + await importAccounts(child, accountName, rootType); + } + } } function identifyIsGroup(child) { - if (child.isGroup || child.is_group) { - return child.isGroup || child.is_group; - } + if (child.isGroup || child.is_group) { + return child.isGroup || child.is_group; + } - const keys = Object.keys(child); - const children = keys.filter(key => !accountFields.includes(key)) + const keys = Object.keys(child); + const children = keys.filter(key => !accountFields.includes(key)); - if (children.length) { - return 1; - } + if (children.length) { + return 1; + } - return 0; + return 0; } -async function getCountryCOA(){ - const doc = await frappe.getDoc('AccountingSettings'); - const conCode = countries[doc.country].code; +async function getCountryCOA() { + const doc = await frappe.getDoc('AccountingSettings'); + const conCode = countries[doc.country].code; - const countryCOA = path.resolve(path.join('./fixtures/verified/', conCode + '.json')); - - if(fs.existsSync(countryCOA)){ - const jsonText = fs.readFileSync(countryCOA, 'utf-8'); - const json = JSON.parse(jsonText); - return json.tree; - } else { - return standardCOA; - } + try { + const countryCoa = require('../../../fixtures/verified/' + + conCode + + '.json'); + return countryCoa.tree; + } catch (e) { + return standardCOA; + } } module.exports = async function importCharts() { - const chart = await getCountryCOA(); - await importAccounts(chart, '', '', true) -} - + const chart = await getCountryCOA(); + await importAccounts(chart, '', '', true); +}; diff --git a/models/doctype/Bill/BillDocument.js b/models/doctype/Bill/BillDocument.js deleted file mode 100644 index 12561406..00000000 --- a/models/doctype/Bill/BillDocument.js +++ /dev/null @@ -1,4 +0,0 @@ -const InvoiceDocument = require('../Invoice/InvoiceDocument'); -const frappe = require('frappejs'); - -module.exports = class Bill extends InvoiceDocument { } diff --git a/models/doctype/BillSettings/BillSettings.js b/models/doctype/BillSettings/BillSettings.js deleted file mode 100644 index b8126fb4..00000000 --- a/models/doctype/BillSettings/BillSettings.js +++ /dev/null @@ -1,18 +0,0 @@ -module.exports = { - "name": "BillSettings", - "label": "Bill Settings", - "doctype": "DocType", - "isSingle": 1, - "isChild": 0, - "keywordFields": [], - "fields": [ - { - "fieldname": "numberSeries", - "label": "Number Series", - "fieldtype": "Link", - "target": "NumberSeries", - "required": 1, - "default": "BILL" - } - ] -} \ No newline at end of file diff --git a/models/doctype/DashboardChart/DashboardChart.js b/models/doctype/DashboardChart/DashboardChart.js new file mode 100644 index 00000000..5a906124 --- /dev/null +++ b/models/doctype/DashboardChart/DashboardChart.js @@ -0,0 +1,24 @@ +module.exports = { + name: 'DashboardChart', + doctype: 'DocType', + isChild: 1, + fields: [ + { + fieldname: 'account', + fieldtype: 'Link', + label: 'Account', + target: 'Account' + }, + { + fieldname: 'type', + fieldtype: 'Select', + options: ['', 'Bar', 'Line', 'Percentage'], + label: 'Chart Type' + }, + { + fieldname: 'color', + fieldtype: 'Data', + label: 'Color' + } + ] +}; diff --git a/models/doctype/DashboardSettings/DashboardSettings.js b/models/doctype/DashboardSettings/DashboardSettings.js new file mode 100644 index 00000000..065ca301 --- /dev/null +++ b/models/doctype/DashboardSettings/DashboardSettings.js @@ -0,0 +1,19 @@ +module.exports = { + name: 'Dashboard', + label: 'Dashboard Settings', + doctype: 'DocType', + isSingle: 1, + fields: [ + { + fieldname: 'name', + fieldtype: 'Data', + label: 'Dashboard Name' + }, + { + fieldname: 'charts', + fieldtype: 'Table', + label: 'Charts', + childtype: 'DashboardChart' + } + ] +}; diff --git a/models/doctype/GSTR3B/GSTR3BDocument.js b/models/doctype/GSTR3B/GSTR3BDocument.js index 9314caec..6e2722d1 100644 --- a/models/doctype/GSTR3B/GSTR3BDocument.js +++ b/models/doctype/GSTR3B/GSTR3BDocument.js @@ -28,25 +28,28 @@ module.exports = class GSTR3B extends BaseDocument { `${this.year}-${month}-${lastDate}` ] }; - const invoices = frappe.db.getAll({ - doctype: 'Invoice', + const salesInvoices = frappe.db.getAll({ + doctype: 'SalesInvoice', filters, fields: ['*'] }); - const bills = frappe.db.getAll({ - doctype: 'Bill', + const purchaseInvoices = frappe.db.getAll({ + doctype: 'PurchaseInvoice', filters, fields: ['*'] }); - const [gstr1Data, gstr2Data] = await Promise.all([invoices, bills]); + const [gstr1Data, gstr2Data] = await Promise.all([ + salesInvoices, + purchaseInvoices + ]); let gstr3bData = [[], []]; for (let ledgerEntry of gstr1Data) { - ledgerEntry.doctype = 'Invoice'; + ledgerEntry.doctype = 'SalesInvoice'; gstr3bData[0].push(await this.makeGSTRow(ledgerEntry)); } for (let ledgerEntry of gstr2Data) { - ledgerEntry.doctype = 'Bill'; + ledgerEntry.doctype = 'BiPurchaseInvoicell'; gstr3bData[1].push(await this.makeGSTRow(ledgerEntry)); } diff --git a/models/doctype/InvoiceSettings/InvoiceSettings.js b/models/doctype/InvoiceSettings/InvoiceSettings.js deleted file mode 100644 index b7607f40..00000000 --- a/models/doctype/InvoiceSettings/InvoiceSettings.js +++ /dev/null @@ -1,42 +0,0 @@ -module.exports = { - name: "InvoiceSettings", - label: "Invoice Settings", - doctype: "DocType", - isSingle: 1, - isChild: 0, - keywordFields: [], - fields: [ - { - fieldname: "numberSeries", - label: "Number Series", - fieldtype: "Link", - target: "NumberSeries", - required: 1, - default: "INV" - }, - { - fieldname: "template", - label: "Template", - fieldtype: "Select", - options: ["Basic I", "Basic II", "Modern"], - required: 1, - default: "Basic I" - }, - { - fieldname: "font", - label: "Font", - fieldtype: "Select", - options: ["Montserrat", "Open Sans", "Oxygen", "Merriweather"], - required: 1, - default: "Montserrat" - }, - { - fieldname: "themeColor", - label: "Theme Color", - fieldtype: "Data", - required: 1, - default: "#000000", - hidden: 1 - } - ] -} \ No newline at end of file diff --git a/models/doctype/Party/Party.js b/models/doctype/Party/Party.js index 2ffe40e2..9d4c57b0 100644 --- a/models/doctype/Party/Party.js +++ b/models/doctype/Party/Party.js @@ -44,7 +44,7 @@ module.exports = { links: [ { - label: 'Invoices', + label: 'Sales Invoices', condition: form => form.doc.customer, action: form => { form.$router.push({ @@ -52,6 +52,15 @@ module.exports = { }); } }, + { + label: 'Purchase Invoices', + condition: form => form.doc.supplier, + action: form => { + form.$router.push({ + path: `/report/purchase-register?&supplier=${form.doc.name}` + }); + } + }, { label: 'Delete', condition: form => form.doc.customer, diff --git a/models/doctype/Payment/PaymentServer.js b/models/doctype/Payment/PaymentServer.js index caa4d37c..54449d46 100644 --- a/models/doctype/Payment/PaymentServer.js +++ b/models/doctype/Payment/PaymentServer.js @@ -15,7 +15,7 @@ module.exports = class PaymentServer extends BaseDocument { async beforeSubmit() { if (this.for.length > 0) for (let row of this.for) { - if (['Invoice', 'Bill'].includes(row.referenceType)) { + if (['SalesInvoice', 'PurchaseInvoice'].includes(row.referenceType)) { let { outstandingAmount, grandTotal } = await frappe.getDoc( row.referenceType, row.referenceName diff --git a/models/doctype/Bill/Bill.js b/models/doctype/PurchaseInvoice/PurchaseInvoice.js similarity index 94% rename from models/doctype/Bill/Bill.js rename to models/doctype/PurchaseInvoice/PurchaseInvoice.js index bbe27c32..c894db3e 100644 --- a/models/doctype/Bill/Bill.js +++ b/models/doctype/PurchaseInvoice/PurchaseInvoice.js @@ -2,14 +2,15 @@ const frappe = require('frappejs'); const utils = require('../../../accounting/utils'); module.exports = { - name: 'Bill', + name: 'PurchaseInvoice', doctype: 'DocType', - documentClass: require('./BillDocument'), + label: 'Purchase Invoice', + documentClass: require('./PurchaseInvoiceDocument'), isSingle: 0, isChild: 0, isSubmittable: 1, keywordFields: ['name', 'supplier'], - settings: 'BillSettings', + settings: 'PurchaseInvoiceSettings', showTitle: true, fields: [ { @@ -50,7 +51,7 @@ module.exports = { fieldname: 'items', label: 'Items', fieldtype: 'Table', - childtype: 'BillItem', + childtype: 'PurchaseInvoiceItem', required: true }, { diff --git a/models/doctype/PurchaseInvoice/PurchaseInvoiceDocument.js b/models/doctype/PurchaseInvoice/PurchaseInvoiceDocument.js new file mode 100644 index 00000000..b2752ec2 --- /dev/null +++ b/models/doctype/PurchaseInvoice/PurchaseInvoiceDocument.js @@ -0,0 +1,4 @@ +const SalesInvoiceDocument = require('../SalesInvoice/SalesInvoiceDocument'); +const frappe = require('frappejs'); + +module.exports = class PurchaseInvoice extends SalesInvoiceDocument {}; diff --git a/models/doctype/Bill/BillList.js b/models/doctype/PurchaseInvoice/PurchaseInvoiceList.js similarity index 90% rename from models/doctype/Bill/BillList.js rename to models/doctype/PurchaseInvoice/PurchaseInvoiceList.js index ed97ce51..5ce2f04e 100644 --- a/models/doctype/Bill/BillList.js +++ b/models/doctype/PurchaseInvoice/PurchaseInvoiceList.js @@ -2,8 +2,8 @@ import { _ } from 'frappejs/utils'; import indicators from 'frappejs/ui/constants/indicators'; export default { - doctype: 'Bill', - title: _('Bill'), + doctype: 'PurchaseInvoice', + title: _('Purchase Invoice'), columns: [ 'supplier', { diff --git a/models/doctype/Bill/BillServer.js b/models/doctype/PurchaseInvoice/PurchaseInvoiceServer.js similarity index 90% rename from models/doctype/Bill/BillServer.js rename to models/doctype/PurchaseInvoice/PurchaseInvoiceServer.js index fbfa4d01..15d67acc 100644 --- a/models/doctype/Bill/BillServer.js +++ b/models/doctype/PurchaseInvoice/PurchaseInvoiceServer.js @@ -1,8 +1,8 @@ const frappe = require('frappejs'); -const Bill = require('./BillDocument'); +const PurchaseInvoice = require('./PurchaseInvoiceDocument'); const LedgerPosting = require('../../../accounting/ledgerPosting'); -module.exports = class BillServer extends Bill { +module.exports = class PurchaseInvoiceServer extends PurchaseInvoice { async getPosting() { let entries = new LedgerPosting({ reference: this, party: this.supplier }); await entries.credit(this.account, this.grandTotal); @@ -36,7 +36,7 @@ module.exports = class BillServer extends Bill { const entries = await this.getPosting(); await entries.post(); await frappe.db.setValue( - 'Bill', + 'PurchaseInvoice', this.name, 'outstandingAmount', this.grandTotal diff --git a/models/doctype/BillItem/BillItem.js b/models/doctype/PurchaseInvoiceItem/PurchaseInvoiceItem.js similarity index 95% rename from models/doctype/BillItem/BillItem.js rename to models/doctype/PurchaseInvoiceItem/PurchaseInvoiceItem.js index 0753639a..d17572fb 100644 --- a/models/doctype/BillItem/BillItem.js +++ b/models/doctype/PurchaseInvoiceItem/PurchaseInvoiceItem.js @@ -1,5 +1,6 @@ module.exports = { - name: 'BillItem', + name: 'PurchaseInvoiceItem', + label: 'Purchase Invoice Item', doctype: 'DocType', isSingle: 0, isChild: 1, diff --git a/models/doctype/PurchaseInvoiceSettings/PurchaseInvoiceSettings.js b/models/doctype/PurchaseInvoiceSettings/PurchaseInvoiceSettings.js new file mode 100644 index 00000000..663bc7fa --- /dev/null +++ b/models/doctype/PurchaseInvoiceSettings/PurchaseInvoiceSettings.js @@ -0,0 +1,18 @@ +module.exports = { + name: 'PurchaseInvoiceSettings', + label: 'Purchase Invoice Settings', + doctype: 'DocType', + isSingle: 1, + isChild: 0, + keywordFields: [], + fields: [ + { + fieldname: 'numberSeries', + label: 'Number Series', + fieldtype: 'Link', + target: 'NumberSeries', + required: 1, + default: 'PINV' + } + ] +}; diff --git a/models/doctype/PurchaseOrder/PurchaseOrder.js b/models/doctype/PurchaseOrder/PurchaseOrder.js index a973d86d..7eba77d1 100644 --- a/models/doctype/PurchaseOrder/PurchaseOrder.js +++ b/models/doctype/PurchaseOrder/PurchaseOrder.js @@ -1,16 +1,20 @@ const model = require('frappejs/model'); -const Bill = require('../Bill/Bill'); +const PurchaseInvoice = require('../PurchaseInvoice/PurchaseInvoice'); -module.exports = model.extend(Bill, { - name: "PurchaseOrder", - label: "Purchase Order", - settings: "PurchaseOrderSettings", +module.exports = model.extend( + PurchaseInvoice, + { + name: 'PurchaseOrder', + label: 'Purchase Order', + settings: 'PurchaseOrderSettings', fields: [ - { - "fieldname": "items", - "childtype": "PurchaseOrderItem" - } + { + fieldname: 'items', + childtype: 'PurchaseOrderItem' + } ] -}, { + }, + { skipFields: ['account'] -}); + } +); diff --git a/models/doctype/PurchaseOrderItem/PurchaseOrderItem.js b/models/doctype/PurchaseOrderItem/PurchaseOrderItem.js index ad72ffee..140aba73 100644 --- a/models/doctype/PurchaseOrderItem/PurchaseOrderItem.js +++ b/models/doctype/PurchaseOrderItem/PurchaseOrderItem.js @@ -1,6 +1,6 @@ const model = require('frappejs/model'); -const BillItem = require('../BillItem/BillItem'); +const PurchaseInvoiceItem = require('../PurchaseInvoiceItem/PurchaseInvoiceItem'); -module.exports = model.extend(BillItem, { +module.exports = model.extend(PurchaseInvoiceItem, { name: "PurchaseOrderItem" }); diff --git a/models/doctype/PurchaseOrderSettings/PurchaseOrderSettings.js b/models/doctype/PurchaseOrderSettings/PurchaseOrderSettings.js index 928eb542..b7100db1 100644 --- a/models/doctype/PurchaseOrderSettings/PurchaseOrderSettings.js +++ b/models/doctype/PurchaseOrderSettings/PurchaseOrderSettings.js @@ -1,7 +1,7 @@ const model = require('frappejs/model'); -const BillSettings = require('../BillSettings/BillSettings'); +const PurchaseInvoiceSettings = require('../PurchaseInvoiceSettings/PurchaseInvoiceSettings'); -module.exports = model.extend(BillSettings, { +module.exports = model.extend(PurchaseInvoiceSettings, { "name": "PurchaseOrderSettings", "label": "Purchase Order Settings", "fields": [ diff --git a/models/doctype/Invoice/Invoice.js b/models/doctype/SalesInvoice/SalesInvoice.js similarity index 95% rename from models/doctype/Invoice/Invoice.js rename to models/doctype/SalesInvoice/SalesInvoice.js index 4573c967..8b492e26 100644 --- a/models/doctype/Invoice/Invoice.js +++ b/models/doctype/SalesInvoice/SalesInvoice.js @@ -2,9 +2,10 @@ const frappe = require('frappejs'); const utils = require('../../../accounting/utils'); module.exports = { - name: 'Invoice', + name: 'SalesInvoice', + label: 'Sales Invoice', doctype: 'DocType', - documentClass: require('./InvoiceDocument.js'), + documentClass: require('./SalesInvoiceDocument'), print: { printFormat: 'Standard Invoice Format' }, @@ -12,7 +13,7 @@ module.exports = { isChild: 0, isSubmittable: 1, keywordFields: ['name', 'customer'], - settings: 'InvoiceSettings', + settings: 'SalesInvoiceSettings', showTitle: true, fields: [ { @@ -62,7 +63,7 @@ module.exports = { fieldname: 'items', label: 'Items', fieldtype: 'Table', - childtype: 'InvoiceItem', + childtype: 'SalesInvoiceItem', required: true }, { diff --git a/models/doctype/Invoice/InvoiceDocument.js b/models/doctype/SalesInvoice/SalesInvoiceDocument.js similarity index 97% rename from models/doctype/Invoice/InvoiceDocument.js rename to models/doctype/SalesInvoice/SalesInvoiceDocument.js index ba20a2d5..a84a15ef 100644 --- a/models/doctype/Invoice/InvoiceDocument.js +++ b/models/doctype/SalesInvoice/SalesInvoiceDocument.js @@ -1,7 +1,7 @@ const BaseDocument = require('frappejs/model/document'); const frappe = require('frappejs'); -module.exports = class Invoice extends BaseDocument { +module.exports = class SalesInvoice extends BaseDocument { async getRowTax(row) { if (row.tax) { let tax = await this.getTax(row.tax); diff --git a/models/doctype/Invoice/InvoiceList.js b/models/doctype/SalesInvoice/SalesInvoiceList.js similarity index 91% rename from models/doctype/Invoice/InvoiceList.js rename to models/doctype/SalesInvoice/SalesInvoiceList.js index 194052b6..0bf3b839 100644 --- a/models/doctype/Invoice/InvoiceList.js +++ b/models/doctype/SalesInvoice/SalesInvoiceList.js @@ -2,8 +2,8 @@ import { _ } from 'frappejs/utils'; import indicators from 'frappejs/ui/constants/indicators'; export default { - doctype: 'Invoice', - title: _('Invoice'), + doctype: 'SalesInvoice', + title: _('Sales Invoice'), columns: [ 'customer', { diff --git a/models/doctype/Invoice/InvoicePrint.vue b/models/doctype/SalesInvoice/SalesInvoicePrint.vue similarity index 90% rename from models/doctype/Invoice/InvoicePrint.vue rename to models/doctype/SalesInvoice/SalesInvoicePrint.vue index 6dc92d7f..0f985d7d 100644 --- a/models/doctype/Invoice/InvoicePrint.vue +++ b/models/doctype/SalesInvoice/SalesInvoicePrint.vue @@ -26,9 +26,9 @@
diff --git a/src/components/InvoiceCustomizer.vue b/src/components/InvoiceCustomizer.vue index 8c9d5c4d..e5907f56 100644 --- a/src/components/InvoiceCustomizer.vue +++ b/src/components/InvoiceCustomizer.vue @@ -3,7 +3,7 @@
-

Customizer

+

Customize

{{ _('Save & Close') }} @@ -36,9 +36,9 @@ export default { }; }, async created() { - this.doc = await frappe.getDoc('InvoiceSettings'); + this.doc = await frappe.getDoc('SalesInvoiceSettings'); this.color.hex = this.doc.themeColor; - const meta = frappe.getMeta('InvoiceSettings'); + const meta = frappe.getMeta('SalesInvoiceSettings'); this.fields = meta.fields.filter( field => field.fieldname !== 'numberSeries' ); diff --git a/src/components/PageHeader.vue b/src/components/PageHeader.vue index a345b0a2..736d028c 100644 --- a/src/components/PageHeader.vue +++ b/src/components/PageHeader.vue @@ -1,5 +1,7 @@ + + + diff --git a/src/components/SearchInput.vue b/src/components/SearchInput.vue deleted file mode 100644 index d30b5983..00000000 --- a/src/components/SearchInput.vue +++ /dev/null @@ -1,39 +0,0 @@ - - diff --git a/src/components/Sidebar.vue b/src/components/Sidebar.vue index 93934ca0..30e30316 100644 --- a/src/components/Sidebar.vue +++ b/src/components/Sidebar.vue @@ -2,7 +2,7 @@
-
{{ companyName }}
+
{{ companyName }}
@@ -95,6 +95,9 @@ export default { @import '../styles/variables.scss'; @import '../styles/animation.scss'; +.company-name { + cursor: pointer; +} .page-sidebar { height: 100vh; } diff --git a/src/pages/Dashboard.vue b/src/pages/Dashboard.vue new file mode 100644 index 00000000..5b4ebd6d --- /dev/null +++ b/src/pages/Dashboard.vue @@ -0,0 +1,119 @@ + + + \ No newline at end of file diff --git a/src/pages/DataImport/index.vue b/src/pages/DataImport/index.vue index b68c0ca8..debac2ec 100644 --- a/src/pages/DataImport/index.vue +++ b/src/pages/DataImport/index.vue @@ -6,7 +6,7 @@ :docfield="{ fieldtype: 'Select', fieldname: 'referenceDoctype', - options: ['Select a doctype...', 'ToDo', 'Item', 'Party', 'Invoice'] + options: ['Select a doctype...', 'ToDo', 'Item', 'Party', 'SalesInvoice'] }" @change="doctype => showTable(doctype)" /> diff --git a/src/pages/Desk.vue b/src/pages/Desk.vue index c50c6dac..81726b47 100644 --- a/src/pages/Desk.vue +++ b/src/pages/Desk.vue @@ -1,7 +1,7 @@