2
0
mirror of https://github.com/frappe/books.git synced 2024-09-19 19:19:02 +00:00

restructure acc to electron build project

This commit is contained in:
Faris Ansari 2018-03-30 22:33:12 +05:30
parent 25095bd064
commit 10c47fb6dc
8 changed files with 3112 additions and 2932 deletions

3
.gitignore vendored
View File

@ -4,4 +4,5 @@ Thumbs.db
*test.db
*.log
.cache
/temp
/temp
dist

View File

@ -1,12 +1,68 @@
const path = require('path');
const electron = require('frappejs/client/electron');
const { writeFile } = require('frappejs/server/utils');
const appClient = require('../client');
const SetupWizard = require('../setup');
electron.start({
dbPath: 'test.db',
columns: 3,
models: require('../models')
}).then((frappe) => {
(async () => {
const configFilePath = path.join(require('os').homedir(), '.config', 'frappe-accounting', 'settings.json');
let settings, dbPath;
try {
settings = require(configFilePath);
} catch(e) {
settings = {}
}
if (settings.dbPath) {
dbPath = settings.dbPath;
electron.start({
dbPath,
models: require('../models')
}).then(() => {
appClient.start();
});
} else {
const setup = new SetupWizard();
window.setup = setup;
const values = await setup.start();
const {
companyName,
file,
country,
name,
email,
abbreviation,
bankName
} = values;
dbPath = path.join(file[0].path, companyName + '.db');
electron.start({
dbPath,
models: require('../models')
}).then(async () => {
await writeFile(configFilePath, JSON.stringify({
directory: path.dirname(dbPath),
dbPath: dbPath
}));
const doc = await frappe.getDoc('AccountingSettings');
await doc.set('companyName', companyName);
await doc.set('file', dbPath);
await doc.set('country', country);
await doc.set('fullname', name);
await doc.set('email', email);
await doc.set('abbreviation', abbreviation);
await doc.set('bankName', bankName);
await doc.update();
appClient.start();
})
}
})();
module.exports = false;
appClient.start(frappe);
});

View File

