mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-23 00:00:31 +00:00
spelling: accounts
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import { Service, Inject } from 'typedi';
|
||||
import { Knex } from 'knex';
|
||||
import HasTenancyService from '@/services/Tenancy/TenancyService';
|
||||
|
||||
@Service()
|
||||
export class InventoryTransactionsWarehouses {
|
||||
@Inject()
|
||||
tenancy: HasTenancyService;
|
||||
|
||||
/**
|
||||
* Updates all accounts transctions with the priamry branch.
|
||||
* @param tenantId
|
||||
* @param primaryBranchId
|
||||
*/
|
||||
public updateTransactionsWithWarehouse = async (
|
||||
tenantId: number,
|
||||
primaryBranchId: number,
|
||||
trx?: Knex.Transaction
|
||||
) => {
|
||||
const { AccountTransaction } = await this.tenancy.models(tenantId);
|
||||
|
||||
await AccountTransaction.query(trx).update({
|
||||
branchId: primaryBranchId,
|
||||
});
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user