mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
- feat: Sales estimates.
- feat: Sales invoices. - feat: Sales payment receives. - feat: Purchases bills. - feat: Purchases bills payments that made to the vendors.
This commit is contained in:
@@ -1,9 +1,24 @@
|
||||
import { Account } from '@/models';
|
||||
import { Account, AccountType } from '@/models';
|
||||
|
||||
export default class AccountsService {
|
||||
|
||||
static async isAccountExists(accountId) {
|
||||
const foundAccounts = await Account.tenant().query().where('id', accountId);
|
||||
return foundAccounts.length > 0;
|
||||
}
|
||||
}
|
||||
|
||||
static async getAccountByType(accountTypeKey) {
|
||||
const accountType = await AccountType.tenant()
|
||||
.query()
|
||||
.where('key', accountTypeKey)
|
||||
.first();
|
||||
|
||||
const account = await Account.tenant()
|
||||
.query()
|
||||
.where('account_type_id', accountType.id)
|
||||
.first();
|
||||
|
||||
console.log(account);
|
||||
|
||||
return account;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user