mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 22:30:31 +00:00
fix: writing the bill journal entries.
This commit is contained in:
@@ -11,6 +11,8 @@ interface IJournalTransactionsFilter {
|
||||
toAmount: number,
|
||||
contactsIds?: number[],
|
||||
contactType?: string,
|
||||
referenceType?: string[],
|
||||
referenceId?: number[],
|
||||
};
|
||||
|
||||
export default class AccountTransactionsRepository extends TenantRepository {
|
||||
@@ -42,6 +44,12 @@ export default class AccountTransactionsRepository extends TenantRepository {
|
||||
if (filter.contactType) {
|
||||
query.where('contact_type', filter.contactType);
|
||||
}
|
||||
if (filter.referenceType && filter.referenceType.length > 0) {
|
||||
query.whereIn('reference_type', filter.referenceType);
|
||||
}
|
||||
if (filter.referenceId && filter.referenceId.length > 0) {
|
||||
query.whereIn('reference_id', filter.referenceId);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -177,7 +177,20 @@ export default class CachableRepository extends EntityRepository{
|
||||
*
|
||||
* @param {string|number[]} values -
|
||||
*/
|
||||
async deleteWhereIn(values: string | number[]) {
|
||||
async deleteWhereIn(field: string, values: string | number[]) {
|
||||
const result = await super.deleteWhereIn(field, values);
|
||||
|
||||
// Flushes the repository cache after delete operation.
|
||||
this.flushCache();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {string|number[]} values
|
||||
*/
|
||||
async deleteWhereIdIn(values: string | number[]) {
|
||||
const result = await super.deleteWhereIdIn(values);
|
||||
|
||||
// Flushes the repository cache after delete operation.
|
||||
|
||||
@@ -175,7 +175,7 @@ export default class EntityRepository {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Deletes the given entries in the array on the specific field.
|
||||
* @param {string} field -
|
||||
* @param {number|string} values -
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user