mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 14:20:31 +00:00
feat: rewrite repositories with base entity repository class.
feat: sales and purchases status. feat: sales and purchases auto-increment number. fix: settings find query with extra columns.
This commit is contained in:
@@ -70,7 +70,9 @@ export default class BillPaymentsService {
|
||||
*/
|
||||
private async getVendorOrThrowError(tenantId: number, vendorId: number) {
|
||||
const { vendorRepository } = this.tenancy.repositories(tenantId);
|
||||
const vendor = await vendorRepository.findById(vendorId);
|
||||
|
||||
// Retrieve vendor details of the given id.
|
||||
const vendor = await vendorRepository.findOneById(vendorId);
|
||||
|
||||
if (!vendor) {
|
||||
throw new ServiceError(ERRORS.BILL_VENDOR_NOT_FOUND)
|
||||
@@ -106,7 +108,7 @@ export default class BillPaymentsService {
|
||||
const { accountTypeRepository, accountRepository } = this.tenancy.repositories(tenantId);
|
||||
|
||||
const currentAssetTypes = await accountTypeRepository.getByChildType('current_asset');
|
||||
const paymentAccount = await accountRepository.findById(paymentAccountId);
|
||||
const paymentAccount = await accountRepository.findOneById(paymentAccountId);
|
||||
|
||||
const currentAssetTypesIds = currentAssetTypes.map(type => type.id);
|
||||
|
||||
@@ -405,7 +407,9 @@ export default class BillPaymentsService {
|
||||
|
||||
const paymentAmount = sumBy(billPayment.entries, 'paymentAmount');
|
||||
const formattedDate = moment(billPayment.paymentDate).format('YYYY-MM-DD');
|
||||
const payableAccount = await accountRepository.getBySlug('accounts-payable');
|
||||
|
||||
// Retrieve AP account from the storage.
|
||||
const payableAccount = await accountRepository.findOne({ slug: 'accounts-payable' });
|
||||
|
||||
const journal = new JournalPoster(tenantId);
|
||||
const commonJournal = {
|
||||
|
||||
Reference in New Issue
Block a user