2
0
mirror of https://github.com/frappe/books.git synced 2024-12-22 02:49:03 +00:00

chore: format files using prettier

This commit is contained in:
18alantom 2023-06-27 13:10:04 +05:30
parent 711b4d9b20
commit 8c9d81d298
28 changed files with 3985 additions and 4851 deletions

View File

@ -51,5 +51,5 @@ jobs:
- name: Build Source Files - name: Build Source Files
run: yarn build --nosign --nopackage run: yarn build --nosign --nopackage
- name: Run UI Tests - name: Run UI Tests
run: yarn uitest run: yarn uitest

View File

@ -1,4 +1,3 @@
**/types.ts **/types.ts
**/dist_electron **/dist_electron
**/dummy/*.json **/dummy/*.json
**/fixtures/countryInfo.json

View File

@ -97,7 +97,6 @@ couple of seconds to render this because of how dev mode works. Each file is
individually served by the dev server. And there are many files that have to be individually served by the dev server. And there are many files that have to be
sent. sent.
**Note: Debug Electron Main Process** **Note: Debug Electron Main Process**
When in dev mode electron runs with the `--inspect` flag which allows an When in dev mode electron runs with the `--inspect` flag which allows an

View File

@ -8,7 +8,7 @@ import {
assertDoesNotThrow, assertDoesNotThrow,
assertThrows, assertThrows,
BaseMetaKey, BaseMetaKey,
getBuiltTestSchemaMap getBuiltTestSchemaMap,
} from './helpers'; } from './helpers';
/** /**

View File

@ -8,4 +8,4 @@ these are not to be edited.
The generated data has some randomness, there is a `baseCount` arg to the The generated data has some randomness, there is a `baseCount` arg to the
exported `setupDummyInstance` function, the number of transactions generated are exported `setupDummyInstance` function, the number of transactions generated are
always more than this. always more than this.

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,3 @@
{ {
"countryCode": "ae", "countryCode": "ae",
"name": "U.A.E - Chart of Accounts", "name": "U.A.E - Chart of Accounts",
@ -464,4 +463,4 @@
"rootType": "Equity" "rootType": "Equity"
} }
} }
} }

View File

@ -409,4 +409,4 @@
"rootType": "Income" "rootType": "Income"
} }
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -420,4 +420,4 @@
"rootType": "Asset" "rootType": "Asset"
} }
} }
} }

View File

@ -832,4 +832,4 @@
"rootType": "Income" "rootType": "Income"
} }
} }
} }

View File

@ -684,4 +684,4 @@
"rootType": "Income" "rootType": "Income"
} }
} }
} }

View File

@ -173,4 +173,4 @@
"rootType": "Liability" "rootType": "Liability"
} }
} }
} }

View File

@ -599,4 +599,4 @@
"rootType": "Liability" "rootType": "Liability"
} }
} }
} }

View File

@ -491,4 +491,4 @@
"rootType": "Liability" "rootType": "Liability"
} }
} }
} }

View File

@ -690,4 +690,4 @@
"rootType": "Asset" "rootType": "Asset"
} }
} }
} }

View File

@ -308,4 +308,4 @@
"rootType": "Liability" "rootType": "Liability"
} }
} }
} }

View File

@ -1,170 +1,170 @@
{ {
"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": true
},
"Cash In Hand": {
"Cash": {
"accountType": "Cash"
},
"accountType": "Cash"
},
"Loans and Advances (Assets)": {
"isGroup": true
},
"Securities and Deposits": {
"Earnest Money": {}
},
"Stock Assets": {
"Stock In Hand": {
"accountType": "Stock"
},
"accountType": "Stock"
},
"Tax Assets": {
"isGroup": true
}
}, },
"Fixed Assets": { "Bank Accounts": {
"Capital Equipments": { "accountType": "Bank",
"accountType": "Fixed Asset"
},
"Electronic Equipments": {
"accountType": "Fixed Asset"
},
"Furnitures and Fixtures": {
"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": {
"isGroup": true "isGroup": true
}, },
"Temporary Accounts": { "Cash In Hand": {
"Temporary Opening": { "Cash": {
"accountType": "Temporary" "accountType": "Cash"
} },
"accountType": "Cash"
}, },
"rootType": "Asset" "Loans and Advances (Assets)": {
"isGroup": true
},
"Securities and Deposits": {
"Earnest Money": {}
},
"Stock Assets": {
"Stock In Hand": {
"accountType": "Stock"
},
"accountType": "Stock"
},
"Tax Assets": {
"isGroup": true
}
},
"Fixed Assets": {
"Capital Equipments": {
"accountType": "Fixed Asset"
},
"Electronic Equipments": {
"accountType": "Fixed Asset"
},
"Furnitures and Fixtures": {
"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": {
"isGroup": true
},
"Temporary Accounts": {
"Temporary Opening": {
"accountType": "Temporary"
}
},
"rootType": "Asset"
}, },
"Expenses": { "Expenses": {
"Direct Expenses": { "Direct Expenses": {
"Stock Expenses": { "Stock Expenses": {
"Cost of Goods Sold": { "Cost of Goods Sold": {
"accountType": "Cost of Goods Sold" "accountType": "Cost of Goods Sold"
}, },
"Expenses Included In Valuation": { "Expenses Included In Valuation": {
"accountType": "Expenses Included In Valuation" "accountType": "Expenses Included In Valuation"
}, },
"Stock Adjustment": { "Stock Adjustment": {
"accountType": "Stock Adjustment" "accountType": "Stock Adjustment"
} }
} }
},
"Indirect Expenses": {
"Administrative Expenses": {},
"Commission on Sales": {},
"Depreciation": {
"accountType": "Depreciation"
}, },
"Indirect Expenses": { "Entertainment Expenses": {},
"Administrative Expenses": {}, "Freight and Forwarding Charges": {
"Commission on Sales": {}, "accountType": "Chargeable"
"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" "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": { "Income": {
"Direct Income": { "Direct Income": {
"Sales": {}, "Sales": {},
"Service": {} "Service": {}
}, },
"Indirect Income": { "Indirect Income": {
"isGroup": true "isGroup": true
}, },
"rootType": "Income" "rootType": "Income"
}, },
"Source of Funds (Liabilities)": { "Source of Funds (Liabilities)": {
"Current Liabilities": { "Current Liabilities": {
"Accounts Payable": { "Accounts Payable": {
"Creditors": { "Creditors": {
"accountType": "Payable" "accountType": "Payable"
}, },
"Payroll Payable": {} "Payroll Payable": {}
},
"Stock Liabilities": {
"Stock Received But Not Billed": {
"accountType": "Stock Received But Not Billed"
}
},
"Duties and Taxes": {
"accountType": "Tax",
"isGroup": true
},
"Loans (Liabilities)": {
"Secured Loans": {},
"Unsecured Loans": {},
"Bank Overdraft Account": {}
}
}, },
"rootType": "Liability" "Stock Liabilities": {
"Stock Received But Not Billed": {
"accountType": "Stock Received But Not Billed"
}
},
"Duties and Taxes": {
"accountType": "Tax",
"isGroup": true
},
"Loans (Liabilities)": {
"Secured Loans": {},
"Unsecured Loans": {},
"Bank Overdraft Account": {}
}
},
"rootType": "Liability"
}, },
"Equity": { "Equity": {
"Capital Stock": { "Capital Stock": {
"accountType": "Equity" "accountType": "Equity"
}, },
"Dividends Paid": { "Dividends Paid": {
"accountType": "Equity" "accountType": "Equity"
}, },
"Opening Balance Equity": { "Opening Balance Equity": {
"accountType": "Equity" "accountType": "Equity"
}, },
"Retained Earnings": { "Retained Earnings": {
"accountType": "Equity" "accountType": "Equity"
}, },
"rootType": "Equity" "rootType": "Equity"
} }
} }

View File

@ -29,7 +29,7 @@ located in `model/doc.ts`, all classes exported from `books/models` extend this.
- **Model**: the controller class that extends the `Doc` class, or the `Doc` - **Model**: the controller class that extends the `Doc` class, or the `Doc`
class itself (if a specific controller doesn't exist). class itself (if a specific controller doesn't exist).
- **doc** (not `Doc`): instance of a Model, i.e. what has the data. - **doc** (not `Doc`): instance of a Model, i.e. what has the data.
If you are confused, I understand. If you are confused, I understand.
## Initialization ## Initialization
@ -102,6 +102,7 @@ strings globally since this will be evaluated before the map is loaded.
The doc and db handlers have observers (instances of `Observable`) as The doc and db handlers have observers (instances of `Observable`) as
properties, these can be accessed using properties, these can be accessed using
- `fyo.db.observer` - `fyo.db.observer`
- `fyo.doc.observer` - `fyo.doc.observer`
@ -109,4 +110,4 @@ The purpose of the observer is to trigger registered callbacks when some `doc`
operation or `db` operation takes place. operation or `db` operation takes place.
These are schema level observers i.e. they are registered like so: These are schema level observers i.e. they are registered like so:
`method:schemaName`. The callbacks receive args passed to the functions. `method:schemaName`. The callbacks receive args passed to the functions.

View File

@ -1,3 +1,3 @@
module.exports = { module.exports = {
plugins: [require('tailwindcss'), require('autoprefixer')] plugins: [require('tailwindcss'), require('autoprefixer')],
}; };

View File

@ -17,7 +17,7 @@ There are a few types of schemas:
- **Subclass**: Schemas that have an `"extends"` field on them, the value of which - **Subclass**: Schemas that have an `"extends"` field on them, the value of which
points to an Abstract schema. points to an Abstract schema.
- **Complete**: Schemas which are neither abstract nor stub. - **Complete**: Schemas which are neither abstract nor stub.
For more detail on the meta structure of the schema check `books/schemas/types.ts`. For more detail on the meta structure of the schema check `books/schemas/types.ts`.
## Final Schema ## Final Schema
@ -40,4 +40,4 @@ In all the schemas, the `"name"` field/column is the primary key. If it isn't
explicitly added, the schema builder will add it in. explicitly added, the schema builder will add it in.
The following schema fields will be implicitly translated by the frontend: The following schema fields will be implicitly translated by the frontend:
`"label"`, `"description"`, and `"placeholder"`, irrespective of nesting. `"label"`, `"description"`, and `"placeholder"`, irrespective of nesting.

View File

@ -21,4 +21,4 @@
], ],
"keywordFields": ["name"], "keywordFields": ["name"],
"quickEditFields": ["details"] "quickEditFields": ["details"]
} }

View File

@ -21,4 +21,4 @@
} }
], ],
"tableFields": ["account", "rate"] "tableFields": ["account", "rate"]
} }

View File

@ -2,4 +2,4 @@
"name": "Customer", "name": "Customer",
"label": "Customer", "label": "Customer",
"extends": "Party" "extends": "Party"
} }

View File

@ -6,14 +6,14 @@ import {
cleanSchemas, cleanSchemas,
getAbstractCombinedSchemas, getAbstractCombinedSchemas,
getRegionalCombinedSchemas, getRegionalCombinedSchemas,
setSchemaNameOnFields setSchemaNameOnFields,
} from '../index'; } from '../index';
import { metaSchemas } from '../schemas'; import { metaSchemas } from '../schemas';
import { import {
everyFieldExists, everyFieldExists,
getTestSchemaMap, getTestSchemaMap,
someFieldExists, someFieldExists,
subtract subtract,
} from './helpers'; } from './helpers';
const { appSchemaMap, regionalSchemaMap } = getTestSchemaMap(); const { appSchemaMap, regionalSchemaMap } = getTestSchemaMap();

View File

@ -64,4 +64,4 @@ test('import SalesInvoices', async (t) => {
); );
}); });
closeTestFyo(fyo, __filename); closeTestFyo(fyo, __filename);

View File

@ -6,7 +6,7 @@ import { getValueMapFromList } from 'utils';
import { import {
getTestDbPath, getTestDbPath,
getTestFyo, getTestFyo,
getTestSetupWizardOptions getTestSetupWizardOptions,
} from './helpers'; } from './helpers';
const dbPath = getTestDbPath(); const dbPath = getTestDbPath();

View File

@ -2,12 +2,11 @@ import vue from '@vitejs/plugin-vue';
import path from 'path'; import path from 'path';
import { defineConfig } from 'vite'; import { defineConfig } from 'vite';
/** /**
* This vite config file is used only for dev mode, i.e. * This vite config file is used only for dev mode, i.e.
* to create a serve build modules of the source code * to create a serve build modules of the source code
* which will be rendered by electron. * which will be rendered by electron.
* *
* For building the project, vite is used programmatically * For building the project, vite is used programmatically
* see build/scripts/build.mjs for this. * see build/scripts/build.mjs for this.
*/ */