@ -17,13 +17,13 @@ function createWindow () {
// and load the index.html of the app.
mainWindow.loadURL(url.format({
pathname: path.join(__dirname, 'index.html'),
pathname: path.join(__dirname, 'electron/index.html'),
protocol: 'file:',
slashes: true
}))
// Open the DevTools.
mainWindow.webContents.openDevTools()
// mainWindow.webContents.openDevTools()
// Emitted when the window is closed.
mainWindow.on('closed', function () {

View File

@ -1,15 +1,23 @@
{
"name": "frappe-accounting",
"productName": "ERPNext Desktop",
"description": "Simple Accounting app for everyone",
"productName": "Frappe Accounting",
"version": "1.0.0",
"main": "electron/main.js",
"author": {
"name": "Frappe Technologies Pvt. Ltd.",
"email": "hello@frappe.io"
},
"build": {
"appId": "io.frappe.accounting"
},
"main": "main.js",
"license": "MIT",
"scripts": {
"test": "mocha tests",
"start": "nodemon server.js",
"watch": "rollup -c --watch",
"electron": "electron electron/main.js",
"electron-pack": "electron-packager electron/main.js --overwrite",
"electron": "electron main.js",
"electron-pack": "electron-packager . --overwrite",
"postinstall": "electron-builder install-app-deps"
},
"dependencies": {

View File

@ -1,7 +1,7 @@
const server = require('frappejs/server');
const frappe = require('frappejs');
const GeneralLedger = require('../reports/generalLedger/GeneralLedger')
const naming = require('frappejs/model/naming')
const GeneralLedger = require('../reports/generalLedger/GeneralLedger');
const naming = require('frappejs/model/naming');
module.exports = {
async start() {

View File

@ -7207,6 +7207,10 @@ span.CodeMirror-selectedtext {
border-bottom: 1px solid #d1d8dd; }
.body-scrollable.row-highlight-all .data-table-row:not(.row-unhighlight) {
background-color: #f5f7fa; }
.body-scrollable .no-data td {
text-align: center;
padding: 8px;
padding: 0.5rem; }
.data-table-header {
position: absolute;
top: 0;
@ -7494,6 +7498,74 @@ mark {
margin: 0.25rem; }
.vertical-margin {
margin: 1rem 0px; }
.tree {
padding: 15px; }
.tree li {
list-style: none;
margin: 2px 0px; }
ul.tree-children {
padding-left: 20px; }
.tree-link {
cursor: pointer;
display: inline-block;
padding: 1px; }
.tree-link .node-parent {
color: #6c757d;
font-size: 14px;
width: 10px;
text-align: center; }
.tree-link .node-leaf {
color: #ced4da; }
.tree-link .node-parent, .tree-link .node-leaf {
margin-right: 5px;
margin-left: 2px;
margin-top: 3px; }
.tree-link.active svg {
color: #007bff; }
.tree-link.active a {
color: #6c757d; }
.tree-hover {
background-color: #e9ecef;
min-height: 20px;
border: 1px solid #6c757d; }
.tree-node-toolbar {
display: inline-block;
padding: 0px 5px;
margin-left: 15px;
margin-bottom: -4px;
margin-top: -8px; }
.tree.with-skeleton, .tree.with-skeleton .tree-node {
position: relative; }
.tree.with-skeleton.opened::before, .tree.with-skeleton:last-child::after, .tree.with-skeleton .tree-node.opened::before, .tree.with-skeleton .tree-node:last-child::after {
content: '';
position: absolute;
top: 12px;
left: 7px;
height: calc(100% - 23px);
width: 1px;
background: #ced4da;
z-index: -1; }
.tree.with-skeleton:last-child::after, .tree.with-skeleton .tree-node:last-child::after {
top: 11px;
left: -13px;
height: calc(100% - 15px);
width: 3px;
background: #fff; }
.tree.with-skeleton.opened > .tree-children > .tree-node > .tree-link::before, .tree.with-skeleton .tree-node.opened > .tree-children > .tree-node > .tree-link::before {
content: '';
position: absolute;
width: 18px;
height: 1px;
top: 10px;
left: -12px;
z-index: -1;
background: #ced4da; }
.tree.with-skeleton.opened::before {
left: 22px;
top: 33px;
height: calc(100% - 67px); }
.tree-link.active ~ .balance-area {
color: #6c757d !important; }
.setup-container {
margin: 40px auto;
padding: 20px 0px;
@ -7502,9 +7574,16 @@ mark {
border-radius: 4px; }
.setup-container h3 {
text-align: center; }
.setup-container .form-body {
.setup-container .form-section {
display: none; }
.setup-container .form-body.active {
.setup-container .form-section.active {
display: block; }
.setup-container .setup-link-area {
margin: 0.25rem 2rem; }
input[type=file] {
width: 0.1px;
height: 0.1px;
opacity: 0;
overflow: hidden;
position: absolute;
z-index: -1; }

5846
www/dist/js/bundle.js vendored

File diff suppressed because one or more lines are too long

View File

@ -2014,9 +2014,9 @@ fragment-cache@^0.2.1:
dependencies:
map-cache "^0.2.2"
frappe-datatable@^0.0.3:
frappe-datatable@frappe/datatable:
version "0.0.3"
resolved "https://registry.yarnpkg.com/frappe-datatable/-/frappe-datatable-0.0.3.tgz#55d3fd7bafdf2a7380efab2ae2aaaa956624fca0"
resolved "https://codeload.github.com/frappe/datatable/tar.gz/e5af37fb07ddaaa43cfb42dd84ac4f98d93816bc"
dependencies:
clusterize.js "^0.18.0"
lodash "^4.17.5"
@ -2035,7 +2035,7 @@ frappejs@../frappejs:
eslint "^4.19.1"
express "^4.16.2"
flatpickr "^4.3.2"
frappe-datatable "^0.0.3"
frappe-datatable frappe/datatable
frappejs "../frappejs"
jquery "^3.3.1"
mocha "^4.1.0"
@ -2045,6 +2045,7 @@ frappejs@../frappejs:
node-sass "^4.7.2"
nodemon "^1.14.7"
nunjucks "^3.1.0"
octicons "^7.2.0"
popper.js "^1.12.9"
precss "^2.0.0"
puppeteer "^1.2.0"
@ -4842,15 +4843,6 @@ rollup-plugin-sass@^0.5.3:
node-sass ">= 3.8.0"
rollup-pluginutils ">= 1.3.1"
rollup-plugin-sass@^0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/rollup-plugin-sass/-/rollup-plugin-sass-0.6.0.tgz#7d490827f395db4b5252485c45cc1a39da88901b"
dependencies:
babel-runtime "^6.23.0"
fs-extra "^0.30.0"
node-sass ">= 3.8.0"
rollup-pluginutils ">= 1.3.1"
"rollup-pluginutils@>= 1.3.1", rollup-pluginutils@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.0.1.tgz#7ec95b3573f6543a46a6461bd9a7c544525d0fc0"