mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
hotfix: editing sales and expense transactions don't reflect GL entries
This commit is contained in:
@@ -136,7 +136,7 @@ export class EditExpense {
|
||||
} as IExpenseEventEditingPayload);
|
||||
|
||||
// Upsert the expense object with expense entries.
|
||||
const expense: IExpense = await Expense.query(trx).upsertGraph({
|
||||
const expense: IExpense = await Expense.query(trx).upsertGraphAndFetch({
|
||||
id: expenseId,
|
||||
...expenseObj,
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Knex } from 'knex';
|
||||
import { Service, Inject } from 'typedi';
|
||||
import LedgerStorageService from '@/services/Accounting/LedgerStorageService';
|
||||
import HasTenancyService from '@/services/Tenancy/TenancyService';
|
||||
import { Service, Inject } from 'typedi';
|
||||
import { ExpenseGLEntries } from './ExpenseGLEntries';
|
||||
|
||||
@Service()
|
||||
|
||||
@@ -70,10 +70,10 @@ export class ExpensesWriteGLSubscriber {
|
||||
authorizedUser,
|
||||
trx,
|
||||
}: IExpenseEventEditPayload) => {
|
||||
// In case expense published, write journal entries.
|
||||
if (expense.publishedAt) return;
|
||||
// Cannot continue if the expense is not published.
|
||||
if (!expense.publishedAt) return;
|
||||
|
||||
await this.expenseGLEntries.writeExpenseGLEntries(
|
||||
await this.expenseGLEntries.rewriteExpenseGLEntries(
|
||||
tenantId,
|
||||
expense.id,
|
||||
trx
|
||||
|
||||
Reference in New Issue
Block a user