mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 21:30:31 +00:00
fix: bank rules
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
exports.up = function (knex) {
|
||||
return knex.schema.table('uncategorized_cashflow_transactions', (table) => {
|
||||
table.boolean('excluded');
|
||||
table.datetime('excluded_at');
|
||||
});
|
||||
};
|
||||
|
||||
exports.down = function (knex) {
|
||||
return knex.schema.table('uncategorized_cashflow_transactions', (table) => {
|
||||
table.dropColumn('excluded');
|
||||
table.dropColumn('excluded_at');
|
||||
});
|
||||
};
|
||||
|
||||
@@ -98,14 +98,14 @@ export default class UncategorizedCashflowTransaction extends mixin(
|
||||
* Filters the not excluded transactions.
|
||||
*/
|
||||
notExcluded(query) {
|
||||
query.whereNull('excluded');
|
||||
query.whereNull('excluded_at');
|
||||
},
|
||||
|
||||
/**
|
||||
* Filters the excluded transactions.
|
||||
*/
|
||||
excluded(query) {
|
||||
query.where('excluded', true)
|
||||
query.whereNotNull('excluded_at')
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
@@ -34,7 +34,7 @@ export class ExcludeBankTransaction {
|
||||
await UncategorizedCashflowTransaction.query(trx)
|
||||
.findById(uncategorizedTransactionId)
|
||||
.patch({
|
||||
excluded: true,
|
||||
excludedAt: new Date(),
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ export class GetExcludedBankTransactionsService {
|
||||
const { results, pagination } =
|
||||
await UncategorizedCashflowTransaction.query()
|
||||
.onBuild((q) => {
|
||||
q.where('excluded', true);
|
||||
q.modify('excluded');
|
||||
q.orderBy('date', 'DESC');
|
||||
|
||||
if (_query.accountId) {
|
||||
|
||||
@@ -34,7 +34,7 @@ export class UnexcludeBankTransaction {
|
||||
await UncategorizedCashflowTransaction.query(trx)
|
||||
.findById(uncategorizedTransactionId)
|
||||
.patch({
|
||||
excluded: null,
|
||||
excludedAt: null,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user