Skip to content

Commit

Permalink
Merge branch 'master' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
18alantom committed Feb 25, 2022
2 parents 9b9abc0 + 0109296 commit 75b5909
Show file tree
Hide file tree
Showing 33 changed files with 1,433 additions and 377 deletions.
23 changes: 9 additions & 14 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,21 @@ module.exports = {
root: true,

env: {
node: true
node: true,
},

extends: ["plugin:vue/essential"],

rules: {
"no-console": process.env.NODE_ENV === "production" ? "error" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
"arrow-body-style": "off",
"prefer-arrow-callback": "off",
"vue/multi-word-component-names": "off",
"vue/no-useless-template-attributes": "off",
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'arrow-body-style': 'off',
'prefer-arrow-callback': 'off',
'vue/multi-word-component-names': 'off',
'vue/no-useless-template-attributes': 'off',
},

parserOptions: {
parser: '@typescript-eslint/parser'
parser: '@typescript-eslint/parser',
},

'extends': [
'plugin:vue/essential',
'@vue/typescript'
]
extends: ['plugin:vue/vue3-essential', '@vue/typescript'],
};
47 changes: 0 additions & 47 deletions .vscode/launch.json

This file was deleted.

86 changes: 47 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,27 @@
![Platforms](https://img.shields.io/badge/platform-mac%2C%20windows%2C%20linux-yellowgreen)
[![Publish](https://github.com/frappe/books/actions/workflows/publish.yml/badge.svg)](https://github.com/frappe/books/actions/workflows/publish.yml)

Free Desktop book-keeping software for small businesses and freelancers.

Free Desktop book-keeping software for small-businesses and freelancers.
[frappebooks.com](https://frappebooks.com/)

<img src=".github/frappe-books-preview.png" alt="Frappe Books Preview" />

</div>

## Index

<details>
<summary><code>[show/hide]</code></summary>

1. [Features](#features)
2. [Installation](#installation)
3. [Development](#development)
4. [Contributions and Community](#contributions-and-community)
5. [Links](#links)
6. [License](#license)

</details>

## Features

Expand All @@ -26,51 +40,34 @@ Free Desktop book-keeping software for small-businesses and freelancers.
1. Dashboard
1. Works Offline
1. Financial Reports
- General Ledger
- Profit and Loss Statement
- Balance Sheet
- Trial Balance
1. Multi-currency Invoicing
- General Ledger
- Profit and Loss Statement
- Balance Sheet
- Trial Balance

## Download
## Installation

Download the latest release for your platform from the [releases
page](https://github.com/frappe/books/releases).
Download and install the latest release for your platform from the [releases
page](https://github.com/frappe/books/releases) or the [download
page](https://frappebooks.com/download).

## Development

Frappe Books is built on Vue.js and Electron. It is offline by default, and uses
Frappe Books is built on Vue.js and Electron. It is offline by default and uses
a local SQLite file as the database.

### Pre-requisites

1. Install build essentials

Ubuntu

```bash
apt-get install build-essential python git
apt-get install libgconf-2-4
```

MacOS

```bash
xcode-select --install
```
To get the dev environment up and running you need to first set up Node.js version
16.13.1 and npm. For this, we suggest using
[nvm](https://github.com/nvm-sh/nvm#installing-and-updating).

You will also need [Xcode App](https://apps.apple.com/in/app/xcode/id497799835?mt=12) from App Store

2. Install [Node.js](https://nodejs.org/en/). Check the `package.json` file for the node version.
> Tip: The best way to install and manage Node is to install [nvm](https://github.com/nvm-sh/nvm#usage)
3. Install `yarn` package manager
```bash
npm install -g yarn
```
Next, you will need to install [yarn](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable).

### Clone and Run

Due to some `yarn.lock` issue this won't run, to run it check [Issue #315](https://github.com/frappe/books/issues/315)
Once you are through the Pre-requisites, you can run the following commands to
get Frappe Books running in development mode:

```bash
# clone the repository
Expand All @@ -86,14 +83,25 @@ yarn
yarn electron:serve
```

## Contributions and Community

### FAQ
There are many ways you can contribute even if you don't code:

1. Launching electron and nothing displays
https://github.com/nklayman/vue-cli-plugin-electron-builder/issues/24#issuecomment-770165389
```bash
sudo chown root node_modules/electron/dist/chrome-sandbox && sudo chmod 4755 node_modules/electron/dist/chrome-sandbox
```
1. If you find any issues, no matter how small (even typos), you can [raise an issue](https://github.com/frappe/books/issues/new) to inform us.
2. You can help us with language support by [contributing translations](https://github.com/frappe/books/wiki/Contributing-Translations).
3. You report errors by setting **Hide & Auto Report Errors** in _Settings > System_.
4. If you're an ardent user you can tell us what you would like to see.
5. If you have accounting requirements, you can become an ardent user. 🙂
6. You can join our [telegram group](https://t.me/frappebooks) and share your thoughts.

If you want to contribute code then you can fork this repo, make changes and raise a PR. ([see how to](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork))

## Links

- [Telegram Group](https://t.me/frappebooks): Used for discussions regarding features, issues, changes, etc. This group is also be used to make decisions regarding project direction.
- [Project Board](https://github.com/frappe/books/projects/1): Roadmap that is updated with acceptable latency.
- [GitHub Discussions](https://github.com/frappe/books/discussions): Used for discussions around a specific topic.
- [Frappe Books Blog](https://frappebooks.com/tech/): Sporadically updated dev blog regarding the development of this project.

## License

Expand Down
16 changes: 10 additions & 6 deletions accounting/importCOA.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import frappe from 'frappe';
import countries from '../fixtures/countryInfo.json';
import standardCOA from '../fixtures/verified/standardCOA.json';
import { getCOAList } from '../src/utils';
const accountFields = ['accountType', 'accountNumber', 'rootType', 'isGroup'];

function getAccountName(accountName, accountNumber) {
Expand Down Expand Up @@ -55,9 +55,13 @@ function identifyIsGroup(child) {
return 0;
}

export async function getCountryCOA() {
const doc = await frappe.getDoc('AccountingSettings');
const conCode = countries[doc.country].code;
export async function getCountryCOA(chartOfAccounts) {
const coaList = await getCOAList();
const coa = coaList.find(({ name }) => name === chartOfAccounts);
const conCode = coa.countryCode;
if (!conCode) {
return standardCOA;
}

try {
const countryCoa = (
Expand All @@ -69,7 +73,7 @@ export async function getCountryCOA() {
}
}

export default async function importCharts() {
const chart = await getCountryCOA();
export default async function importCharts(chartOfAccounts) {
const chart = await getCountryCOA(chartOfAccounts);
await importAccounts(chart, '', '', true);
}
1 change: 1 addition & 0 deletions frappe/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ module.exports = {
this.methods = {};
this.errorLog = [];
// temp params while calling routes
this.temp = {};
this.params = {};
},

Expand Down
18 changes: 18 additions & 0 deletions frappe/model/naming.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@ const frappe = require('frappe');
const { getRandomString } = require('frappe/utils');

module.exports = {
async isNameAutoSet(doctype) {
const doc = frappe.getNewDoc(doctype);
if (doc.meta.naming === 'autoincrement') {
return true;
}

if (!doc.meta.settings) {
return false;
}

const { numberSeries } = await doc.getSettings();
if (numberSeries) {
return true;
}

return false;
},

async setName(doc) {
if (frappe.isServer) {
// if is server, always name again if autoincrement or other
Expand Down
2 changes: 1 addition & 1 deletion frappe/models/doctype/SystemSettings/SystemSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ module.exports = {
label: t`Locale`,
fieldtype: 'Data',
default: DEFAULT_LOCALE,
description: t`Set the local code, this is used for number formatting.`,
description: t`Set the local code. This is used for number formatting.`,
},
{
fieldname: 'displayPrecision',
Expand Down
1 change: 1 addition & 0 deletions models/doctype/Item/Item.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import frappe, { t } from 'frappe';

export default {
name: 'Item',
label: t`Item`,
doctype: 'DocType',
isSingle: 0,
regional: 1,
Expand Down
1 change: 1 addition & 0 deletions models/doctype/JournalEntry/JournalEntry.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export default {
label: t`Cancelled`,
fieldtype: 'Check',
default: 0,
readOnly: 1,
},
],
actions: [ledgerLink],
Expand Down
1 change: 1 addition & 0 deletions models/doctype/Payment/Payment.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ export default {
label: t`Cancelled`,
fieldtype: 'Check',
default: 0,
readOnly: 1,
},
],

Expand Down
1 change: 1 addition & 0 deletions models/doctype/PurchaseInvoice/PurchaseInvoice.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ export default {
label: t`Cancelled`,
fieldtype: 'Check',
default: 0,
readOnly: 1,
},
],

Expand Down
1 change: 1 addition & 0 deletions models/doctype/SalesInvoice/SalesInvoice.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ export default {
label: t`Cancelled`,
fieldtype: 'Check',
default: 0,
readOnly: 1,
},
],

Expand Down
22 changes: 22 additions & 0 deletions models/doctype/SetupWizard/SetupWizard.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { t } from 'frappe';
import { DateTime } from 'luxon';
import countryList from '~/fixtures/countryInfo.json';
import { getCOAList } from '../../../src/utils';

export default {
name: 'SetupWizard',
Expand Down Expand Up @@ -116,12 +117,33 @@ export default {
fieldtype: 'Check',
readonly: 1,
},
{
fieldname: 'chartOfAccounts',
label: t`Chart of Accounts`,
fieldtype: 'AutoComplete',
placeholder: t`Select CoA`,
formulaDependsOn: ['country'],
formula: async (doc) => {
if (!doc.country) return;

const { code } = countryList[doc.country];
const coaList = await getCOAList();
const coa = coaList.find(({ countryCode }) => countryCode === code);

if (coa === undefined) {
return coaList[0].name;
}
return coa.name;
},
getList: async () => (await getCOAList()).map(({ name }) => name),
},
],
quickEditFields: [
'fullname',
'bankName',
'country',
'currency',
'chartOfAccounts',
'fiscalYearStart',
'fiscalYearEnd',
],
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "frappe-books",
"version": "0.2.1-beta.0",
"version": "0.3.0-beta.0",
"description": "Simple book-keeping app for everyone",
"author": {
"name": "Frappe Technologies Pvt. Ltd.",
Expand Down Expand Up @@ -69,9 +69,10 @@
"trailingComma": "es5"
},
"engines": {
"node": ">=16.13.1",
"node": ">=16.13.1 <17",
"yarn": "1.22.17"
},
"engineStrict": true,
"gitHooks": {
"pre-commit": "lint-staged"
},
Expand Down
Loading

0 comments on commit 75b5909

Please sign in to comment.