mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 22:30:31 +00:00
fix financial statements.
This commit is contained in:
@@ -270,7 +270,7 @@ export default {
|
||||
user_id: user.id,
|
||||
});
|
||||
|
||||
const accountsDepGraph = await Account.depGraph().query().remember();
|
||||
const accountsDepGraph = await Account.depGraph().query();
|
||||
const journalPoster = new JournalPoster(accountsDepGraph);
|
||||
|
||||
entries.forEach((entry) => {
|
||||
|
||||
@@ -27,6 +27,10 @@ export default class Account extends mixin(TenantModel, [CachableModel, DateSess
|
||||
return CachableQueryBuilder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Query return override.
|
||||
* @param {...any} args
|
||||
*/
|
||||
static query(...args) {
|
||||
return super.query(...args).runAfter((result) => {
|
||||
if (Array.isArray(result)) {
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
tenantFactory,
|
||||
tenantWebsite
|
||||
} from '~/dbInit';
|
||||
|
||||
import DependencyGraph from '@/lib/DependencyGraph';
|
||||
|
||||
describe('Model: Account', () => {
|
||||
it('Should account model belongs to the associated account type model.', async () => {
|
||||
@@ -42,4 +42,9 @@ describe('Model: Account', () => {
|
||||
|
||||
expect(transactionsModels.length).equals(1);
|
||||
});
|
||||
|
||||
it('Should retrieve dependency graph.', async () => {
|
||||
const accountsDepGraph = await Account.tenant().depGraph().query();
|
||||
expect(accountsDepGraph).to.be.an.instanceOf(DependencyGraph);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
} from '~/dbInit';
|
||||
|
||||
|
||||
describe.only('routes: `/items`', () => {
|
||||
describe('routes: `/items`', () => {
|
||||
describe('POST: `/items`', () => {
|
||||
it('Should not create a new item if the user was not authorized.', async () => {
|
||||
const res = await request()
|
||||
|
||||
Reference in New Issue
Block a user