diff --git a/.gitignore b/.gitignore index d4f5cfc9..2ded444e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ node_modules .DS_Store -*.db Thumbs.db +*test.db *.log .cache /temp @@ -11,3 +11,4 @@ Frappe Accounting* build !build/icons !.gitkeep +*.db \ No newline at end of file diff --git a/electron/settings.js b/electron/settings.js index d11dbb64..8049239f 100644 --- a/electron/settings.js +++ b/electron/settings.js @@ -20,7 +20,6 @@ function getSettings() { async function saveSettings(settings) { await writeFile(configFilePath, JSON.stringify(settings)); } -console.log(getSettings()); module.exports = { getSettings, diff --git a/email/getConfig.js b/email/getConfig.js deleted file mode 100644 index 9b7d66a4..00000000 --- a/email/getConfig.js +++ /dev/null @@ -1,5 +0,0 @@ -const frappe = require('frappejs'); -module.exports = async function getData() { - account = await frappe.getDoc('EmailAccount'); - return account; -} \ No newline at end of file diff --git a/email/sender.js b/email/sender.js deleted file mode 100644 index 87fcd34e..00000000 --- a/email/sender.js +++ /dev/null @@ -1,46 +0,0 @@ -const nodemailer = require('nodemailer'); -const getConfig = require("./getConfig"); -const validator = require('./validator'); - -module.exports = { - 'sendMail': async function (mailDetails) { - if (!validator.validate(mailDetails.fromEmailAddress)) { - console.log("INVALID EMAIL"); - return false; - } - - let account = await getConfig(); - if (mailDetails.fromEmailAddress == account.email) { - if (validator.validate(mailDetails.toEmailAddress)) { - mailDetails = { - from: mailDetails.fromEmailAddress, - to: mailDetails.toEmailAddress, - replyTo: mailDetails.toEmailAddress, - inReplyTo: mailDetails.replyId, - references: [mailDetails.replyId], - cc: mailDetails.ccEmailAddress, - bcc: mailDetails.bccEmailAddress, - subject: mailDetails.subject, - text: mailDetails.bodyText, - attachments: [{ - filename: 'Invoice.pdf', - path: mailDetails.filePath, - contentType: 'application/pdf' - }], - }; - let transporter = nodemailer.createTransport({ - service: 'gmail', - auth: { - user: account.email, - pass: account.password, - } - }); - transporter.sendMail(mailDetails); - return true; - } else { - console.log("Sender Email Invalid"); - return false; - } - } - } -}; diff --git a/email/validator.js b/email/validator.js deleted file mode 100644 index f1d390dc..00000000 --- a/email/validator.js +++ /dev/null @@ -1,11 +0,0 @@ -// + Check Confirm Password == Password - -module.exports = { - validate: function (email) { - var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; - if (reg.test(email) == false) { - return false; - } - return true; - } -} \ No newline at end of file diff --git a/fixtures/countryInfo.json b/fixtures/countryInfo.json index 8679cc71..2f2cb426 100644 --- a/fixtures/countryInfo.json +++ b/fixtures/countryInfo.json @@ -8,9 +8,7 @@ "number_format": "#,###.##", "timezones": [ "Asia/Kabul" - ], - "fiscal_year_start": "12-20", - "fiscal_year_end": "12-21" + ] }, "Albania": { "code": "al", @@ -171,9 +169,7 @@ "Australia/Melbourne", "Australia/Perth", "Australia/Sydney" - ], - "fiscal_year_start": "07-01", - "fiscal_year_end": "06-30" + ] }, "Austria": { "code": "at", @@ -227,9 +223,7 @@ "number_format": "#,###.##", "timezones": [ "Asia/Dhaka" - ], - "fiscal_year_start": "07-01", - "fiscal_year_end": "06-30" + ] }, "Barbados": { "code": "bb", @@ -494,9 +488,7 @@ "America/Whitehorse", "America/Winnipeg", "America/Yellowknife" - ], - "fiscal_year_start": "04-01", - "fiscal_year_end": "03-31" + ] }, "Cape Verde": { "code": "cv", @@ -647,9 +639,7 @@ "number_format": "#.###,##", "timezones": [ "America/Costa_Rica" - ], - "fiscal_year_start": "10-01", - "fiscal_year_end": "09-30" + ] }, "Croatia": { "code": "hr", @@ -775,9 +765,7 @@ "number_format": "#,###.##", "timezones": [ "Africa/Cairo" - ], - "fiscal_year_start": "07-01", - "fiscal_year_end": "06-30" + ] }, "El Salvador": { "code": "sv", @@ -1125,9 +1113,7 @@ "number_format": "#,###.##", "timezones": [ "Asia/Hong_Kong" - ], - "fiscal_year_start": "04-01", - "fiscal_year_end": "03-31" + ] }, "Hungary": { "code": "hu", @@ -1164,9 +1150,7 @@ "number_format": "#,##,###.##", "timezones": [ "Asia/Kolkata" - ], - "fiscal_year_start": "04-01", - "fiscal_year_end": "03-31" + ] }, "Indonesia": { "code": "id", @@ -1191,9 +1175,7 @@ "number_format": "#,###.##", "timezones": [ "Asia/Tehran" - ], - "fiscal_year_start": "06-23", - "fiscal_year_end": "06-22" + ] }, "Iraq": { "code": "iq", @@ -1250,9 +1232,7 @@ "date_format": "dd/mm/yyyy", "timezones": [ "Europe/Rome" - ], - "fiscal_year_start": "07-01", - "fiscal_year_end": "06-30" + ] }, "Ivory Coast": { "code": "ci", @@ -1734,9 +1714,7 @@ "number_format": "#,###.##", "timezones": [ "Asia/Rangoon" - ], - "fiscal_year_start": "04-01", - "fiscal_year_end": "03-31" + ] }, "Namibia": { "code": "na", @@ -1804,9 +1782,7 @@ "timezones": [ "Pacific/Auckland", "Pacific/Chatham" - ], - "fiscal_year_start": "04-01", - "fiscal_year_end": "03-31" + ] }, "Nicaragua": { "code": "ni", @@ -1902,9 +1878,7 @@ "number_format": "#,###.##", "timezones": [ "Asia/Karachi" - ], - "fiscal_year_start": "07-01", - "fiscal_year_end": "06-30" + ] }, "Palau": { "code": "pw", @@ -2217,9 +2191,7 @@ "number_format": "#,###.##", "timezones": [ "Asia/Singapore" - ], - "fiscal_year_start": "04-01", - "fiscal_year_end": "03-31" + ] }, "Sint Maarten (Dutch part)": { "code": "sx", @@ -2282,9 +2254,7 @@ "number_format": "# ###.##", "timezones": [ "Africa/Johannesburg" - ], - "fiscal_year_start": "03-01", - "fiscal_year_end": "02-28" + ] }, "South Georgia and the South Sandwich Islands": { "code": "gs", @@ -2427,9 +2397,7 @@ "number_format": "#,###.##", "timezones": [ "Asia/Bangkok" - ], - "fiscal_year_start": "10-01", - "fiscal_year_end": "09-30" + ] }, "Timor-Leste": { "code": "tl", @@ -2579,9 +2547,7 @@ "number_format": "#,###.##", "timezones": [ "Europe/London" - ], - "fiscal_year_start": "04-01", - "fiscal_year_end": "03-31" + ] }, "United States": { "code": "us", diff --git a/fixtures/verified/in.json b/fixtures/verified/in.json deleted file mode 100644 index 88703e95..00000000 --- a/fixtures/verified/in.json +++ /dev/null @@ -1,176 +0,0 @@ -{ - "country_code": "in", - "name": "India - Chart of Accounts", - "tree": { - "Application of Funds (Assets)": { - "Current Assets": { - "Accounts Receivable": { - "Debtors": { - "is_group": 0, - "account_type": "Receivable" - } - }, - "Bank Accounts": { - "account_type": "Bank", - "is_group": 1 - }, - "Cash In Hand": { - "Cash": { - "account_type": "Cash" - }, - "account_type": "Cash" - }, - "Loans and Advances (Assets)": { - "is_group": 1 - }, - "Securities and Deposits": { - "Earnest Money": {} - }, - "Stock Assets": { - "Stock In Hand": { - "account_type": "Stock" - }, - "account_type": "Stock" - }, - "Tax Assets": { - "is_group": 1 - } - }, - "Fixed Assets": { - "Capital Equipments": { - "account_type": "Fixed Asset" - }, - "Electronic Equipments": { - "account_type": "Fixed Asset" - }, - "Furnitures and Fixtures": { - "account_type": "Fixed Asset" - }, - "Office Equipments": { - "account_type": "Fixed Asset" - }, - "Plants and Machineries": { - "account_type": "Fixed Asset" - }, - "Buildings": { - "account_type": "Fixed Asset" - }, - "Accumulated Depreciations": { - "account_type": "Accumulated Depreciation" - } - }, - "Investments": { - "is_group": 1 - }, - "Temporary Accounts": { - "Temporary Opening": { - "account_type": "Temporary" - } - }, - "root_type": "Asset" - }, - "Expenses": { - "Direct Expenses": { - "Stock Expenses": { - "Cost of Goods Sold": { - "account_type": "Cost of Goods Sold" - }, - "Expenses Included In Valuation": { - "account_type": "Expenses Included In Valuation" - }, - "Stock Adjustment": { - "account_type": "Stock Adjustment" - } - } - }, - "Indirect Expenses": { - "Administrative Expenses": {}, - "Commission on Sales": {}, - "Depreciation": { - "account_type": "Depreciation" - }, - "Entertainment Expenses": {}, - "Freight and Forwarding Charges": { - "account_type": "Chargeable" - }, - "Legal Expenses": {}, - "Marketing Expenses": {}, - "Miscellaneous Expenses": {}, - "Office Maintenance Expenses": {}, - "Office Rent": {}, - "Postal Expenses": {}, - "Print and Stationary": {}, - "Rounded Off": { - "account_type": "Round Off" - }, - "Salary": {}, - "Sales Expenses": {}, - "Telephone Expenses": {}, - "Travel Expenses": {}, - "Utility Expenses": {}, - "Write Off": {}, - "Exchange Gain/Loss": {}, - "Gain/Loss on Asset Disposal": {} - }, - "root_type": "Expense" - }, - "Income": { - "Direct Income": { - "Sales": { - "account_type": "Income Account" - }, - "Service": { - "account_type": "Income Account" - }, - "account_type": "Income Account" - }, - "Indirect Income": { - "account_type": "Income Account", - "is_group": 1 - }, - "root_type": "Income" - }, - "Source of Funds (Liabilities)": { - "Capital Account": { - "Reserves and Surplus": {}, - "Shareholders Funds": {} - }, - "Current Liabilities": { - "Accounts Payable": { - "Creditors": { - "account_type": "Payable" - }, - "Payroll Payable": {} - }, - "Stock Liabilities": { - "Stock Received But Not Billed": { - "account_type": "Stock Received But Not Billed" - } - }, - "Duties and Taxes": { - "TDS": { - "account_type": "Tax" - }, - "IGST": { - "accountType": "Tax" - }, - "CGST": { - "accountType": "Tax" - }, - "SGST": { - "accountType": "Tax" - }, - "Exempt": { - "accountType": "Tax" - } - }, - "Loans (Liabilities)": { - "Secured Loans": {}, - "Unsecured Loans": {}, - "Bank Overdraft Account": {} - } - }, - "root_type": "Liability" - } - } -} \ No newline at end of file diff --git a/models/doctype/Account/importCOA.js b/models/doctype/Account/importCOA.js deleted file mode 100644 index 50a1b4c2..00000000 --- a/models/doctype/Account/importCOA.js +++ /dev/null @@ -1,69 +0,0 @@ -const frappe = require('frappejs'); -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']; - -async function importAccounts(children, parent, rootType, rootAccount) { - 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) - } - } -} - -function identifyIsGroup(child) { - 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)) - - if (children.length) { - return 1; - } - - return 0; -} - -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; - } -} - -module.exports = async function importCharts() { - const chart = await getCountryCOA(); - await importAccounts(chart, '', '', true) -} - diff --git a/models/doctype/AccountingLedgerEntry/AccountingLedgerEntry.js b/models/doctype/AccountingLedgerEntry/AccountingLedgerEntry.js index 98a1e4c1..278e4105 100644 --- a/models/doctype/AccountingLedgerEntry/AccountingLedgerEntry.js +++ b/models/doctype/AccountingLedgerEntry/AccountingLedgerEntry.js @@ -51,12 +51,12 @@ module.exports = { }, { fieldname: "referenceType", - label: "Ref. Type", + label: "Reference Type", fieldtype: "Data", }, { fieldname: "referenceName", - label: "Ref. Name", + label: "Reference Name", fieldtype: "DynamicLink", references: "referenceType" }, diff --git a/models/doctype/AccountingSettings/AccountingSettings.js b/models/doctype/AccountingSettings/AccountingSettings.js index 32354316..96ac53f3 100644 --- a/models/doctype/AccountingSettings/AccountingSettings.js +++ b/models/doctype/AccountingSettings/AccountingSettings.js @@ -9,12 +9,13 @@ module.exports = { isSubmittable: 0, settings: null, keywordFields: [], - fields: [{ + fields: [ + { label: "Company Name", fieldname: "companyName", fieldtype: "Data", required: 1, - disabled: 0 + disabled: 1 }, { diff --git a/models/doctype/Address/Address.js b/models/doctype/Address/Address.js index f1225c74..b6191f8c 100644 --- a/models/doctype/Address/Address.js +++ b/models/doctype/Address/Address.js @@ -45,6 +45,11 @@ module.exports = { "fieldtype": "Data", "required": 1 }, + { + "fieldname": "county", + "label": "County", + "fieldtype": "Data" + }, { "fieldname": "state", "label": "State", @@ -88,11 +93,11 @@ module.exports = { } ], - // events: { - // validate: (doc) => { + events: { + validate: (doc) => { - // } - // }, + } + }, listSettings: { getFields(list) { @@ -108,17 +113,11 @@ module.exports = { { columns: [ { - fields: [ - "addressTitle", "addressType", "addressLine1", - "addressLine2", "city", "country", "state", - "postalCode" - ] + fields: [ "addressTitle", "addressType", "addressLine1", + "addressLine2", "city", "county", "state", "country", + "postalCode"] }, - { - fields: [ - "emailAddress", "phone", "fax", "isPreferredBilling", "isShippingBilling" - ] - } + { fields: [ "emailAddress", "phone", "fax", "isPreferredBilling", "isShippingBilling" ] } ] } ] diff --git a/models/doctype/CompanySettings/CompanySettings.js b/models/doctype/CompanySettings/CompanySettings.js deleted file mode 100644 index 74308bef..00000000 --- a/models/doctype/CompanySettings/CompanySettings.js +++ /dev/null @@ -1,27 +0,0 @@ -module.exports = { - "name": "CompanySettings", - "label": "Company Settings", - "naming": "autoincrement", - "isSingle": true, - "isChild": false, - "keywordFields": [ - "companyName" - ], - "fields": [ - { - "fieldname": "companyName", - "label": "Company Name", - "fieldtype": "Data", - "disabled": false, - "required": true - }, - { - "fieldname": "companyAddress", - "label": "Company Address", - "fieldtype": "Link", - "disabled": false, - "required": true, - "target": "Address" - } - ] -} \ No newline at end of file diff --git a/models/doctype/Email/Email.js b/models/doctype/Email/Email.js deleted file mode 100644 index 8f8f2389..00000000 --- a/models/doctype/Email/Email.js +++ /dev/null @@ -1,72 +0,0 @@ -const frappe = require('frappejs'); - -module.exports = { - "name": "Email", - "doctype": "DocType", - "pageSettings": { - hideTitle: true - }, - "isSingle": 0, - "isChild": 0, - "keywordFields": ["name"], - "fields": [{ - "fieldname": "name", - "label": "name", - "fieldtype": "Data", - "required": 0, - "hidden": 1, - "disabled": 0 - }, - { - "fieldname": "fromEmailAddress", - "label": "From", - "fieldtype": "Data", - "required": 1, - "hidden": 0, - formula: async () => { - const accountingSettings = await frappe.getDoc('AccountingSettings'); - return accountingSettings.email; - }, - "disabled": 1 - }, - { - "fieldname": "toEmailAddress", - "label": "To", - "fieldtype": "Data", - "required": 1, - "hidden": 0, - "disabled": 0 - }, - { - "fieldname": "date", - "label": "Date", - "fieldtype": "Datetime", - "required": 0, - "hidden": 0, - "disabled": 1 - }, - { - "fieldname": "subject", - "label": "Subject", - "fieldtype": "Data", - "required": 0, - "hidden": 0, - "disabled": 0 - }, - { - "fieldname": "bodyText", - "label": "Body", - "fieldtype": "Text", - "required": 0, - "hidden": 0, - "disabled": 0 - }, - { - "fieldname": "filePath", - "label": "File Path", - "fieldtype": "Text", - "required": 0, - "hidden": 1, - } - ] -} \ No newline at end of file diff --git a/models/doctype/EmailAccount/EmailAccount.js b/models/doctype/EmailAccount/EmailAccount.js deleted file mode 100644 index e3d93972..00000000 --- a/models/doctype/EmailAccount/EmailAccount.js +++ /dev/null @@ -1,59 +0,0 @@ -const frappe = require('frappejs'); - -module.exports = { - "name": "EmailAccount", - "label": "Email Account", - "doctype": "DocType", - "isSingle": true, - "isChild": false, - "keywordFields": [ - "email" - ], - "fields": [ - { - "fieldname": "email", - "label": "Email", - "fieldtype": "Data", - "required": 1, - formula: async () => { - const accountingSettings = await frappe.getDoc('AccountingSettings'); - return accountingSettings.email; - }, - }, - { - "fieldname": "password", - "label": "Password", - "fieldtype": "Password", - "required": 1 - }, - { - "fieldname": "confirmPassword", - "label": "Confirm Password", - "fieldtype": "Password", - "required": 1 - }, - { - "fieldname": "smtpHost", - "label": "SMTP Host", - "fieldtype": "Select", - "options": [ - "smtp.gmail.com", - "smtp.mail.yahoo.com", - "smtp-mail.outlook.com", - "smtp.mail.me.com", - "smtp.aol.com" - ], - "default": "smtp.gmail.com" - }, - { - "fieldname": "smtpPort", - "label": "SMTP Port", - "fieldtype": "Select", - "options": [ - "465", - "587" - ], - "default": "465" - } - ] -} \ No newline at end of file diff --git a/models/doctype/Invoice/Invoice.js b/models/doctype/Invoice/Invoice.js index 3cafe8d0..4dbe9e35 100644 --- a/models/doctype/Invoice/Invoice.js +++ b/models/doctype/Invoice/Invoice.js @@ -18,8 +18,7 @@ module.exports = { { fieldname: 'date', label: 'Date', - fieldtype: 'Date', - // default: (new Date()).toISOString() + fieldtype: 'Date' }, { fieldname: 'customer', diff --git a/models/doctype/Invoice/InvoicePrint.vue b/models/doctype/Invoice/InvoicePrint.vue index 442cf2fa..72b3caa6 100644 --- a/models/doctype/Invoice/InvoicePrint.vue +++ b/models/doctype/Invoice/InvoicePrint.vue @@ -1,61 +1,73 @@ \ No newline at end of file + props: ['doc'] +} + diff --git a/models/doctype/Invoice/Templates/AddressDetails.js b/models/doctype/Invoice/Templates/AddressDetails.js deleted file mode 100644 index 6e1c8f07..00000000 --- a/models/doctype/Invoice/Templates/AddressDetails.js +++ /dev/null @@ -1,28 +0,0 @@ -async function getCompanyDetails() { - let companyDetails = { - name: null, - address: {} - }; - - let companySettings = await frappe.getDoc('CompanySettings'); - companyDetails.name = companySettings.companyName; - - let companyAddress = await getAddress(companySettings.companyAddress); - companyDetails.address = companyAddress; - return companyDetails; -} - -async function getCustomerAddress(customer) { - let customers = await frappe.db.getAll({ doctype: 'Party', fields:['name, address'], filters: { name: customer }}); - let customerDetails = await frappe.getDoc('Party', customers[0].name); - return await getAddress(customerDetails.address); -} - -async function getAddress(addressName) { - return await frappe.getDoc('Address', addressName); -} - -module.exports = { - getCompanyDetails, - getCustomerAddress -} \ No newline at end of file diff --git a/models/doctype/Invoice/Templates/CompanyAddress.vue b/models/doctype/Invoice/Templates/CompanyAddress.vue deleted file mode 100644 index 382e8ea1..00000000 --- a/models/doctype/Invoice/Templates/CompanyAddress.vue +++ /dev/null @@ -1,38 +0,0 @@ - - \ No newline at end of file diff --git a/models/doctype/Invoice/Templates/CustomerAddress.vue b/models/doctype/Invoice/Templates/CustomerAddress.vue deleted file mode 100644 index 3fa08858..00000000 --- a/models/doctype/Invoice/Templates/CustomerAddress.vue +++ /dev/null @@ -1,37 +0,0 @@ - - \ No newline at end of file diff --git a/models/doctype/Invoice/Templates/InvoiceStyles.js b/models/doctype/Invoice/Templates/InvoiceStyles.js deleted file mode 100644 index 49f3b5f6..00000000 --- a/models/doctype/Invoice/Templates/InvoiceStyles.js +++ /dev/null @@ -1,54 +0,0 @@ -module.exports = { - bold: { - fontWeight: 'bold' - }, - font: { - fontFamily: null - }, - regularFontSize: { - fontSize: '0.8rem' - }, - mediumFontSize: { - fontSize: '1rem' - }, - paraStyle: { - margin: '0.5rem', - marginLeft: 0, - marginRight: 0 - }, - bgColor: { - backgroundColor: null - }, - showBorderBottom: { - borderBottom: null - }, - hideBorderTop: { - borderTop: '0px solid black' - }, - showBorderRight: { - borderRight: '1px solid #e0e0d1' - }, - tablePadding: { - paddingTop: '3%', - paddingBottom: '3%' - }, - fontColor: { - color: null - }, - headerColor: { - backgroundColor: null, - color: 'white' - }, - showNoticeBorderBottom: { - borderBottom: null - }, - showBorderTop: { - borderTop: null - }, - headerFontColor: { - color: null - }, - showBorderTop: { - borderTop: null - } -} \ No newline at end of file diff --git a/models/doctype/Invoice/Templates/InvoiceTemplate1.vue b/models/doctype/Invoice/Templates/InvoiceTemplate1.vue deleted file mode 100644 index 34bc58dd..00000000 --- a/models/doctype/Invoice/Templates/InvoiceTemplate1.vue +++ /dev/null @@ -1,108 +0,0 @@ - - diff --git a/models/doctype/Invoice/Templates/InvoiceTemplate2.vue b/models/doctype/Invoice/Templates/InvoiceTemplate2.vue deleted file mode 100644 index cc4c4cc5..00000000 --- a/models/doctype/Invoice/Templates/InvoiceTemplate2.vue +++ /dev/null @@ -1,117 +0,0 @@ - - \ No newline at end of file diff --git a/models/doctype/Invoice/Templates/InvoiceTemplate3.vue b/models/doctype/Invoice/Templates/InvoiceTemplate3.vue deleted file mode 100644 index dff84267..00000000 --- a/models/doctype/Invoice/Templates/InvoiceTemplate3.vue +++ /dev/null @@ -1,113 +0,0 @@ - - \ No newline at end of file diff --git a/models/doctype/InvoiceItem/InvoiceItem.js b/models/doctype/InvoiceItem/InvoiceItem.js index a5a840a9..e5033e52 100644 --- a/models/doctype/InvoiceItem/InvoiceItem.js +++ b/models/doctype/InvoiceItem/InvoiceItem.js @@ -5,7 +5,8 @@ module.exports = { isChild: 1, keywordFields: [], layout: 'ratio', - fields: [{ + fields: [ + { fieldname: 'item', label: 'Item', fieldtype: 'Link', diff --git a/models/doctype/InvoiceSettings/InvoiceSettings.js b/models/doctype/InvoiceSettings/InvoiceSettings.js index b7607f40..9feeb779 100644 --- a/models/doctype/InvoiceSettings/InvoiceSettings.js +++ b/models/doctype/InvoiceSettings/InvoiceSettings.js @@ -1,42 +1,18 @@ module.exports = { - name: "InvoiceSettings", - label: "Invoice Settings", - doctype: "DocType", - isSingle: 1, - isChild: 0, - keywordFields: [], - fields: [ + "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 + "fieldname": "numberSeries", + "label": "Number Series", + "fieldtype": "Link", + "target": "NumberSeries", + "required": 1, + "default": "INV" } ] } \ No newline at end of file diff --git a/models/doctype/Item/Item.js b/models/doctype/Item/Item.js index 4e718576..b018e589 100644 --- a/models/doctype/Item/Item.js +++ b/models/doctype/Item/Item.js @@ -6,7 +6,8 @@ module.exports = { 'name', 'description' ], - fields: [{ + fields: [ + { fieldname: 'name', label: 'Item Name', fieldtype: 'Data', @@ -58,31 +59,25 @@ module.exports = { layout: [ // section 1 { - columns: [{ - fields: ['name', 'unit'] - }, - { - fields: ['rate'] - } + columns: [ + { fields: ['name', 'unit'] }, + { fields: ['rate'] } ] }, // section 2 { - columns: [{ - fields: ['description'] - }] + columns: [ + { fields: ['description'] } + ] }, // section 3 { title: 'Accounting', - columns: [{ - fields: ['incomeAccount', 'expenseAccount'] - }, - { - fields: ['tax'] - } + columns: [ + { fields: ['incomeAccount', 'expenseAccount'] }, + { fields: ['tax'] } ] } ] diff --git a/models/doctype/Party/Party.js b/models/doctype/Party/Party.js index e12e15d2..27f5ab93 100644 --- a/models/doctype/Party/Party.js +++ b/models/doctype/Party/Party.js @@ -6,29 +6,24 @@ module.exports = { "keywordFields": [ "name" ], - "fields": [{ + "fields": [ + { "fieldname": "name", "label": "Name", "fieldtype": "Data", "required": 1 }, { - fieldname: "address", - label: "Address", - fieldtype: "Link", - target: "Address" - }, - { - fieldname: 'defaultAccount', - label: 'Default Account', - fieldtype: 'Link', - target: 'Account', - getFilters: (query, control) => { - return { - isGroup: 0, - accountType: 'Receivable' - }; - } + fieldname: 'defaultAccount', + label: 'Default Account', + fieldtype: 'Link', + target: 'Account', + getFilters: (query, control) => { + return { + isGroup: 0, + accountType: 'Receivable' + }; + } }, { "fieldname": "customer", @@ -42,13 +37,15 @@ module.exports = { } ], - links: [{ - label: 'Invoices', - condition: (form) => form.doc.customer, - action: form => { - form.$router.push({ + links: [ + { + label: 'Invoices', + condition: (form) => form.doc.customer, + action: form => { + form.$router.push({ path: `/report/sales-register?&customer=${form.doc.name}` - }); + }); + } } - }] -} \ No newline at end of file + ] +} diff --git a/models/doctype/Party/RegionalChanges.js b/models/doctype/Party/RegionalChanges.js deleted file mode 100644 index 95cb7350..00000000 --- a/models/doctype/Party/RegionalChanges.js +++ /dev/null @@ -1,12 +0,0 @@ -const party = require('./Party') - -party.fields.splice(3, 0, { //insert at 3rd position - fieldname: 'gstin', - label: 'GSTIN No.', - fieldtype: 'Data', - hidden: 0 -}) -party.fields.join() -const newParty = party - -module.exports = newParty \ No newline at end of file diff --git a/models/doctype/Payment/Payment.js b/models/doctype/Payment/Payment.js index 69504524..9d04e259 100644 --- a/models/doctype/Payment/Payment.js +++ b/models/doctype/Payment/Payment.js @@ -8,11 +8,11 @@ module.exports = { isSubmittable: 1, keywordFields: [], settings: "PaymentSettings", - fields: [{ + fields: [ + { "fieldname": "date", - "label": "Posting Date", - "fieldtype": "Date", - // default: (new Date()).toISOString() + "label": "Date", + "fieldtype": "Date" }, { fieldname: "party", @@ -35,23 +35,6 @@ module.exports = { target: "Account", required: 1 }, - { - fieldname: "referenceId", - label: "Ref. / Cheque No.", - fieldtype: "Data", - default: "ABC", - required: 1 // TODO: UNIQUE - }, - { - fieldname: "referenceDate", - label: "Ref. Date", - fieldtype: "Date", - }, - { - fieldname: "clearanceDate", - label: "Clearance Date", - fieldtype: "Date", - }, { fieldname: "amount", label: "Amount", @@ -74,33 +57,26 @@ module.exports = { } ], - layout: [{ - columns: [{ - fields: ['date', 'party'] - }, - { - fields: ['account', 'paymentAccount'] - }, + layout: [ + { + columns: [ + { fields: ['date', 'party'] }, + { fields: ['account', 'paymentAccount'] }, ] }, { - columns: [{ - fields: ['referenceId'] - }, { - fields: ['referenceDate'] - },{ - fields: ['clearanceDate'] - }] + columns: [ + { + fields: ['for'] + } + ] }, { - columns: [{ - fields: ['for'] - }] - }, - { - columns: [{ - fields: ['amount', 'writeoff'] - }] + columns: [ + { + fields: ['amount', 'writeoff'] + } + ] } ], diff --git a/models/doctype/Payment/PaymentList.js b/models/doctype/Payment/PaymentList.js index 1f9b048c..38451218 100644 --- a/models/doctype/Payment/PaymentList.js +++ b/models/doctype/Payment/PaymentList.js @@ -1,30 +1,13 @@ import { _ } from 'frappejs/utils'; -import indicators from 'frappejs/ui/constants/indicators'; export default { doctype: 'Payment', title: _('Payment'), columns: [ 'party', - { - label: 'Payment', - getValue(doc) { - if (doc.submitted === 1 && doc.clearanceDate !== null) { - return 'Reconciled'; - } - return 'Not Reconciled'; - }, - getIndicator(doc) { - if (doc.submitted === 1 && doc.clearanceDate !== null) { - return indicators.GREEN; - } - return indicators.ORANGE; - } - }, 'account', 'amount', 'date', - 'clearanceDate', 'name' ] } \ No newline at end of file diff --git a/models/doctype/SetupWizard/SetupWizard.js b/models/doctype/SetupWizard/SetupWizard.js deleted file mode 100644 index 547e26e9..00000000 --- a/models/doctype/SetupWizard/SetupWizard.js +++ /dev/null @@ -1,102 +0,0 @@ -const countryList = require('../../../fixtures/countryInfo.json'); - -module.exports = { - name: "SetupWizard", - label: "Setup Wizard", - naming: "name", - isSingle: 1, - isChild: 0, - isSubmittable: 0, - settings: null, - keywordFields: [], - fields: [{ - fieldname: 'country', - label: 'Country', - fieldtype: 'Autocomplete', - required: 1, - getList: () => Object.keys(countryList).sort() - }, - - { - fieldname: 'fullname', - label: 'Name', - fieldtype: 'Data', - required: 1 - }, - - { - fieldname: 'email', - label: 'Email', - fieldtype: 'Data', - required: 1, - inputType: 'email' - }, - - { - fieldname: 'companyName', - label: 'Company Name', - fieldtype: 'Data', - required: 1 - }, - - { - fieldname: 'bankName', - label: 'Bank Name', - fieldtype: 'Data', - required: 1 - }, - - { - fieldname: 'fiscalYearStart', - label: 'Fiscal Year Start Date', - fieldtype: 'Date', - formula: (doc) => { - let date = countryList[doc.country]["fiscal_year_start"].split("-"); - var currentYear = (new Date).getFullYear(); - let currentMonth = date[0] - 1 ; - let currentDate = date[1]; - return new Date(currentYear,currentMonth,currentDate).toISOString().substr(0, 10);; - }, - required: 1 - }, - - { - fieldname: 'fiscalYearEnd', - label: 'Fiscal Year End Date', - fieldtype: 'Date', - formula: (doc) => { - let date = countryList[doc.country]["fiscal_year_end"].split("-"); - var currentYear = (new Date).getFullYear() + 1 ; - let currentMonth = date[0] - 1 ; - let currentDate = date[1]; - return new Date(currentYear,currentMonth,currentDate).toISOString().substr(0, 10);; - }, - required: 1 - } - ], - - layout: { - paginated: true, - sections: [{ - title: 'Select Country', - columns: [{ - fields: ['country'] - }] - }, - - { - title: 'Add a Profile', - columns: [{ - fields: ['fullname', 'email'] - }] - }, - - { - title: 'Add your Company', - columns: [{ - fields: ['companyName', 'bankName', 'fiscalYearStart', 'fiscalYearEnd'] - }] - } - ].filter(Boolean) - } -} diff --git a/models/doctype/Tax/Tax.js b/models/doctype/Tax/Tax.js index 2bb02ac9..6d7d8af9 100644 --- a/models/doctype/Tax/Tax.js +++ b/models/doctype/Tax/Tax.js @@ -1,6 +1,5 @@ module.exports = { "name": "Tax", - "label": "Tax", "doctype": "DocType", "isSingle": 0, "isChild": 0, diff --git a/models/doctype/Tax/TaxList.js b/models/doctype/Tax/TaxList.js deleted file mode 100644 index 2bf95864..00000000 --- a/models/doctype/Tax/TaxList.js +++ /dev/null @@ -1,10 +0,0 @@ -import { _ } from 'frappejs/utils'; -import indicators from 'frappejs/ui/constants/indicators'; - -export default { - doctype: 'Tax', - title: _('Tax'), - columns: [ - 'name' - ] -} \ No newline at end of file diff --git a/models/doctype/account/importCOA.js b/models/doctype/account/importCOA.js index 50a1b4c2..4e3359a2 100644 --- a/models/doctype/account/importCOA.js +++ b/models/doctype/account/importCOA.js @@ -52,7 +52,7 @@ async function getCountryCOA(){ 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); diff --git a/models/index.js b/models/index.js index b156455f..29ba5d94 100644 --- a/models/index.js +++ b/models/index.js @@ -1,9 +1,7 @@ module.exports = { models: { - SetupWizard: require('./doctype/SetupWizard/SetupWizard'), Account: require('./doctype/Account/Account.js'), AccountingSettings: require('./doctype/AccountingSettings/AccountingSettings'), - CompanySettings: require('./doctype/CompanySettings/CompanySettings'), AccountingLedgerEntry: require('./doctype/AccountingLedgerEntry/AccountingLedgerEntry.js'), Party: require('./doctype/Party/Party.js'), @@ -55,8 +53,5 @@ module.exports = { Event: require('./doctype/Event/Event'), EventSchedule: require('./doctype/EventSchedule/EventSchedule'), EventSettings: require('./doctype/EventSettings/EventSettings'), - - Email: require('./doctype/Email/Email'), - EmailAccount: require('./doctype/EmailAccount/EmailAccount'), } -} \ No newline at end of file +} diff --git a/package-lock.json b/package-lock.json index 10d973fc..0eb75f01 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,9 +15,9 @@ "integrity": "sha512-XtGk+IF57pr852UK1AhQJXqmm1WmSgS5uISL+LPs0z/iAxXouMvdlLJrHPeukP6gd7yR2rDTMSMkHNODgwIq7A==" }, "@types/node": { - "version": "8.10.38", - "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.38.tgz", - "integrity": "sha512-EibsnbJerd0hBFaDjJStFrVbVBAtOy4dgL8zZFw0uOvPqzBAX59Ci8cgjg3+RgJIWhsB5A4c+pi+D4P9tQQh/A==" + "version": "8.10.36", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.36.tgz", + "integrity": "sha512-SL6KhfM7PTqiFmbCW3eVNwVBZ+88Mrzbuvn9olPsfv43mbiWaFY+nRcz/TGGku0/lc2FepdMbImdMY1JrQ+zbw==" }, "@vue/component-compiler-utils": { "version": "2.2.0", @@ -1867,11 +1867,6 @@ "safe-buffer": "^5.0.1" } }, - "clamp": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/clamp/-/clamp-1.0.1.tgz", - "integrity": "sha1-ZqDmQBGBbjcZaCj9yMjBRzEshjQ=" - }, "class-utils": { "version": "0.3.6", "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", @@ -2829,12 +2824,12 @@ "integrity": "sha512-0xy4A/twfrRCnkhfk8ErDi5DqdAsAqeGxht4xkCUrsvhhbQNs7E+4jV0CN7+NKIY0aHE72+XvqtBIXzD31ZbXQ==" }, "electron": { - "version": "3.0.12", - "resolved": "https://registry.npmjs.org/electron/-/electron-3.0.12.tgz", - "integrity": "sha512-stvGbqYzWv5qHHtjZZgA7gET3NPGLuxs68IHTrJqsqujQfXGkhMOh8tstpXl86kBdRpzZn7GaDlTWcgeFSmsPw==", + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/electron/-/electron-2.0.12.tgz", + "integrity": "sha512-mw8hoM/GPtFPP8FGiJcVNe8Rx63YJ7O8bf7McQj21HAvrXGAwReGFrpIe5xN6ec10fDXNSNyfzRucjFXtOtLcg==", "requires": { "@types/node": "^8.0.24", - "electron-download": "^4.1.0", + "electron-download": "^3.0.1", "extract-zip": "^1.0.3" } }, @@ -2907,38 +2902,33 @@ } }, "electron-download": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/electron-download/-/electron-download-4.1.1.tgz", - "integrity": "sha512-FjEWG9Jb/ppK/2zToP+U5dds114fM1ZOJqMAR4aXXL5CvyPE9fiqBK/9YcwC9poIFQTEJk/EM/zyRwziziRZrg==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/electron-download/-/electron-download-3.3.0.tgz", + "integrity": "sha1-LP1U1pZsAZxNSa1l++Zcyc3vaMg=", "requires": { - "debug": "^3.0.0", - "env-paths": "^1.0.0", - "fs-extra": "^4.0.1", + "debug": "^2.2.0", + "fs-extra": "^0.30.0", + "home-path": "^1.0.1", "minimist": "^1.2.0", - "nugget": "^2.0.1", - "path-exists": "^3.0.0", - "rc": "^1.2.1", - "semver": "^5.4.1", - "sumchecker": "^2.0.2" + "nugget": "^2.0.0", + "path-exists": "^2.1.0", + "rc": "^1.1.2", + "semver": "^5.3.0", + "sumchecker": "^1.2.0" }, "dependencies": { - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "requires": { - "ms": "^2.1.1" - } - }, "minimist": { "version": "1.2.0", "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "requires": { + "pinkie-promise": "^2.0.0" + } } } }, @@ -3173,11 +3163,6 @@ "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=" }, - "env-paths": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-1.0.0.tgz", - "integrity": "sha1-QWgTO0K7BcOKNbGuQ5fIKYqzaeA=" - }, "errno": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", @@ -3554,11 +3539,6 @@ "schema-utils": "^0.4.5" } }, - "file-saver": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/file-saver/-/file-saver-2.0.0.tgz", - "integrity": "sha512-cYM1ic5DAkg25pHKgi5f10ziAM7RJU37gaH1XQlyNDrtUnzhC/dfoV9zf2OmF0RMKi42jG5B0JWBnPQqyj/G6g==" - }, "fill-range": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", @@ -3740,13 +3720,13 @@ "mysql": "^2.15.0", "node-fetch": "^1.7.3", "node-sass": "^4.7.2", - "nodemailer": "^4.7.0", "nunjucks": "^3.1.0", "octicons": "^7.2.0", "passport": "^0.4.0", "passport-jwt": "^4.0.0", "puppeteer": "^1.2.0", "sass-loader": "^7.0.3", + "sharp": "^0.20.8", "showdown": "^1.8.6", "socket.io": "^2.0.4", "sqlite3": "^4.0.2", @@ -3758,78 +3738,6 @@ "webpack": "^4.16.1", "webpack-dev-server": "^3.1.4", "webpack-hot-middleware": "^2.22.3" - }, - "dependencies": { - "electron": { - "version": "2.0.12", - "resolved": "https://registry.npmjs.org/electron/-/electron-2.0.12.tgz", - "integrity": "sha512-mw8hoM/GPtFPP8FGiJcVNe8Rx63YJ7O8bf7McQj21HAvrXGAwReGFrpIe5xN6ec10fDXNSNyfzRucjFXtOtLcg==", - "requires": { - "@types/node": "^8.0.24", - "electron-download": "^3.0.1", - "extract-zip": "^1.0.3" - }, - "dependencies": { - "electron-download": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/electron-download/-/electron-download-3.3.0.tgz", - "integrity": "sha1-LP1U1pZsAZxNSa1l++Zcyc3vaMg=", - "requires": { - "debug": "^2.2.0", - "fs-extra": "^0.30.0", - "home-path": "^1.0.1", - "minimist": "^1.2.0", - "nugget": "^2.0.0", - "path-exists": "^2.1.0", - "rc": "^1.1.2", - "semver": "^5.3.0", - "sumchecker": "^1.2.0" - } - } - } - }, - "fs-extra": { - "version": "0.30.0", - "resolved": "http://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", - "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^2.1.0", - "klaw": "^1.0.0", - "path-is-absolute": "^1.0.0", - "rimraf": "^2.2.8" - } - }, - "jsonfile": { - "version": "2.4.0", - "resolved": "http://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", - "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "minimist": { - "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" - }, - "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", - "requires": { - "pinkie-promise": "^2.0.0" - } - }, - "sumchecker": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/sumchecker/-/sumchecker-1.3.1.tgz", - "integrity": "sha1-ebs7RFbdBPGOvbwNcDodHa7FEF0=", - "requires": { - "debug": "^2.2.0", - "es6-promise": "^4.0.5" - } - } } }, "fresh": { @@ -3896,13 +3804,15 @@ "integrity": "sha512-2QY5eeqVv4m2PfyMiEuy9adxNP+ajf+8AR05cEi+OAzPcOj90hvFImeZhTmKLBgSd9EvG33jsD7ZRxsx9dThkQ==" }, "fs-extra": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz", - "integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==", + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", + "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", "requires": { "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" + "jsonfile": "^2.1.0", + "klaw": "^1.0.0", + "path-is-absolute": "^1.0.0", + "rimraf": "^2.2.8" } }, "fs-extra-p": { @@ -5462,9 +5372,9 @@ "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=" }, "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "version": "2.4.0", + "resolved": "http://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", "requires": { "graceful-fs": "^4.1.6" } @@ -5689,11 +5599,6 @@ "resolved": "https://registry.npmjs.org/lodash.tail/-/lodash.tail-4.1.1.tgz", "integrity": "sha1-0jM6NtnncXyK0vfKyv7HwytERmQ=" }, - "lodash.throttle": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz", - "integrity": "sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ=" - }, "loglevel": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.6.1.tgz", @@ -5774,11 +5679,6 @@ "object-visit": "^1.0.0" } }, - "material-colors": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/material-colors/-/material-colors-1.2.6.tgz", - "integrity": "sha512-6qE4B9deFBIa9YSpOc9O0Sgc43zTeVYbgDT5veRKSlB2+ZuHNoVVxA1L/ckMUayV9Ay9y7Z/SZCLcGteW9i7bg==" - }, "md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", @@ -6257,23 +6157,23 @@ } }, "tar": { - "version": "4.4.8", - "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.8.tgz", - "integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==", + "version": "4.4.6", + "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.6.tgz", + "integrity": "sha512-tMkTnh9EdzxyfW+6GK6fCahagXsnYk6kE6S9Gr9pjVdys769+laCTbodXDhPAjzVtEBazRgP0gYqOjnk9dQzLg==", "requires": { - "chownr": "^1.1.1", + "chownr": "^1.0.1", "fs-minipass": "^1.2.5", - "minipass": "^2.3.4", - "minizlib": "^1.1.1", + "minipass": "^2.3.3", + "minizlib": "^1.1.0", "mkdirp": "^0.5.0", "safe-buffer": "^5.1.2", "yallist": "^3.0.2" } }, "yallist": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.2.tgz", + "integrity": "sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k=" } } }, @@ -6314,11 +6214,6 @@ } } }, - "nodemailer": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-4.7.0.tgz", - "integrity": "sha512-IludxDypFpYw4xpzKdMAozBSkzKHmNBvGanUREjJItgJ2NYcK/s8+PggVhj7c2yGFQykKsnnmv1+Aqo0ZfjHmw==" - }, "noop-logger": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz", @@ -8028,6 +7923,49 @@ } } }, + "sharp": { + "version": "0.20.8", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.20.8.tgz", + "integrity": "sha512-A8NaPGWRDKpmHTi8sl2xzozYXhTQWBb/GaJ8ZPU7L/vKW8wVvd4Yq+isJ0c7p9sX5gnjPQcM3eOfHuvvnZ2fOQ==", + "requires": { + "color": "^3.0.0", + "detect-libc": "^1.0.3", + "fs-copy-file-sync": "^1.1.1", + "nan": "^2.11.0", + "npmlog": "^4.1.2", + "prebuild-install": "^4.0.0", + "semver": "^5.5.1", + "simple-get": "^2.8.1", + "tar": "^4.4.6", + "tunnel-agent": "^0.6.0" + }, + "dependencies": { + "nan": { + "version": "2.11.1", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.11.1.tgz", + "integrity": "sha512-iji6k87OSXa0CcrLl9z+ZiYSuR2o+c0bGuNmXdrhTQTakxytAFsC56SArGYoiHlJlFoHSnvmhpceZJaXkVuOtA==" + }, + "tar": { + "version": "4.4.6", + "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.6.tgz", + "integrity": "sha512-tMkTnh9EdzxyfW+6GK6fCahagXsnYk6kE6S9Gr9pjVdys769+laCTbodXDhPAjzVtEBazRgP0gYqOjnk9dQzLg==", + "requires": { + "chownr": "^1.0.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.3.3", + "minizlib": "^1.1.0", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.2" + } + }, + "yallist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.2.tgz", + "integrity": "sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k=" + } + } + }, "shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", @@ -8521,9 +8459,9 @@ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" }, "sqlite3": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-4.0.4.tgz", - "integrity": "sha512-CO8vZMyUXBPC+E3iXOCc7Tz2pAdq5BWfLcQmOokCOZW5S5sZ/paijiPOCdvzpdP83RroWHYa5xYlVqCxSqpnQg==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-4.0.2.tgz", + "integrity": "sha512-51ferIRwYOhzUEtogqOa/y9supADlAht98bF/gbIi6WkzRJX6Yioldxbzj1MV4yV+LgdKD/kkHwFTeFXOG4htA==", "requires": { "nan": "~2.10.0", "node-pre-gyp": "^0.10.3", @@ -8694,11 +8632,12 @@ "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" }, "sumchecker": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/sumchecker/-/sumchecker-2.0.2.tgz", - "integrity": "sha1-D0LBDl0F2l1C7qPlbDOZo31sWz4=", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/sumchecker/-/sumchecker-1.3.1.tgz", + "integrity": "sha1-ebs7RFbdBPGOvbwNcDodHa7FEF0=", "requires": { - "debug": "^2.2.0" + "debug": "^2.2.0", + "es6-promise": "^4.0.5" } }, "supports-color": { @@ -8808,11 +8747,6 @@ "setimmediate": "^1.0.4" } }, - "tinycolor2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.4.1.tgz", - "integrity": "sha1-9PrTM0R7wLB9TcjpIJ2POaisd+g=" - }, "to-array": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/to-array/-/to-array-0.1.4.tgz", @@ -9314,17 +9248,6 @@ "resolved": "https://registry.npmjs.org/vue/-/vue-2.5.17.tgz", "integrity": "sha512-mFbcWoDIJi0w0Za4emyLiW72Jae0yjANHbCVquMKijcavBGypqlF7zHRgMa5k4sesdv7hv2rB4JPdZfR+TPfhQ==" }, - "vue-color": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/vue-color/-/vue-color-2.7.0.tgz", - "integrity": "sha512-fak9oPRL3BsYtakTGmWIS2yNRppRYNlMgGGq78CMH34ipU8fLgi/bT9JiSPcscpdTNLGracuOFuZ8OFeml+SQQ==", - "requires": { - "clamp": "^1.0.1", - "lodash.throttle": "^4.0.0", - "material-colors": "^1.0.0", - "tinycolor2": "^1.1.2" - } - }, "vue-flatpickr-component": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/vue-flatpickr-component/-/vue-flatpickr-component-7.0.6.tgz", @@ -9876,4 +9799,4 @@ "integrity": "sha1-AI4G2AlDIMNy28L47XagymyKxBk=" } } -} \ No newline at end of file +} diff --git a/package.json b/package.json index 57b44715..64dac8f0 100644 --- a/package.json +++ b/package.json @@ -52,22 +52,15 @@ "scripts": { "test": "mocha tests", "start": "frappe start", - "electron": "ELECTRON=true frappe start electron", + "electron": "cross-env ELECTRON=true frappe start electron", "pack-electron": "cross-env NODE_ENV=production ELECTRON=true frappe build electron", "build-electron": "npm run pack-electron && electron-builder", "postinstall": "electron-builder install-app-deps" }, "dependencies": { "cross-env": "^5.2.0", - "file-saver": "^2.0.0", "frappejs": "github:frappe/frappejs", - "nodemailer": "^4.7.0", "popper.js": "^1.14.4", - "sharp": "^0.21.3", - "vue-color": "^2.7.0", "vue-toasted": "^1.1.25" - }, - "devDependencies": { - "electron-rebuild": "^1.8.4" } } diff --git a/reports/AccountsReceivablePayable/AccountsReceivablePayable.js b/reports/AccountsReceivablePayable/AccountsReceivablePayable.js index fa628931..4c0b7ce6 100644 --- a/reports/AccountsReceivablePayable/AccountsReceivablePayable.js +++ b/reports/AccountsReceivablePayable/AccountsReceivablePayable.js @@ -29,6 +29,7 @@ async function getReceivablePayable({ reportType = 'Receivable', date }) { let data = []; for (let entry of validEntries) { + // console.log(entry); const { outStandingAmount, creditNoteAmount } = getOutstandingAmount(entry); diff --git a/reports/BankReconciliation/BankReconciliation.js b/reports/BankReconciliation/BankReconciliation.js deleted file mode 100644 index f87e2c41..00000000 --- a/reports/BankReconciliation/BankReconciliation.js +++ /dev/null @@ -1,42 +0,0 @@ -const frappe = require('frappejs'); - -class BankReconciliation { - async run(params) { - const filters = {}; - if (params.paymentAccount) filters.paymentAccount = params.paymentAccount; - if (params.party) filters.party = params.party; - // if (params.referenceType) filters.referenceType = params.referenceType; - // if (params.referenceName) filters.referenceName = params.referenceName; - if (params.toDate || params.fromDate) { - filters.date = []; - if (params.toDate) filters.date.push('<=', params.toDate); - if (params.fromDate) filters.date.push('>=', params.fromDate); - } - - let data = await frappe.db.getAll({ - doctype: 'Payment', - fields: ['date', 'account', 'paymentAccount', 'party', 'name', 'referenceDate','clearanceDate'], - filters: filters, - }); - - for (var i = 0; i < data.length; i++) { - let ledger = await frappe.db.getAll({ - doctype: 'AccountingLedgerEntry', - fields: ['date', 'referenceType', 'referenceName', 'debit', 'credit'], - filters: { - referenceType: 'Payment', - account: data[i].paymentAccount, - referenceName: data[i].name - } - }) - data[i].credit = ledger[0].credit; - data[i].debit = ledger[0].debit; - data[i].referenceName = ledger[0].referenceName; - data[i].referenceType = ledger[0].referenceType; - } - - return data; - } -} - -module.exports = BankReconciliation; diff --git a/reports/BankReconciliation/BankReconciliationView.js b/reports/BankReconciliation/BankReconciliationView.js deleted file mode 100644 index 6c0ec972..00000000 --- a/reports/BankReconciliation/BankReconciliationView.js +++ /dev/null @@ -1,80 +0,0 @@ -const ReportPage = require('frappejs/client/desk/reportpage'); -const frappe = require('frappejs'); - -module.exports = class BankReconciliationView extends ReportPage { - constructor() { - super({ - title: frappe._('Bank Reconciliation'), - filterFields: [{ - fieldtype: 'Link', - target: 'Account', - label: 'Payment Account' - }, - { - fieldtype: 'Link', - target: 'Party', - label: 'Party' - }, - { - fieldtype: 'Date', - label: 'From Date' - }, - { - fieldtype: 'Date', - label: 'To Date' - } - ] - }); - - this.method = 'bank-reconciliation'; - } - - getColumns() { - return [{ - label: 'Posting Date', - fieldtype: 'Date', - fieldname: 'date' - }, - { - label: 'Payment Account', - fieldtype: 'Link' - }, - { - label: 'Debit', - fieldtype: 'Currency' - }, - { - label: 'Credit', - fieldtype: 'Currency' - }, - { - label: 'Balance', - fieldtype: 'Currency' - }, - { - label: 'Ref. Type', - fieldtype: 'Data', - fieldname: 'referenceType' - }, - { - label: 'Ref. Name', - fieldtype: 'Data', - fieldname: 'referenceName' - }, - { - label: 'Ref. Date', - fieldtype: 'Date', - fieldname: 'referenceDate' - }, - { - label: 'Clearance Date', - fieldtype: 'Date', - fieldname: 'clearanceDate' - }, - { - label: 'Party', - fieldtype: 'Link' - } - ]; - } -}; diff --git a/reports/BankReconciliation/viewConfig.js b/reports/BankReconciliation/viewConfig.js deleted file mode 100644 index 6fc88d23..00000000 --- a/reports/BankReconciliation/viewConfig.js +++ /dev/null @@ -1,76 +0,0 @@ -const title = 'Bank Reconciliation'; -module.exports = { - title: title, - method: 'bank-reconciliation', - filterFields: [{ - fieldtype: 'Link', - target: 'Account', - label: 'Payement Account', - fieldname: 'paymentAccount' - }, - { - fieldtype: 'Link', - target: 'Party', - label: 'Party', - fieldname: 'party' - }, - { - fieldtype: 'Date', - label: 'From Date', - fieldname: 'fromDate' - }, - { - fieldtype: 'Date', - label: 'To Date', - fieldname: 'toDate' - } - ], - getColumns() { - return [{ - label: 'Posting Date', - fieldtype: 'Date', - fieldname: 'date' - }, - { - label: 'Payment Account', - fieldtype: 'Link' - }, - { - label: 'Debit', - fieldtype: 'Currency' - }, - { - label: 'Credit', - fieldtype: 'Currency' - }, - { - label: 'Balance', - fieldtype: 'Currency' - }, - { - label: 'Ref. Type', - fieldtype: 'Data', - fieldname: 'referenceType' - }, - { - label: 'Ref. Name', - fieldtype: 'Data', - fieldname: 'referenceName' - }, - { - label: 'Ref. Date', - fieldtype: 'Date', - fieldname: 'referenceDate' - }, - { - label: 'Clearance Date', - fieldtype: 'Date', - fieldname: 'clearanceDate' - }, - { - label: 'Party', - fieldtype: 'Link' - } - ]; - } -}; diff --git a/reports/GeneralLedger/GeneralLedger.js b/reports/GeneralLedger/GeneralLedger.js index b203f4d6..722d7045 100644 --- a/reports/GeneralLedger/GeneralLedger.js +++ b/reports/GeneralLedger/GeneralLedger.js @@ -12,6 +12,7 @@ class GeneralLedger { if (params.toDate) filters.date.push('<=', params.toDate); if (params.fromDate) filters.date.push('>=', params.fromDate); } + let data = await frappe.db.getAll({ doctype: 'AccountingLedgerEntry', fields: ['date', 'account', 'party', 'referenceType', 'referenceName', 'debit', 'credit'], diff --git a/reports/GeneralLedger/GeneralLedgerView.js b/reports/GeneralLedger/GeneralLedgerView.js index 6338112b..0fd85946 100644 --- a/reports/GeneralLedger/GeneralLedgerView.js +++ b/reports/GeneralLedger/GeneralLedgerView.js @@ -5,7 +5,8 @@ module.exports = class GeneralLedgerView extends ReportPage { constructor() { super({ title: frappe._('General Ledger'), - filterFields: [{ + filterFields: [ + { fieldtype: 'Select', options: ['', 'Invoice', 'Payment'], label: 'Reference Type', @@ -42,42 +43,16 @@ module.exports = class GeneralLedgerView extends ReportPage { } getColumns() { - return [{ - label: 'Date', - fieldtype: 'Date' - }, - { - label: 'Account', - fieldtype: 'Link' - }, - { - label: 'Debit', - fieldtype: 'Currency' - }, - { - label: 'Credit', - fieldtype: 'Currency' - }, - { - label: 'Balance', - fieldtype: 'Currency' - }, - { - label: 'Reference Type', - fieldtype: 'Data' - }, - { - label: 'Reference Name', - fieldtype: 'Data' - }, - { - label: 'Party', - fieldtype: 'Link' - }, - { - label: 'Description', - fieldtype: 'Data' - } + return [ + {label: 'Date', fieldtype: 'Date'}, + {label: 'Account', fieldtype: 'Link'}, + {label: 'Debit', fieldtype: 'Currency'}, + {label: 'Credit', fieldtype: 'Currency'}, + {label: 'Balance', fieldtype: 'Currency'}, + {label: 'Reference Type', fieldtype: 'Data'}, + {label: 'Reference Name', fieldtype: 'Data'}, + {label: 'Party', fieldtype: 'Link'}, + {label: 'Description', fieldtype: 'Data'} ]; } }; diff --git a/reports/GeneralLedger/viewConfig.js b/reports/GeneralLedger/viewConfig.js index bec82bba..38c41764 100644 --- a/reports/GeneralLedger/viewConfig.js +++ b/reports/GeneralLedger/viewConfig.js @@ -2,7 +2,8 @@ const title = 'General Ledger'; module.exports = { title: title, method: 'general-ledger', - filterFields: [{ + filterFields: [ + { fieldtype: 'Select', options: ['', 'Invoice', 'Payment'], label: 'Reference Type', @@ -14,66 +15,22 @@ module.exports = { label: 'Reference Name', fieldname: 'referenceName' }, - { - fieldtype: 'Link', - target: 'Account', - label: 'Account', - fieldname: 'account' - }, - { - fieldtype: 'Link', - target: 'Party', - label: 'Party', - fieldname: 'party' - }, - { - fieldtype: 'Date', - label: 'From Date', - fieldname: 'fromDate' - }, - { - fieldtype: 'Date', - label: 'To Date', - fieldname: 'toDate' - } + { fieldtype: 'Link', target: 'Account', label: 'Account', fieldname: 'account' }, + { fieldtype: 'Link', target: 'Party', label: 'Party', fieldname: 'party' }, + { fieldtype: 'Date', label: 'From Date', fieldname: 'fromDate' }, + { fieldtype: 'Date', label: 'To Date', fieldname: 'toDate' } ], getColumns() { - return [{ - label: 'Date', - fieldtype: 'Date' - }, - { - label: 'Account', - fieldtype: 'Link' - }, - { - label: 'Debit', - fieldtype: 'Currency' - }, - { - label: 'Credit', - fieldtype: 'Currency' - }, - { - label: 'Balance', - fieldtype: 'Currency' - }, - { - label: 'Reference Type', - fieldtype: 'Data' - }, - { - label: 'Reference Name', - fieldtype: 'Data' - }, - { - label: 'Party', - fieldtype: 'Link' - }, - { - label: 'Description', - fieldtype: 'Data' - } + return [ + { label: 'Date', fieldtype: 'Date' }, + { label: 'Account', fieldtype: 'Link' }, + { label: 'Debit', fieldtype: 'Currency' }, + { label: 'Credit', fieldtype: 'Currency' }, + { label: 'Balance', fieldtype: 'Currency' }, + { label: 'Reference Type', fieldtype: 'Data' }, + { label: 'Reference Name', fieldtype: 'Data' }, + { label: 'Party', fieldtype: 'Link' }, + { label: 'Description', fieldtype: 'Data' } ]; } }; diff --git a/reports/GoodsAndServiceTax/GoodsAndServiceTax.js b/reports/GoodsAndServiceTax/GoodsAndServiceTax.js deleted file mode 100644 index 88bbff61..00000000 --- a/reports/GoodsAndServiceTax/GoodsAndServiceTax.js +++ /dev/null @@ -1,59 +0,0 @@ -const frappe = require('frappejs'); - -class GoodsAndServiceTax { - async run(params) { - let filters = {}; - if (params.toDate || params.fromDate) { - filters.date = []; - if (params.toDate) filters.date.push('<=', params.toDate); - if (params.fromDate) filters.date.push('>=', params.fromDate); - } - if (params.transferType) filters.transferType = params.transferType; - - let invoiceNames = await frappe.db.getAll({ - doctype: 'Invoice', - filter: filters - }); - - let tableData = []; - for (let invoice of invoiceNames) { - const row = await this.getRow(invoice.name) - tableData.push(row) - } - - if(Object.keys(filters).length != 0){ - tableData = tableData.filter((row) => { - if(filters.account) return row.account === filters.account - if(filters.transferType) return row.transferType === filters.transferType - if(filters.place) return row.place === filters.place - return true - }) - } - - return tableData; - } - - async getRow(name) { - let row = {} - let invoiceDetails = await frappe.getDoc('Invoice', name); - let customerDetails = await frappe.getDoc('Party', invoiceDetails.customer); - let addressDetails = await frappe.getDoc('Address', customerDetails.address); - row.gstin = customerDetails.gstin - row.cusName = invoiceDetails.customer - row.invNo = invoiceDetails.name - row.invDate = invoiceDetails.date - row.place = addressDetails.state - row.rate = 0 - row.transferType = 'In State'; - invoiceDetails.taxes.forEach(tax => { - row.rate += tax.rate - if (tax.account === 'IGST') row.transferType = 'Out of State'; - }); - row.invAmt = invoiceDetails.grandTotal - row.taxAmt = invoiceDetails.netTotal - return row - } - -} - -module.exports = GoodsAndServiceTax; diff --git a/reports/GoodsAndServiceTax/GoodsAndServiceTaxView.js b/reports/GoodsAndServiceTax/GoodsAndServiceTaxView.js deleted file mode 100644 index 1d705096..00000000 --- a/reports/GoodsAndServiceTax/GoodsAndServiceTaxView.js +++ /dev/null @@ -1,74 +0,0 @@ -const ReportPage = require('frappejs/client/desk/reportpage'); -const frappe = require('frappejs'); - -module.exports = class GoodsAndServiceTaxView extends ReportPage { - constructor() { - super({ - title: frappe._('Goods and Service Tax'), - filterFields: [ - { - fieldtype: 'Data', - label: 'Transfer Type' - }, - { - fieldtype: 'Data', - label: 'Place' - }, - { - fieldtype: 'Date', - label: 'From Date' - }, - { - fieldtype: 'Date', - label: 'To Date' - } - ] - }); - - this.method = 'gst-taxes'; - } - - getColumns() { - return [{ - label: 'GSTIN No.', - fieldname: 'gstin', - fieldtype: 'Data' - }, - { - fieldtype: 'Data', - fieldname: 'cusName', - label: 'Customer Name' - }, - { - label: 'Invoice No.', - fieldname: 'invNo', - fieldtype: 'Data' - }, - { - label: 'Invoice Value', - fieldname: 'invAmt', - fieldtype: 'Data' - }, - { - label: 'Invoice Date', - fieldname: 'invDate', - fieldtype: 'Date' - }, - { - label: 'Place of supply', - fieldname: 'place', - fieldtype: 'Data' - }, - { - label: 'Rate', - fieldname: 'rate', - fieldtype: 'Data' - }, - { - label: 'Taxable Amount', - fieldname: 'taxAmt', - fieldtype: 'Data' - } - ]; - } -}; diff --git a/reports/GoodsAndServiceTax/viewConfig.js b/reports/GoodsAndServiceTax/viewConfig.js deleted file mode 100644 index 924aca9a..00000000 --- a/reports/GoodsAndServiceTax/viewConfig.js +++ /dev/null @@ -1,69 +0,0 @@ -const title = 'Goods and Service Tax'; -module.exports = { - title: title, - method: 'gst-taxes', - filterFields: [{ - fieldtype: 'Data', - label: 'Transfer Type', - fieldname: 'transferType' - }, - { - fieldtype: 'Data', - label: 'Place', - fieldname: 'place' - }, - { - fieldtype: 'Date', - label: 'From Date', - fieldname: 'fromDate' - }, - { - fieldtype: 'Date', - label: 'To Date', - fieldname: 'toDate' - }], - - getColumns() { - return [{ - label: 'GSTIN No.', - fieldname: 'gstin', - fieldtype: 'Data' - }, - { - fieldtype: 'Data', - fieldname: 'cusName', - label: 'Customer Name' - }, - { - label: 'Invoice No.', - fieldname: 'invNo', - fieldtype: 'Data' - }, - { - label: 'Invoice Value', - fieldname: 'invAmt', - fieldtype: 'Data' - }, - { - label: 'Invoice Date', - fieldname: 'invDate', - fieldtype: 'Date' - }, - { - label: 'Place of supply', - fieldname: 'place', - fieldtype: 'Data' - }, - { - label: 'Rate', - fieldname: 'rate', - fieldtype: 'Data' - }, - { - label: 'Taxable Amount', - fieldname: 'taxAmt', - fieldtype: 'Data' - } - ]; - } -}; \ No newline at end of file diff --git a/reports/index.js b/reports/index.js index b4718eaa..385b8551 100644 --- a/reports/index.js +++ b/reports/index.js @@ -5,13 +5,12 @@ const BalanceSheet = require('./BalanceSheet/BalanceSheet'); const TrialBalance = require('./TrialBalance/TrialBalance'); const SalesRegister = require('./SalesRegister/SalesRegister'); const PurchaseRegister = require('./PurchaseRegister/PurchaseRegister'); -const BankReconciliation = require('./BankReconciliation/BankReconciliation'); -const GoodsAndServiceTax = require('./GoodsAndServiceTax/GoodsAndServiceTax'); const AccountsReceivablePayable = require('./AccountsReceivablePayable/AccountsReceivablePayable'); // called on server side function registerReportMethods() { - const reports = [{ + const reports = [ + { method: 'general-ledger', class: GeneralLedger }, @@ -34,15 +33,7 @@ function registerReportMethods() { { method: 'purchase-register', class: PurchaseRegister - }, - { - method: 'bank-reconciliation', - class: BankReconciliation - }, - { - method: 'gst-taxes', - class: GoodsAndServiceTax - }, + } ]; reports.forEach(report => { diff --git a/reports/view.js b/reports/view.js index e70cbcaf..fed283d4 100644 --- a/reports/view.js +++ b/reports/view.js @@ -2,7 +2,5 @@ module.exports = { 'general-ledger': require('./GeneralLedger/viewConfig'), 'sales-register': require('./SalesRegister/viewConfig'), 'profit-and-loss': require('./ProfitAndLoss/viewConfig'), - 'trial-balance': require('./TrialBalance/viewConfig'), - 'bank-reconciliation': require('./BankReconciliation/viewConfig'), - 'gst-taxes': require('./GoodsAndServiceTax/viewConfig'), + 'trial-balance': require('./TrialBalance/viewConfig') } diff --git a/server/registerServerMethods.js b/server/registerServerMethods.js index 5eed5ec1..436f6589 100644 --- a/server/registerServerMethods.js +++ b/server/registerServerMethods.js @@ -1,15 +1,9 @@ const frappe = require('frappejs'); const registerReportMethods = require('../reports'); -const sender = require('../email/sender'); module.exports = function registerServerMethods() { registerReportMethods(); - frappe.registerMethod({ - method: 'send-mail', - handler: sender.sendMail - }); - frappe.registerMethod({ method: 'import-coa', async handler() { @@ -25,7 +19,7 @@ module.exports = function registerServerMethods() { const path = require('path'); const { getPDFForElectron } = require('frappejs/server/pdf'); const { getSettings } = require('../electron/settings'); - const destination = path.resolve('.') + const destination = path.resolve(getSettings().dbPath, '..') getPDFForElectron(doctype, name, destination, html); } } diff --git a/src-electron/main.js b/src-electron/main.js index 7e0d0dca..6fb75ba9 100644 --- a/src-electron/main.js +++ b/src-electron/main.js @@ -1,7 +1,4 @@ -const { - app, - BrowserWindow -} = require('electron'); +const { app, BrowserWindow } = require('electron'); const setupMenu = require('./menu'); let mainWindow @@ -12,9 +9,7 @@ if (process.env.NODE_ENV !== 'development') { } if (process.env.NODE_ENV === 'development') { - const { - getAppConfig - } = require('frappejs/webpack/utils'); + const { getAppConfig } = require('frappejs/webpack/utils'); const appConfig = getAppConfig(); winURL = `http://localhost:${appConfig.dev.devServerPort}`; } else { @@ -25,7 +20,6 @@ function createWindow() { /** * Initial window options */ - mainWindow = new BrowserWindow({ width: 1024, height: 768, diff --git a/src/components/ExportWizard.vue b/src/components/ExportWizard.vue deleted file mode 100644 index e104028a..00000000 --- a/src/components/ExportWizard.vue +++ /dev/null @@ -1,113 +0,0 @@ - - - diff --git a/src/components/InvoiceCustomizer.vue b/src/components/InvoiceCustomizer.vue deleted file mode 100644 index 81fc40e5..00000000 --- a/src/components/InvoiceCustomizer.vue +++ /dev/null @@ -1,71 +0,0 @@ - - diff --git a/src/components/PageHeader.vue b/src/components/PageHeader.vue index a149bee1..fe51f1b6 100644 --- a/src/components/PageHeader.vue +++ b/src/components/PageHeader.vue @@ -6,7 +6,7 @@ diff --git a/src/pages/ChartOfAccounts/index.vue b/src/pages/ChartOfAccounts/index.vue deleted file mode 100644 index 4f6820b9..00000000 --- a/src/pages/ChartOfAccounts/index.vue +++ /dev/null @@ -1,50 +0,0 @@ - - diff --git a/src/pages/Email/EmailSend.vue b/src/pages/Email/EmailSend.vue deleted file mode 100644 index bb70a7e8..00000000 --- a/src/pages/Email/EmailSend.vue +++ /dev/null @@ -1,47 +0,0 @@ - - - \ No newline at end of file diff --git a/src/pages/Email/EmailSendActions.vue b/src/pages/Email/EmailSendActions.vue deleted file mode 100644 index 0a9f3ae0..00000000 --- a/src/pages/Email/EmailSendActions.vue +++ /dev/null @@ -1,25 +0,0 @@ - - \ No newline at end of file diff --git a/src/pages/FormView/FormView.vue b/src/pages/FormView/FormView.vue index 8f26394c..2e851635 100644 --- a/src/pages/FormView/FormView.vue +++ b/src/pages/FormView/FormView.vue @@ -1,5 +1,6 @@