feat: Financial statements enhancement.

This commit is contained in:
Ahmed Bouhuolia
2020-06-17 22:06:33 +02:00
parent 5c43f902e3
commit 3e15cd42c8
75 changed files with 1308 additions and 593 deletions

View File

@@ -22,7 +22,7 @@ export default class Account extends mixin(TenantModel, [CachableModel]) {
/**
* Timestamps columns.
*/
static get timestamps() {
get timestamps() {
return ['createdAt', 'updatedAt'];
}

View File

@@ -16,7 +16,7 @@ export default class AccountTransaction extends mixin(TenantModel, [CachableMode
/**
* Timestamps columns.
*/
static get timestamps() {
get timestamps() {
return ['createdAt'];
}

View File

@@ -12,7 +12,7 @@ export default class Customer extends TenantModel {
/**
* Model timestamps.
*/
static get timestamps() {
get timestamps() {
return ['createdAt', 'updatedAt'];
}

View File

@@ -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');
}
});
}