mirror of
https://github.com/frappe/books.git
synced 2025-02-08 15:08:29 +00:00
refactor: rename imports, frappejs → frappe
This commit is contained in:
parent
f602caff81
commit
cc09847337
@ -1,6 +1,6 @@
|
|||||||
import { showMessageDialog } from '@/utils';
|
import { showMessageDialog } from '@/utils';
|
||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
import { _ } from 'frappejs/utils';
|
import { _ } from 'frappe/utils';
|
||||||
import { DateTime } from 'luxon';
|
import { DateTime } from 'luxon';
|
||||||
import { exportCsv, saveExportData } from '../reports/commonExporter';
|
import { exportCsv, saveExportData } from '../reports/commonExporter';
|
||||||
import { getSavePath } from '../src/utils';
|
import { getSavePath } from '../src/utils';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
import countries from '../fixtures/countryInfo.json';
|
import countries from '../fixtures/countryInfo.json';
|
||||||
import standardCOA from '../fixtures/verified/standardCOA.json';
|
import standardCOA from '../fixtures/verified/standardCOA.json';
|
||||||
const accountFields = ['accountType', 'accountNumber', 'rootType', 'isGroup'];
|
const accountFields = ['accountType', 'accountNumber', 'rootType', 'isGroup'];
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
|
|
||||||
export default class LedgerPosting {
|
export default class LedgerPosting {
|
||||||
constructor({ reference, party, date, description }) {
|
constructor({ reference, party, date, description }) {
|
||||||
|
@ -1,173 +1,173 @@
|
|||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
const _ = frappe._.bind(frappe);
|
const _ = frappe._.bind(frappe);
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
[_("Application of Funds (Assets)")]: {
|
[_('Application of Funds (Assets)')]: {
|
||||||
[_("Current Assets")]: {
|
[_('Current Assets')]: {
|
||||||
[_("Accounts Receivable")]: {
|
[_('Accounts Receivable')]: {
|
||||||
[_("Debtors")]: {
|
[_('Debtors')]: {
|
||||||
"accountType": "Receivable"
|
accountType: 'Receivable',
|
||||||
}
|
|
||||||
},
|
|
||||||
[_("Bank Accounts")]: {
|
|
||||||
"accountType": "Bank",
|
|
||||||
"isGroup": 1
|
|
||||||
},
|
|
||||||
[_("Cash In Hand")]: {
|
|
||||||
[_("Cash")]: {
|
|
||||||
"accountType": "Cash"
|
|
||||||
},
|
|
||||||
"accountType": "Cash"
|
|
||||||
},
|
|
||||||
[_("Loans and Advances (Assets)")]: {
|
|
||||||
"isGroup": 1
|
|
||||||
},
|
|
||||||
[_("Securities and Deposits")]: {
|
|
||||||
[_("Earnest Money")]: {}
|
|
||||||
},
|
|
||||||
[_("Stock Assets")]: {
|
|
||||||
[_("Stock In Hand")]: {
|
|
||||||
"accountType": "Stock"
|
|
||||||
},
|
|
||||||
"accountType": "Stock",
|
|
||||||
},
|
|
||||||
[_("Tax Assets")]: {
|
|
||||||
"isGroup": 1
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
[_("Fixed Assets")]: {
|
},
|
||||||
[_("Capital Equipments")]: {
|
[_('Bank Accounts')]: {
|
||||||
"accountType": "Fixed Asset"
|
accountType: 'Bank',
|
||||||
},
|
isGroup: 1,
|
||||||
[_("Electronic Equipments")]: {
|
},
|
||||||
"accountType": "Fixed Asset"
|
[_('Cash In Hand')]: {
|
||||||
},
|
[_('Cash')]: {
|
||||||
[_("Furnitures and Fixtures")]: {
|
accountType: 'Cash',
|
||||||
"accountType": "Fixed Asset"
|
|
||||||
},
|
|
||||||
[_("Office Equipments")]: {
|
|
||||||
"accountType": "Fixed Asset"
|
|
||||||
},
|
|
||||||
[_("Plants and Machineries")]: {
|
|
||||||
"accountType": "Fixed Asset"
|
|
||||||
},
|
|
||||||
[_("Buildings")]: {
|
|
||||||
"accountType": "Fixed Asset"
|
|
||||||
},
|
|
||||||
[_("Softwares")]: {
|
|
||||||
"accountType": "Fixed Asset"
|
|
||||||
},
|
|
||||||
[_("Accumulated Depreciation")]: {
|
|
||||||
"accountType": "Accumulated Depreciation"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
[_("Investments")]: {
|
accountType: 'Cash',
|
||||||
"isGroup": 1
|
},
|
||||||
|
[_('Loans and Advances (Assets)')]: {
|
||||||
|
isGroup: 1,
|
||||||
|
},
|
||||||
|
[_('Securities and Deposits')]: {
|
||||||
|
[_('Earnest Money')]: {},
|
||||||
|
},
|
||||||
|
[_('Stock Assets')]: {
|
||||||
|
[_('Stock In Hand')]: {
|
||||||
|
accountType: 'Stock',
|
||||||
},
|
},
|
||||||
[_("Temporary Accounts")]: {
|
accountType: 'Stock',
|
||||||
[_("Temporary Opening")]: {
|
},
|
||||||
"accountType": "Temporary"
|
[_('Tax Assets')]: {
|
||||||
}
|
isGroup: 1,
|
||||||
},
|
},
|
||||||
"rootType": "Asset"
|
|
||||||
},
|
},
|
||||||
[_("Expenses")]: {
|
[_('Fixed Assets')]: {
|
||||||
[_("Direct Expenses")]: {
|
[_('Capital Equipments')]: {
|
||||||
[_("Stock Expenses")]: {
|
accountType: 'Fixed Asset',
|
||||||
[_("Cost of Goods Sold")]: {
|
},
|
||||||
"accountType": "Cost of Goods Sold"
|
[_('Electronic Equipments')]: {
|
||||||
},
|
accountType: 'Fixed Asset',
|
||||||
[_("Expenses Included In Valuation")]: {
|
},
|
||||||
"accountType": "Expenses Included In Valuation"
|
[_('Furnitures and Fixtures')]: {
|
||||||
},
|
accountType: 'Fixed Asset',
|
||||||
[_("Stock Adjustment")]: {
|
},
|
||||||
"accountType": "Stock Adjustment"
|
[_('Office Equipments')]: {
|
||||||
}
|
accountType: 'Fixed Asset',
|
||||||
},
|
},
|
||||||
},
|
[_('Plants and Machineries')]: {
|
||||||
[_("Indirect Expenses")]: {
|
accountType: 'Fixed Asset',
|
||||||
[_("Administrative Expenses")]: {},
|
},
|
||||||
[_("Commission on Sales")]: {},
|
[_('Buildings')]: {
|
||||||
[_("Depreciation")]: {
|
accountType: 'Fixed Asset',
|
||||||
"accountType": "Depreciation"
|
},
|
||||||
},
|
[_('Softwares')]: {
|
||||||
[_("Entertainment Expenses")]: {},
|
accountType: 'Fixed Asset',
|
||||||
[_("Freight and Forwarding Charges")]: {
|
},
|
||||||
"accountType": "Chargeable"
|
[_('Accumulated Depreciation')]: {
|
||||||
},
|
accountType: 'Accumulated Depreciation',
|
||||||
[_("Legal Expenses")]: {},
|
},
|
||||||
[_("Marketing Expenses")]: {
|
|
||||||
"accountType": "Chargeable"
|
|
||||||
},
|
|
||||||
[_("Miscellaneous Expenses")]: {
|
|
||||||
"accountType": "Chargeable"
|
|
||||||
},
|
|
||||||
[_("Office Maintenance Expenses")]: {},
|
|
||||||
[_("Office Rent")]: {},
|
|
||||||
[_("Postal Expenses")]: {},
|
|
||||||
[_("Print and Stationery")]: {},
|
|
||||||
[_("Round Off")]: {
|
|
||||||
"accountType": "Round Off"
|
|
||||||
},
|
|
||||||
[_("Salary")]: {},
|
|
||||||
[_("Sales Expenses")]: {},
|
|
||||||
[_("Telephone Expenses")]: {},
|
|
||||||
[_("Travel Expenses")]: {},
|
|
||||||
[_("Utility Expenses")]: {},
|
|
||||||
[_("Write Off")]: {},
|
|
||||||
[_("Exchange Gain/Loss")]: {},
|
|
||||||
[_("Gain/Loss on Asset Disposal")]: {}
|
|
||||||
},
|
|
||||||
"rootType": "Expense"
|
|
||||||
},
|
},
|
||||||
[_("Income")]: {
|
[_('Investments')]: {
|
||||||
[_("Direct Income")]: {
|
isGroup: 1,
|
||||||
[_("Sales")]: {},
|
|
||||||
[_("Service")]: {}
|
|
||||||
},
|
|
||||||
[_("Indirect Income")]: {
|
|
||||||
"isGroup": 1
|
|
||||||
},
|
|
||||||
"rootType": "Income"
|
|
||||||
},
|
},
|
||||||
[_("Source of Funds (Liabilities)")]: {
|
[_('Temporary Accounts')]: {
|
||||||
[_("Current Liabilities")]: {
|
[_('Temporary Opening')]: {
|
||||||
[_("Accounts Payable")]: {
|
accountType: 'Temporary',
|
||||||
[_("Creditors")]: {
|
},
|
||||||
"accountType": "Payable"
|
|
||||||
},
|
|
||||||
[_("Payroll Payable")]: {},
|
|
||||||
},
|
|
||||||
[_("Stock Liabilities")]: {
|
|
||||||
[_("Stock Received But Not Billed")]: {
|
|
||||||
"accountType": "Stock Received But Not Billed"
|
|
||||||
},
|
|
||||||
},
|
|
||||||
[_("Duties and Taxes")]: {
|
|
||||||
"accountType": "Tax",
|
|
||||||
"isGroup": 1
|
|
||||||
},
|
|
||||||
[_("Loans (Liabilities)")]: {
|
|
||||||
[_("Secured Loans")]: {},
|
|
||||||
[_("Unsecured Loans")]: {},
|
|
||||||
[_("Bank Overdraft Account")]: {},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"rootType": "Liability"
|
|
||||||
},
|
},
|
||||||
[_("Equity")]: {
|
rootType: 'Asset',
|
||||||
[_("Capital Stock")]: {
|
},
|
||||||
"accountType": "Equity"
|
[_('Expenses')]: {
|
||||||
|
[_('Direct Expenses')]: {
|
||||||
|
[_('Stock Expenses')]: {
|
||||||
|
[_('Cost of Goods Sold')]: {
|
||||||
|
accountType: 'Cost of Goods Sold',
|
||||||
},
|
},
|
||||||
[_("Dividends Paid")]: {
|
[_('Expenses Included In Valuation')]: {
|
||||||
"accountType": "Equity"
|
accountType: 'Expenses Included In Valuation',
|
||||||
},
|
},
|
||||||
[_("Opening Balance Equity")]: {
|
[_('Stock Adjustment')]: {
|
||||||
"accountType": "Equity"
|
accountType: 'Stock Adjustment',
|
||||||
},
|
},
|
||||||
[_("Retained Earnings")]: {
|
},
|
||||||
"accountType": "Equity"
|
},
|
||||||
|
[_('Indirect Expenses')]: {
|
||||||
|
[_('Administrative Expenses')]: {},
|
||||||
|
[_('Commission on Sales')]: {},
|
||||||
|
[_('Depreciation')]: {
|
||||||
|
accountType: 'Depreciation',
|
||||||
|
},
|
||||||
|
[_('Entertainment Expenses')]: {},
|
||||||
|
[_('Freight and Forwarding Charges')]: {
|
||||||
|
accountType: 'Chargeable',
|
||||||
|
},
|
||||||
|
[_('Legal Expenses')]: {},
|
||||||
|
[_('Marketing Expenses')]: {
|
||||||
|
accountType: 'Chargeable',
|
||||||
|
},
|
||||||
|
[_('Miscellaneous Expenses')]: {
|
||||||
|
accountType: 'Chargeable',
|
||||||
|
},
|
||||||
|
[_('Office Maintenance Expenses')]: {},
|
||||||
|
[_('Office Rent')]: {},
|
||||||
|
[_('Postal Expenses')]: {},
|
||||||
|
[_('Print and Stationery')]: {},
|
||||||
|
[_('Round Off')]: {
|
||||||
|
accountType: 'Round Off',
|
||||||
|
},
|
||||||
|
[_('Salary')]: {},
|
||||||
|
[_('Sales Expenses')]: {},
|
||||||
|
[_('Telephone Expenses')]: {},
|
||||||
|
[_('Travel Expenses')]: {},
|
||||||
|
[_('Utility Expenses')]: {},
|
||||||
|
[_('Write Off')]: {},
|
||||||
|
[_('Exchange Gain/Loss')]: {},
|
||||||
|
[_('Gain/Loss on Asset Disposal')]: {},
|
||||||
|
},
|
||||||
|
rootType: 'Expense',
|
||||||
|
},
|
||||||
|
[_('Income')]: {
|
||||||
|
[_('Direct Income')]: {
|
||||||
|
[_('Sales')]: {},
|
||||||
|
[_('Service')]: {},
|
||||||
|
},
|
||||||
|
[_('Indirect Income')]: {
|
||||||
|
isGroup: 1,
|
||||||
|
},
|
||||||
|
rootType: 'Income',
|
||||||
|
},
|
||||||
|
[_('Source of Funds (Liabilities)')]: {
|
||||||
|
[_('Current Liabilities')]: {
|
||||||
|
[_('Accounts Payable')]: {
|
||||||
|
[_('Creditors')]: {
|
||||||
|
accountType: 'Payable',
|
||||||
},
|
},
|
||||||
"rootType": "Equity"
|
[_('Payroll Payable')]: {},
|
||||||
}
|
},
|
||||||
};
|
[_('Stock Liabilities')]: {
|
||||||
|
[_('Stock Received But Not Billed')]: {
|
||||||
|
accountType: 'Stock Received But Not Billed',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
[_('Duties and Taxes')]: {
|
||||||
|
accountType: 'Tax',
|
||||||
|
isGroup: 1,
|
||||||
|
},
|
||||||
|
[_('Loans (Liabilities)')]: {
|
||||||
|
[_('Secured Loans')]: {},
|
||||||
|
[_('Unsecured Loans')]: {},
|
||||||
|
[_('Bank Overdraft Account')]: {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
rootType: 'Liability',
|
||||||
|
},
|
||||||
|
[_('Equity')]: {
|
||||||
|
[_('Capital Stock')]: {
|
||||||
|
accountType: 'Equity',
|
||||||
|
},
|
||||||
|
[_('Dividends Paid')]: {
|
||||||
|
accountType: 'Equity',
|
||||||
|
},
|
||||||
|
[_('Opening Balance Equity')]: {
|
||||||
|
accountType: 'Equity',
|
||||||
|
},
|
||||||
|
[_('Retained Earnings')]: {
|
||||||
|
accountType: 'Equity',
|
||||||
|
},
|
||||||
|
rootType: 'Equity',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
const frappe = require('frappejs');
|
const frappe = require('frappe');
|
||||||
const Observable = require('frappejs/utils/observable');
|
const Observable = require('frappe/utils/observable');
|
||||||
const CacheManager = require('frappejs/utils/cacheManager');
|
const CacheManager = require('frappe/utils/cacheManager');
|
||||||
const Knex = require('knex');
|
const Knex = require('knex');
|
||||||
|
|
||||||
module.exports = class Database extends Observable {
|
module.exports = class Database extends Observable {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
const frappe = require('frappejs');
|
const frappe = require('frappe');
|
||||||
const Observable = require('frappejs/utils/observable');
|
const Observable = require('frappe/utils/observable');
|
||||||
const triggerEvent = name => frappe.events.trigger(`http:${name}`);
|
const triggerEvent = (name) => frappe.events.trigger(`http:${name}`);
|
||||||
|
|
||||||
module.exports = class HTTPClient extends Observable {
|
module.exports = class HTTPClient extends Observable {
|
||||||
constructor({ server, protocol = 'http' }) {
|
constructor({ server, protocol = 'http' }) {
|
||||||
@ -16,9 +16,7 @@ module.exports = class HTTPClient extends Observable {
|
|||||||
this.initTypeMap();
|
this.initTypeMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
connect() {
|
connect() {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
async insert(doctype, doc) {
|
async insert(doctype, doc) {
|
||||||
doc.doctype = doctype;
|
doc.doctype = doctype;
|
||||||
@ -27,7 +25,7 @@ module.exports = class HTTPClient extends Observable {
|
|||||||
|
|
||||||
const responseDoc = await this.fetch(url, {
|
const responseDoc = await this.fetch(url, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify(doc)
|
body: JSON.stringify(doc),
|
||||||
});
|
});
|
||||||
|
|
||||||
await this.uploadFilesAndUpdateDoc(filesToUpload, doctype, responseDoc);
|
await this.uploadFilesAndUpdateDoc(filesToUpload, doctype, responseDoc);
|
||||||
@ -40,21 +38,24 @@ module.exports = class HTTPClient extends Observable {
|
|||||||
let url = this.getURL('/api/resource', doctype, name);
|
let url = this.getURL('/api/resource', doctype, name);
|
||||||
return await this.fetch(url, {
|
return await this.fetch(url, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: this.getHeaders()
|
headers: this.getHeaders(),
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async getAll({ doctype, fields, filters, start, limit, sortBy, order }) {
|
async getAll({ doctype, fields, filters, start, limit, sortBy, order }) {
|
||||||
let url = this.getURL('/api/resource', doctype);
|
let url = this.getURL('/api/resource', doctype);
|
||||||
|
|
||||||
url = url + '?' + frappe.getQueryString({
|
url =
|
||||||
fields: JSON.stringify(fields),
|
url +
|
||||||
filters: JSON.stringify(filters),
|
'?' +
|
||||||
start: start,
|
frappe.getQueryString({
|
||||||
limit: limit,
|
fields: JSON.stringify(fields),
|
||||||
sortBy: sortBy,
|
filters: JSON.stringify(filters),
|
||||||
order: order
|
start: start,
|
||||||
});
|
limit: limit,
|
||||||
|
sortBy: sortBy,
|
||||||
|
order: order,
|
||||||
|
});
|
||||||
|
|
||||||
return await this.fetch(url, {
|
return await this.fetch(url, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
@ -68,7 +69,7 @@ module.exports = class HTTPClient extends Observable {
|
|||||||
|
|
||||||
const responseDoc = await this.fetch(url, {
|
const responseDoc = await this.fetch(url, {
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
body: JSON.stringify(doc)
|
body: JSON.stringify(doc),
|
||||||
});
|
});
|
||||||
|
|
||||||
await this.uploadFilesAndUpdateDoc(filesToUpload, doctype, responseDoc);
|
await this.uploadFilesAndUpdateDoc(filesToUpload, doctype, responseDoc);
|
||||||
@ -89,7 +90,7 @@ module.exports = class HTTPClient extends Observable {
|
|||||||
|
|
||||||
return await this.fetch(url, {
|
return await this.fetch(url, {
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
body: JSON.stringify(names)
|
body: JSON.stringify(names),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,9 +101,11 @@ module.exports = class HTTPClient extends Observable {
|
|||||||
async getValue(doctype, name, fieldname) {
|
async getValue(doctype, name, fieldname) {
|
||||||
let url = this.getURL('/api/resource', doctype, name, fieldname);
|
let url = this.getURL('/api/resource', doctype, name, fieldname);
|
||||||
|
|
||||||
return (await this.fetch(url, {
|
return (
|
||||||
method: 'GET',
|
await this.fetch(url, {
|
||||||
})).value;
|
method: 'GET',
|
||||||
|
})
|
||||||
|
).value;
|
||||||
}
|
}
|
||||||
|
|
||||||
async fetch(url, args) {
|
async fetch(url, args) {
|
||||||
@ -131,13 +134,13 @@ module.exports = class HTTPClient extends Observable {
|
|||||||
const filesToUpload = [];
|
const filesToUpload = [];
|
||||||
|
|
||||||
if (fileFields.length > 0) {
|
if (fileFields.length > 0) {
|
||||||
fileFields.forEach(df => {
|
fileFields.forEach((df) => {
|
||||||
const files = doc[df.fieldname] || [];
|
const files = doc[df.fieldname] || [];
|
||||||
if (files.length) {
|
if (files.length) {
|
||||||
filesToUpload.push({
|
filesToUpload.push({
|
||||||
fieldname: df.fieldname,
|
fieldname: df.fieldname,
|
||||||
files: files
|
files: files,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
delete doc[df.fieldname];
|
delete doc[df.fieldname];
|
||||||
});
|
});
|
||||||
@ -150,7 +153,12 @@ module.exports = class HTTPClient extends Observable {
|
|||||||
if (filesToUpload.length > 0) {
|
if (filesToUpload.length > 0) {
|
||||||
// upload files
|
// upload files
|
||||||
for (const fileToUpload of filesToUpload) {
|
for (const fileToUpload of filesToUpload) {
|
||||||
const files = await this.uploadFiles(fileToUpload.files, doctype, doc.name, fileToUpload.fieldname);
|
const files = await this.uploadFiles(
|
||||||
|
fileToUpload.files,
|
||||||
|
doctype,
|
||||||
|
doc.name,
|
||||||
|
fileToUpload.fieldname
|
||||||
|
);
|
||||||
doc[fileToUpload.fieldname] = files[0].name;
|
doc[fileToUpload.fieldname] = files[0].name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -166,7 +174,7 @@ module.exports = class HTTPClient extends Observable {
|
|||||||
|
|
||||||
let response = await frappe.fetch(url, {
|
let response = await frappe.fetch(url, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: formData
|
body: formData,
|
||||||
});
|
});
|
||||||
|
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
@ -182,49 +190,46 @@ module.exports = class HTTPClient extends Observable {
|
|||||||
|
|
||||||
getHeaders() {
|
getHeaders() {
|
||||||
const headers = {
|
const headers = {
|
||||||
'Accept': 'application/json',
|
Accept: 'application/json',
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json',
|
||||||
};
|
};
|
||||||
if (frappe.session && frappe.session.token) {
|
if (frappe.session && frappe.session.token) {
|
||||||
headers.token = frappe.session.token;
|
headers.token = frappe.session.token;
|
||||||
};
|
}
|
||||||
return headers;
|
return headers;
|
||||||
}
|
}
|
||||||
|
|
||||||
initTypeMap() {
|
initTypeMap() {
|
||||||
this.typeMap = {
|
this.typeMap = {
|
||||||
'AutoComplete': true
|
AutoComplete: true,
|
||||||
, 'Currency': true
|
Currency: true,
|
||||||
, 'Int': true
|
Int: true,
|
||||||
, 'Float': true
|
Float: true,
|
||||||
, 'Percent': true
|
Percent: true,
|
||||||
, 'Check': true
|
Check: true,
|
||||||
, 'Small Text': true
|
'Small Text': true,
|
||||||
, 'Long Text': true
|
'Long Text': true,
|
||||||
, 'Code': true
|
Code: true,
|
||||||
, 'Text Editor': true
|
'Text Editor': true,
|
||||||
, 'Date': true
|
Date: true,
|
||||||
, 'Datetime': true
|
Datetime: true,
|
||||||
, 'Time': true
|
Time: true,
|
||||||
, 'Text': true
|
Text: true,
|
||||||
, 'Data': true
|
Data: true,
|
||||||
, 'Link': true
|
Link: true,
|
||||||
, 'DynamicLink': true
|
DynamicLink: true,
|
||||||
, 'Password': true
|
Password: true,
|
||||||
, 'Select': true
|
Select: true,
|
||||||
, 'Read Only': true
|
'Read Only': true,
|
||||||
, 'File': true
|
File: true,
|
||||||
, 'Attach': true
|
Attach: true,
|
||||||
, 'Attach Image': true
|
'Attach Image': true,
|
||||||
, 'Signature': true
|
Signature: true,
|
||||||
, 'Color': true
|
Color: true,
|
||||||
, 'Barcode': true
|
Barcode: true,
|
||||||
, 'Geolocation': true
|
Geolocation: true,
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
close() {
|
close() {}
|
||||||
|
};
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
@ -1,210 +1,238 @@
|
|||||||
const frappe = require('frappejs');
|
const frappe = require('frappe');
|
||||||
const mysql = require('mysql');
|
const mysql = require('mysql');
|
||||||
const Database = require('./database');
|
const Database = require('./database');
|
||||||
const debug = false;
|
const debug = false;
|
||||||
|
|
||||||
|
module.exports = class mysqlDatabase extends Database {
|
||||||
|
constructor({ db_name, username, password, host }) {
|
||||||
|
super();
|
||||||
|
this.db_name = db_name;
|
||||||
|
this.username = username;
|
||||||
|
this.password = password;
|
||||||
|
this.host = host;
|
||||||
|
this.init_typeMap();
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = class mysqlDatabase extends Database{
|
connect(db_name) {
|
||||||
constructor({ db_name, username, password, host }) {
|
if (db_name) {
|
||||||
super();
|
this.db_name = db_name;
|
||||||
this.db_name = db_name;
|
|
||||||
this.username = username;
|
|
||||||
this.password = password;
|
|
||||||
this.host = host;
|
|
||||||
this.init_typeMap();
|
|
||||||
}
|
}
|
||||||
|
return new Promise((resolve) => {
|
||||||
connect(db_name) {
|
this.conn = new mysql.createConnection({
|
||||||
if (db_name) {
|
host: this.host,
|
||||||
this.db_name = db_name;
|
user: this.username,
|
||||||
|
password: this.password,
|
||||||
|
database: this.db_name,
|
||||||
|
});
|
||||||
|
() => {
|
||||||
|
if (debug) {
|
||||||
|
this.conn.on('trace', (trace) => console.log(trace));
|
||||||
}
|
}
|
||||||
return new Promise(resolve => {
|
};
|
||||||
this.conn = new mysql.createConnection({
|
resolve();
|
||||||
host : this.host,
|
});
|
||||||
user : this.username,
|
}
|
||||||
password : this.password,
|
|
||||||
database : this.db_name
|
|
||||||
});
|
|
||||||
() => {
|
|
||||||
if (debug) {
|
|
||||||
this.conn.on('trace', (trace) => console.log(trace));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
resolve();
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
async tableExists(table) {
|
||||||
|
const name = await this.sql(`SELECT table_name
|
||||||
async tableExists(table) {
|
|
||||||
|
|
||||||
const name = await this.sql(`SELECT table_name
|
|
||||||
FROM information_schema.tables
|
FROM information_schema.tables
|
||||||
WHERE table_schema = '${this.db_name}'
|
WHERE table_schema = '${this.db_name}'
|
||||||
AND table_name = '${table}'`);
|
AND table_name = '${table}'`);
|
||||||
return (name && name.length) ? true : false;
|
return name && name.length ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
async runCreateTableQuery(doctype, columns, values){
|
async runCreateTableQuery(doctype, columns, values) {
|
||||||
const query = `CREATE TABLE IF NOT EXISTS ${doctype} (
|
const query = `CREATE TABLE IF NOT EXISTS ${doctype} (
|
||||||
${columns.join(", ")})`;
|
${columns.join(', ')})`;
|
||||||
|
|
||||||
return await this.run(query, values);
|
return await this.run(query, values);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateColumnDefinition(df, columns, indexes) {
|
||||||
|
columns.push(
|
||||||
|
`${df.fieldname} ${this.typeMap[df.fieldtype]} ${
|
||||||
|
df.required && !df.default ? 'not null' : ''
|
||||||
|
} ${df.default ? `default '${df.default}'` : ''}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
updateColumnDefinition(df, columns, indexes) {
|
async getTableColumns(doctype) {
|
||||||
columns.push(`${df.fieldname} ${this.typeMap[df.fieldtype]} ${df.required && !df.default ? "not null" : ""} ${df.default ? `default '${df.default}'` : ""}`);
|
return (await this.sql(`SHOW COLUMNS FROM ${doctype}`)).map((d) => d.Field);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getTableColumns(doctype) {
|
async runAddColumnQuery(doctype, fields) {
|
||||||
return (await this.sql(`SHOW COLUMNS FROM ${doctype}`)).map(d => d.Field);
|
await this.run(
|
||||||
}
|
`ALTER TABLE ${doctype} ADD COLUMN ${this.get_column_definition(doctype)}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
getOne(doctype, name, fields = '*') {
|
||||||
|
fields = this.prepareFields(fields);
|
||||||
|
|
||||||
async runAddColumnQuery(doctype, fields) {
|
return new Promise((resolve, reject) => {
|
||||||
await this.run(`ALTER TABLE ${doctype} ADD COLUMN ${this.get_column_definition(doctype)}`);
|
this.conn.get(
|
||||||
}
|
`select ${fields} from ${doctype}
|
||||||
|
where name = ?`,
|
||||||
getOne(doctype, name, fields = '*') {
|
name,
|
||||||
|
(err, row) => {
|
||||||
fields = this.prepareFields(fields);
|
resolve(row || {});
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
this.conn.get(`select ${fields} from ${doctype}
|
|
||||||
where name = ?`, name,
|
|
||||||
(err, row) => {
|
|
||||||
resolve(row || {});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async insertOne(doctype, doc) {
|
|
||||||
let fields = this.get_keys(doctype);
|
|
||||||
let placeholders = fields.map(d => '?').join(', ');
|
|
||||||
|
|
||||||
if (!doc.name) {
|
|
||||||
doc.name = frappe.getRandomString();
|
|
||||||
}
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return await this.run(`insert into ${doctype}
|
async insertOne(doctype, doc) {
|
||||||
(${fields.map(field => field.fieldname).join(", ")})
|
let fields = this.get_keys(doctype);
|
||||||
values (${placeholders})`, this.getFormattedValues(fields, doc));
|
let placeholders = fields.map((d) => '?').join(', ');
|
||||||
|
|
||||||
|
if (!doc.name) {
|
||||||
|
doc.name = frappe.getRandomString();
|
||||||
}
|
}
|
||||||
|
|
||||||
async updateOne(doctype, doc) {
|
return await this.run(
|
||||||
let fields = this.getKeys(doctype);
|
`insert into ${doctype}
|
||||||
let assigns = fields.map(field => `${field.fieldname} = ?`);
|
(${fields.map((field) => field.fieldname).join(', ')})
|
||||||
let values = this.getFormattedValues(fields, doc);
|
values (${placeholders})`,
|
||||||
|
this.getFormattedValues(fields, doc)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// additional name for where clause
|
async updateOne(doctype, doc) {
|
||||||
values.push(doc.name);
|
let fields = this.getKeys(doctype);
|
||||||
|
let assigns = fields.map((field) => `${field.fieldname} = ?`);
|
||||||
|
let values = this.getFormattedValues(fields, doc);
|
||||||
|
|
||||||
return await this.run(`update ${doctype}
|
// additional name for where clause
|
||||||
set ${assigns.join(", ")} where name=?`, values);
|
values.push(doc.name);
|
||||||
}
|
|
||||||
|
|
||||||
async runDeleteOtherChildren(field, added) {
|
return await this.run(
|
||||||
await this.run(`delete from ${field.childtype}
|
`update ${doctype}
|
||||||
|
set ${assigns.join(', ')} where name=?`,
|
||||||
|
values
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
async runDeleteOtherChildren(field, added) {
|
||||||
|
await this.run(
|
||||||
|
`delete from ${field.childtype}
|
||||||
where
|
where
|
||||||
parent = ? and
|
parent = ? and
|
||||||
name not in (${added.slice(1).map(d => '?').join(', ')})`, added);
|
name not in (${added
|
||||||
|
.slice(1)
|
||||||
|
.map((d) => '?')
|
||||||
|
.join(', ')})`,
|
||||||
|
added
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
async deleteOne(doctype, name) {
|
||||||
|
return await this.run(`delete from ${doctype} where name=?`, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
async deleteChildren(parenttype, parent) {
|
||||||
|
await this.run(`delete from ${parent} where parent=?`, parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
getAll({
|
||||||
|
doctype,
|
||||||
|
fields,
|
||||||
|
filters,
|
||||||
|
start,
|
||||||
|
limit,
|
||||||
|
order_by = 'modified',
|
||||||
|
order = 'desc',
|
||||||
|
} = {}) {
|
||||||
|
if (!fields) {
|
||||||
|
fields = frappe.getMeta(doctype).getKeywordFields();
|
||||||
}
|
}
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
let conditions = this.getFilterConditions(filters);
|
||||||
|
|
||||||
async deleteOne(doctype, name) {
|
this.conn.all(
|
||||||
return await this.run(`delete from ${doctype} where name=?`, name);
|
`select ${fields.join(', ')}
|
||||||
}
|
|
||||||
|
|
||||||
async deleteChildren(parenttype, parent) {
|
|
||||||
await this.run(`delete from ${parent} where parent=?`, parent);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
getAll({ doctype, fields, filters, start, limit, order_by = 'modified', order = 'desc' } = {}) {
|
|
||||||
if (!fields) {
|
|
||||||
fields = frappe.getMeta(doctype).getKeywordFields();
|
|
||||||
}
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
let conditions = this.getFilterConditions(filters);
|
|
||||||
|
|
||||||
this.conn.all(`select ${fields.join(", ")}
|
|
||||||
from ${doctype}
|
from ${doctype}
|
||||||
${conditions.conditions ? "where" : ""} ${conditions.conditions}
|
${conditions.conditions ? 'where' : ''} ${conditions.conditions}
|
||||||
${order_by ? ("order by " + order_by) : ""} ${order_by ? (order || "asc") : ""}
|
${order_by ? 'order by ' + order_by : ''} ${
|
||||||
${limit ? ("limit " + limit) : ""} ${start ? ("offset " + start) : ""}`, conditions.values,
|
order_by ? order || 'asc' : ''
|
||||||
(err, rows) => {
|
|
||||||
if (err) {
|
|
||||||
reject(err);
|
|
||||||
} else {
|
|
||||||
resolve(rows);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
run(query, params) {
|
|
||||||
// TODO promisify
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
this.conn.query(query, params, (err) => {
|
|
||||||
if (err) {
|
|
||||||
if (debug) {
|
|
||||||
console.error(err);
|
|
||||||
}
|
|
||||||
reject(err);
|
|
||||||
} else {
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
sql(query, params) {
|
|
||||||
return new Promise((resolve) => {
|
|
||||||
this.conn.query(query, params, (err, rows) => {
|
|
||||||
resolve(rows);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async commit() {
|
|
||||||
try {
|
|
||||||
await this.run('commit');
|
|
||||||
} catch (e) {
|
|
||||||
if (e.errno !== 1) {
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
${limit ? 'limit ' + limit : ''} ${
|
||||||
|
start ? 'offset ' + start : ''
|
||||||
|
}`,
|
||||||
init_typeMap() {
|
conditions.values,
|
||||||
this.typeMap = {
|
(err, rows) => {
|
||||||
'AutoComplete': 'VARCHAR(140)'
|
if (err) {
|
||||||
, 'Currency': 'real'
|
reject(err);
|
||||||
, 'Int': 'INT'
|
} else {
|
||||||
, 'Float': 'decimal(18,6)'
|
resolve(rows);
|
||||||
, 'Percent': 'real'
|
}
|
||||||
, 'Check': 'INT(1)'
|
|
||||||
, 'Small Text': 'text'
|
|
||||||
, 'Long Text': 'text'
|
|
||||||
, 'Code': 'text'
|
|
||||||
, 'Text Editor': 'text'
|
|
||||||
, 'Date': 'DATE'
|
|
||||||
, 'Datetime': 'DATETIME'
|
|
||||||
, 'Time': 'TIME'
|
|
||||||
, 'Text': 'text'
|
|
||||||
, 'Data': 'VARCHAR(140)'
|
|
||||||
, 'Link': ' varchar(140)'
|
|
||||||
, 'DynamicLink': 'text'
|
|
||||||
, 'Password': 'varchar(140)'
|
|
||||||
, 'Select': 'VARCHAR(140)'
|
|
||||||
, 'Read Only': 'varchar(140)'
|
|
||||||
, 'File': 'text'
|
|
||||||
, 'Attach': 'text'
|
|
||||||
, 'Attach Image': 'text'
|
|
||||||
, 'Signature': 'text'
|
|
||||||
, 'Color': 'text'
|
|
||||||
, 'Barcode': 'text'
|
|
||||||
, 'Geolocation': 'text'
|
|
||||||
}
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
run(query, params) {
|
||||||
|
// TODO promisify
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
this.conn.query(query, params, (err) => {
|
||||||
|
if (err) {
|
||||||
|
if (debug) {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
|
reject(err);
|
||||||
|
} else {
|
||||||
|
resolve();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
sql(query, params) {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
this.conn.query(query, params, (err, rows) => {
|
||||||
|
resolve(rows);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async commit() {
|
||||||
|
try {
|
||||||
|
await this.run('commit');
|
||||||
|
} catch (e) {
|
||||||
|
if (e.errno !== 1) {
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
init_typeMap() {
|
||||||
|
this.typeMap = {
|
||||||
|
AutoComplete: 'VARCHAR(140)',
|
||||||
|
Currency: 'real',
|
||||||
|
Int: 'INT',
|
||||||
|
Float: 'decimal(18,6)',
|
||||||
|
Percent: 'real',
|
||||||
|
Check: 'INT(1)',
|
||||||
|
'Small Text': 'text',
|
||||||
|
'Long Text': 'text',
|
||||||
|
Code: 'text',
|
||||||
|
'Text Editor': 'text',
|
||||||
|
Date: 'DATE',
|
||||||
|
Datetime: 'DATETIME',
|
||||||
|
Time: 'TIME',
|
||||||
|
Text: 'text',
|
||||||
|
Data: 'VARCHAR(140)',
|
||||||
|
Link: ' varchar(140)',
|
||||||
|
DynamicLink: 'text',
|
||||||
|
Password: 'varchar(140)',
|
||||||
|
Select: 'VARCHAR(140)',
|
||||||
|
'Read Only': 'varchar(140)',
|
||||||
|
File: 'text',
|
||||||
|
Attach: 'text',
|
||||||
|
'Attach Image': 'text',
|
||||||
|
Signature: 'text',
|
||||||
|
Color: 'text',
|
||||||
|
Barcode: 'text',
|
||||||
|
Geolocation: 'text',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
const frappe = require('frappejs');
|
const frappe = require('frappe');
|
||||||
const Database = require('./database');
|
const Database = require('./database');
|
||||||
|
|
||||||
class SqliteDatabase extends Database {
|
class SqliteDatabase extends Database {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
const frappe = require('frappejs');
|
const frappe = require('frappe');
|
||||||
|
|
||||||
class BaseError extends Error {
|
class BaseError extends Error {
|
||||||
constructor(statusCode, message) {
|
constructor(statusCode, message) {
|
||||||
@ -75,7 +75,7 @@ function throwError(message, error = 'ValidationError') {
|
|||||||
NotFoundError: NotFoundError,
|
NotFoundError: NotFoundError,
|
||||||
ForbiddenError: ForbiddenError,
|
ForbiddenError: ForbiddenError,
|
||||||
ValueError: ValueError,
|
ValueError: ValueError,
|
||||||
Conflict: Conflict
|
Conflict: Conflict,
|
||||||
};
|
};
|
||||||
const err = new errorClass[error](message);
|
const err = new errorClass[error](message);
|
||||||
frappe.events.trigger('throw', { message, stackTrace: err.stack });
|
frappe.events.trigger('throw', { message, stackTrace: err.stack });
|
||||||
@ -97,5 +97,5 @@ module.exports = {
|
|||||||
CannotCommitError,
|
CannotCommitError,
|
||||||
MandatoryError,
|
MandatoryError,
|
||||||
InvalidFieldError,
|
InvalidFieldError,
|
||||||
throw: throwError
|
throw: throwError,
|
||||||
};
|
};
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
const utils = require('../utils');
|
const utils = require('../utils');
|
||||||
const format = require('../utils/format');
|
const format = require('../utils/format');
|
||||||
const errors = require('./errors');
|
const errors = require('./errors');
|
||||||
const BaseDocument = require('frappejs/model/document');
|
const BaseDocument = require('frappe/model/document');
|
||||||
const BaseMeta = require('frappejs/model/meta');
|
const BaseMeta = require('frappe/model/meta');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
initLibs(frappe) {
|
initLibs(frappe) {
|
||||||
|
@ -9,9 +9,9 @@ const {
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
initializeAndRegister(customModels = {}, force = false) {
|
initializeAndRegister(customModels = {}, force = false) {
|
||||||
this.init(force);
|
this.init(force);
|
||||||
const common = require('frappejs/common');
|
const common = require('frappe/common');
|
||||||
this.registerLibs(common);
|
this.registerLibs(common);
|
||||||
const coreModels = require('frappejs/models');
|
const coreModels = require('frappe/models');
|
||||||
this.registerModels(coreModels);
|
this.registerModels(coreModels);
|
||||||
this.registerModels(customModels);
|
this.registerModels(customModels);
|
||||||
},
|
},
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
const frappe = require('frappejs');
|
const frappe = require('frappe');
|
||||||
const Observable = require('frappejs/utils/observable');
|
const Observable = require('frappe/utils/observable');
|
||||||
const naming = require('./naming');
|
const naming = require('./naming');
|
||||||
const { isPesa } = require('../utils/index');
|
const { isPesa } = require('../utils/index');
|
||||||
const { DEFAULT_INTERNAL_PRECISION } = require('../utils/consts');
|
const { DEFAULT_INTERNAL_PRECISION } = require('../utils/consts');
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
const BaseDocument = require('./document');
|
const BaseDocument = require('./document');
|
||||||
const frappe = require('frappejs');
|
const frappe = require('frappe');
|
||||||
const model = require('./index');
|
const model = require('./index');
|
||||||
const indicatorColor = require('frappejs/ui/constants/indicators');
|
const indicatorColor = require('frappe/ui/constants/indicators');
|
||||||
|
|
||||||
module.exports = class BaseMeta extends BaseDocument {
|
module.exports = class BaseMeta extends BaseDocument {
|
||||||
constructor(data) {
|
constructor(data) {
|
||||||
|
@ -1,88 +1,92 @@
|
|||||||
const frappe = require('frappejs');
|
const frappe = require('frappe');
|
||||||
const { getRandomString } = require('frappejs/utils');
|
const { getRandomString } = require('frappe/utils');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
async setName(doc) {
|
async setName(doc) {
|
||||||
if (frappe.isServer) {
|
if (frappe.isServer) {
|
||||||
// if is server, always name again if autoincrement or other
|
// if is server, always name again if autoincrement or other
|
||||||
if (doc.meta.naming === 'autoincrement') {
|
if (doc.meta.naming === 'autoincrement') {
|
||||||
doc.name = await this.getNextId(doc.doctype);
|
doc.name = await this.getNextId(doc.doctype);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (doc.meta.settings) {
|
if (doc.meta.settings) {
|
||||||
const numberSeries = (await doc.getSettings()).numberSeries;
|
const numberSeries = (await doc.getSettings()).numberSeries;
|
||||||
if(numberSeries) {
|
if (numberSeries) {
|
||||||
doc.name = await this.getSeriesNext(numberSeries);
|
doc.name = await this.getSeriesNext(numberSeries);
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (doc.name) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// name === doctype for Single
|
|
||||||
if (doc.meta.isSingle) {
|
|
||||||
doc.name = doc.meta.name;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// assign a random name by default
|
|
||||||
// override doc to set a name
|
|
||||||
if (!doc.name) {
|
|
||||||
doc.name = getRandomString();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
async getNextId(doctype) {
|
|
||||||
// get the last inserted row
|
|
||||||
let lastInserted = await this.getLastInserted(doctype);
|
|
||||||
let name = 1;
|
|
||||||
if (lastInserted) {
|
|
||||||
let lastNumber = parseInt(lastInserted.name);
|
|
||||||
if (isNaN(lastNumber)) lastNumber = 0;
|
|
||||||
name = lastNumber + 1;
|
|
||||||
}
|
|
||||||
return (name + '').padStart(9, '0');
|
|
||||||
},
|
|
||||||
|
|
||||||
async getLastInserted(doctype) {
|
|
||||||
const lastInserted = await frappe.db.getAll({
|
|
||||||
doctype: doctype,
|
|
||||||
fields: ['name'],
|
|
||||||
limit: 1,
|
|
||||||
order_by: 'creation',
|
|
||||||
order: 'desc'
|
|
||||||
});
|
|
||||||
return (lastInserted && lastInserted.length) ? lastInserted[0] : null;
|
|
||||||
},
|
|
||||||
|
|
||||||
async getSeriesNext(prefix) {
|
|
||||||
let series;
|
|
||||||
try {
|
|
||||||
series = await frappe.getDoc('NumberSeries', prefix);
|
|
||||||
} catch (e) {
|
|
||||||
if (!e.statusCode || e.statusCode !== 404) {
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
await this.createNumberSeries(prefix);
|
|
||||||
series = await frappe.getDoc('NumberSeries', prefix);
|
|
||||||
}
|
|
||||||
let next = await series.next()
|
|
||||||
return prefix + next;
|
|
||||||
},
|
|
||||||
|
|
||||||
async createNumberSeries(prefix, setting, start=1000) {
|
|
||||||
if (!(await frappe.db.exists('NumberSeries', prefix))) {
|
|
||||||
const series = frappe.newDoc({doctype: 'NumberSeries', name: prefix, current: start});
|
|
||||||
await series.insert();
|
|
||||||
|
|
||||||
if (setting) {
|
|
||||||
const settingDoc = await frappe.getSingle(setting);
|
|
||||||
settingDoc.numberSeries = series.name;
|
|
||||||
await settingDoc.update();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
if (doc.name) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// name === doctype for Single
|
||||||
|
if (doc.meta.isSingle) {
|
||||||
|
doc.name = doc.meta.name;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// assign a random name by default
|
||||||
|
// override doc to set a name
|
||||||
|
if (!doc.name) {
|
||||||
|
doc.name = getRandomString();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
async getNextId(doctype) {
|
||||||
|
// get the last inserted row
|
||||||
|
let lastInserted = await this.getLastInserted(doctype);
|
||||||
|
let name = 1;
|
||||||
|
if (lastInserted) {
|
||||||
|
let lastNumber = parseInt(lastInserted.name);
|
||||||
|
if (isNaN(lastNumber)) lastNumber = 0;
|
||||||
|
name = lastNumber + 1;
|
||||||
|
}
|
||||||
|
return (name + '').padStart(9, '0');
|
||||||
|
},
|
||||||
|
|
||||||
|
async getLastInserted(doctype) {
|
||||||
|
const lastInserted = await frappe.db.getAll({
|
||||||
|
doctype: doctype,
|
||||||
|
fields: ['name'],
|
||||||
|
limit: 1,
|
||||||
|
order_by: 'creation',
|
||||||
|
order: 'desc',
|
||||||
|
});
|
||||||
|
return lastInserted && lastInserted.length ? lastInserted[0] : null;
|
||||||
|
},
|
||||||
|
|
||||||
|
async getSeriesNext(prefix) {
|
||||||
|
let series;
|
||||||
|
try {
|
||||||
|
series = await frappe.getDoc('NumberSeries', prefix);
|
||||||
|
} catch (e) {
|
||||||
|
if (!e.statusCode || e.statusCode !== 404) {
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
await this.createNumberSeries(prefix);
|
||||||
|
series = await frappe.getDoc('NumberSeries', prefix);
|
||||||
|
}
|
||||||
|
let next = await series.next();
|
||||||
|
return prefix + next;
|
||||||
|
},
|
||||||
|
|
||||||
|
async createNumberSeries(prefix, setting, start = 1000) {
|
||||||
|
if (!(await frappe.db.exists('NumberSeries', prefix))) {
|
||||||
|
const series = frappe.newDoc({
|
||||||
|
doctype: 'NumberSeries',
|
||||||
|
name: prefix,
|
||||||
|
current: start,
|
||||||
|
});
|
||||||
|
await series.insert();
|
||||||
|
|
||||||
|
if (setting) {
|
||||||
|
const settingDoc = await frappe.getSingle(setting);
|
||||||
|
settingDoc.numberSeries = series.name;
|
||||||
|
await settingDoc.update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
const frappe = require('frappejs');
|
const frappe = require('frappe');
|
||||||
|
|
||||||
module.exports = async function runPatches(patchList) {
|
module.exports = async function runPatches(patchList) {
|
||||||
const patchesAlreadyRun = (
|
const patchesAlreadyRun = (
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
const BaseDocument = require('frappejs/model/document');
|
const BaseDocument = require('frappe/model/document');
|
||||||
|
|
||||||
module.exports = class NumberSeries extends BaseDocument {
|
module.exports = class NumberSeries extends BaseDocument {
|
||||||
validate() {
|
validate() {
|
||||||
if (this.current===null || this.current===undefined) {
|
if (this.current === null || this.current === undefined) {
|
||||||
this.current = 0;
|
this.current = 0;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
async next() {
|
}
|
||||||
this.validate();
|
async next() {
|
||||||
this.current++;
|
this.validate();
|
||||||
await this.update();
|
this.current++;
|
||||||
return this.current;
|
await this.update();
|
||||||
}
|
return this.current;
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
const { DateTime } = require('luxon');
|
const { DateTime } = require('luxon');
|
||||||
const { _ } = require('frappejs/utils');
|
const { _ } = require('frappe/utils');
|
||||||
const {
|
const {
|
||||||
DEFAULT_DISPLAY_PRECISION,
|
DEFAULT_DISPLAY_PRECISION,
|
||||||
DEFAULT_INTERNAL_PRECISION,
|
DEFAULT_INTERNAL_PRECISION,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
const { BLUE, GREEN } = require('frappejs/ui/constants/indicators');
|
const { BLUE, GREEN } = require('frappe/ui/constants/indicators');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'ToDo',
|
name: 'ToDo',
|
||||||
@ -11,8 +11,8 @@ module.exports = {
|
|||||||
key: 'status',
|
key: 'status',
|
||||||
colors: {
|
colors: {
|
||||||
Open: BLUE,
|
Open: BLUE,
|
||||||
Closed: GREEN
|
Closed: GREEN,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
@ -20,7 +20,7 @@ module.exports = {
|
|||||||
label: 'Subject',
|
label: 'Subject',
|
||||||
placeholder: 'Subject',
|
placeholder: 'Subject',
|
||||||
fieldtype: 'Data',
|
fieldtype: 'Data',
|
||||||
required: 1
|
required: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldname: 'status',
|
fieldname: 'status',
|
||||||
@ -28,13 +28,13 @@ module.exports = {
|
|||||||
fieldtype: 'Select',
|
fieldtype: 'Select',
|
||||||
options: ['Open', 'Closed'],
|
options: ['Open', 'Closed'],
|
||||||
default: 'Open',
|
default: 'Open',
|
||||||
required: 1
|
required: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldname: 'description',
|
fieldname: 'description',
|
||||||
label: 'Description',
|
label: 'Description',
|
||||||
fieldtype: 'Text'
|
fieldtype: 'Text',
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
quickEditFields: ['status', 'description'],
|
quickEditFields: ['status', 'description'],
|
||||||
@ -42,19 +42,19 @@ module.exports = {
|
|||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
label: 'Close',
|
label: 'Close',
|
||||||
condition: doc => doc.status !== 'Closed',
|
condition: (doc) => doc.status !== 'Closed',
|
||||||
action: async doc => {
|
action: async (doc) => {
|
||||||
await doc.set('status', 'Closed');
|
await doc.set('status', 'Closed');
|
||||||
await doc.update();
|
await doc.update();
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Re-Open',
|
label: 'Re-Open',
|
||||||
condition: doc => doc.status !== 'Open',
|
condition: (doc) => doc.status !== 'Open',
|
||||||
action: async doc => {
|
action: async (doc) => {
|
||||||
await doc.set('status', 'Open');
|
await doc.set('status', 'Open');
|
||||||
await doc.update();
|
await doc.update();
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
};
|
};
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
const BaseList = require('frappejs/client/view/list');
|
const BaseList = require('frappe/client/view/list');
|
||||||
|
|
||||||
module.exports = class ToDoList extends BaseList {
|
module.exports = class ToDoList extends BaseList {
|
||||||
getFields(list) {
|
getFields(list) {
|
||||||
return ['name', 'subject', 'status'];
|
return ['name', 'subject', 'status'];
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
const luxon = require('luxon');
|
const luxon = require('luxon');
|
||||||
const frappe = require('frappejs');
|
const frappe = require('frappe');
|
||||||
const { DEFAULT_DISPLAY_PRECISION, DEFAULT_LOCALE } = require('./consts');
|
const { DEFAULT_DISPLAY_PRECISION, DEFAULT_LOCALE } = require('./consts');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
import Account from './AccountDocument';
|
import Account from './AccountDocument';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
import BaseDocument from 'frappejs/model/document';
|
import BaseDocument from 'frappe/model/document';
|
||||||
|
|
||||||
export default class Account extends BaseDocument {
|
export default class Account extends BaseDocument {
|
||||||
async validate() {
|
async validate() {
|
||||||
@ -11,4 +11,4 @@ export default class Account extends BaseDocument {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { _ } from 'frappejs/utils';
|
import { _ } from 'frappe/utils';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
doctype: 'Account',
|
doctype: 'Account',
|
||||||
title: _('Account'),
|
title: _('Account'),
|
||||||
columns: ['name', 'parentAccount', 'rootType']
|
columns: ['name', 'parentAccount', 'rootType'],
|
||||||
};
|
};
|
||||||
|
@ -1,13 +1,7 @@
|
|||||||
import { _ } from 'frappejs/utils';
|
import { _ } from 'frappe/utils';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
doctype: 'AccountingLedgerEntry',
|
doctype: 'AccountingLedgerEntry',
|
||||||
title: _('Accounting Ledger Entries'),
|
title: _('Accounting Ledger Entries'),
|
||||||
columns: [
|
columns: ['account', 'party', 'debit', 'credit', 'balance'],
|
||||||
'account',
|
};
|
||||||
'party',
|
|
||||||
'debit',
|
|
||||||
'credit',
|
|
||||||
'balance'
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
@ -1,72 +1,73 @@
|
|||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
"name": "Email",
|
name: 'Email',
|
||||||
"doctype": "DocType",
|
doctype: 'DocType',
|
||||||
"pageSettings": {
|
pageSettings: {
|
||||||
hideTitle: true
|
hideTitle: true,
|
||||||
|
},
|
||||||
|
isSingle: 0,
|
||||||
|
isChild: 0,
|
||||||
|
keywordFields: ['name'],
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
fieldname: 'name',
|
||||||
|
label: 'name',
|
||||||
|
fieldtype: 'Data',
|
||||||
|
required: 0,
|
||||||
|
hidden: 1,
|
||||||
|
disabled: 0,
|
||||||
},
|
},
|
||||||
"isSingle": 0,
|
{
|
||||||
"isChild": 0,
|
fieldname: 'fromEmailAddress',
|
||||||
"keywordFields": ["name"],
|
label: 'From',
|
||||||
"fields": [{
|
fieldtype: 'Data',
|
||||||
"fieldname": "name",
|
required: 1,
|
||||||
"label": "name",
|
hidden: 0,
|
||||||
"fieldtype": "Data",
|
formula: async () => {
|
||||||
"required": 0,
|
const accountingSettings = await frappe.getDoc('AccountingSettings');
|
||||||
"hidden": 1,
|
return accountingSettings.email;
|
||||||
"disabled": 0
|
},
|
||||||
},
|
disabled: 1,
|
||||||
{
|
},
|
||||||
"fieldname": "fromEmailAddress",
|
{
|
||||||
"label": "From",
|
fieldname: 'toEmailAddress',
|
||||||
"fieldtype": "Data",
|
label: 'To',
|
||||||
"required": 1,
|
fieldtype: 'Data',
|
||||||
"hidden": 0,
|
required: 1,
|
||||||
formula: async () => {
|
hidden: 0,
|
||||||
const accountingSettings = await frappe.getDoc('AccountingSettings');
|
disabled: 0,
|
||||||
return accountingSettings.email;
|
},
|
||||||
},
|
{
|
||||||
"disabled": 1
|
fieldname: 'date',
|
||||||
},
|
label: 'Date',
|
||||||
{
|
fieldtype: 'Datetime',
|
||||||
"fieldname": "toEmailAddress",
|
required: 0,
|
||||||
"label": "To",
|
hidden: 0,
|
||||||
"fieldtype": "Data",
|
disabled: 1,
|
||||||
"required": 1,
|
},
|
||||||
"hidden": 0,
|
{
|
||||||
"disabled": 0
|
fieldname: 'subject',
|
||||||
},
|
label: 'Subject',
|
||||||
{
|
fieldtype: 'Data',
|
||||||
"fieldname": "date",
|
required: 0,
|
||||||
"label": "Date",
|
hidden: 0,
|
||||||
"fieldtype": "Datetime",
|
disabled: 0,
|
||||||
"required": 0,
|
},
|
||||||
"hidden": 0,
|
{
|
||||||
"disabled": 1
|
fieldname: 'bodyText',
|
||||||
},
|
label: 'Body',
|
||||||
{
|
fieldtype: 'Text',
|
||||||
"fieldname": "subject",
|
required: 0,
|
||||||
"label": "Subject",
|
hidden: 0,
|
||||||
"fieldtype": "Data",
|
disabled: 0,
|
||||||
"required": 0,
|
},
|
||||||
"hidden": 0,
|
{
|
||||||
"disabled": 0
|
fieldname: 'filePath',
|
||||||
},
|
label: 'File Path',
|
||||||
{
|
fieldtype: 'Text',
|
||||||
"fieldname": "bodyText",
|
required: 0,
|
||||||
"label": "Body",
|
hidden: 1,
|
||||||
"fieldtype": "Text",
|
},
|
||||||
"required": 0,
|
],
|
||||||
"hidden": 0,
|
};
|
||||||
"disabled": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "filePath",
|
|
||||||
"label": "File Path",
|
|
||||||
"fieldtype": "Text",
|
|
||||||
"required": 0,
|
|
||||||
"hidden": 1,
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
|
||||||
|
@ -1,59 +1,54 @@
|
|||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
"name": "EmailAccount",
|
name: 'EmailAccount',
|
||||||
"label": "Email Account",
|
label: 'Email Account',
|
||||||
"doctype": "DocType",
|
doctype: 'DocType',
|
||||||
"isSingle": true,
|
isSingle: true,
|
||||||
"isChild": false,
|
isChild: false,
|
||||||
"keywordFields": [
|
keywordFields: ['email'],
|
||||||
"email"
|
fields: [
|
||||||
],
|
{
|
||||||
"fields": [
|
fieldname: 'email',
|
||||||
{
|
label: 'Email',
|
||||||
"fieldname": "email",
|
fieldtype: 'Data',
|
||||||
"label": "Email",
|
required: 1,
|
||||||
"fieldtype": "Data",
|
formula: async () => {
|
||||||
"required": 1,
|
const accountingSettings = await frappe.getDoc('AccountingSettings');
|
||||||
formula: async () => {
|
return accountingSettings.email;
|
||||||
const accountingSettings = await frappe.getDoc('AccountingSettings');
|
},
|
||||||
return accountingSettings.email;
|
},
|
||||||
},
|
{
|
||||||
},
|
fieldname: 'password',
|
||||||
{
|
label: 'Password',
|
||||||
"fieldname": "password",
|
fieldtype: 'Password',
|
||||||
"label": "Password",
|
required: 1,
|
||||||
"fieldtype": "Password",
|
},
|
||||||
"required": 1
|
{
|
||||||
},
|
fieldname: 'confirmPassword',
|
||||||
{
|
label: 'Confirm Password',
|
||||||
"fieldname": "confirmPassword",
|
fieldtype: 'Password',
|
||||||
"label": "Confirm Password",
|
required: 1,
|
||||||
"fieldtype": "Password",
|
},
|
||||||
"required": 1
|
{
|
||||||
},
|
fieldname: 'smtpHost',
|
||||||
{
|
label: 'SMTP Host',
|
||||||
"fieldname": "smtpHost",
|
fieldtype: 'Select',
|
||||||
"label": "SMTP Host",
|
options: [
|
||||||
"fieldtype": "Select",
|
'smtp.gmail.com',
|
||||||
"options": [
|
'smtp.mail.yahoo.com',
|
||||||
"smtp.gmail.com",
|
'smtp-mail.outlook.com',
|
||||||
"smtp.mail.yahoo.com",
|
'smtp.mail.me.com',
|
||||||
"smtp-mail.outlook.com",
|
'smtp.aol.com',
|
||||||
"smtp.mail.me.com",
|
],
|
||||||
"smtp.aol.com"
|
default: 'smtp.gmail.com',
|
||||||
],
|
},
|
||||||
"default": "smtp.gmail.com"
|
{
|
||||||
},
|
fieldname: 'smtpPort',
|
||||||
{
|
label: 'SMTP Port',
|
||||||
"fieldname": "smtpPort",
|
fieldtype: 'Select',
|
||||||
"label": "SMTP Port",
|
options: ['465', '587'],
|
||||||
"fieldtype": "Select",
|
default: '465',
|
||||||
"options": [
|
},
|
||||||
"465",
|
],
|
||||||
"587"
|
};
|
||||||
],
|
|
||||||
"default": "465"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
import frappe from 'frappejs';
|
import BaseDocument from 'frappe/model/document';
|
||||||
import BaseDocument from 'frappejs/model/document';
|
|
||||||
|
|
||||||
export default class Event extends BaseDocument {
|
export default class Event extends BaseDocument {
|
||||||
alertEvent() {
|
alertEvent() {
|
||||||
alert(this.title);
|
alert(this.title);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
import model from 'frappejs/model';
|
import model from 'frappe/model';
|
||||||
import Quotation from '../Quotation/Quotation';
|
import Quotation from '../Quotation/Quotation';
|
||||||
|
|
||||||
export default model.extend(Quotation, {
|
export default model.extend(Quotation, {
|
||||||
name: "Fulfillment",
|
name: 'Fulfillment',
|
||||||
label: "Fulfillment",
|
label: 'Fulfillment',
|
||||||
settings: "FulfillmentSettings",
|
settings: 'FulfillmentSettings',
|
||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
"fieldname": "items",
|
fieldname: 'items',
|
||||||
"childtype": "FulfillmentItem"
|
childtype: 'FulfillmentItem',
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
});
|
});
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import model from 'frappejs/model';
|
import model from 'frappe/model';
|
||||||
import QuotationItem from '../QuotationItem/QuotationItem';
|
import QuotationItem from '../QuotationItem/QuotationItem';
|
||||||
|
|
||||||
export default model.extend(QuotationItem, {
|
export default model.extend(QuotationItem, {
|
||||||
name: "FulfillmentItem"
|
name: 'FulfillmentItem',
|
||||||
});
|
});
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import model from 'frappejs/model';
|
import model from 'frappe/model';
|
||||||
import QuotationSettings from '../QuotationSettings/QuotationSettings';
|
import QuotationSettings from '../QuotationSettings/QuotationSettings';
|
||||||
|
|
||||||
export default model.extend(QuotationSettings, {
|
export default model.extend(QuotationSettings, {
|
||||||
"name": "FulfillmentSettings",
|
name: 'FulfillmentSettings',
|
||||||
"label": "Fulfillment Settings",
|
label: 'Fulfillment Settings',
|
||||||
"fields": [
|
fields: [
|
||||||
{
|
{
|
||||||
"fieldname": "numberSeries",
|
fieldname: 'numberSeries',
|
||||||
"default": "OF"
|
default: 'OF',
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
});
|
});
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
import GSTR3B from './GSTR3BDocument.js';
|
import GSTR3B from './GSTR3BDocument.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import BaseDocument from 'frappejs/model/document';
|
import frappe from 'frappe';
|
||||||
import frappe from 'frappejs';
|
import BaseDocument from 'frappe/model/document';
|
||||||
import format from './GSTR3BFormat';
|
import format from './GSTR3BFormat';
|
||||||
|
|
||||||
export default class GSTR3B extends BaseDocument {
|
export default class GSTR3B extends BaseDocument {
|
||||||
@ -16,7 +16,7 @@ export default class GSTR3B extends BaseDocument {
|
|||||||
'September',
|
'September',
|
||||||
'October',
|
'October',
|
||||||
'November',
|
'November',
|
||||||
'December'
|
'December',
|
||||||
].indexOf(this.month);
|
].indexOf(this.month);
|
||||||
const month = monthIndex + 1 > 9 ? monthIndex + 1 : `0${monthIndex + 1}`;
|
const month = monthIndex + 1 > 9 ? monthIndex + 1 : `0${monthIndex + 1}`;
|
||||||
const lastDate = new Date(this.year, monthIndex + 1, 0).getDate();
|
const lastDate = new Date(this.year, monthIndex + 1, 0).getDate();
|
||||||
@ -25,22 +25,22 @@ export default class GSTR3B extends BaseDocument {
|
|||||||
'>=',
|
'>=',
|
||||||
`${this.year}-${month}-01`,
|
`${this.year}-${month}-01`,
|
||||||
'<=',
|
'<=',
|
||||||
`${this.year}-${month}-${lastDate}`
|
`${this.year}-${month}-${lastDate}`,
|
||||||
]
|
],
|
||||||
};
|
};
|
||||||
const salesInvoices = frappe.db.getAll({
|
const salesInvoices = frappe.db.getAll({
|
||||||
doctype: 'SalesInvoice',
|
doctype: 'SalesInvoice',
|
||||||
filters,
|
filters,
|
||||||
fields: ['*']
|
fields: ['*'],
|
||||||
});
|
});
|
||||||
const purchaseInvoices = frappe.db.getAll({
|
const purchaseInvoices = frappe.db.getAll({
|
||||||
doctype: 'PurchaseInvoice',
|
doctype: 'PurchaseInvoice',
|
||||||
filters,
|
filters,
|
||||||
fields: ['*']
|
fields: ['*'],
|
||||||
});
|
});
|
||||||
const [gstr1Data, gstr2Data] = await Promise.all([
|
const [gstr1Data, gstr2Data] = await Promise.all([
|
||||||
salesInvoices,
|
salesInvoices,
|
||||||
purchaseInvoices
|
purchaseInvoices,
|
||||||
]);
|
]);
|
||||||
let gstr3bData = [[], []];
|
let gstr3bData = [[], []];
|
||||||
|
|
||||||
@ -74,7 +74,7 @@ export default class GSTR3B extends BaseDocument {
|
|||||||
row.rate = 0;
|
row.rate = 0;
|
||||||
row.inState = true;
|
row.inState = true;
|
||||||
row.reverseCharge = !party.gstin ? 'Y' : 'N';
|
row.reverseCharge = !party.gstin ? 'Y' : 'N';
|
||||||
ledgerEntry.taxes.forEach(tax => {
|
ledgerEntry.taxes.forEach((tax) => {
|
||||||
row.rate += tax.rate;
|
row.rate += tax.rate;
|
||||||
const taxAmt = (tax.rate * ledgerEntry.netTotal) / 100;
|
const taxAmt = (tax.rate * ledgerEntry.netTotal) / 100;
|
||||||
if (tax.account === 'IGST') row.igstAmt = taxAmt;
|
if (tax.account === 'IGST') row.igstAmt = taxAmt;
|
||||||
@ -113,7 +113,7 @@ export default class GSTR3B extends BaseDocument {
|
|||||||
jsonData['inter_sup']['unreg_details'].push({
|
jsonData['inter_sup']['unreg_details'].push({
|
||||||
pos: ledgerEntry.place,
|
pos: ledgerEntry.place,
|
||||||
txval: ledgerEntry.taxVal,
|
txval: ledgerEntry.taxVal,
|
||||||
iAmt: ledgerEntry.igstAmt || 0
|
iAmt: ledgerEntry.igstAmt || 0,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -147,4 +147,4 @@ export default class GSTR3B extends BaseDocument {
|
|||||||
return JSON.stringify(json, undefined, 2);
|
return JSON.stringify(json, undefined, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { _ } from 'frappejs/utils';
|
import { _ } from 'frappe/utils';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
doctype: 'GSTR3B',
|
doctype: 'GSTR3B',
|
||||||
title: _('GSTR 3B Report'),
|
title: _('GSTR 3B Report'),
|
||||||
columns: ['year', 'month']
|
columns: ['year', 'month'],
|
||||||
};
|
};
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
import { _ } from 'frappejs/utils';
|
import { _ } from 'frappe/utils';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Item',
|
name: 'Item',
|
||||||
|
@ -1,12 +1,7 @@
|
|||||||
import { _ } from 'frappejs/utils';
|
import { _ } from 'frappe/utils';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
doctype: 'Item',
|
doctype: 'Item',
|
||||||
title: _('Items'),
|
title: _('Items'),
|
||||||
columns: [
|
columns: ['name', 'unit', 'tax', 'rate'],
|
||||||
'name',
|
};
|
||||||
'unit',
|
|
||||||
'tax',
|
|
||||||
'rate',
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import { _ } from 'frappejs/utils';
|
|
||||||
import Badge from '@/components/Badge';
|
import Badge from '@/components/Badge';
|
||||||
|
import { _ } from 'frappe/utils';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
doctype: 'JournalEntry',
|
doctype: 'JournalEntry',
|
||||||
title: _('Journal Entry'),
|
title: _('Journal Entry'),
|
||||||
formRoute: name => `/edit/JournalEntry/${name}`,
|
formRoute: (name) => `/edit/JournalEntry/${name}`,
|
||||||
columns: [
|
columns: [
|
||||||
'date',
|
'date',
|
||||||
{
|
{
|
||||||
@ -35,10 +35,10 @@ export default {
|
|||||||
fieldname: 'name',
|
fieldname: 'name',
|
||||||
fieldtype: 'Data',
|
fieldtype: 'Data',
|
||||||
getValue(doc) {
|
getValue(doc) {
|
||||||
return doc.name
|
return doc.name;
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
'entryType',
|
'entryType',
|
||||||
'referenceNumber'
|
'referenceNumber',
|
||||||
]
|
],
|
||||||
};
|
};
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import BaseDocument from 'frappejs/model/document';
|
import BaseDocument from 'frappe/model/document';
|
||||||
import LedgerPosting from '../../../accounting/ledgerPosting';
|
import LedgerPosting from '../../../accounting/ledgerPosting';
|
||||||
|
|
||||||
export default class JournalEntryServer extends BaseDocument {
|
export default class JournalEntryServer extends BaseDocument {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import frappe from 'frappejs';
|
|
||||||
import { _ } from 'frappejs/utils';
|
|
||||||
import router from '@/router';
|
import router from '@/router';
|
||||||
|
import frappe from 'frappe';
|
||||||
|
import { _ } from 'frappe/utils';
|
||||||
import PartyWidget from './PartyWidget.vue';
|
import PartyWidget from './PartyWidget.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -8,46 +8,46 @@ export default {
|
|||||||
label: 'Customer',
|
label: 'Customer',
|
||||||
basedOn: 'Party',
|
basedOn: 'Party',
|
||||||
filters: {
|
filters: {
|
||||||
customer: 1
|
customer: 1,
|
||||||
},
|
},
|
||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
label: _('Create Invoice'),
|
label: _('Create Invoice'),
|
||||||
condition: doc => !doc.isNew(),
|
condition: (doc) => !doc.isNew(),
|
||||||
action: async customer => {
|
action: async (customer) => {
|
||||||
let doc = await frappe.getNewDoc('SalesInvoice');
|
let doc = await frappe.getNewDoc('SalesInvoice');
|
||||||
router.push({
|
router.push({
|
||||||
path: `/edit/SalesInvoice/${doc.name}`,
|
path: `/edit/SalesInvoice/${doc.name}`,
|
||||||
query: {
|
query: {
|
||||||
doctype: 'SalesInvoice',
|
doctype: 'SalesInvoice',
|
||||||
values: {
|
values: {
|
||||||
customer: customer.name
|
customer: customer.name,
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: _('View Invoices'),
|
label: _('View Invoices'),
|
||||||
condition: doc => !doc.isNew(),
|
condition: (doc) => !doc.isNew(),
|
||||||
action: customer => {
|
action: (customer) => {
|
||||||
router.push({
|
router.push({
|
||||||
name: 'ListView',
|
name: 'ListView',
|
||||||
params: {
|
params: {
|
||||||
doctype: 'SalesInvoice',
|
doctype: 'SalesInvoice',
|
||||||
filters: {
|
filters: {
|
||||||
customer: customer.name
|
customer: customer.name,
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
quickEditWidget: doc => ({
|
quickEditWidget: (doc) => ({
|
||||||
render(h) {
|
render(h) {
|
||||||
return h(PartyWidget, {
|
return h(PartyWidget, {
|
||||||
props: { doc }
|
props: { doc },
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
})
|
}),
|
||||||
};
|
};
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { _ } from 'frappejs/utils';
|
import { _ } from 'frappe/utils';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
doctype: 'Customer',
|
doctype: 'Customer',
|
||||||
title: _('Customers'),
|
title: _('Customers'),
|
||||||
columns: ['name', 'phone', 'outstandingAmount']
|
columns: ['name', 'phone', 'outstandingAmount'],
|
||||||
};
|
};
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
import { _ } from 'frappejs/utils';
|
import { _ } from 'frappe/utils';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Party',
|
name: 'Party',
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
import { _ } from 'frappejs/utils';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
doctype: 'Party',
|
doctype: 'Party',
|
||||||
columns: ['name', 'phone', 'outstandingAmount']
|
columns: ['name', 'phone', 'outstandingAmount'],
|
||||||
};
|
};
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
import BaseDocument from 'frappejs/model/document';
|
import BaseDocument from 'frappe/model/document';
|
||||||
|
|
||||||
export default class PartyServer extends BaseDocument {
|
export default class PartyServer extends BaseDocument {
|
||||||
beforeInsert() {
|
beforeInsert() {
|
||||||
|
@ -50,7 +50,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
import { getStatusColumn } from '../Transaction/Transaction';
|
import { getStatusColumn } from '../Transaction/Transaction';
|
||||||
import { routeTo } from '@/utils';
|
import { routeTo } from '@/utils';
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { _ } from 'frappejs/utils';
|
|
||||||
import router from '@/router';
|
import router from '@/router';
|
||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
|
import { _ } from 'frappe/utils';
|
||||||
import PartyWidget from './PartyWidget.vue';
|
import PartyWidget from './PartyWidget.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -8,46 +8,46 @@ export default {
|
|||||||
label: 'Supplier',
|
label: 'Supplier',
|
||||||
basedOn: 'Party',
|
basedOn: 'Party',
|
||||||
filters: {
|
filters: {
|
||||||
supplier: 1
|
supplier: 1,
|
||||||
},
|
},
|
||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
label: _('Create Bill'),
|
label: _('Create Bill'),
|
||||||
condition: doc => !doc.isNew(),
|
condition: (doc) => !doc.isNew(),
|
||||||
action: async supplier => {
|
action: async (supplier) => {
|
||||||
let doc = await frappe.getNewDoc('PurchaseInvoice');
|
let doc = await frappe.getNewDoc('PurchaseInvoice');
|
||||||
router.push({
|
router.push({
|
||||||
path: `/edit/PurchaseInvoice/${doc.name}`,
|
path: `/edit/PurchaseInvoice/${doc.name}`,
|
||||||
query: {
|
query: {
|
||||||
doctype: 'PurchaseInvoice',
|
doctype: 'PurchaseInvoice',
|
||||||
values: {
|
values: {
|
||||||
supplier: supplier.name
|
supplier: supplier.name,
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: _('View Bills'),
|
label: _('View Bills'),
|
||||||
condition: doc => !doc.isNew(),
|
condition: (doc) => !doc.isNew(),
|
||||||
action: supplier => {
|
action: (supplier) => {
|
||||||
router.push({
|
router.push({
|
||||||
name: 'ListView',
|
name: 'ListView',
|
||||||
params: {
|
params: {
|
||||||
doctype: 'PurchaseInvoice',
|
doctype: 'PurchaseInvoice',
|
||||||
filters: {
|
filters: {
|
||||||
supplier: supplier.name
|
supplier: supplier.name,
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
quickEditWidget: doc => ({
|
quickEditWidget: (doc) => ({
|
||||||
render(h) {
|
render(h) {
|
||||||
return h(PartyWidget, {
|
return h(PartyWidget, {
|
||||||
props: { doc }
|
props: { doc },
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
})
|
}),
|
||||||
};
|
};
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { _ } from 'frappejs/utils';
|
import { _ } from 'frappe/utils';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
doctype: 'Supplier',
|
doctype: 'Supplier',
|
||||||
title: _('Supplier'),
|
title: _('Supplier'),
|
||||||
columns: ['name', 'phone', 'outstandingAmount']
|
columns: ['name', 'phone', 'outstandingAmount'],
|
||||||
};
|
};
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
import utils from '../../../accounting/utils';
|
import utils from '../../../accounting/utils';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { _ } from 'frappejs/utils';
|
|
||||||
import Badge from '@/components/Badge';
|
import Badge from '@/components/Badge';
|
||||||
|
import { _ } from 'frappe/utils';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
doctype: 'Payment',
|
doctype: 'Payment',
|
||||||
@ -28,12 +28,12 @@ export default {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
template: `<Badge class="text-xs" color="${color}">${status}</Badge>`,
|
template: `<Badge class="text-xs" color="${color}">${status}</Badge>`,
|
||||||
components: { Badge }
|
components: { Badge },
|
||||||
};
|
};
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
'paymentType',
|
'paymentType',
|
||||||
'date',
|
'date',
|
||||||
'amount'
|
'amount',
|
||||||
]
|
],
|
||||||
};
|
};
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
import BaseDocument from 'frappejs/model/document';
|
import BaseDocument from 'frappe/model/document';
|
||||||
import LedgerPosting from '../../../accounting/ledgerPosting';
|
import LedgerPosting from '../../../accounting/ledgerPosting';
|
||||||
|
|
||||||
export default class PaymentServer extends BaseDocument {
|
export default class PaymentServer extends BaseDocument {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
import { _ } from 'frappejs/utils';
|
import { _ } from 'frappe/utils';
|
||||||
|
|
||||||
const referenceTypeMap = {
|
const referenceTypeMap = {
|
||||||
SalesInvoice: _('Invoice'),
|
SalesInvoice: _('Invoice'),
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
import { _ } from 'frappejs/utils';
|
import { _ } from 'frappetils';
|
||||||
import { getStatusColumn } from '../Transaction/Transaction';
|
import { getStatusColumn } from '../Transaction/Transaction';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
doctype: 'PurchaseInvoice',
|
doctype: 'PurchaseInvoice',
|
||||||
title: _('Bills'),
|
title: _('Bills'),
|
||||||
formRoute: name => `/edit/PurchaseInvoice/${name}`,
|
formRoute: (name) => `/edit/PurchaseInvoice/${name}`,
|
||||||
columns: [
|
columns: [
|
||||||
'supplier',
|
'supplier',
|
||||||
'name',
|
'name',
|
||||||
getStatusColumn('PurchaseInvoice'),
|
getStatusColumn('PurchaseInvoice'),
|
||||||
'date',
|
'date',
|
||||||
'grandTotal',
|
'grandTotal',
|
||||||
'outstandingAmount'
|
'outstandingAmount',
|
||||||
]
|
],
|
||||||
};
|
};
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import model from 'frappejs/model';
|
import model from 'frappe/model';
|
||||||
import PurchaseInvoice from '../PurchaseInvoice/PurchaseInvoice';
|
import PurchaseInvoice from '../PurchaseInvoice/PurchaseInvoice';
|
||||||
|
|
||||||
export default model.extend(
|
export default model.extend(
|
||||||
@ -10,11 +10,11 @@ export default model.extend(
|
|||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
fieldname: 'items',
|
fieldname: 'items',
|
||||||
childtype: 'PurchaseOrderItem'
|
childtype: 'PurchaseOrderItem',
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
skipFields: ['account']
|
skipFields: ['account'],
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import model from 'frappejs/model';
|
import model from 'frappe/model';
|
||||||
import PurchaseInvoiceItem from '../PurchaseInvoiceItem/PurchaseInvoiceItem';
|
import PurchaseInvoiceItem from '../PurchaseInvoiceItem/PurchaseInvoiceItem';
|
||||||
|
|
||||||
export default model.extend(PurchaseInvoiceItem, {
|
export default model.extend(PurchaseInvoiceItem, {
|
||||||
name: "PurchaseOrderItem"
|
name: 'PurchaseOrderItem',
|
||||||
});
|
});
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import model from 'frappejs/model';
|
import model from 'frappe/model';
|
||||||
import PurchaseInvoiceSettings from '../PurchaseInvoiceSettings/PurchaseInvoiceSettings';
|
import PurchaseInvoiceSettings from '../PurchaseInvoiceSettings/PurchaseInvoiceSettings';
|
||||||
|
|
||||||
export default model.extend(PurchaseInvoiceSettings, {
|
export default model.extend(PurchaseInvoiceSettings, {
|
||||||
"name": "PurchaseOrderSettings",
|
name: 'PurchaseOrderSettings',
|
||||||
"label": "Purchase Order Settings",
|
label: 'Purchase Order Settings',
|
||||||
"fields": [
|
fields: [
|
||||||
{
|
{
|
||||||
"fieldname": "numberSeries",
|
fieldname: 'numberSeries',
|
||||||
"default": "PO"
|
default: 'PO',
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
});
|
});
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
import model from 'frappejs/model';
|
import model from 'frappe/model';
|
||||||
import PurchaseOrder from '../PurchaseOrder/PurchaseOrder';
|
import PurchaseOrder from '../PurchaseOrder/PurchaseOrder';
|
||||||
|
|
||||||
export default model.extend(PurchaseOrder, {
|
export default model.extend(PurchaseOrder, {
|
||||||
name: "PurchaseReceipt",
|
name: 'PurchaseReceipt',
|
||||||
label: "Purchase Receipt",
|
label: 'Purchase Receipt',
|
||||||
settings: "PurchaseReceiptSettings",
|
settings: 'PurchaseReceiptSettings',
|
||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
"fieldname": "items",
|
fieldname: 'items',
|
||||||
"childtype": "PurchaseReceiptItem"
|
childtype: 'PurchaseReceiptItem',
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
});
|
});
|
||||||
|
@ -1,16 +1,20 @@
|
|||||||
import model from 'frappejs/model';
|
import model from 'frappe/model';
|
||||||
import PurchaseOrderItem from '../PurchaseOrderItem/PurchaseOrderItem';
|
import PurchaseOrderItem from '../PurchaseOrderItem/PurchaseOrderItem';
|
||||||
|
|
||||||
export default model.extend(PurchaseOrderItem, {
|
export default model.extend(
|
||||||
name: "PurchaseReceiptItem",
|
PurchaseOrderItem,
|
||||||
|
{
|
||||||
|
name: 'PurchaseReceiptItem',
|
||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
"fieldname": "acceptedQuantity",
|
fieldname: 'acceptedQuantity',
|
||||||
"label": "Accepted Quantity",
|
label: 'Accepted Quantity',
|
||||||
"fieldtype": "Float",
|
fieldtype: 'Float',
|
||||||
"required": 1
|
required: 1,
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
}, {
|
},
|
||||||
skipFields: ['expenseAccount']
|
{
|
||||||
});
|
skipFields: ['expenseAccount'],
|
||||||
|
}
|
||||||
|
);
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import model from 'frappejs/model';
|
import model from 'frappe/model';
|
||||||
import PurchaseOrderSettings from '../PurchaseOrderSettings/PurchaseOrderSettings';
|
import PurchaseOrderSettings from '../PurchaseOrderSettings/PurchaseOrderSettings';
|
||||||
|
|
||||||
export default model.extend(PurchaseOrderSettings, {
|
export default model.extend(PurchaseOrderSettings, {
|
||||||
"name": "PurchaseReceiptSettings",
|
name: 'PurchaseReceiptSettings',
|
||||||
"label": "Purchase Receipt Settings",
|
label: 'Purchase Receipt Settings',
|
||||||
"fields": [
|
fields: [
|
||||||
{
|
{
|
||||||
"fieldname": "numberSeries",
|
fieldname: 'numberSeries',
|
||||||
"default": "PREC"
|
default: 'PREC',
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
});
|
});
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import model from 'frappejs/model';
|
import model from 'frappe/model';
|
||||||
import SalesInvoice from '../SalesInvoice/SalesInvoice';
|
import SalesInvoice from '../SalesInvoice/SalesInvoice';
|
||||||
|
|
||||||
const Quotation = model.extend(
|
const Quotation = model.extend(
|
||||||
@ -10,14 +10,14 @@ const Quotation = model.extend(
|
|||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
fieldname: 'items',
|
fieldname: 'items',
|
||||||
childtype: 'QuotationItem'
|
childtype: 'QuotationItem',
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
links: []
|
links: [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
skipFields: ['account'],
|
skipFields: ['account'],
|
||||||
overrideProps: ['links']
|
overrideProps: ['links'],
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import model from 'frappejs/model';
|
import model from 'frappe/model';
|
||||||
import SalesInvoiceItem from '../SalesInvoiceItem/SalesInvoiceItem';
|
import SalesInvoiceItem from '../SalesInvoiceItem/SalesInvoiceItem';
|
||||||
|
|
||||||
export default model.extend(SalesInvoiceItem, {
|
export default model.extend(SalesInvoiceItem, {
|
||||||
name: "QuotationItem"
|
name: 'QuotationItem',
|
||||||
});
|
});
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import model from 'frappejs/model';
|
import model from 'frappe/model';
|
||||||
import SalesInvoiceSettings from '../SalesInvoiceSettings/SalesInvoiceSettings';
|
import SalesInvoiceSettings from '../SalesInvoiceSettings/SalesInvoiceSettings';
|
||||||
|
|
||||||
export default model.extend(SalesInvoiceSettings, {
|
export default model.extend(SalesInvoiceSettings, {
|
||||||
"name": "QuotationSettings",
|
name: 'QuotationSettings',
|
||||||
"label": "Quotation Settings",
|
label: 'Quotation Settings',
|
||||||
"fields": [
|
fields: [
|
||||||
{
|
{
|
||||||
"fieldname": "numberSeries",
|
fieldname: 'numberSeries',
|
||||||
"default": "QTN"
|
default: 'QTN',
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
});
|
});
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
import { _ } from 'frappejs/utils';
|
import { _ } from 'frappe/utils';
|
||||||
import { getStatusColumn } from '../Transaction/Transaction';
|
import { getStatusColumn } from '../Transaction/Transaction';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
doctype: 'SalesInvoice',
|
doctype: 'SalesInvoice',
|
||||||
title: _('Invoices'),
|
title: _('Invoices'),
|
||||||
formRoute: name => `/edit/SalesInvoice/${name}`,
|
formRoute: (name) => `/edit/SalesInvoice/${name}`,
|
||||||
columns: [
|
columns: [
|
||||||
'customer',
|
'customer',
|
||||||
'name',
|
'name',
|
||||||
getStatusColumn('SalesInvoice'),
|
getStatusColumn('SalesInvoice'),
|
||||||
'date',
|
'date',
|
||||||
'grandTotal',
|
'grandTotal',
|
||||||
'outstandingAmount'
|
'outstandingAmount',
|
||||||
]
|
],
|
||||||
};
|
};
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<script>
|
<script>
|
||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
export default {
|
export default {
|
||||||
name: 'Base',
|
name: 'Base',
|
||||||
props: ['doc', 'printSettings'],
|
props: ['doc', 'printSettings'],
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import model from 'frappejs/model';
|
import model from 'frappe/model';
|
||||||
import Quotation from '../Quotation/Quotation';
|
import Quotation from '../Quotation/Quotation';
|
||||||
|
|
||||||
export default model.extend(Quotation, {
|
export default model.extend(Quotation, {
|
||||||
@ -8,7 +8,7 @@ export default model.extend(Quotation, {
|
|||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
fieldname: 'items',
|
fieldname: 'items',
|
||||||
childtype: 'SalesOrderItem'
|
childtype: 'SalesOrderItem',
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
});
|
});
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import model from 'frappejs/model';
|
import model from 'frappe/model';
|
||||||
import QuotationItem from '../QuotationItem/QuotationItem';
|
import QuotationItem from '../QuotationItem/QuotationItem';
|
||||||
|
|
||||||
export default model.extend(QuotationItem, {
|
export default model.extend(QuotationItem, {
|
||||||
name: "SalesOrderItem"
|
name: 'SalesOrderItem',
|
||||||
});
|
});
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import model from 'frappejs/model';
|
import model from 'frappe/model';
|
||||||
import QuotationSettings from '../QuotationSettings/QuotationSettings';
|
import QuotationSettings from '../QuotationSettings/QuotationSettings';
|
||||||
|
|
||||||
export default model.extend(QuotationSettings, {
|
export default model.extend(QuotationSettings, {
|
||||||
"name": "SalesOrderSettings",
|
name: 'SalesOrderSettings',
|
||||||
"label": "Sales Order Settings",
|
label: 'Sales Order Settings',
|
||||||
"fields": [
|
fields: [
|
||||||
{
|
{
|
||||||
"fieldname": "numberSeries",
|
fieldname: 'numberSeries',
|
||||||
"default": "SO"
|
default: 'SO',
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
});
|
});
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
|
|
||||||
export default async function generateTaxes(country) {
|
export default async function generateTaxes(country) {
|
||||||
if (country === 'India') {
|
if (country === 'India') {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { _ } from 'frappejs/utils';
|
import { _ } from 'frappe/utils';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
doctype: 'Tax',
|
doctype: 'Tax',
|
||||||
title: _('Taxes'),
|
title: _('Taxes'),
|
||||||
columns: ['name']
|
columns: ['name'],
|
||||||
};
|
};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import Badge from '@/components/Badge';
|
import Badge from '@/components/Badge';
|
||||||
import { getInvoiceStatus, openQuickEdit, routeTo } from '@/utils';
|
import { getInvoiceStatus, openQuickEdit, routeTo } from '@/utils';
|
||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
import utils from '../../../accounting/utils';
|
import utils from '../../../accounting/utils';
|
||||||
import { statusColor } from '../../../src/colors';
|
import { statusColor } from '../../../src/colors';
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
import BaseDocument from 'frappejs/model/document';
|
import BaseDocument from 'frappe/model/document';
|
||||||
import { getExchangeRate } from '../../../accounting/exchangeRate';
|
import { getExchangeRate } from '../../../accounting/exchangeRate';
|
||||||
|
|
||||||
export default class TransactionDocument extends BaseDocument {
|
export default class TransactionDocument extends BaseDocument {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
async getPayments() {
|
async getPayments() {
|
||||||
@ -6,7 +6,7 @@ export default {
|
|||||||
doctype: 'PaymentFor',
|
doctype: 'PaymentFor',
|
||||||
fields: ['parent'],
|
fields: ['parent'],
|
||||||
filters: { referenceName: this.name },
|
filters: { referenceName: this.name },
|
||||||
orderBy: 'name'
|
orderBy: 'name',
|
||||||
});
|
});
|
||||||
if (payments.length != 0) {
|
if (payments.length != 0) {
|
||||||
return payments;
|
return payments;
|
||||||
@ -57,5 +57,5 @@ export default {
|
|||||||
}
|
}
|
||||||
const entries = await this.getPosting();
|
const entries = await this.getPosting();
|
||||||
await entries.postReverse();
|
await entries.postReverse();
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
|
|
||||||
async function setAugmentedModel(model, regionalInfo) {
|
async function setAugmentedModel(model, regionalInfo) {
|
||||||
const getAugmentedModel = (
|
const getAugmentedModel = (
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
|
|
||||||
export default async function execute() {
|
export default async function execute() {
|
||||||
// Since sqlite has no ALTER TABLE to change column meta
|
// Since sqlite has no ALTER TABLE to change column meta
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
|
|
||||||
function getTablesToConvert() {
|
function getTablesToConvert() {
|
||||||
// Do not change loops to map, doesn't work for some reason.
|
// Do not change loops to map, doesn't work for some reason.
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
|
|
||||||
export default class AccountsReceivablePayable {
|
export default class AccountsReceivablePayable {
|
||||||
async run(reportType, { date }) {
|
async run(reportType, { date }) {
|
||||||
const rows = await getReceivablePayable({
|
const rows = await getReceivablePayable({
|
||||||
reportType,
|
reportType,
|
||||||
date
|
date,
|
||||||
});
|
});
|
||||||
|
|
||||||
return { rows };
|
return { rows };
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
async function getReceivablePayable({ reportType = 'Receivable', date }) {
|
async function getReceivablePayable({ reportType = 'Receivable', date }) {
|
||||||
let entries = [];
|
let entries = [];
|
||||||
@ -34,7 +34,7 @@ async function getReceivablePayable({ reportType = 'Receivable', date }) {
|
|||||||
if (outStandingAmount > 0.1 / 10) {
|
if (outStandingAmount > 0.1 / 10) {
|
||||||
const row = {
|
const row = {
|
||||||
date: entry.date,
|
date: entry.date,
|
||||||
party: entry.party
|
party: entry.party,
|
||||||
};
|
};
|
||||||
|
|
||||||
// due date / bill date
|
// due date / bill date
|
||||||
@ -51,7 +51,7 @@ async function getReceivablePayable({ reportType = 'Receivable', date }) {
|
|||||||
invoicedAmount,
|
invoicedAmount,
|
||||||
paidAmount,
|
paidAmount,
|
||||||
outStandingAmount,
|
outStandingAmount,
|
||||||
creditNoteAmount
|
creditNoteAmount,
|
||||||
});
|
});
|
||||||
|
|
||||||
// ageing
|
// ageing
|
||||||
@ -69,13 +69,13 @@ async function getReceivablePayable({ reportType = 'Receivable', date }) {
|
|||||||
doctype: referenceType,
|
doctype: referenceType,
|
||||||
fields: ['name', 'date'],
|
fields: ['name', 'date'],
|
||||||
filters: {
|
filters: {
|
||||||
submitted: 1
|
submitted: 1,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function getValidEntries() {
|
function getValidEntries() {
|
||||||
return entries.filter(entry => {
|
return entries.filter((entry) => {
|
||||||
return (
|
return (
|
||||||
entry.date <= date &&
|
entry.date <= date &&
|
||||||
entry.referenceType === referenceType &&
|
entry.referenceType === referenceType &&
|
||||||
@ -111,7 +111,7 @@ async function getReceivablePayable({ reportType = 'Receivable', date }) {
|
|||||||
entry[reverseDebitOrCredit] -
|
entry[reverseDebitOrCredit] -
|
||||||
paymentAmount -
|
paymentAmount -
|
||||||
creditNoteAmount,
|
creditNoteAmount,
|
||||||
creditNoteAmount
|
creditNoteAmount,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,7 +121,7 @@ async function getReceivablePayable({ reportType = 'Receivable', date }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getFutureEntries() {
|
function getFutureEntries() {
|
||||||
return entries.filter(entry => entry.date > date);
|
return entries.filter((entry) => entry.date > date);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getReturnEntries() {
|
function getReturnEntries() {
|
||||||
@ -139,12 +139,14 @@ async function getReceivablePayable({ reportType = 'Receivable', date }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const partyType = reportType === 'Receivable' ? 'customer' : 'supplier';
|
const partyType = reportType === 'Receivable' ? 'customer' : 'supplier';
|
||||||
const partyList = (await frappe.db.getAll({
|
const partyList = (
|
||||||
doctype: 'Party',
|
await frappe.db.getAll({
|
||||||
filters: {
|
doctype: 'Party',
|
||||||
[partyType]: 1
|
filters: {
|
||||||
}
|
[partyType]: 1,
|
||||||
})).map(d => d.name);
|
},
|
||||||
|
})
|
||||||
|
).map((d) => d.name);
|
||||||
|
|
||||||
return await frappe.db.getAll({
|
return await frappe.db.getAll({
|
||||||
doctype: 'AccountingLedgerEntry',
|
doctype: 'AccountingLedgerEntry',
|
||||||
@ -156,13 +158,13 @@ async function getReceivablePayable({ reportType = 'Receivable', date }) {
|
|||||||
'referenceType',
|
'referenceType',
|
||||||
'referenceName',
|
'referenceName',
|
||||||
'sum(debit) as debit',
|
'sum(debit) as debit',
|
||||||
'sum(credit) as credit'
|
'sum(credit) as credit',
|
||||||
],
|
],
|
||||||
filters: {
|
filters: {
|
||||||
party: ['in', partyList]
|
party: ['in', partyList],
|
||||||
},
|
},
|
||||||
groupBy: ['referenceType', 'referenceName', 'party'],
|
groupBy: ['referenceType', 'referenceName', 'party'],
|
||||||
orderBy: 'date'
|
orderBy: 'date',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,51 +1,55 @@
|
|||||||
import frappe from 'frappejs';
|
import { unique } from 'frappe/utils';
|
||||||
import { unique } from 'frappejs/utils';
|
|
||||||
import { getData } from '../FinancialStatements/FinancialStatements';
|
import { getData } from '../FinancialStatements/FinancialStatements';
|
||||||
|
|
||||||
class BalanceSheet {
|
class BalanceSheet {
|
||||||
async run({ fromDate, toDate, periodicity }) {
|
async run({ fromDate, toDate, periodicity }) {
|
||||||
|
let asset = await getData({
|
||||||
|
rootType: 'Asset',
|
||||||
|
balanceMustBe: 'Debit',
|
||||||
|
fromDate,
|
||||||
|
toDate,
|
||||||
|
periodicity,
|
||||||
|
accumulateValues: true,
|
||||||
|
});
|
||||||
|
|
||||||
let asset = await getData({
|
let liability = await getData({
|
||||||
rootType: 'Asset',
|
rootType: 'Liability',
|
||||||
balanceMustBe: 'Debit',
|
balanceMustBe: 'Credit',
|
||||||
fromDate,
|
fromDate,
|
||||||
toDate,
|
toDate,
|
||||||
periodicity,
|
periodicity,
|
||||||
accumulateValues: true
|
accumulateValues: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
let liability = await getData({
|
let equity = await getData({
|
||||||
rootType: 'Liability',
|
rootType: 'Equity',
|
||||||
balanceMustBe: 'Credit',
|
balanceMustBe: 'Credit',
|
||||||
fromDate,
|
fromDate,
|
||||||
toDate,
|
toDate,
|
||||||
periodicity,
|
periodicity,
|
||||||
accumulateValues: true
|
accumulateValues: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
let equity = await getData({
|
const rows = [
|
||||||
rootType: 'Equity',
|
...asset.accounts,
|
||||||
balanceMustBe: 'Credit',
|
asset.totalRow,
|
||||||
fromDate,
|
[],
|
||||||
toDate,
|
...liability.accounts,
|
||||||
periodicity,
|
liability.totalRow,
|
||||||
accumulateValues: true
|
[],
|
||||||
});
|
...equity.accounts,
|
||||||
|
equity.totalRow,
|
||||||
|
[],
|
||||||
|
];
|
||||||
|
|
||||||
const rows = [
|
const columns = unique([
|
||||||
...asset.accounts, asset.totalRow, [],
|
...asset.periodList,
|
||||||
...liability.accounts, liability.totalRow, [],
|
...liability.periodList,
|
||||||
...equity.accounts, equity.totalRow, []
|
...equity.periodList,
|
||||||
];
|
]);
|
||||||
|
|
||||||
const columns = unique([
|
return { rows, columns };
|
||||||
...asset.periodList,
|
}
|
||||||
...liability.periodList,
|
|
||||||
...equity.periodList
|
|
||||||
]);
|
|
||||||
|
|
||||||
return { rows, columns };
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default BalanceSheet;
|
export default BalanceSheet;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
import getCommonExportActions from '../commonExporter';
|
import getCommonExportActions from '../commonExporter';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
|
|
||||||
class BankReconciliation {
|
class BankReconciliation {
|
||||||
async run(params) {
|
async run(params) {
|
||||||
@ -25,9 +25,9 @@ class BankReconciliation {
|
|||||||
'name',
|
'name',
|
||||||
'referenceDate',
|
'referenceDate',
|
||||||
'referenceId',
|
'referenceId',
|
||||||
'clearanceDate'
|
'clearanceDate',
|
||||||
],
|
],
|
||||||
filters: filters
|
filters: filters,
|
||||||
});
|
});
|
||||||
|
|
||||||
for (var i = 0; i < data.length; i++) {
|
for (var i = 0; i < data.length; i++) {
|
||||||
@ -37,8 +37,8 @@ class BankReconciliation {
|
|||||||
filters: {
|
filters: {
|
||||||
referenceType: 'Payment',
|
referenceType: 'Payment',
|
||||||
account: data[i].paymentAccount,
|
account: data[i].paymentAccount,
|
||||||
referenceName: data[i].name
|
referenceName: data[i].name,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
data[i].credit = ledger[0].credit;
|
data[i].credit = ledger[0].credit;
|
||||||
data[i].debit = ledger[0].debit;
|
data[i].debit = ledger[0].debit;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import csv2json from 'csvjson-csv2json';
|
import csv2json from 'csvjson-csv2json';
|
||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
import ReconciliationValidation from '../../src/components/ReconciliationValidation';
|
import ReconciliationValidation from '../../src/components/ReconciliationValidation';
|
||||||
|
|
||||||
export const fileImportHandler = (file, report) => {
|
export const fileImportHandler = (file, report) => {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
import { getPeriodList } from '../FinancialStatements/FinancialStatements';
|
|
||||||
import { DateTime } from 'luxon';
|
import { DateTime } from 'luxon';
|
||||||
|
import { getPeriodList } from '../FinancialStatements/FinancialStatements';
|
||||||
|
|
||||||
class Cashflow {
|
class Cashflow {
|
||||||
async run({ fromDate, toDate, periodicity }) {
|
async run({ fromDate, toDate, periodicity }) {
|
||||||
@ -15,10 +15,10 @@ class Cashflow {
|
|||||||
.where('reverted', 0)
|
.where('reverted', 0)
|
||||||
.sum({
|
.sum({
|
||||||
inflow: 'debit',
|
inflow: 'debit',
|
||||||
outflow: 'credit'
|
outflow: 'credit',
|
||||||
})
|
})
|
||||||
.select({
|
.select({
|
||||||
'month-year': dateAsMonthYear
|
'month-year': dateAsMonthYear,
|
||||||
})
|
})
|
||||||
.where('account', 'in', cashAndBankAccounts)
|
.where('account', 'in', cashAndBankAccounts)
|
||||||
.whereBetween('date', [fromDate, toDate])
|
.whereBetween('date', [fromDate, toDate])
|
||||||
@ -26,9 +26,9 @@ class Cashflow {
|
|||||||
|
|
||||||
let periodList = getPeriodList(fromDate, toDate, periodicity);
|
let periodList = getPeriodList(fromDate, toDate, periodicity);
|
||||||
|
|
||||||
let data = periodList.map(periodKey => {
|
let data = periodList.map((periodKey) => {
|
||||||
let monthYear = this.getMonthYear(periodKey, 'MMM yyyy');
|
let monthYear = this.getMonthYear(periodKey, 'MMM yyyy');
|
||||||
let cashflowForPeriod = res.find(d => d['month-year'] === monthYear);
|
let cashflowForPeriod = res.find((d) => d['month-year'] === monthYear);
|
||||||
if (cashflowForPeriod) {
|
if (cashflowForPeriod) {
|
||||||
cashflowForPeriod.periodKey = periodKey;
|
cashflowForPeriod.periodKey = periodKey;
|
||||||
return cashflowForPeriod;
|
return cashflowForPeriod;
|
||||||
@ -37,13 +37,13 @@ class Cashflow {
|
|||||||
inflow: 0,
|
inflow: 0,
|
||||||
outflow: 0,
|
outflow: 0,
|
||||||
periodKey,
|
periodKey,
|
||||||
'month-year': monthYear
|
'month-year': monthYear,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
data,
|
data,
|
||||||
periodList
|
periodList,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
import { DateTime } from 'luxon';
|
import { DateTime } from 'luxon';
|
||||||
import { convertPesaValuesToFloat } from '../../src/utils';
|
import { convertPesaValuesToFloat } from '../../src/utils';
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
|
|
||||||
class GeneralLedger {
|
class GeneralLedger {
|
||||||
async run(params) {
|
async run(params) {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
import { stateCodeMap } from '../../accounting/gst';
|
import { stateCodeMap } from '../../accounting/gst';
|
||||||
import { convertPesaValuesToFloat } from '../../src/utils';
|
import { convertPesaValuesToFloat } from '../../src/utils';
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import frappe from 'frappejs';
|
import { unique } from 'frappe/utils';
|
||||||
import { unique } from 'frappejs/utils';
|
|
||||||
import { getData } from '../FinancialStatements/FinancialStatements';
|
import { getData } from '../FinancialStatements/FinancialStatements';
|
||||||
|
|
||||||
class ProfitAndLoss {
|
class ProfitAndLoss {
|
||||||
@ -9,7 +8,7 @@ class ProfitAndLoss {
|
|||||||
balanceMustBe: 'Credit',
|
balanceMustBe: 'Credit',
|
||||||
fromDate,
|
fromDate,
|
||||||
toDate,
|
toDate,
|
||||||
periodicity
|
periodicity,
|
||||||
});
|
});
|
||||||
|
|
||||||
let expense = await getData({
|
let expense = await getData({
|
||||||
@ -17,17 +16,17 @@ class ProfitAndLoss {
|
|||||||
balanceMustBe: 'Debit',
|
balanceMustBe: 'Debit',
|
||||||
fromDate,
|
fromDate,
|
||||||
toDate,
|
toDate,
|
||||||
periodicity
|
periodicity,
|
||||||
});
|
});
|
||||||
|
|
||||||
let incomeTotalRow = income.totalRow;
|
let incomeTotalRow = income.totalRow;
|
||||||
incomeTotalRow.account = {
|
incomeTotalRow.account = {
|
||||||
template: `<span class="font-semibold">${income.totalRow.account}</span>`
|
template: `<span class="font-semibold">${income.totalRow.account}</span>`,
|
||||||
};
|
};
|
||||||
|
|
||||||
let expenseTotalRow = expense.totalRow;
|
let expenseTotalRow = expense.totalRow;
|
||||||
expenseTotalRow.account = {
|
expenseTotalRow.account = {
|
||||||
template: `<span class="font-semibold">${expense.totalRow.account}</span>`
|
template: `<span class="font-semibold">${expense.totalRow.account}</span>`,
|
||||||
};
|
};
|
||||||
|
|
||||||
let rows = [
|
let rows = [
|
||||||
@ -35,24 +34,24 @@ class ProfitAndLoss {
|
|||||||
incomeTotalRow,
|
incomeTotalRow,
|
||||||
{
|
{
|
||||||
account: {
|
account: {
|
||||||
template: '<span> </span>'
|
template: '<span> </span>',
|
||||||
},
|
},
|
||||||
isGroup: 1
|
isGroup: 1,
|
||||||
},
|
},
|
||||||
...expense.accounts,
|
...expense.accounts,
|
||||||
expenseTotalRow,
|
expenseTotalRow,
|
||||||
{
|
{
|
||||||
account: {
|
account: {
|
||||||
template: '<span> </span>'
|
template: '<span> </span>',
|
||||||
},
|
},
|
||||||
isGroup: 1
|
isGroup: 1,
|
||||||
}
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
rows = rows.map(row => {
|
rows = rows.map((row) => {
|
||||||
if (row.indent === 0) {
|
if (row.indent === 0) {
|
||||||
row.account = {
|
row.account = {
|
||||||
template: `<span class="font-semibold">${row.account}</span>`
|
template: `<span class="font-semibold">${row.account}</span>`,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return row;
|
return row;
|
||||||
@ -61,14 +60,14 @@ class ProfitAndLoss {
|
|||||||
const columns = unique([...income.periodList, ...expense.periodList]);
|
const columns = unique([...income.periodList, ...expense.periodList]);
|
||||||
|
|
||||||
let profitRow = {
|
let profitRow = {
|
||||||
account: 'Total Profit'
|
account: 'Total Profit',
|
||||||
};
|
};
|
||||||
|
|
||||||
for (let column of columns) {
|
for (let column of columns) {
|
||||||
profitRow[column] =
|
profitRow[column] =
|
||||||
(income.totalRow[column] || 0.0) - (expense.totalRow[column] || 0.0);
|
(income.totalRow[column] || 0.0) - (expense.totalRow[column] || 0.0);
|
||||||
|
|
||||||
rows.forEach(row => {
|
rows.forEach((row) => {
|
||||||
if (!row.isGroup) {
|
if (!row.isGroup) {
|
||||||
row[column] = row[column] || 0.0;
|
row[column] = row[column] || 0.0;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
import getCommonExportActions from '../commonExporter';
|
import getCommonExportActions from '../commonExporter';
|
||||||
|
|
||||||
const title = 'Profit and Loss';
|
const title = 'Profit and Loss';
|
||||||
@ -52,7 +52,7 @@ export default {
|
|||||||
label: name,
|
label: name,
|
||||||
fieldname: name,
|
fieldname: name,
|
||||||
fieldtype: 'Currency',
|
fieldtype: 'Currency',
|
||||||
width: 1
|
width: 1,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
columns.push(...columnDefs);
|
columns.push(...columnDefs);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
|
|
||||||
class PurchaseRegister {
|
class PurchaseRegister {
|
||||||
async run({ fromDate, toDate, supplier }) {
|
async run({ fromDate, toDate, supplier }) {
|
||||||
@ -23,24 +23,24 @@ class PurchaseRegister {
|
|||||||
fields: ['name', 'date', 'supplier', 'account', 'netTotal', 'grandTotal'],
|
fields: ['name', 'date', 'supplier', 'account', 'netTotal', 'grandTotal'],
|
||||||
filters,
|
filters,
|
||||||
orderBy: 'date',
|
orderBy: 'date',
|
||||||
order: 'desc'
|
order: 'desc',
|
||||||
});
|
});
|
||||||
|
|
||||||
const billNames = bills.map(d => d.name);
|
const billNames = bills.map((d) => d.name);
|
||||||
|
|
||||||
const taxes = await frappe.db.getAll({
|
const taxes = await frappe.db.getAll({
|
||||||
doctype: 'TaxSummary',
|
doctype: 'TaxSummary',
|
||||||
fields: ['parent', 'amount'],
|
fields: ['parent', 'amount'],
|
||||||
filters: {
|
filters: {
|
||||||
parenttype: 'PurchaseInvoice',
|
parenttype: 'PurchaseInvoice',
|
||||||
parent: ['in', billNames]
|
parent: ['in', billNames],
|
||||||
},
|
},
|
||||||
orderBy: 'name'
|
orderBy: 'name',
|
||||||
});
|
});
|
||||||
|
|
||||||
for (let bill of bills) {
|
for (let bill of bills) {
|
||||||
bill.totalTax = taxes
|
bill.totalTax = taxes
|
||||||
.filter(tax => tax.parent === bill.name)
|
.filter((tax) => tax.parent === bill.name)
|
||||||
.reduce((acc, tax) => {
|
.reduce((acc, tax) => {
|
||||||
if (tax.amount) {
|
if (tax.amount) {
|
||||||
acc = acc + tax.amount;
|
acc = acc + tax.amount;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
|
|
||||||
class SalesRegister {
|
class SalesRegister {
|
||||||
async run({ fromDate, toDate, customer }) {
|
async run({ fromDate, toDate, customer }) {
|
||||||
@ -22,24 +22,24 @@ class SalesRegister {
|
|||||||
fields: ['name', 'date', 'customer', 'account', 'netTotal', 'grandTotal'],
|
fields: ['name', 'date', 'customer', 'account', 'netTotal', 'grandTotal'],
|
||||||
filters: filters,
|
filters: filters,
|
||||||
orderBy: 'date',
|
orderBy: 'date',
|
||||||
order: 'desc'
|
order: 'desc',
|
||||||
});
|
});
|
||||||
|
|
||||||
const invoiceNames = invoices.map(d => d.name);
|
const invoiceNames = invoices.map((d) => d.name);
|
||||||
|
|
||||||
const taxes = await frappe.db.getAll({
|
const taxes = await frappe.db.getAll({
|
||||||
doctype: 'TaxSummary',
|
doctype: 'TaxSummary',
|
||||||
fields: ['parent', 'amount'],
|
fields: ['parent', 'amount'],
|
||||||
filters: {
|
filters: {
|
||||||
parenttype: 'Invoice',
|
parenttype: 'Invoice',
|
||||||
parent: ['in', invoiceNames]
|
parent: ['in', invoiceNames],
|
||||||
},
|
},
|
||||||
orderBy: 'name'
|
orderBy: 'name',
|
||||||
});
|
});
|
||||||
|
|
||||||
for (let invoice of invoices) {
|
for (let invoice of invoices) {
|
||||||
invoice.totalTax = taxes
|
invoice.totalTax = taxes
|
||||||
.filter(tax => tax.parent === invoice.name)
|
.filter((tax) => tax.parent === invoice.name)
|
||||||
.reduce((acc, tax) => {
|
.reduce((acc, tax) => {
|
||||||
if (tax.amount) {
|
if (tax.amount) {
|
||||||
acc = acc + tax.amount;
|
acc = acc + tax.amount;
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import frappe from 'frappejs';
|
|
||||||
import { getTrialBalance } from '../FinancialStatements/FinancialStatements';
|
import { getTrialBalance } from '../FinancialStatements/FinancialStatements';
|
||||||
|
|
||||||
export default class TrialBalance {
|
export default class TrialBalance {
|
||||||
@ -7,7 +6,7 @@ export default class TrialBalance {
|
|||||||
return { rows: [] };
|
return { rows: [] };
|
||||||
}
|
}
|
||||||
const promises = ['Asset', 'Expense', 'Income', 'Liability', 'Equity'].map(
|
const promises = ['Asset', 'Expense', 'Income', 'Liability', 'Equity'].map(
|
||||||
rootType => {
|
(rootType) => {
|
||||||
return getTrialBalance({ rootType, fromDate, toDate });
|
return getTrialBalance({ rootType, fromDate, toDate });
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -17,7 +16,7 @@ export default class TrialBalance {
|
|||||||
return [...acc, ...curr];
|
return [...acc, ...curr];
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
rows = rows.filter(r => r.debit !== 0 || r.credit !== 0);
|
rows = rows.filter((r) => r.debit !== 0 || r.credit !== 0);
|
||||||
return { rows };
|
return { rows };
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
import getCommonExportActions from '../commonExporter';
|
import getCommonExportActions from '../commonExporter';
|
||||||
|
|
||||||
const title = 'Trial Balance';
|
const title = 'Trial Balance';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
import { getSavePath, saveData, showExportInFolder } from '../src/utils';
|
import { getSavePath, saveData, showExportInFolder } from '../src/utils';
|
||||||
|
|
||||||
function templateToInnerText(innerHTML) {
|
function templateToInnerText(innerHTML) {
|
||||||
|
@ -1,76 +1,76 @@
|
|||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
import GeneralLedger from './GeneralLedger/GeneralLedger';
|
import AccountsReceivablePayable from './AccountsReceivablePayable/AccountsReceivablePayable';
|
||||||
import ProfitAndLoss from './ProfitAndLoss/ProfitAndLoss';
|
|
||||||
import BalanceSheet from './BalanceSheet/BalanceSheet';
|
import BalanceSheet from './BalanceSheet/BalanceSheet';
|
||||||
import TrialBalance from './TrialBalance/TrialBalance';
|
|
||||||
import SalesRegister from './SalesRegister/SalesRegister';
|
|
||||||
import PurchaseRegister from './PurchaseRegister/PurchaseRegister';
|
|
||||||
import BankReconciliation from './BankReconciliation/BankReconciliation';
|
import BankReconciliation from './BankReconciliation/BankReconciliation';
|
||||||
|
import GeneralLedger from './GeneralLedger/GeneralLedger';
|
||||||
import GSTR1 from './GoodsAndServiceTax/GSTR1';
|
import GSTR1 from './GoodsAndServiceTax/GSTR1';
|
||||||
import GSTR2 from './GoodsAndServiceTax/GSTR2';
|
import GSTR2 from './GoodsAndServiceTax/GSTR2';
|
||||||
import AccountsReceivablePayable from './AccountsReceivablePayable/AccountsReceivablePayable';
|
import ProfitAndLoss from './ProfitAndLoss/ProfitAndLoss';
|
||||||
|
import PurchaseRegister from './PurchaseRegister/PurchaseRegister';
|
||||||
|
import SalesRegister from './SalesRegister/SalesRegister';
|
||||||
|
import TrialBalance from './TrialBalance/TrialBalance';
|
||||||
|
|
||||||
// called on server side
|
// called on server side
|
||||||
function registerReportMethods() {
|
function registerReportMethods() {
|
||||||
const reports = [
|
const reports = [
|
||||||
{
|
{
|
||||||
method: 'general-ledger',
|
method: 'general-ledger',
|
||||||
class: GeneralLedger
|
class: GeneralLedger,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
method: 'profit-and-loss',
|
method: 'profit-and-loss',
|
||||||
class: ProfitAndLoss
|
class: ProfitAndLoss,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
method: 'balance-sheet',
|
method: 'balance-sheet',
|
||||||
class: BalanceSheet
|
class: BalanceSheet,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
method: 'trial-balance',
|
method: 'trial-balance',
|
||||||
class: TrialBalance
|
class: TrialBalance,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
method: 'sales-register',
|
method: 'sales-register',
|
||||||
class: SalesRegister
|
class: SalesRegister,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
method: 'purchase-register',
|
method: 'purchase-register',
|
||||||
class: PurchaseRegister
|
class: PurchaseRegister,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
method: 'bank-reconciliation',
|
method: 'bank-reconciliation',
|
||||||
class: BankReconciliation
|
class: BankReconciliation,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
method: 'gstr-1',
|
method: 'gstr-1',
|
||||||
class: GSTR1
|
class: GSTR1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
method: 'gstr-2',
|
method: 'gstr-2',
|
||||||
class: GSTR2
|
class: GSTR2,
|
||||||
}
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
reports.forEach(report => {
|
reports.forEach((report) => {
|
||||||
frappe.registerMethod({
|
frappe.registerMethod({
|
||||||
method: report.method,
|
method: report.method,
|
||||||
handler: getReportData(report.class)
|
handler: getReportData(report.class),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
frappe.registerMethod({
|
frappe.registerMethod({
|
||||||
method: 'accounts-receivable',
|
method: 'accounts-receivable',
|
||||||
handler: args => new AccountsReceivablePayable().run('Receivable', args)
|
handler: (args) => new AccountsReceivablePayable().run('Receivable', args),
|
||||||
});
|
});
|
||||||
|
|
||||||
frappe.registerMethod({
|
frappe.registerMethod({
|
||||||
method: 'accounts-payable',
|
method: 'accounts-payable',
|
||||||
handler: args => new AccountsReceivablePayable().run('Payable', args)
|
handler: (args) => new AccountsReceivablePayable().run('Payable', args),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function getReportData(ReportClass) {
|
function getReportData(ReportClass) {
|
||||||
return args => new ReportClass().run(args);
|
return (args) => new ReportClass().run(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default registerReportMethods;
|
export default registerReportMethods;
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
|
import server from 'frappe/server';
|
||||||
import models from '../models';
|
import models from '../models';
|
||||||
import server from 'frappejs/server';
|
|
||||||
import postStart from './postStart';
|
import postStart from './postStart';
|
||||||
|
|
||||||
async function start() {
|
async function start() {
|
||||||
await server.start({
|
await server.start({
|
||||||
backend: 'sqlite',
|
backend: 'sqlite',
|
||||||
connectionParams: { dbPath: 'test.db', enableCORS: true },
|
connectionParams: { dbPath: 'test.db', enableCORS: true },
|
||||||
models
|
models,
|
||||||
})
|
});
|
||||||
|
|
||||||
await postStart();
|
await postStart();
|
||||||
}
|
}
|
||||||
|
|
||||||
start();
|
start();
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
start
|
start,
|
||||||
};
|
};
|
||||||
|
@ -1,14 +1,13 @@
|
|||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
import naming from 'frappejs/model/naming';
|
import naming from 'frappe/model/naming';
|
||||||
|
import GSTR3BServer from '../models/doctype/GSTR3B/GSTR3BServer.js';
|
||||||
|
import JournalEntryServer from '../models/doctype/JournalEntry/JournalEntryServer.js';
|
||||||
|
import PartyServer from '../models/doctype/Party/PartyServer.js';
|
||||||
|
import PaymentServer from '../models/doctype/Payment/PaymentServer.js';
|
||||||
|
import PurchaseInvoiceServer from '../models/doctype/PurchaseInvoice/PurchaseInvoiceServer.js';
|
||||||
|
import SalesInvoiceServer from '../models/doctype/SalesInvoice/SalesInvoiceServer.js';
|
||||||
import registerServerMethods from './registerServerMethods';
|
import registerServerMethods from './registerServerMethods';
|
||||||
|
|
||||||
import SalesInvoiceServer from '../models/doctype/SalesInvoice/SalesInvoiceServer.js'
|
|
||||||
import PaymentServer from '../models/doctype/Payment/PaymentServer.js'
|
|
||||||
import PartyServer from '../models/doctype/Party/PartyServer.js'
|
|
||||||
import PurchaseInvoiceServer from '../models/doctype/PurchaseInvoice/PurchaseInvoiceServer.js'
|
|
||||||
import JournalEntryServer from '../models/doctype/JournalEntry/JournalEntryServer.js'
|
|
||||||
import GSTR3BServer from '../models/doctype/GSTR3B/GSTR3BServer.js'
|
|
||||||
|
|
||||||
export default async function postStart() {
|
export default async function postStart() {
|
||||||
// set server-side modules
|
// set server-side modules
|
||||||
frappe.models.SalesInvoice.documentClass = SalesInvoiceServer;
|
frappe.models.SalesInvoice.documentClass = SalesInvoiceServer;
|
||||||
@ -41,15 +40,15 @@ export default async function postStart() {
|
|||||||
frappe.currencySymbols = await getCurrencySymbols();
|
frappe.currencySymbols = await getCurrencySymbols();
|
||||||
|
|
||||||
registerServerMethods();
|
registerServerMethods();
|
||||||
};
|
}
|
||||||
|
|
||||||
function getCurrencySymbols() {
|
function getCurrencySymbols() {
|
||||||
return frappe.db
|
return frappe.db
|
||||||
.getAll({
|
.getAll({
|
||||||
doctype: 'Currency',
|
doctype: 'Currency',
|
||||||
fields: ['name', 'symbol']
|
fields: ['name', 'symbol'],
|
||||||
})
|
})
|
||||||
.then(data => {
|
.then((data) => {
|
||||||
return data.reduce((obj, currency) => {
|
return data.reduce((obj, currency) => {
|
||||||
obj[currency.name] = currency.symbol;
|
obj[currency.name] = currency.symbol;
|
||||||
return obj;
|
return obj;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
import importCharts from '../accounting/importCOA';
|
import importCharts from '../accounting/importCOA';
|
||||||
import registerReportMethods from '../reports';
|
import registerReportMethods from '../reports';
|
||||||
|
|
||||||
@ -9,6 +9,6 @@ export default function registerServerMethods() {
|
|||||||
method: 'import-coa',
|
method: 'import-coa',
|
||||||
async handler() {
|
async handler() {
|
||||||
await importCharts();
|
await importCharts();
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import './styles/index.css';
|
import './styles/index.css';
|
||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
import Desk from './pages/Desk';
|
import Desk from './pages/Desk';
|
||||||
import SetupWizard from './pages/SetupWizard/SetupWizard';
|
import SetupWizard from './pages/SetupWizard/SetupWizard';
|
||||||
import DatabaseSelector from './pages/DatabaseSelector';
|
import DatabaseSelector from './pages/DatabaseSelector';
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
import { ipcRenderer } from 'electron';
|
import { ipcRenderer } from 'electron';
|
||||||
import Base from './Base';
|
import Base from './Base';
|
||||||
import { IPC_ACTIONS } from '@/messages'
|
import { IPC_ACTIONS } from '@/messages'
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
import Float from './Float';
|
import Float from './Float';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
import Base from './Base';
|
import Base from './Base';
|
||||||
import DatePicker from '../DatePicker/DatePicker';
|
import DatePicker from '../DatePicker/DatePicker';
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<script>
|
<script>
|
||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
import AutoComplete from './AutoComplete';
|
import AutoComplete from './AutoComplete';
|
||||||
import Badge from '@/components/Badge';
|
import Badge from '@/components/Badge';
|
||||||
import { openQuickEdit } from '@/utils';
|
import { openQuickEdit } from '@/utils';
|
||||||
|
@ -61,7 +61,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import frappe from 'frappejs';
|
import frappe from 'frappe';
|
||||||
import Row from '@/components/Row';
|
import Row from '@/components/Row';
|
||||||
import Base from './Base';
|
import Base from './Base';
|
||||||
import TableRow from './TableRow';
|
import TableRow from './TableRow';
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import FormLayout from 'frappejs/ui/components/Form/FormLayout';
|
import FormLayout from 'frappe/ui/components/Form/FormLayout';
|
||||||
import { Sketch } from 'vue-color';
|
import { Sketch } from 'vue-color';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import indicators from 'frappejs/ui/constants/indicators';
|
import indicators from 'frappe/ui/constants/indicators';
|
||||||
export default {
|
export default {
|
||||||
name: 'MessageDialog',
|
name: 'MessageDialog',
|
||||||
data() {
|
data() {
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user