mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 20:30:33 +00:00
feat: Financial statements enhancement.
This commit is contained in:
@@ -336,7 +336,7 @@ export default {
|
||||
}
|
||||
const expenses = await Expense.query().onBuild((builder) => {
|
||||
builder.withGraphFetched('paymentAccount');
|
||||
builder.withGraphFetched('categories');
|
||||
builder.withGraphFetched('categories.expenseAccount');
|
||||
builder.withGraphFetched('user');
|
||||
dynamicFilter.buildQuery()(builder);
|
||||
}).pagination(filter.page - 1, filter.page_size);;
|
||||
|
||||
@@ -106,11 +106,12 @@ export default class ReceivableAgingSummary extends AgingReport {
|
||||
}
|
||||
|
||||
const storedCustomers = await Customer.query().onBuild((builder) => {
|
||||
if (filter.customer_ids) {
|
||||
if (filter.customer_ids.length > 0) {
|
||||
builder.modify('filterCustomerIds', filter.customer_ids);
|
||||
}
|
||||
return builder;
|
||||
});
|
||||
|
||||
const accountsReceivableType = await AccountType.query()
|
||||
.where('key', 'accounts_receivable')
|
||||
.first();
|
||||
|
||||
@@ -22,7 +22,7 @@ export default class Account extends mixin(TenantModel, [CachableModel]) {
|
||||
/**
|
||||
* Timestamps columns.
|
||||
*/
|
||||
static get timestamps() {
|
||||
get timestamps() {
|
||||
return ['createdAt', 'updatedAt'];
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ export default class AccountTransaction extends mixin(TenantModel, [CachableMode
|
||||
/**
|
||||
* Timestamps columns.
|
||||
*/
|
||||
static get timestamps() {
|
||||
get timestamps() {
|
||||
return ['createdAt'];
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ export default class Customer extends TenantModel {
|
||||
/**
|
||||
* Model timestamps.
|
||||
*/
|
||||
static get timestamps() {
|
||||
get timestamps() {
|
||||
return ['createdAt', 'updatedAt'];
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import moment from 'moment';
|
||||
export default (Model) => {
|
||||
return class DateSession extends Model {
|
||||
|
||||
static get timestamps() {
|
||||
get timestamps() {
|
||||
return ['createdAt', 'updatedAt'];
|
||||
}
|
||||
|
||||
@@ -11,8 +11,8 @@ export default (Model) => {
|
||||
const maybePromise = super.$beforeUpdate(opt, context);
|
||||
|
||||
return Promise.resolve(maybePromise).then(() => {
|
||||
if (DateSession.timestamps[1]) {
|
||||
this[DateSession.timestamps[1]] = moment().format('YYYY/MM/DD HH:mm:ss');
|
||||
if (this.timestamps[1]) {
|
||||
this[this.timestamps[1]] = moment().format('YYYY/MM/DD HH:mm:ss');
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -21,8 +21,8 @@ export default (Model) => {
|
||||
const maybePromise = super.$beforeInsert(context);
|
||||
|
||||
return Promise.resolve(maybePromise).then(() => {
|
||||
if (DateSession.timestamps[0]) {
|
||||
this[DateSession.timestamps[0]] = moment().format('YYYY/MM/DD HH:mm:ss');
|
||||
if (this.timestamps[0]) {
|
||||
this[this.timestamps[0]] = moment().format('YYYY/MM/DD HH:mm:ss');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user