mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 23:00:34 +00:00
spelling: associate
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
This commit is contained in:
@@ -97,7 +97,7 @@ export default class Branch extends TenantModel {
|
|||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Branch may belongs to assocaited bills.
|
* Branch may belongs to associated bills.
|
||||||
*/
|
*/
|
||||||
bills: {
|
bills: {
|
||||||
relation: Model.HasManyRelation,
|
relation: Model.HasManyRelation,
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ export default class CashflowTransaction extends TenantModel {
|
|||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cashflow transaction may has assocaited cashflow account.
|
* Cashflow transaction may has associated cashflow account.
|
||||||
*/
|
*/
|
||||||
cashflowAccount: {
|
cashflowAccount: {
|
||||||
relation: Model.BelongsToOneRelation,
|
relation: Model.BelongsToOneRelation,
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ export default class Warehouse extends TenantModel {
|
|||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Warehouse may belongs to assocaited bills.
|
* Warehouse may belongs to associated bills.
|
||||||
*/
|
*/
|
||||||
bills: {
|
bills: {
|
||||||
relation: Model.HasManyRelation,
|
relation: Model.HasManyRelation,
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ export default class LedgerStorageService {
|
|||||||
// Saves the ledger entries.
|
// Saves the ledger entries.
|
||||||
this.ledgerEntriesService.saveEntries(tenantId, ledger, trx),
|
this.ledgerEntriesService.saveEntries(tenantId, ledger, trx),
|
||||||
|
|
||||||
// Mutates the assocaited accounts balances.
|
// Mutates the associated accounts balances.
|
||||||
this.ledgerAccountsBalance.saveAccountsBalance(tenantId, ledger, trx),
|
this.ledgerAccountsBalance.saveAccountsBalance(tenantId, ledger, trx),
|
||||||
|
|
||||||
// Mutates the associated contacts balances.
|
// Mutates the associated contacts balances.
|
||||||
@@ -60,7 +60,7 @@ export default class LedgerStorageService {
|
|||||||
// Deletes the ledger entries.
|
// Deletes the ledger entries.
|
||||||
this.ledgerEntriesService.deleteEntries(tenantId, ledger, trx),
|
this.ledgerEntriesService.deleteEntries(tenantId, ledger, trx),
|
||||||
|
|
||||||
// Mutates the assocaited accounts balances.
|
// Mutates the associated accounts balances.
|
||||||
this.ledgerAccountsBalance.saveAccountsBalance(tenantId, ledger, trx),
|
this.ledgerAccountsBalance.saveAccountsBalance(tenantId, ledger, trx),
|
||||||
|
|
||||||
// Mutates the associated contacts balances.
|
// Mutates the associated contacts balances.
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ export class DeleteAccount {
|
|||||||
// Authorize before delete account.
|
// Authorize before delete account.
|
||||||
await this.authorize(tenantId, accountId, oldAccount);
|
await this.authorize(tenantId, accountId, oldAccount);
|
||||||
|
|
||||||
// Deletes the account and assocaited transactions under UOW envirement.
|
// Deletes the account and associated transactions under UOW envirement.
|
||||||
return this.uow.withTransaction(tenantId, async (trx: Knex.Transaction) => {
|
return this.uow.withTransaction(tenantId, async (trx: Knex.Transaction) => {
|
||||||
// Triggers `onAccountDelete` event.
|
// Triggers `onAccountDelete` event.
|
||||||
await this.eventPublisher.emitAsync(events.accounts.onDelete, {
|
await this.eventPublisher.emitAsync(events.accounts.onDelete, {
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ export default class CreditNoteInventoryTransactions {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Edits vendor credit assocaited inventory transactions.
|
* Edits vendor credit associated inventory transactions.
|
||||||
* @param {number} tenantId
|
* @param {number} tenantId
|
||||||
* @param {number} creditNoteId
|
* @param {number} creditNoteId
|
||||||
* @param {ICreditNote} creditNote
|
* @param {ICreditNote} creditNote
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export default class DeleteCustomerLinkedCreditSubscriber {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validate vendor has no assocaited credit transaction once the vendor deleting.
|
* Validate vendor has no associated credit transaction once the vendor deleting.
|
||||||
* @param {IVendorEventDeletingPayload} payload -
|
* @param {IVendorEventDeletingPayload} payload -
|
||||||
*/
|
*/
|
||||||
public validateCustomerHasNoLinkedCreditsOnDeleting = async ({
|
public validateCustomerHasNoLinkedCreditsOnDeleting = async ({
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ export default class InventoryService {
|
|||||||
) {
|
) {
|
||||||
const { Item } = this.tenancy.models(tenantId);
|
const { Item } = this.tenancy.models(tenantId);
|
||||||
|
|
||||||
// Fetches the item with assocaited item category.
|
// Fetches the item with associated item category.
|
||||||
const item = await Item.query().findById(itemId);
|
const item = await Item.query().findById(itemId);
|
||||||
|
|
||||||
// Cannot continue if the given item was not inventory item.
|
// Cannot continue if the given item was not inventory item.
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ export default class InventoryAdjustmentService {
|
|||||||
quickAdjustmentDTO,
|
quickAdjustmentDTO,
|
||||||
} as IInventoryAdjustmentCreatingPayload
|
} as IInventoryAdjustmentCreatingPayload
|
||||||
);
|
);
|
||||||
// Saves the inventory adjustment with assocaited entries to the storage.
|
// Saves the inventory adjustment with associated entries to the storage.
|
||||||
const inventoryAdjustment = await InventoryAdjustment.query(
|
const inventoryAdjustment = await InventoryAdjustment.query(
|
||||||
trx
|
trx
|
||||||
).upsertGraph({
|
).upsertGraph({
|
||||||
|
|||||||
@@ -344,7 +344,7 @@ export default class ItemCategoriesService implements IItemCategoriesService {
|
|||||||
);
|
);
|
||||||
// Items categories.
|
// Items categories.
|
||||||
const itemCategories = await ItemCategory.query().onBuild((query) => {
|
const itemCategories = await ItemCategory.query().onBuild((query) => {
|
||||||
// Subquery to calculate sumation of assocaited items to the item category.
|
// Subquery to calculate sumation of associated items to the item category.
|
||||||
query.select('*', ItemCategory.relatedQuery('items').count().as('count'));
|
query.select('*', ItemCategory.relatedQuery('items').count().as('count'));
|
||||||
|
|
||||||
dynamicList.buildQuery()(query);
|
dynamicList.buildQuery()(query);
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ export class ItemsValidators {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Validate the item inventory account whether modified and item
|
* Validate the item inventory account whether modified and item
|
||||||
* has assocaited inventory transactions.
|
* has associated inventory transactions.
|
||||||
* @param {numnber} tenantId
|
* @param {numnber} tenantId
|
||||||
* @param {IItem} oldItem
|
* @param {IItem} oldItem
|
||||||
* @param {IItemDTO} newItemDTO
|
* @param {IItemDTO} newItemDTO
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export class GetManualJournal {
|
|||||||
private transformer: TransformerInjectable;
|
private transformer: TransformerInjectable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve manual journal details with assocaited journal transactions.
|
* Retrieve manual journal details with associated journal transactions.
|
||||||
* @param {number} tenantId
|
* @param {number} tenantId
|
||||||
* @param {number} manualJournalId
|
* @param {number} manualJournalId
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -541,7 +541,7 @@ export default class BillPaymentsService implements IBillPaymentsService {
|
|||||||
oldBillPayment,
|
oldBillPayment,
|
||||||
} as IBillPaymentDeletingPayload);
|
} as IBillPaymentDeletingPayload);
|
||||||
|
|
||||||
// Deletes the bill payment assocaited entries.
|
// Deletes the bill payment associated entries.
|
||||||
await BillPaymentEntry.query(trx)
|
await BillPaymentEntry.query(trx)
|
||||||
.where('bill_payment_id', billPaymentId)
|
.where('bill_payment_id', billPaymentId)
|
||||||
.delete();
|
.delete();
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ export default class BillPaymentsPages {
|
|||||||
): Promise<IBillReceivePageEntry[]> {
|
): Promise<IBillReceivePageEntry[]> {
|
||||||
const { Bill } = this.tenancy.models(tenantId);
|
const { Bill } = this.tenancy.models(tenantId);
|
||||||
|
|
||||||
// Retrieve all payable bills that assocaited to the payment made transaction.
|
// Retrieve all payable bills that associated to the payment made transaction.
|
||||||
const payableBills = await Bill.query()
|
const payableBills = await Bill.query()
|
||||||
.modify('opened')
|
.modify('opened')
|
||||||
.modify('dueBills')
|
.modify('dueBills')
|
||||||
|
|||||||
@@ -498,7 +498,7 @@ export default class BillsService
|
|||||||
// Validate the givne bill has no associated landed cost transactions.
|
// Validate the givne bill has no associated landed cost transactions.
|
||||||
await this.validateBillHasNoLandedCost(tenantId, billId);
|
await this.validateBillHasNoLandedCost(tenantId, billId);
|
||||||
|
|
||||||
// Validate the purchase bill has no assocaited payments transactions.
|
// Validate the purchase bill has no associated payments transactions.
|
||||||
await this.validateBillHasNoEntries(tenantId, billId);
|
await this.validateBillHasNoEntries(tenantId, billId);
|
||||||
|
|
||||||
// Validate the given bill has no associated reconciled with vendor credits.
|
// Validate the given bill has no associated reconciled with vendor credits.
|
||||||
@@ -683,7 +683,7 @@ export default class BillsService
|
|||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const { Bill } = this.tenancy.models(tenantId);
|
const { Bill } = this.tenancy.models(tenantId);
|
||||||
|
|
||||||
// Retireve bill with assocaited entries and allocated cost entries.
|
// Retireve bill with associated entries and allocated cost entries.
|
||||||
const bill = await Bill.query(trx)
|
const bill = await Bill.query(trx)
|
||||||
.findById(billId)
|
.findById(billId)
|
||||||
.withGraphFetched('entries.allocatedCostEntries');
|
.withGraphFetched('entries.allocatedCostEntries');
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ export default class RevertAllocatedLandedCost extends BaseLandedCost {
|
|||||||
);
|
);
|
||||||
// Deletes landed cost with associated transactions.
|
// Deletes landed cost with associated transactions.
|
||||||
return this.uow.withTransaction(tenantId, async (trx: Knex.Transaction) => {
|
return this.uow.withTransaction(tenantId, async (trx: Knex.Transaction) => {
|
||||||
// Delete landed cost transaction with assocaited locate entries.
|
// Delete landed cost transaction with associated locate entries.
|
||||||
await this.deleteLandedCost(tenantId, landedCostId, trx);
|
await this.deleteLandedCost(tenantId, landedCostId, trx);
|
||||||
|
|
||||||
// Triggers the event `onBillLandedCostCreated`.
|
// Triggers the event `onBillLandedCostCreated`.
|
||||||
@@ -55,7 +55,7 @@ export default class RevertAllocatedLandedCost extends BaseLandedCost {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deletes the landed cost transaction with assocaited allocate entries.
|
* Deletes the landed cost transaction with associated allocate entries.
|
||||||
* @param {number} tenantId - Tenant id.
|
* @param {number} tenantId - Tenant id.
|
||||||
* @param {number} landedCostId - Landed cost id.
|
* @param {number} landedCostId - Landed cost id.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export default class DeleteVendorAssociatedVendorCredit {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validate vendor has no assocaited credit transaction once the vendor deleting.
|
* Validate vendor has no associated credit transaction once the vendor deleting.
|
||||||
* @param {IVendorEventDeletingPayload} payload -
|
* @param {IVendorEventDeletingPayload} payload -
|
||||||
*/
|
*/
|
||||||
public validateVendorHasNoCreditsTransactionsOnceDeleting = async ({
|
public validateVendorHasNoCreditsTransactionsOnceDeleting = async ({
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ export default class VendorCreditGlEntriesSubscriber {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Edits assocaited GL entries once vendor credit edited.
|
* Edits associated GL entries once vendor credit edited.
|
||||||
* @param {IVendorCreditEditedPayload} payload
|
* @param {IVendorCreditEditedPayload} payload
|
||||||
*/
|
*/
|
||||||
private editGLEntriesOnceVendorCreditEdited = async ({
|
private editGLEntriesOnceVendorCreditEdited = async ({
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ export default class VendorCreditInventoryTransactions {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Edits vendor credit assocaited inventory transactions.
|
* Edits vendor credit associated inventory transactions.
|
||||||
* @param {number} tenantId
|
* @param {number} tenantId
|
||||||
* @param {number} creditNoteId
|
* @param {number} creditNoteId
|
||||||
* @param {ICreditNote} creditNote
|
* @param {ICreditNote} creditNote
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export default class InvoicePaymentsService {
|
|||||||
private transformer: TransformerInjectable;
|
private transformer: TransformerInjectable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the invoice assocaited payments transactions.
|
* Retrieve the invoice associated payments transactions.
|
||||||
* @param {number} tenantId - Tenant id.
|
* @param {number} tenantId - Tenant id.
|
||||||
* @param {number} invoiceId - Invoice id.
|
* @param {number} invoiceId - Invoice id.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -709,7 +709,7 @@ export default class PaymentReceiveService implements IPaymentsReceiveService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve sale invoices that assocaited to the given payment receive.
|
* Retrieve sale invoices that associated to the given payment receive.
|
||||||
* @param {number} tenantId - Tenant id.
|
* @param {number} tenantId - Tenant id.
|
||||||
* @param {number} paymentReceiveId - Payment receive id.
|
* @param {number} paymentReceiveId - Payment receive id.
|
||||||
* @return {Promise<ISaleInvoice>}
|
* @return {Promise<ISaleInvoice>}
|
||||||
|
|||||||
@@ -584,7 +584,7 @@ export default class SaleEstimateService implements ISalesEstimatesService {
|
|||||||
if (oldSaleEstimate.isDelivered) {
|
if (oldSaleEstimate.isDelivered) {
|
||||||
throw new ServiceError(ERRORS.SALE_ESTIMATE_ALREADY_DELIVERED);
|
throw new ServiceError(ERRORS.SALE_ESTIMATE_ALREADY_DELIVERED);
|
||||||
}
|
}
|
||||||
// Updates the sale estimate transaction with assocaited transactions
|
// Updates the sale estimate transaction with associated transactions
|
||||||
// under UOW envirement.
|
// under UOW envirement.
|
||||||
return this.uow.withTransaction(tenantId, async (trx: Knex.Transaction) => {
|
return this.uow.withTransaction(tenantId, async (trx: Knex.Transaction) => {
|
||||||
// Triggers `onSaleEstimateDelivering` event.
|
// Triggers `onSaleEstimateDelivering` event.
|
||||||
|
|||||||
@@ -507,7 +507,7 @@ export default class SaleInvoicesService implements ISalesInvoicesService {
|
|||||||
if (oldSaleInvoice.isDelivered) {
|
if (oldSaleInvoice.isDelivered) {
|
||||||
throw new ServiceError(ERRORS.SALE_INVOICE_ALREADY_DELIVERED);
|
throw new ServiceError(ERRORS.SALE_INVOICE_ALREADY_DELIVERED);
|
||||||
}
|
}
|
||||||
// Update sale invoice transaction with assocaite transactions
|
// Update sale invoice transaction with associate transactions
|
||||||
// under unit-of-work envirement.
|
// under unit-of-work envirement.
|
||||||
return this.uow.withTransaction(tenantId, async (trx: Knex.Transaction) => {
|
return this.uow.withTransaction(tenantId, async (trx: Knex.Transaction) => {
|
||||||
// Triggers `onSaleInvoiceDelivering` event.
|
// Triggers `onSaleInvoiceDelivering` event.
|
||||||
|
|||||||
@@ -471,7 +471,7 @@ describe('route: `/sales/invoices`', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Should delete the given sale invoice with assocaited entries.', async () => {
|
it('Should delete the given sale invoice with associated entries.', async () => {
|
||||||
const saleInvoice = await tenantFactory.create('sale_invoice');
|
const saleInvoice = await tenantFactory.create('sale_invoice');
|
||||||
const saleInvoiceEntey = await tenantFactory.create('sale_invoice_entry', {
|
const saleInvoiceEntey = await tenantFactory.create('sale_invoice_entry', {
|
||||||
sale_invoice_id: saleInvoice.id,
|
sale_invoice_id: saleInvoice.id,
|
||||||
|
|||||||
Reference in New Issue
Block a user