mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-10 18:01:59 +00:00
Compare commits
20 Commits
bugs-bashi
...
v0.23.0-rc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3f2ab6e8f0 | ||
|
|
f0fae7d148 | ||
|
|
e063597a80 | ||
|
|
9b3f6b22d1 | ||
|
|
0475ce136a | ||
|
|
987ad992a4 | ||
|
|
ee92c2815b | ||
|
|
5767f1f603 | ||
|
|
885d8014c2 | ||
|
|
3ffab896ed | ||
|
|
92a5086f1f | ||
|
|
1bf9038ddc | ||
|
|
2736b76ced | ||
|
|
9e921b074f | ||
|
|
0f377e19f3 | ||
|
|
5d872798ff | ||
|
|
0ef78a19fe | ||
|
|
70b0a4833c | ||
|
|
ead4fc9b97 | ||
|
|
a91a7c612f |
5
packages/server/src/i18n/en/customer.json
Normal file
5
packages/server/src/i18n/en/customer.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"type.business": "Business",
|
||||
"type.individual": "Individual"
|
||||
}
|
||||
|
||||
@@ -48,14 +48,30 @@ export class PaginationQueryBuilder<
|
||||
// No relations defined
|
||||
return this.delete();
|
||||
}
|
||||
|
||||
// Only check HasManyRelation and ManyToManyRelation relations, as BelongsToOneRelation are just
|
||||
// foreign key references and shouldn't prevent deletion. Only dependent records should block deletion.
|
||||
const dependentRelationNames = relationNames.filter((name) => {
|
||||
const relation = relationMappings[name];
|
||||
return relation && (
|
||||
relation.relation === Model.HasManyRelation ||
|
||||
relation.relation === Model.ManyToManyRelation
|
||||
);
|
||||
});
|
||||
|
||||
if (dependentRelationNames.length === 0) {
|
||||
// No dependent relations defined, safe to delete
|
||||
return this.delete();
|
||||
}
|
||||
|
||||
const recordQuery = this.clone();
|
||||
|
||||
relationNames.forEach((relationName: string) => {
|
||||
dependentRelationNames.forEach((relationName: string) => {
|
||||
recordQuery.withGraphFetched(relationName);
|
||||
});
|
||||
const record = await recordQuery;
|
||||
|
||||
const hasRelations = relationNames.some((name) => {
|
||||
const hasRelations = dependentRelationNames.some((name) => {
|
||||
const val = record[name];
|
||||
return Array.isArray(val) ? val.length > 0 : val != null;
|
||||
});
|
||||
|
||||
@@ -14,6 +14,7 @@ import { BranchesSettingsService } from '../Branches/BranchesSettings';
|
||||
import { BillPaymentsController } from './BillPayments.controller';
|
||||
import { BillPaymentGLEntries } from './commands/BillPaymentGLEntries';
|
||||
import { BillPaymentGLEntriesSubscriber } from './subscribers/BillPaymentGLEntriesSubscriber';
|
||||
import { BillPaymentBillSyncSubscriber } from './subscribers/BillPaymentBillSyncSubscriber';
|
||||
import { LedgerModule } from '../Ledger/Ledger.module';
|
||||
import { AccountsModule } from '../Accounts/Accounts.module';
|
||||
import { BillPaymentsExportable } from './queries/BillPaymentsExportable';
|
||||
@@ -39,6 +40,7 @@ import { BillPaymentsPages } from './commands/BillPaymentsPages.service';
|
||||
TenancyContext,
|
||||
BillPaymentGLEntries,
|
||||
BillPaymentGLEntriesSubscriber,
|
||||
BillPaymentBillSyncSubscriber,
|
||||
BillPaymentsExportable,
|
||||
BillPaymentsImportable,
|
||||
GetBillPaymentsService,
|
||||
@@ -52,4 +54,4 @@ import { BillPaymentsPages } from './commands/BillPaymentsPages.service';
|
||||
],
|
||||
controllers: [BillPaymentsController],
|
||||
})
|
||||
export class BillPaymentsModule {}
|
||||
export class BillPaymentsModule { }
|
||||
|
||||
@@ -38,7 +38,7 @@ export class CreateBillPaymentService {
|
||||
|
||||
@Inject(BillPayment.name)
|
||||
private readonly billPaymentModel: TenantModelProxy<typeof BillPayment>,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Creates a new bill payment transcations and store it to the storage
|
||||
@@ -103,11 +103,19 @@ export class CreateBillPaymentService {
|
||||
} as IBillPaymentCreatingPayload);
|
||||
|
||||
// Writes the bill payment graph to the storage.
|
||||
const billPayment = await this.billPaymentModel()
|
||||
const insertedBillPayment = await this.billPaymentModel()
|
||||
.query(trx)
|
||||
.insertGraphAndFetch({
|
||||
...billPaymentObj,
|
||||
});
|
||||
|
||||
// Fetch the bill payment with entries to ensure they're loaded for the subscriber.
|
||||
const billPayment = await this.billPaymentModel()
|
||||
.query(trx)
|
||||
.withGraphFetched('entries')
|
||||
.findById(insertedBillPayment.id)
|
||||
.throwIfNotFound();
|
||||
|
||||
// Triggers `onBillPaymentCreated` event.
|
||||
await this.eventPublisher.emitAsync(events.billPayment.onCreated, {
|
||||
billPayment,
|
||||
|
||||
@@ -29,7 +29,7 @@ export class EditBillPayment {
|
||||
|
||||
@Inject(Vendor.name)
|
||||
private readonly vendorModel: TenantModelProxy<typeof Vendor>,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Edits the details of the given bill payment.
|
||||
@@ -116,12 +116,20 @@ export class EditBillPayment {
|
||||
} as IBillPaymentEditingPayload);
|
||||
|
||||
// Edits the bill payment transaction graph on the storage.
|
||||
const billPayment = await this.billPaymentModel()
|
||||
await this.billPaymentModel()
|
||||
.query(trx)
|
||||
.upsertGraphAndFetch({
|
||||
.upsertGraph({
|
||||
id: billPaymentId,
|
||||
...billPaymentObj,
|
||||
});
|
||||
|
||||
// Fetch the bill payment with entries to ensure they're loaded for the subscriber.
|
||||
const billPayment = await this.billPaymentModel()
|
||||
.query(trx)
|
||||
.withGraphFetched('entries')
|
||||
.findById(billPaymentId)
|
||||
.throwIfNotFound();
|
||||
|
||||
// Triggers `onBillPaymentEdited` event.
|
||||
await this.eventPublisher.emitAsync(events.billPayment.onEdited, {
|
||||
billPaymentId,
|
||||
|
||||
@@ -16,8 +16,6 @@ export class BillPaymentsExportable extends Exportable {
|
||||
|
||||
/**
|
||||
* Retrieves the accounts data to exportable sheet.
|
||||
* @param {number} tenantId
|
||||
* @returns
|
||||
*/
|
||||
public async exportable(query: any) {
|
||||
const filterQuery = (builder) => {
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
import {
|
||||
IBillPaymentEventCreatedPayload,
|
||||
IBillPaymentEventDeletedPayload,
|
||||
IBillPaymentEventEditedPayload,
|
||||
} from '../types/BillPayments.types';
|
||||
import { BillPaymentBillSync } from '../commands/BillPaymentBillSync.service';
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { OnEvent } from '@nestjs/event-emitter';
|
||||
import { events } from '@/common/events/events';
|
||||
|
||||
@Injectable()
|
||||
export class BillPaymentBillSyncSubscriber {
|
||||
/**
|
||||
* @param {BillPaymentBillSync} billPaymentBillSync - Bill payment bill sync service.
|
||||
*/
|
||||
constructor(private readonly billPaymentBillSync: BillPaymentBillSync) { }
|
||||
|
||||
/**
|
||||
* Handle bill increment/decrement payment amount
|
||||
* once created, edited or deleted.
|
||||
*/
|
||||
@OnEvent(events.billPayment.onCreated)
|
||||
async handleBillIncrementPaymentOnceCreated({
|
||||
billPayment,
|
||||
trx,
|
||||
}: IBillPaymentEventCreatedPayload) {
|
||||
// Ensure entries are available - they should be included in insertGraphAndFetch
|
||||
const entries = billPayment.entries || [];
|
||||
await this.billPaymentBillSync.saveChangeBillsPaymentAmount(
|
||||
entries.map((entry) => ({
|
||||
billId: entry.billId,
|
||||
paymentAmount: entry.paymentAmount,
|
||||
})),
|
||||
null,
|
||||
trx,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle bill increment/decrement payment amount once edited.
|
||||
*/
|
||||
@OnEvent(events.billPayment.onEdited)
|
||||
async handleBillIncrementPaymentOnceEdited({
|
||||
billPayment,
|
||||
oldBillPayment,
|
||||
trx,
|
||||
}: IBillPaymentEventEditedPayload) {
|
||||
const entries = billPayment.entries || [];
|
||||
const oldEntries = oldBillPayment?.entries || null;
|
||||
|
||||
await this.billPaymentBillSync.saveChangeBillsPaymentAmount(
|
||||
entries.map((entry) => ({
|
||||
billId: entry.billId,
|
||||
paymentAmount: entry.paymentAmount,
|
||||
})),
|
||||
oldEntries,
|
||||
trx,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle revert bills payment amount once bill payment deleted.
|
||||
*/
|
||||
@OnEvent(events.billPayment.onDeleted)
|
||||
async handleBillDecrementPaymentAmount({
|
||||
oldBillPayment,
|
||||
trx,
|
||||
}: IBillPaymentEventDeletedPayload) {
|
||||
const oldEntries = oldBillPayment.entries || [];
|
||||
|
||||
await this.billPaymentBillSync.saveChangeBillsPaymentAmount(
|
||||
oldEntries.map((entry) => ({
|
||||
billId: entry.billId,
|
||||
paymentAmount: 0,
|
||||
})),
|
||||
oldEntries,
|
||||
trx,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -7,9 +7,13 @@ import { CreditNotesRefundsApplication } from './CreditNotesRefundsApplication.s
|
||||
import { CreditNoteRefundsController } from './CreditNoteRefunds.controller';
|
||||
import { CreditNotesModule } from '../CreditNotes/CreditNotes.module';
|
||||
import { GetCreditNoteRefundsService } from './queries/GetCreditNoteRefunds.service';
|
||||
import { RefundCreditNoteGLEntries } from './commands/RefundCreditNoteGLEntries';
|
||||
import { RefundCreditNoteGLEntriesSubscriber } from '../CreditNotes/subscribers/RefundCreditNoteGLEntriesSubscriber';
|
||||
import { LedgerModule } from '../Ledger/Ledger.module';
|
||||
import { AccountsModule } from '../Accounts/Accounts.module';
|
||||
|
||||
@Module({
|
||||
imports: [forwardRef(() => CreditNotesModule)],
|
||||
imports: [forwardRef(() => CreditNotesModule), LedgerModule, AccountsModule],
|
||||
providers: [
|
||||
CreateRefundCreditNoteService,
|
||||
DeleteRefundCreditNoteService,
|
||||
@@ -17,8 +21,10 @@ import { GetCreditNoteRefundsService } from './queries/GetCreditNoteRefunds.serv
|
||||
RefundSyncCreditNoteBalanceService,
|
||||
CreditNotesRefundsApplication,
|
||||
GetCreditNoteRefundsService,
|
||||
RefundCreditNoteGLEntries,
|
||||
RefundCreditNoteGLEntriesSubscriber,
|
||||
],
|
||||
exports: [RefundSyncCreditNoteBalanceService],
|
||||
controllers: [CreditNoteRefundsController],
|
||||
})
|
||||
export class CreditNoteRefundsModule {}
|
||||
export class CreditNoteRefundsModule { }
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsNotEmpty, IsOptional, IsPositive, IsString } from 'class-validator';
|
||||
import { ToNumber, IsOptional } from '@/common/decorators/Validators';
|
||||
import { IsDateString, IsNotEmpty, IsPositive, IsString } from 'class-validator';
|
||||
import { IsDate } from 'class-validator';
|
||||
import { IsNumber } from 'class-validator';
|
||||
|
||||
@@ -10,8 +11,13 @@ export class CreditNoteRefundDto {
|
||||
description: 'The id of the from account',
|
||||
example: 1,
|
||||
})
|
||||
@ApiProperty({
|
||||
description: 'The id of the from account',
|
||||
example: 1,
|
||||
})
|
||||
fromAccountId: number;
|
||||
|
||||
@ToNumber()
|
||||
@IsNumber()
|
||||
@IsPositive()
|
||||
@IsNotEmpty()
|
||||
@@ -21,6 +27,7 @@ export class CreditNoteRefundDto {
|
||||
})
|
||||
amount: number;
|
||||
|
||||
@ToNumber()
|
||||
@IsNumber()
|
||||
@IsOptional()
|
||||
@IsPositive()
|
||||
@@ -30,23 +37,23 @@ export class CreditNoteRefundDto {
|
||||
})
|
||||
exchangeRate?: number;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@ApiProperty({
|
||||
description: 'The reference number of the credit note refund',
|
||||
example: '123456',
|
||||
})
|
||||
referenceNo: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@ApiProperty({
|
||||
description: 'The description of the credit note refund',
|
||||
example: 'Credit note refund',
|
||||
})
|
||||
description: string;
|
||||
|
||||
@IsDate()
|
||||
@IsDateString()
|
||||
@IsNotEmpty()
|
||||
@ApiProperty({
|
||||
description: 'The date of the credit note refund',
|
||||
@@ -54,6 +61,7 @@ export class CreditNoteRefundDto {
|
||||
})
|
||||
date: Date;
|
||||
|
||||
@ToNumber()
|
||||
@IsNumber()
|
||||
@IsOptional()
|
||||
@ApiProperty({
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import { renderCreditNotePaperTemplateHtml } from '@bigcapital/pdf-templates';
|
||||
import { GetCreditNoteService } from './GetCreditNote.service';
|
||||
import { CreditNoteBrandingTemplate } from './CreditNoteBrandingTemplate.service';
|
||||
import { transformCreditNoteToPdfTemplate } from '../utils';
|
||||
import { CreditNote } from '../models/CreditNote';
|
||||
import { ChromiumlyTenancy } from '@/modules/ChromiumlyTenancy/ChromiumlyTenancy.service';
|
||||
import { TemplateInjectable } from '@/modules/TemplateInjectable/TemplateInjectable.service';
|
||||
import { EventEmitter2 } from '@nestjs/event-emitter';
|
||||
import { PdfTemplateModel } from '@/modules/PdfTemplate/models/PdfTemplate';
|
||||
import { CreditNotePdfTemplateAttributes } from '../types/CreditNotes.types';
|
||||
@@ -15,7 +15,6 @@ import { TenantModelProxy } from '@/modules/System/models/TenantBaseModel';
|
||||
export class GetCreditNotePdf {
|
||||
/**
|
||||
* @param {ChromiumlyTenancy} chromiumlyTenancy - Chromiumly tenancy service.
|
||||
* @param {TemplateInjectable} templateInjectable - Template injectable service.
|
||||
* @param {GetCreditNote} getCreditNoteService - Get credit note service.
|
||||
* @param {CreditNoteBrandingTemplate} creditNoteBrandingTemplate - Credit note branding template service.
|
||||
* @param {EventEmitter2} eventPublisher - Event publisher service.
|
||||
@@ -24,7 +23,6 @@ export class GetCreditNotePdf {
|
||||
*/
|
||||
constructor(
|
||||
private readonly chromiumlyTenancy: ChromiumlyTenancy,
|
||||
private readonly templateInjectable: TemplateInjectable,
|
||||
private readonly getCreditNoteService: GetCreditNoteService,
|
||||
private readonly creditNoteBrandingTemplate: CreditNoteBrandingTemplate,
|
||||
private readonly eventPublisher: EventEmitter2,
|
||||
@@ -36,23 +34,40 @@ export class GetCreditNotePdf {
|
||||
private readonly pdfTemplateModel: TenantModelProxy<
|
||||
typeof PdfTemplateModel
|
||||
>,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Retrieves sale invoice pdf content.
|
||||
* Retrieves credit note html content.
|
||||
* @param {number} creditNoteId - Credit note id.
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
public async getCreditNoteHtml(creditNoteId: number): Promise<string> {
|
||||
const brandingAttributes =
|
||||
await this.getCreditNoteBrandingAttributes(creditNoteId);
|
||||
|
||||
// Map attributes to match the React component props
|
||||
// The branding template returns companyLogoUri, but type may have companyLogo
|
||||
const props = {
|
||||
...brandingAttributes,
|
||||
companyLogoUri:
|
||||
(brandingAttributes as any).companyLogoUri ||
|
||||
(brandingAttributes as any).companyLogo ||
|
||||
'',
|
||||
};
|
||||
|
||||
return renderCreditNotePaperTemplateHtml(props);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves credit note pdf content.
|
||||
* @param {number} creditNoteId - Credit note id.
|
||||
* @returns {Promise<[Buffer, string]>}
|
||||
*/
|
||||
public async getCreditNotePdf(
|
||||
creditNoteId: number,
|
||||
): Promise<[Buffer, string]> {
|
||||
const brandingAttributes =
|
||||
await this.getCreditNoteBrandingAttributes(creditNoteId);
|
||||
const htmlContent = await this.templateInjectable.render(
|
||||
'modules/credit-note-standard',
|
||||
brandingAttributes,
|
||||
);
|
||||
const filename = await this.getCreditNoteFilename(creditNoteId);
|
||||
const htmlContent = await this.getCreditNoteHtml(creditNoteId);
|
||||
|
||||
const document =
|
||||
await this.chromiumlyTenancy.convertHtmlContent(htmlContent);
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
import { FinancialSheet } from '../../common/FinancialSheet';
|
||||
import { JournalSheetRepository } from './JournalSheetRepository';
|
||||
import { ILedgerEntry } from '@/modules/Ledger/types/Ledger.types';
|
||||
import { getTransactionTypeLabel } from '@/modules/BankingTransactions/utils';
|
||||
|
||||
export class JournalSheet extends FinancialSheet {
|
||||
readonly query: IJournalReportQuery;
|
||||
@@ -97,10 +98,13 @@ export class JournalSheet extends FinancialSheet {
|
||||
|
||||
transactionType: groupEntry.transactionType,
|
||||
referenceId: groupEntry.transactionId,
|
||||
referenceTypeFormatted: this.i18n.t(groupEntry.transactionType),
|
||||
|
||||
referenceTypeFormatted: this.i18n.t(
|
||||
getTransactionTypeLabel(
|
||||
groupEntry.transactionType,
|
||||
groupEntry.transactionSubType,
|
||||
),
|
||||
),
|
||||
entries: this.entriesMapper(entriesGroup),
|
||||
|
||||
currencyCode: this.baseCurrency,
|
||||
|
||||
credit: totalCredit,
|
||||
|
||||
@@ -6,6 +6,7 @@ import { SaleInvoice } from '@/modules/SaleInvoices/models/SaleInvoice';
|
||||
import { SaleReceipt } from '@/modules/SaleReceipts/models/SaleReceipt';
|
||||
import { Item } from '@/modules/Items/models/Item';
|
||||
import { BaseModel } from '@/models/Model';
|
||||
import { ItemEntry } from '@/modules/TransactionItemEntry/models/ItemEntry';
|
||||
|
||||
export class InventoryCostLotTracker extends BaseModel {
|
||||
date: Date;
|
||||
@@ -27,6 +28,7 @@ export class InventoryCostLotTracker extends BaseModel {
|
||||
warehouseId: number;
|
||||
|
||||
item?: Item;
|
||||
itemEntry?: ItemEntry;
|
||||
invoice?: SaleInvoice;
|
||||
receipt?: SaleReceipt;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ export class InventoryCostSubscriber {
|
||||
private readonly itemsQuantitySync: InventoryItemsQuantitySyncService,
|
||||
private readonly inventoryService: InventoryComputeCostService,
|
||||
private readonly importAls: ImportAls,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Sync inventory items quantity once inventory transactions created.
|
||||
@@ -60,7 +60,7 @@ export class InventoryCostSubscriber {
|
||||
* Marks items cost compute running state.
|
||||
*/
|
||||
@OnEvent(events.inventory.onInventoryTransactionsCreated)
|
||||
async markGlobalSettingsComputeItems({}) {
|
||||
async markGlobalSettingsComputeItems({ }) {
|
||||
await this.inventoryService.markItemsCostComputeRunning(true);
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ export class InventoryCostSubscriber {
|
||||
* Marks items cost compute as completed.
|
||||
*/
|
||||
@OnEvent(events.inventory.onInventoryCostEntriesWritten)
|
||||
async markGlobalSettingsComputeItemsCompeted({}) {
|
||||
async markGlobalSettingsComputeItemsCompeted({ }) {
|
||||
await this.inventoryService.markItemsCostComputeRunning(false);
|
||||
}
|
||||
|
||||
@@ -80,15 +80,13 @@ export class InventoryCostSubscriber {
|
||||
itemId,
|
||||
startingDate,
|
||||
}: IComputeItemCostJobCompletedPayload) {
|
||||
// const dependsComputeJobs = await this.agenda.jobs({
|
||||
// name: 'compute-item-cost',
|
||||
// nextRunAt: { $ne: null },
|
||||
// 'data.tenantId': tenantId,
|
||||
// });
|
||||
// // There is no scheduled compute jobs waiting.
|
||||
// if (dependsComputeJobs.length === 0) {
|
||||
// await this.saleInvoicesCost.scheduleWriteJournalEntries(startingDate);
|
||||
// }
|
||||
// Convert startingDate to Date if it's a string
|
||||
const startingDateObj = startingDate instanceof Date
|
||||
? startingDate
|
||||
: new Date(startingDate);
|
||||
|
||||
// Write GL entries for inventory cost lots after cost computation completes
|
||||
await this.saleInvoicesCost.writeCostLotsGLEntries(startingDateObj);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -38,7 +38,8 @@ export class SaleInvoiceCostGLEntries {
|
||||
.modify('filterDateRange', startingDate)
|
||||
.orderBy('date', 'ASC')
|
||||
.withGraphFetched('invoice')
|
||||
.withGraphFetched('item');
|
||||
.withGraphFetched('item')
|
||||
.withGraphFetched('itemEntry');
|
||||
|
||||
const ledger = this.getInventoryCostLotsLedger(inventoryCostLotTrans);
|
||||
|
||||
@@ -79,6 +80,9 @@ export class SaleInvoiceCostGLEntries {
|
||||
transactionType: inventoryCostLot.transactionType,
|
||||
transactionId: inventoryCostLot.transactionId,
|
||||
|
||||
transactionNumber: inventoryCostLot.invoice.invoiceNo,
|
||||
referenceNumber: inventoryCostLot.invoice.referenceNo,
|
||||
|
||||
date: inventoryCostLot.date,
|
||||
indexGroup: 20,
|
||||
costable: true,
|
||||
@@ -105,6 +109,9 @@ export class SaleInvoiceCostGLEntries {
|
||||
const costAccountId =
|
||||
inventoryCostLot.costAccountId || inventoryCostLot.item.costAccountId;
|
||||
|
||||
// Get description from item entry if available
|
||||
const description = inventoryCostLot.itemEntry?.description || null;
|
||||
|
||||
// XXX Debit - Cost account.
|
||||
const costEntry = {
|
||||
...commonEntry,
|
||||
@@ -112,6 +119,7 @@ export class SaleInvoiceCostGLEntries {
|
||||
accountId: costAccountId,
|
||||
accountNormal: AccountNormal.DEBIT,
|
||||
itemId: inventoryCostLot.itemId,
|
||||
note: description,
|
||||
index: getIndexIncrement(),
|
||||
};
|
||||
// XXX Credit - Inventory account.
|
||||
@@ -121,6 +129,7 @@ export class SaleInvoiceCostGLEntries {
|
||||
accountId: inventoryCostLot.item.inventoryAccountId,
|
||||
accountNormal: AccountNormal.DEBIT,
|
||||
itemId: inventoryCostLot.itemId,
|
||||
note: description,
|
||||
index: getIndexIncrement(),
|
||||
};
|
||||
return [costEntry, inventoryEntry];
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { OnEvent } from '@nestjs/event-emitter';
|
||||
import { events } from '@/common/events/events';
|
||||
import { IInventoryCostLotsGLEntriesWriteEvent } from '@/modules/InventoryCost/types/InventoryCost.types';
|
||||
import { SaleInvoiceCostGLEntries } from '../SaleInvoiceCostGLEntries';
|
||||
|
||||
@Injectable()
|
||||
export class InvoiceCostGLEntriesSubscriber {
|
||||
constructor(private readonly invoiceCostEntries: SaleInvoiceCostGLEntries) {}
|
||||
constructor(private readonly invoiceCostEntries: SaleInvoiceCostGLEntries) { }
|
||||
|
||||
/**
|
||||
* Writes the invoices cost GL entries once the inventory cost lots be written.
|
||||
* @param {IInventoryCostLotsGLEntriesWriteEvent}
|
||||
*/
|
||||
@OnEvent(events.inventory.onCostLotsGLEntriesWrite)
|
||||
async writeInvoicesCostEntriesOnCostLotsWritten({
|
||||
trx,
|
||||
startingDate,
|
||||
|
||||
@@ -2,19 +2,35 @@ import { Injectable } from '@nestjs/common';
|
||||
import { DeleteRefundVendorCreditService } from './commands/DeleteRefundVendorCredit.service';
|
||||
import { RefundVendorCredit } from './models/RefundVendorCredit';
|
||||
import { CreateRefundVendorCredit } from './commands/CreateRefundVendorCredit.service';
|
||||
import { IRefundVendorCreditDTO } from './types/VendorCreditRefund.types';
|
||||
import { RefundVendorCreditDto } from './dtos/RefundVendorCredit.dto';
|
||||
import { GetRefundVendorCreditsService } from './queries/GetRefundVendorCredits.service';
|
||||
import { IRefundVendorCreditPOJO } from './types/VendorCreditRefund.types';
|
||||
|
||||
@Injectable()
|
||||
export class VendorCreditsRefundApplication {
|
||||
/**
|
||||
* @param {CreateRefundVendorCredit} createRefundVendorCreditService
|
||||
* @param {DeleteRefundVendorCreditService} deleteRefundVendorCreditService
|
||||
* @param {GetRefundVendorCreditsService} getRefundVendorCreditsService
|
||||
*/
|
||||
constructor(
|
||||
private readonly createRefundVendorCreditService: CreateRefundVendorCredit,
|
||||
private readonly deleteRefundVendorCreditService: DeleteRefundVendorCreditService,
|
||||
) {}
|
||||
private readonly getRefundVendorCreditsService: GetRefundVendorCreditsService,
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Retrieve the vendor credit refunds graph.
|
||||
* @param {number} vendorCreditId - Vendor credit id.
|
||||
* @returns {Promise<IRefundVendorCreditPOJO[]>}
|
||||
*/
|
||||
public getVendorCreditRefunds(
|
||||
vendorCreditId: number,
|
||||
): Promise<IRefundVendorCreditPOJO[]> {
|
||||
return this.getRefundVendorCreditsService.getVendorCreditRefunds(
|
||||
vendorCreditId,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a refund vendor credit.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Body, Controller, Delete, Param, Post } from '@nestjs/common';
|
||||
import { Body, Controller, Delete, Get, Param, Post } from '@nestjs/common';
|
||||
import { VendorCreditsRefundApplication } from './VendorCreditsRefund.application';
|
||||
import { RefundVendorCredit } from './models/RefundVendorCredit';
|
||||
import { ApiOperation, ApiTags } from '@nestjs/swagger';
|
||||
@@ -9,7 +9,22 @@ import { RefundVendorCreditDto } from './dtos/RefundVendorCredit.dto';
|
||||
export class VendorCreditsRefundController {
|
||||
constructor(
|
||||
private readonly vendorCreditsRefundApplication: VendorCreditsRefundApplication,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Retrieve the vendor credit refunds graph.
|
||||
* @param {number} vendorCreditId - Vendor credit id.
|
||||
* @returns {Promise<IRefundVendorCreditPOJO[]>}
|
||||
*/
|
||||
@Get(':vendorCreditId/refund')
|
||||
@ApiOperation({ summary: 'Retrieve the vendor credit refunds graph.' })
|
||||
public getVendorCreditRefunds(
|
||||
@Param('vendorCreditId') vendorCreditId: string,
|
||||
) {
|
||||
return this.vendorCreditsRefundApplication.getVendorCreditRefunds(
|
||||
Number(vendorCreditId),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a refund vendor credit.
|
||||
@@ -17,7 +32,7 @@ export class VendorCreditsRefundController {
|
||||
* @param {IRefundVendorCreditDTO} refundVendorCreditDTO
|
||||
* @returns {Promise<RefundVendorCredit>}
|
||||
*/
|
||||
@Post(':vendorCreditId/refunds')
|
||||
@Post(':vendorCreditId/refund')
|
||||
@ApiOperation({ summary: 'Create a refund for the given vendor credit.' })
|
||||
public async createRefundVendorCredit(
|
||||
@Param('vendorCreditId') vendorCreditId: string,
|
||||
|
||||
@@ -6,15 +6,21 @@ import { VendorCreditsRefundApplication } from './VendorCreditsRefund.applicatio
|
||||
import { CreateRefundVendorCredit } from './commands/CreateRefundVendorCredit.service';
|
||||
import { WarehousesModule } from '../Warehouses/Warehouses.module';
|
||||
import { BranchesModule } from '../Branches/Branches.module';
|
||||
import { RefundVendorCreditGLEntries } from './commands/RefundVendorCreditGLEntries';
|
||||
import { RefundVendorCreditGLEntriesSubscriber } from './subscribers/RefundVendorCreditGLEntriesSubscriber';
|
||||
import { LedgerModule } from '../Ledger/Ledger.module';
|
||||
import { AccountsModule } from '../Accounts/Accounts.module';
|
||||
|
||||
@Module({
|
||||
imports: [WarehousesModule, BranchesModule],
|
||||
imports: [WarehousesModule, BranchesModule, LedgerModule, AccountsModule],
|
||||
providers: [
|
||||
GetRefundVendorCreditsService,
|
||||
DeleteRefundVendorCreditService,
|
||||
CreateRefundVendorCredit,
|
||||
VendorCreditsRefundApplication
|
||||
VendorCreditsRefundApplication,
|
||||
RefundVendorCreditGLEntries,
|
||||
RefundVendorCreditGLEntriesSubscriber,
|
||||
],
|
||||
controllers: [VendorCreditsRefundController],
|
||||
})
|
||||
export class VendorCreditsRefundModule {}
|
||||
export class VendorCreditsRefundModule { }
|
||||
|
||||
@@ -1,159 +1,172 @@
|
||||
// import { Inject, Service } from 'typedi';
|
||||
// import { Knex } from 'knex';
|
||||
// import { AccountNormal, ILedgerEntry } from '@/interfaces';
|
||||
// import { IRefundVendorCredit } from '@/interfaces';
|
||||
// import JournalPosterService from '@/services/Sales/JournalPosterService';
|
||||
// import LedgerRepository from '@/services/Ledger/LedgerRepository';
|
||||
// import HasTenancyService from '@/services/Tenancy/TenancyService';
|
||||
import { LedgerStorageService } from '@/modules/Ledger/LedgerStorage.service';
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import { RefundVendorCredit } from '../models/RefundVendorCredit';
|
||||
import { Ledger } from '@/modules/Ledger/Ledger';
|
||||
import { Knex } from 'knex';
|
||||
import { TenantModelProxy } from '@/modules/System/models/TenantBaseModel';
|
||||
import { Account } from '@/modules/Accounts/models/Account.model';
|
||||
import { ILedgerEntry } from '@/modules/Ledger/types/Ledger.types';
|
||||
import { AccountNormal } from '@/interfaces/Account';
|
||||
import { AccountRepository } from '@/modules/Accounts/repositories/Account.repository';
|
||||
|
||||
// @Service()
|
||||
// export default class RefundVendorCreditGLEntries {
|
||||
// @Inject()
|
||||
// private journalService: JournalPosterService;
|
||||
@Injectable()
|
||||
export class RefundVendorCreditGLEntries {
|
||||
constructor(
|
||||
private readonly ledgerStorage: LedgerStorageService,
|
||||
private readonly accountRepository: AccountRepository,
|
||||
|
||||
// @Inject()
|
||||
// private ledgerRepository: LedgerRepository;
|
||||
@Inject(Account.name)
|
||||
private readonly accountModel: TenantModelProxy<typeof Account>,
|
||||
|
||||
// @Inject()
|
||||
// private tenancy: HasTenancyService;
|
||||
@Inject(RefundVendorCredit.name)
|
||||
private readonly refundVendorCreditModel: TenantModelProxy<
|
||||
typeof RefundVendorCredit
|
||||
>,
|
||||
) { }
|
||||
|
||||
// /**
|
||||
// * Retrieves the refund credit common GL entry.
|
||||
// * @param {IRefundVendorCredit} refundCredit
|
||||
// */
|
||||
// private getRefundCreditGLCommonEntry = (
|
||||
// refundCredit: IRefundVendorCredit
|
||||
// ) => {
|
||||
// return {
|
||||
// exchangeRate: refundCredit.exchangeRate,
|
||||
// currencyCode: refundCredit.currencyCode,
|
||||
/**
|
||||
* Retrieves the refund vendor credit common GL entry.
|
||||
* @param {RefundVendorCredit} refundVendorCredit
|
||||
* @returns
|
||||
*/
|
||||
private getRefundVendorCreditCommonGLEntry = (
|
||||
refundVendorCredit: RefundVendorCredit,
|
||||
) => {
|
||||
const model = refundVendorCredit as any;
|
||||
return {
|
||||
currencyCode: refundVendorCredit.currencyCode,
|
||||
exchangeRate: refundVendorCredit.exchangeRate,
|
||||
|
||||
// transactionType: 'RefundVendorCredit',
|
||||
// transactionId: refundCredit.id,
|
||||
transactionType: 'RefundVendorCredit',
|
||||
transactionId: refundVendorCredit.id,
|
||||
date: refundVendorCredit.date,
|
||||
userId: refundVendorCredit.vendorCredit?.userId,
|
||||
|
||||
// date: refundCredit.date,
|
||||
// userId: refundCredit.userId,
|
||||
// referenceNumber: refundCredit.referenceNo,
|
||||
// createdAt: refundCredit.createdAt,
|
||||
// indexGroup: 10,
|
||||
referenceNumber: refundVendorCredit.referenceNo,
|
||||
|
||||
// credit: 0,
|
||||
// debit: 0,
|
||||
createdAt: model.createdAt,
|
||||
indexGroup: 10,
|
||||
|
||||
// note: refundCredit.description,
|
||||
// branchId: refundCredit.branchId,
|
||||
// };
|
||||
// };
|
||||
credit: 0,
|
||||
debit: 0,
|
||||
|
||||
// /**
|
||||
// * Retrieves the refund credit payable GL entry.
|
||||
// * @param {IRefundVendorCredit} refundCredit
|
||||
// * @param {number} APAccountId
|
||||
// * @returns {ILedgerEntry}
|
||||
// */
|
||||
// private getRefundCreditGLPayableEntry = (
|
||||
// refundCredit: IRefundVendorCredit,
|
||||
// APAccountId: number
|
||||
// ): ILedgerEntry => {
|
||||
// const commonEntry = this.getRefundCreditGLCommonEntry(refundCredit);
|
||||
note: refundVendorCredit.description,
|
||||
branchId: refundVendorCredit.branchId,
|
||||
};
|
||||
};
|
||||
|
||||
// return {
|
||||
// ...commonEntry,
|
||||
// credit: refundCredit.amount,
|
||||
// accountId: APAccountId,
|
||||
// contactId: refundCredit.vendorCredit.vendorId,
|
||||
// index: 1,
|
||||
// accountNormal: AccountNormal.CREDIT,
|
||||
// };
|
||||
// };
|
||||
/**
|
||||
* Retrieves the refund vendor credit payable GL entry.
|
||||
* @param {RefundVendorCredit} refundVendorCredit
|
||||
* @param {number} APAccountId
|
||||
* @returns {ILedgerEntry}
|
||||
*/
|
||||
private getRefundVendorCreditGLPayableEntry = (
|
||||
refundVendorCredit: RefundVendorCredit,
|
||||
APAccountId: number,
|
||||
): ILedgerEntry => {
|
||||
const commonEntry = this.getRefundVendorCreditCommonGLEntry(
|
||||
refundVendorCredit,
|
||||
);
|
||||
|
||||
// /**
|
||||
// * Retrieves the refund credit deposit GL entry.
|
||||
// * @param {IRefundVendorCredit} refundCredit
|
||||
// * @returns {ILedgerEntry}
|
||||
// */
|
||||
// private getRefundCreditGLDepositEntry = (
|
||||
// refundCredit: IRefundVendorCredit
|
||||
// ): ILedgerEntry => {
|
||||
// const commonEntry = this.getRefundCreditGLCommonEntry(refundCredit);
|
||||
return {
|
||||
...commonEntry,
|
||||
credit: refundVendorCredit.amount,
|
||||
accountId: APAccountId,
|
||||
contactId: refundVendorCredit.vendorCredit.vendorId,
|
||||
index: 1,
|
||||
accountNormal: AccountNormal.CREDIT,
|
||||
};
|
||||
};
|
||||
|
||||
// return {
|
||||
// ...commonEntry,
|
||||
// debit: refundCredit.amount,
|
||||
// accountId: refundCredit.depositAccountId,
|
||||
// index: 2,
|
||||
// accountNormal: AccountNormal.DEBIT,
|
||||
// };
|
||||
// };
|
||||
/**
|
||||
* Retrieves the refund vendor credit deposit GL entry.
|
||||
* @param {RefundVendorCredit} refundVendorCredit
|
||||
* @returns {ILedgerEntry}
|
||||
*/
|
||||
private getRefundVendorCreditGLDepositEntry = (
|
||||
refundVendorCredit: RefundVendorCredit,
|
||||
): ILedgerEntry => {
|
||||
const commonEntry = this.getRefundVendorCreditCommonGLEntry(
|
||||
refundVendorCredit,
|
||||
);
|
||||
|
||||
// /**
|
||||
// * Retrieve refund vendor credit GL entries.
|
||||
// * @param {IRefundVendorCredit} refundCredit
|
||||
// * @param {number} APAccountId
|
||||
// * @returns {ILedgerEntry[]}
|
||||
// */
|
||||
// public getRefundCreditGLEntries = (
|
||||
// refundCredit: IRefundVendorCredit,
|
||||
// APAccountId: number
|
||||
// ): ILedgerEntry[] => {
|
||||
// const payableEntry = this.getRefundCreditGLPayableEntry(
|
||||
// refundCredit,
|
||||
// APAccountId
|
||||
// );
|
||||
// const depositEntry = this.getRefundCreditGLDepositEntry(refundCredit);
|
||||
return {
|
||||
...commonEntry,
|
||||
debit: refundVendorCredit.amount,
|
||||
accountId: refundVendorCredit.depositAccountId,
|
||||
index: 2,
|
||||
accountNormal: AccountNormal.DEBIT,
|
||||
};
|
||||
};
|
||||
|
||||
// return [payableEntry, depositEntry];
|
||||
// };
|
||||
/**
|
||||
* Retrieve refund vendor credit GL entries.
|
||||
* @param {RefundVendorCredit} refundVendorCredit
|
||||
* @param {number} APAccountId
|
||||
* @returns {ILedgerEntry[]}
|
||||
*/
|
||||
public getRefundVendorCreditGLEntries(
|
||||
refundVendorCredit: RefundVendorCredit,
|
||||
APAccountId: number,
|
||||
): ILedgerEntry[] {
|
||||
const payableEntry = this.getRefundVendorCreditGLPayableEntry(
|
||||
refundVendorCredit,
|
||||
APAccountId,
|
||||
);
|
||||
const depositEntry = this.getRefundVendorCreditGLDepositEntry(
|
||||
refundVendorCredit,
|
||||
);
|
||||
|
||||
// /**
|
||||
// * Saves refund credit note GL entries.
|
||||
// * @param {number} tenantId
|
||||
// * @param {IRefundVendorCredit} refundCredit -
|
||||
// * @param {Knex.Transaction} trx -
|
||||
// * @return {Promise<void>}
|
||||
// */
|
||||
// public saveRefundCreditGLEntries = async (
|
||||
// tenantId: number,
|
||||
// refundCreditId: number,
|
||||
// trx?: Knex.Transaction
|
||||
// ): Promise<void> => {
|
||||
// const { Account, RefundVendorCredit } = this.tenancy.models(tenantId);
|
||||
return [payableEntry, depositEntry];
|
||||
}
|
||||
|
||||
// // Retireve refund with associated vendor credit entity.
|
||||
// const refundCredit = await RefundVendorCredit.query()
|
||||
// .findById(refundCreditId)
|
||||
// .withGraphFetched('vendorCredit');
|
||||
/**
|
||||
* Creates refund vendor credit GL entries.
|
||||
* @param {number} refundVendorCreditId
|
||||
* @param {Knex.Transaction} trx
|
||||
*/
|
||||
public createRefundVendorCreditGLEntries = async (
|
||||
refundVendorCreditId: number,
|
||||
trx?: Knex.Transaction,
|
||||
) => {
|
||||
// Retrieve the refund with associated vendor credit.
|
||||
const refundVendorCredit = await this.refundVendorCreditModel()
|
||||
.query(trx)
|
||||
.findById(refundVendorCreditId)
|
||||
.withGraphFetched('vendorCredit');
|
||||
|
||||
// const payableAccount = await Account.query().findOne(
|
||||
// 'slug',
|
||||
// 'accounts-payable'
|
||||
// );
|
||||
// // Generates the GL entries of the given refund credit.
|
||||
// const entries = this.getRefundCreditGLEntries(
|
||||
// refundCredit,
|
||||
// payableAccount.id
|
||||
// );
|
||||
// // Saves the ledegr to the storage.
|
||||
// await this.ledgerRepository.saveLedgerEntries(tenantId, entries, trx);
|
||||
// };
|
||||
// Retrieve the payable account (A/P) account based on the given currency.
|
||||
const APAccount = await this.accountRepository.findOrCreateAccountsPayable(
|
||||
refundVendorCredit.currencyCode,
|
||||
{},
|
||||
trx,
|
||||
);
|
||||
|
||||
// /**
|
||||
// * Reverts refund credit note GL entries.
|
||||
// * @param {number} tenantId
|
||||
// * @param {number} refundCreditId
|
||||
// * @param {Knex.Transaction} trx
|
||||
// * @return {Promise<void>}
|
||||
// */
|
||||
// public revertRefundCreditGLEntries = async (
|
||||
// tenantId: number,
|
||||
// refundCreditId: number,
|
||||
// trx?: Knex.Transaction
|
||||
// ) => {
|
||||
// await this.journalService.revertJournalTransactions(
|
||||
// tenantId,
|
||||
// refundCreditId,
|
||||
// 'RefundVendorCredit',
|
||||
// trx
|
||||
// );
|
||||
// };
|
||||
// }
|
||||
// Retrieve refund vendor credit GL entries.
|
||||
const refundGLEntries = this.getRefundVendorCreditGLEntries(
|
||||
refundVendorCredit,
|
||||
APAccount.id,
|
||||
);
|
||||
const ledger = new Ledger(refundGLEntries);
|
||||
|
||||
// Saves refund ledger entries.
|
||||
await this.ledgerStorage.commit(ledger, trx);
|
||||
};
|
||||
|
||||
/**
|
||||
* Reverts refund vendor credit GL entries.
|
||||
* @param {number} refundVendorCreditId
|
||||
* @param {Knex.Transaction} trx
|
||||
*/
|
||||
public revertRefundVendorCreditGLEntries = async (
|
||||
refundVendorCreditId: number,
|
||||
trx?: Knex.Transaction,
|
||||
) => {
|
||||
await this.ledgerStorage.deleteByReference(
|
||||
refundVendorCreditId,
|
||||
'RefundVendorCredit',
|
||||
trx,
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import { IsOptional, ToNumber } from '@/common/decorators/Validators';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { Min } from 'class-validator';
|
||||
import { IsDateString, Min } from 'class-validator';
|
||||
import { IsString } from 'class-validator';
|
||||
import { IsDate } from 'class-validator';
|
||||
import { IsNotEmpty, IsNumber, IsOptional, IsPositive } from 'class-validator';
|
||||
import { IsNotEmpty, IsNumber, IsPositive } from 'class-validator';
|
||||
|
||||
export class RefundVendorCreditDto {
|
||||
@ToNumber()
|
||||
@IsNumber()
|
||||
@IsNotEmpty()
|
||||
@Min(0)
|
||||
@@ -32,6 +34,7 @@ export class RefundVendorCreditDto {
|
||||
})
|
||||
depositAccountId: number;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@ApiProperty({
|
||||
@@ -40,7 +43,7 @@ export class RefundVendorCreditDto {
|
||||
})
|
||||
description: string;
|
||||
|
||||
@IsDate()
|
||||
@IsDateString()
|
||||
@IsNotEmpty()
|
||||
@ApiProperty({
|
||||
description: 'The date of the refund',
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
import { events } from '@/common/events/events';
|
||||
import { RefundVendorCreditGLEntries } from '../commands/RefundVendorCreditGLEntries';
|
||||
import {
|
||||
IRefundVendorCreditCreatedPayload,
|
||||
IRefundVendorCreditDeletedPayload,
|
||||
} from '../types/VendorCreditRefund.types';
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { OnEvent } from '@nestjs/event-emitter';
|
||||
|
||||
@Injectable()
|
||||
export class RefundVendorCreditGLEntriesSubscriber {
|
||||
constructor(
|
||||
private readonly refundVendorCreditGLEntries: RefundVendorCreditGLEntries,
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Writes refund vendor credit GL entries once the transaction created.
|
||||
* @param {IRefundVendorCreditCreatedPayload} payload -
|
||||
*/
|
||||
@OnEvent(events.vendorCredit.onRefundCreated)
|
||||
async writeRefundVendorCreditGLEntriesOnceCreated({
|
||||
trx,
|
||||
refundVendorCredit,
|
||||
vendorCredit,
|
||||
}: IRefundVendorCreditCreatedPayload) {
|
||||
await this.refundVendorCreditGLEntries.createRefundVendorCreditGLEntries(
|
||||
refundVendorCredit.id,
|
||||
trx,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverts refund vendor credit GL entries once the transaction deleted.
|
||||
* @param {IRefundVendorCreditDeletedPayload} payload -
|
||||
*/
|
||||
@OnEvent(events.vendorCredit.onRefundDeleted)
|
||||
async revertRefundVendorCreditGLEntriesOnceDeleted({
|
||||
trx,
|
||||
refundCreditId,
|
||||
oldRefundCredit,
|
||||
}: IRefundVendorCreditDeletedPayload) {
|
||||
await this.refundVendorCreditGLEntries.revertRefundVendorCreditGLEntries(
|
||||
refundCreditId,
|
||||
trx,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
import { Controller, Get, Param } from '@nestjs/common';
|
||||
import { WarehousesApplication } from './WarehousesApplication.service';
|
||||
import {
|
||||
ApiOperation,
|
||||
ApiParam,
|
||||
ApiResponse,
|
||||
ApiTags,
|
||||
} from '@nestjs/swagger';
|
||||
import { ApiCommonHeaders } from '@/common/decorators/ApiCommonHeaders';
|
||||
|
||||
@Controller('items')
|
||||
@ApiTags('Warehouses')
|
||||
@ApiCommonHeaders()
|
||||
export class WarehouseItemsController {
|
||||
constructor(private warehousesApplication: WarehousesApplication) { }
|
||||
|
||||
@Get(':id/warehouses')
|
||||
@ApiOperation({
|
||||
summary: 'Retrieves the item associated warehouses.',
|
||||
})
|
||||
@ApiResponse({
|
||||
status: 200,
|
||||
description:
|
||||
'The item associated warehouses have been successfully retrieved.',
|
||||
})
|
||||
@ApiResponse({ status: 404, description: 'The item not found.' })
|
||||
@ApiParam({
|
||||
name: 'id',
|
||||
required: true,
|
||||
type: Number,
|
||||
description: 'The item id',
|
||||
})
|
||||
getItemWarehouses(@Param('id') itemId: string) {
|
||||
return this.warehousesApplication.getItemWarehouses(Number(itemId));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,10 +85,4 @@ export class WarehousesController {
|
||||
markWarehousePrimary(@Param('id') warehouseId: string) {
|
||||
return this.warehousesApplication.markWarehousePrimary(Number(warehouseId));
|
||||
}
|
||||
|
||||
@Get('items/:itemId')
|
||||
@ApiOperation({ summary: 'Get item warehouses' })
|
||||
getItemWarehouses(@Param('itemId') itemId: string) {
|
||||
return this.warehousesApplication.getItemWarehouses(Number(itemId));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import { CreateWarehouse } from './commands/CreateWarehouse.service';
|
||||
import { EditWarehouse } from './commands/EditWarehouse.service';
|
||||
import { DeleteWarehouseService } from './commands/DeleteWarehouse.service';
|
||||
import { WarehousesController } from './Warehouses.controller';
|
||||
import { WarehouseItemsController } from './WarehouseItems.controller';
|
||||
import { GetWarehouse } from './queries/GetWarehouse';
|
||||
import { WarehouseMarkPrimary } from './commands/WarehouseMarkPrimary.service';
|
||||
import { GetWarehouses } from './queries/GetWarehouses';
|
||||
@@ -47,7 +48,7 @@ const models = [RegisterTenancyModel(Warehouse)];
|
||||
|
||||
@Module({
|
||||
imports: [TenancyDatabaseModule, ...models],
|
||||
controllers: [WarehousesController],
|
||||
controllers: [WarehousesController, WarehouseItemsController],
|
||||
providers: [
|
||||
CreateWarehouse,
|
||||
EditWarehouse,
|
||||
@@ -90,6 +91,6 @@ const models = [RegisterTenancyModel(Warehouse)];
|
||||
InventoryTransactionsWarehouses,
|
||||
ValidateWarehouseExistance
|
||||
],
|
||||
exports: [WarehousesSettings, WarehouseTransactionDTOTransform, ...models],
|
||||
exports: [WarehousesSettings, WarehouseTransactionDTOTransform, WarehousesApplication, ...models],
|
||||
})
|
||||
export class WarehousesModule {}
|
||||
|
||||
@@ -6,7 +6,7 @@ import { MenuItem } from '@blueprintjs/core';
|
||||
import { MenuItemNestedText, FSelect } from '@/components';
|
||||
import { accountPredicate } from './_components';
|
||||
import { DialogsName } from '@/constants/dialogs';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
import { usePreprocessingAccounts } from './_hooks';
|
||||
|
||||
// Create new account renderer.
|
||||
|
||||
@@ -4,7 +4,7 @@ import { MenuItem } from '@blueprintjs/core';
|
||||
import { ItemRenderer, ItemPredicate } from '@blueprintjs/select';
|
||||
import { DialogsName } from '@/constants/dialogs';
|
||||
import { FSuggest, Suggest, FormattedMessage as T } from '@/components';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
import { usePreprocessingAccounts } from './_hooks';
|
||||
|
||||
// Account interface
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// @ts-nocheck
|
||||
import React from 'react';
|
||||
import React, { useMemo } from 'react';
|
||||
import { Position, Checkbox, InputGroup } from '@blueprintjs/core';
|
||||
import { DateInput } from '@blueprintjs/datetime';
|
||||
import moment from 'moment';
|
||||
@@ -7,23 +7,29 @@ import intl from 'react-intl-universal';
|
||||
import { isUndefined } from 'lodash';
|
||||
|
||||
import { useAutofocus } from '@/hooks';
|
||||
import { T, Choose, ListSelect } from '@/components';
|
||||
import { T, Choose } from '@/components';
|
||||
import { Select } from '@/components/Forms';
|
||||
import { momentFormatter } from '@/utils';
|
||||
|
||||
function AdvancedFilterEnumerationField({ options, value, ...rest }) {
|
||||
const selectedItem = useMemo(
|
||||
() => options.find((opt) => opt.key === value) || null,
|
||||
[options, value],
|
||||
);
|
||||
|
||||
return (
|
||||
<ListSelect
|
||||
<Select
|
||||
items={options}
|
||||
selectedItem={value}
|
||||
selectedItem={selectedItem}
|
||||
popoverProps={{
|
||||
fill: true,
|
||||
inline: true,
|
||||
minimal: true,
|
||||
captureDismiss: true,
|
||||
}}
|
||||
defaultText={<T id={'filter.select_option'} />}
|
||||
textProp={'label'}
|
||||
selectedItemProp={'key'}
|
||||
placeholder={<T id={'filter.select_option'} />}
|
||||
textAccessor={'label'}
|
||||
valueAccessor={'key'}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -11,7 +11,7 @@ import { AppIntlProvider } from './AppIntlProvider';
|
||||
import { useSplashLoading } from '@/hooks/state';
|
||||
|
||||
import { useWatchImmediate } from '../hooks';
|
||||
import withDashboardActions from '@/containers/Dashboard/withDashboardActions';
|
||||
import { withDashboardActions } from '@/containers/Dashboard/withDashboardActions';
|
||||
|
||||
const SUPPORTED_LOCALES = [
|
||||
{ name: 'English', value: 'en' },
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import React, { useCallback } from 'react';
|
||||
import * as R from 'ramda';
|
||||
import { FMultiSelect } from '../Forms';
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
|
||||
import { DRAWERS } from '@/constants/drawers';
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,7 +3,7 @@ import React from 'react';
|
||||
import * as R from 'ramda';
|
||||
|
||||
import { ButtonLink } from '../Button';
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
|
||||
import { DRAWERS } from '@/constants/drawers';
|
||||
|
||||
function CustomerDrawerLinkComponent({
|
||||
|
||||
@@ -4,7 +4,7 @@ import * as R from 'ramda';
|
||||
import { useFormikContext } from 'formik';
|
||||
import { createNewItemFromQuery, createNewItemRenderer } from './utils';
|
||||
import { FSelect } from '../Forms';
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
|
||||
import { useCreateAutofillListener } from '@/hooks/state/autofill';
|
||||
import { DRAWERS } from '@/constants/drawers';
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import { useHistory } from 'react-router-dom';
|
||||
|
||||
import { If, Icon } from '@/components';
|
||||
import { FormattedMessage as T } from '@/components';
|
||||
import withDashboard from '@/containers/Dashboard/withDashboard';
|
||||
import { withDashboard } from '@/containers/Dashboard/withDashboard';
|
||||
import { compose } from '@/utils';
|
||||
|
||||
function DashboardBackLink({ dashboardBackLink, breadcrumbs }) {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// @ts-nocheck
|
||||
import React, { useEffect, Suspense } from 'react';
|
||||
import { CLASSES } from '@/constants/classes';
|
||||
import withDashboardActions from '@/containers/Dashboard/withDashboardActions';
|
||||
import { withDashboardActions } from '@/containers/Dashboard/withDashboardActions';
|
||||
import { compose } from '@/utils';
|
||||
import { Spinner } from '@blueprintjs/core';
|
||||
|
||||
import withUniversalSearchActions from '@/containers/UniversalSearch/withUniversalSearchActions';
|
||||
import { withUniversalSearchActions } from '@/containers/UniversalSearch/withUniversalSearchActions';
|
||||
|
||||
/**
|
||||
* Dashboard pages wrapper.
|
||||
|
||||
@@ -3,7 +3,7 @@ import React, { useState, useRef } from 'react';
|
||||
import SplitPane from 'react-split-pane';
|
||||
import { debounce } from 'lodash';
|
||||
|
||||
import withDashboard from '@/containers/Dashboard/withDashboard';
|
||||
import { withDashboard } from '@/containers/Dashboard/withDashboard';
|
||||
import { compose } from '@/utils';
|
||||
|
||||
function DashboardSplitPane({
|
||||
|
||||
@@ -21,10 +21,10 @@ import DashboardTopbarUser from '@/components/Dashboard/TopbarUser';
|
||||
import DashboardBreadcrumbs from '@/components/Dashboard/DashboardBreadcrumbs';
|
||||
import DashboardBackLink from '@/components/Dashboard/DashboardBackLink';
|
||||
|
||||
import withUniversalSearchActions from '@/containers/UniversalSearch/withUniversalSearchActions';
|
||||
import withDashboardActions from '@/containers/Dashboard/withDashboardActions';
|
||||
import withDashboard from '@/containers/Dashboard/withDashboard';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withUniversalSearchActions } from '@/containers/UniversalSearch/withUniversalSearchActions';
|
||||
import { withDashboardActions } from '@/containers/Dashboard/withDashboardActions';
|
||||
import { withDashboard } from '@/containers/Dashboard/withDashboard';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
|
||||
import QuickNewDropdown from '@/containers/QuickNewDropdown/QuickNewDropdown';
|
||||
import {
|
||||
|
||||
@@ -3,9 +3,9 @@ import React from 'react';
|
||||
import { useHotkeys } from 'react-hotkeys-hook';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { getDashboardRoutes } from '@/routes/dashboard';
|
||||
import withDashboardActions from '@/containers/Dashboard/withDashboardActions';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import withUniversalSearchActions from '@/containers/UniversalSearch/withUniversalSearchActions';
|
||||
import { withDashboardActions } from '@/containers/Dashboard/withDashboardActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
import { withUniversalSearchActions } from '@/containers/UniversalSearch/withUniversalSearchActions';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// @ts-nocheck
|
||||
import * as R from 'ramda';
|
||||
import BigcapitalLoading from './BigcapitalLoading';
|
||||
import withDashboard from '@/containers/Dashboard/withDashboard';
|
||||
import { withDashboard } from '@/containers/Dashboard/withDashboard';
|
||||
|
||||
function SplashScreenComponent({ splashScreenLoading }) {
|
||||
return splashScreenLoading ? <BigcapitalLoading /> : null;
|
||||
|
||||
@@ -13,7 +13,7 @@ import { FormattedMessage as T } from '@/components';
|
||||
|
||||
import { useAuthActions } from '@/hooks/state';
|
||||
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
|
||||
import { useAuthenticatedAccount } from '@/hooks/query';
|
||||
import { firstLettersArgs, compose } from '@/utils';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// @ts-nocheck
|
||||
import React from 'react';
|
||||
import { Dialog } from '@blueprintjs/core';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
import { compose } from '@/utils';
|
||||
|
||||
import '@/style/components/Dialog/Dialog.scss';
|
||||
|
||||
@@ -5,7 +5,7 @@ import { Position, Drawer } from '@blueprintjs/core';
|
||||
import '@/style/components/Drawer.scss';
|
||||
|
||||
import { DrawerProvider } from './DrawerProvider';
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
|
||||
import { compose } from '@/utils';
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,7 +3,7 @@ import React from 'react';
|
||||
import { FormattedMessage as T } from '@/components';
|
||||
import { Classes, Icon, H4, Button } from '@blueprintjs/core';
|
||||
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
|
||||
import { useDrawerContext } from './DrawerProvider';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
|
||||
@@ -5,7 +5,7 @@ import * as R from 'ramda';
|
||||
import { DetailItem } from '@/components';
|
||||
import { isEqual } from 'lodash';
|
||||
|
||||
import withCurrentOrganization from '@/containers/Organization/withCurrentOrganization';
|
||||
import { withCurrentOrganization } from '@/containers/Organization/withCurrentOrganization';
|
||||
|
||||
/**
|
||||
* Detail exchange rate item.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// @ts-nocheck
|
||||
import React from 'react';
|
||||
import * as R from 'ramda';
|
||||
import withFeatureCan from './withFeatureCan';
|
||||
import { withFeatureCan } from './withFeatureCan';
|
||||
|
||||
function FeatureCanJSX({ feature, children, isFeatureCan }) {
|
||||
return isFeatureCan && children;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { getDashboardFeaturesSelector } from '@/store/dashboard/dashboard.selectors';
|
||||
|
||||
export default (mapState) => {
|
||||
export const withFeatureCan = (mapState) => {
|
||||
const featuresSelector = getDashboardFeaturesSelector();
|
||||
|
||||
const mapStateToProps = (state, props) => {
|
||||
|
||||
@@ -3,8 +3,8 @@ import React from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { Redirect } from 'react-router-dom';
|
||||
import { compose } from '@/utils';
|
||||
import withAuthentication from '@/containers/Authentication/withAuthentication';
|
||||
import withOrganization from '@/containers/Organization/withOrganization';
|
||||
import { withAuthentication } from '@/containers/Authentication/withAuthentication';
|
||||
import { withOrganization } from '@/containers/Organization/withOrganization';
|
||||
|
||||
/**
|
||||
* Ensures organization is not ready.
|
||||
|
||||
@@ -4,8 +4,8 @@ import { connect } from 'react-redux';
|
||||
import { Redirect } from 'react-router-dom';
|
||||
import { compose } from '@/utils';
|
||||
|
||||
import withAuthentication from '@/containers/Authentication/withAuthentication';
|
||||
import withOrganization from '@/containers/Organization/withOrganization';
|
||||
import { withAuthentication } from '@/containers/Authentication/withAuthentication';
|
||||
import { withOrganization } from '@/containers/Organization/withOrganization';
|
||||
|
||||
function EnsureOrganizationIsReady({
|
||||
// #ownProps
|
||||
|
||||
@@ -4,7 +4,7 @@ import { includes } from 'lodash';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
import { Redirect } from 'react-router-dom';
|
||||
import withSubscriptions from '@/containers/Subscriptions/withSubscriptions';
|
||||
import { withSubscriptions } from '@/containers/Subscriptions/withSubscriptions';
|
||||
|
||||
/**
|
||||
* Ensures the given subscription type is active or redirect to the given route.
|
||||
|
||||
@@ -4,7 +4,7 @@ import { includes } from 'lodash';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
import { Redirect } from 'react-router-dom';
|
||||
import withSubscriptions from '@/containers/Subscriptions/withSubscriptionss';
|
||||
import { withSubscriptions } from '@/containers/Subscriptions/withSubscriptionss';
|
||||
|
||||
/**
|
||||
* Ensures the given subscription type is active or redirect to the given route.
|
||||
|
||||
@@ -4,7 +4,7 @@ import { includes } from 'lodash';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
import { Redirect } from 'react-router-dom';
|
||||
import withSubscriptions from '@/containers/Subscriptions/withSubscriptionss';
|
||||
import { withSubscriptions } from '@/containers/Subscriptions/withSubscriptionss';
|
||||
|
||||
/**
|
||||
* Ensures the given subscription type is active or redirect to the given route.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import React from 'react';
|
||||
import * as R from 'ramda';
|
||||
import { FMultiSelect } from '@/components/Forms';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
|
||||
/**
|
||||
* Items multi-select.
|
||||
|
||||
@@ -9,7 +9,7 @@ import { CLASSES } from '@/constants/classes';
|
||||
|
||||
import { FormattedMessage as T } from '@/components';
|
||||
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
|
||||
|
||||
import { DRAWERS } from '@/constants/drawers';
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import PreferencesContentRoute from '@/components/Preferences/PreferencesContent
|
||||
import DashboardErrorBoundary from '@/components/Dashboard/DashboardErrorBoundary';
|
||||
import PreferencesSidebar from '@/components/Preferences/PreferencesSidebar';
|
||||
|
||||
import withDashboardActions from '@/containers/Dashboard/withDashboardActions';
|
||||
import { withDashboardActions } from '@/containers/Dashboard/withDashboardActions';
|
||||
|
||||
import '@/style/pages/Preferences/Page.scss';
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import CurrenciesActions from '@/containers/Preferences/Currencies/CurrenciesAct
|
||||
import WarehousesActions from '@/containers/Preferences/Warehouses/WarehousesActions';
|
||||
import BranchesActions from '@/containers/Preferences/Branches/BranchesActions';
|
||||
import ApiKeysActions from '@/containers/Preferences/ApiKeys/ApiKeysActions';
|
||||
import withDashboard from '@/containers/Dashboard/withDashboard';
|
||||
import { withDashboard } from '@/containers/Dashboard/withDashboard';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import * as R from 'ramda';
|
||||
import intl from 'react-intl-universal';
|
||||
import { FSelect } from '@/components';
|
||||
import { DialogsName } from '@/constants/dialogs';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
import { MenuItem } from '@blueprintjs/core';
|
||||
|
||||
// Create new account renderer.
|
||||
|
||||
@@ -3,7 +3,7 @@ import React from 'react';
|
||||
import * as R from 'ramda';
|
||||
|
||||
import { ButtonLink } from '../Button';
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
|
||||
import { DRAWERS } from '@/constants/drawers';
|
||||
|
||||
function VendorDrawerLinkComponent({
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import React from 'react';
|
||||
import * as R from 'ramda';
|
||||
import { useFormikContext } from 'formik';
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
|
||||
import { createNewItemFromQuery, createNewItemRenderer } from './utils';
|
||||
import { FSelect } from '../Forms';
|
||||
import { useCreateAutofillListener } from '@/hooks/state/autofill';
|
||||
|
||||
@@ -25,11 +25,11 @@ import { useRefreshJournals } from '@/hooks/query/manualJournals';
|
||||
import { useManualJournalsContext } from './ManualJournalsListProvider';
|
||||
import { ManualJournalAction, AbilitySubject } from '@/constants/abilityOption';
|
||||
|
||||
import withManualJournals from './withManualJournals';
|
||||
import withManualJournalsActions from './withManualJournalsActions';
|
||||
import withSettings from '@/containers/Settings/withSettings';
|
||||
import withSettingsActions from '@/containers/Settings/withSettingsActions';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withManualJournals } from './withManualJournals';
|
||||
import { withManualJournalsActions } from './withManualJournalsActions';
|
||||
import { withSettings } from '@/containers/Settings/withSettings';
|
||||
import { withSettingsActions } from '@/containers/Settings/withSettingsActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
|
||||
import { useDownloadExportPdf } from '@/hooks/query/FinancialReports/use-export-pdf';
|
||||
import { compose } from '@/utils';
|
||||
|
||||
@@ -14,11 +14,11 @@ import ManualJournalsEmptyStatus from './ManualJournalsEmptyStatus';
|
||||
|
||||
import { ActionsMenu } from './components';
|
||||
|
||||
import withManualJournals from './withManualJournals';
|
||||
import withManualJournalsActions from './withManualJournalsActions';
|
||||
import withAlertsActions from '@/containers/Alert/withAlertActions';
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import withSettings from '@/containers/Settings/withSettings';
|
||||
import { withManualJournals } from './withManualJournals';
|
||||
import { withManualJournalsActions } from './withManualJournalsActions';
|
||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
|
||||
import { withSettings } from '@/containers/Settings/withSettings';
|
||||
|
||||
import { useManualJournalsContext } from './ManualJournalsListProvider';
|
||||
import { useMemorizedColumnsWidths } from '@/hooks';
|
||||
@@ -35,7 +35,7 @@ function ManualJournalsDataTable({
|
||||
setManualJournalsTableState,
|
||||
setManualJournalsSelectedRows,
|
||||
|
||||
// #withAlertsActions
|
||||
// #withAlertActions
|
||||
openAlert,
|
||||
|
||||
// #withDrawerActions
|
||||
@@ -157,7 +157,7 @@ export default compose(
|
||||
withManualJournals(({ manualJournalsTableState }) => ({
|
||||
manualJournalsTableState,
|
||||
})),
|
||||
withAlertsActions,
|
||||
withAlertActions,
|
||||
withDrawerActions,
|
||||
withSettings(({ manualJournalsSettings }) => ({
|
||||
manualJournalsTableSize: manualJournalsSettings?.tableSize,
|
||||
|
||||
@@ -9,7 +9,7 @@ import { transformTableStateToQuery, compose } from '@/utils';
|
||||
import { ManualJournalsListProvider } from './ManualJournalsListProvider';
|
||||
import ManualJournalsDataTable from './ManualJournalsDataTable';
|
||||
import ManualJournalsActionsBar from './ManualJournalActionsBar';
|
||||
import withManualJournals from './withManualJournals';
|
||||
import { withManualJournals } from './withManualJournals';
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,9 +5,9 @@ import { pick } from 'lodash';
|
||||
|
||||
import { DashboardViewsTabs } from '@/components';
|
||||
import { useManualJournalsContext } from './ManualJournalsListProvider';
|
||||
import withManualJournals from './withManualJournals';
|
||||
import withManualJournalsActions from './withManualJournalsActions';
|
||||
import withDashboardActions from '@/containers/Dashboard/withDashboardActions';
|
||||
import { withManualJournals } from './withManualJournals';
|
||||
import { withManualJournalsActions } from './withManualJournalsActions';
|
||||
import { withDashboardActions } from '@/containers/Dashboard/withDashboardActions';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
manualJournalTableStateChangedFactory,
|
||||
} from '@/store/manualJournals/manualJournals.selectors';
|
||||
|
||||
export default (mapState) => {
|
||||
export const withManualJournals = (mapState) => {
|
||||
const getJournalsTableQuery = getManualJournalsTableStateFactory();
|
||||
const manualJournalTableStateChanged =
|
||||
manualJournalTableStateChangedFactory();
|
||||
|
||||
@@ -12,4 +12,4 @@ const mapActionsToProps = (dispatch) => ({
|
||||
dispatch(setManualJournalsSelectedRows(selectedRows)),
|
||||
});
|
||||
|
||||
export default connect(null, mapActionsToProps);
|
||||
export const withManualJournalsActions = connect(null, mapActionsToProps);
|
||||
|
||||
@@ -22,8 +22,8 @@ import MakeJournalFormFooter from './MakeJournalFormFooter';
|
||||
import MakeJournalFormDialogs from './MakeJournalFormDialogs';
|
||||
import MakeJournalFormTopBar from './MakeJournalFormTopBar';
|
||||
|
||||
import withSettings from '@/containers/Settings/withSettings';
|
||||
import withCurrentOrganization from '@/containers/Organization/withCurrentOrganization';
|
||||
import { withSettings } from '@/containers/Settings/withSettings';
|
||||
import { withCurrentOrganization } from '@/containers/Organization/withCurrentOrganization';
|
||||
|
||||
import { AppToaster } from '@/components';
|
||||
import { PageForm } from '@/components/PageForm';
|
||||
|
||||
@@ -13,8 +13,8 @@ import {
|
||||
FFormGroup,
|
||||
} from '@/components';
|
||||
|
||||
import withSettings from '@/containers/Settings/withSettings';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withSettings } from '@/containers/Settings/withSettings';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
|
||||
/**
|
||||
* Journal number field of make journal form.
|
||||
|
||||
@@ -25,7 +25,7 @@ import { CellType, Features, Align } from '@/constants';
|
||||
|
||||
import { useCurrentOrganization, useFeatureCan } from '@/hooks/state';
|
||||
import { useJournalIsForeign } from './utils';
|
||||
import withSettings from '@/containers/Settings/withSettings';
|
||||
import { withSettings } from '@/containers/Settings/withSettings';
|
||||
import { transactionNumber } from '@/utils';
|
||||
import { useUpdateEffect } from '@/hooks';
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import intl from 'react-intl-universal';
|
||||
import { RESOURCES_TYPES } from '@/constants/resourcesTypes';
|
||||
import { AbilitySubject, ManualJournalAction } from '@/constants/abilityOption';
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
|
||||
import { DRAWERS } from '@/constants/drawers';
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// @ts-nocheck
|
||||
import intl from 'react-intl-universal';
|
||||
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
|
||||
|
||||
import { AbilitySubject, AccountAction } from '@/constants/abilityOption';
|
||||
import { RESOURCES_TYPES } from '@/constants/resourcesTypes';
|
||||
|
||||
@@ -36,12 +36,12 @@ import { useAccountsChartContext } from './AccountsChartProvider';
|
||||
import { useDownloadExportPdf } from '@/hooks/query/FinancialReports/use-export-pdf';
|
||||
import { useBulkDeleteAccountsDialog } from './hooks/use-bulk-delete-accounts-dialog';
|
||||
|
||||
import withAccounts from './withAccounts';
|
||||
import withAccountsTableActions from './withAccountsTableActions';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import withAlertActions from '@/containers/Alert/withAlertActions';
|
||||
import withSettings from '@/containers/Settings/withSettings';
|
||||
import withSettingsActions from '@/containers/Settings/withSettingsActions';
|
||||
import { withAccounts } from './withAccounts';
|
||||
import { withAccountsTableActions } from './withAccountsTableActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||
import { withSettings } from '@/containers/Settings/withSettings';
|
||||
import { withSettingsActions } from '@/containers/Settings/withSettingsActions';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ import { AccountsChartProvider } from './AccountsChartProvider';
|
||||
import AccountsActionsBar from './AccountsActionsBar';
|
||||
import AccountsDataTable from './AccountsDataTable';
|
||||
|
||||
import withAccounts from '@/containers/Accounts/withAccounts';
|
||||
import withAccountsTableActions from './withAccountsTableActions';
|
||||
import { withAccounts } from '@/containers/Accounts/withAccounts';
|
||||
import { withAccountsTableActions } from './withAccountsTableActions';
|
||||
|
||||
import { transformAccountsStateToQuery } from './utils';
|
||||
import { compose } from '@/utils';
|
||||
|
||||
@@ -18,11 +18,11 @@ import { useMemorizedColumnsWidths } from '@/hooks';
|
||||
import { TABLES } from '@/constants/tables';
|
||||
import { DialogsName } from '@/constants/dialogs';
|
||||
|
||||
import withSettings from '@/containers/Settings/withSettings';
|
||||
import withAlertsActions from '@/containers/Alert/withAlertActions';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import withAccountsTableActions from './withAccountsTableActions';
|
||||
import { withSettings } from '@/containers/Settings/withSettings';
|
||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
|
||||
import { withAccountsTableActions } from './withAccountsTableActions';
|
||||
import { compose } from '@/utils';
|
||||
import { DRAWERS } from '@/constants/drawers';
|
||||
|
||||
@@ -145,7 +145,7 @@ function AccountsDataTable({
|
||||
}
|
||||
|
||||
export default compose(
|
||||
withAlertsActions,
|
||||
withAlertActions,
|
||||
withDrawerActions,
|
||||
withDialogActions,
|
||||
withAccountsTableActions,
|
||||
|
||||
@@ -6,8 +6,8 @@ import intl from 'react-intl-universal';
|
||||
import { DashboardViewsTabs } from '@/components';
|
||||
import { useAccountsChartContext } from './AccountsChartProvider';
|
||||
|
||||
import withAccounts from './withAccounts';
|
||||
import withAccountsTableActions from './withAccountsTableActions';
|
||||
import { withAccounts } from './withAccounts';
|
||||
import { withAccountsTableActions } from './withAccountsTableActions';
|
||||
|
||||
import { compose, transfromViewsToTabs } from '@/utils';
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
accountsTableStateChangedFactory,
|
||||
} from '@/store/accounts/accounts.selectors';
|
||||
|
||||
export default (mapState) => {
|
||||
export const withAccounts = (mapState) => {
|
||||
const getAccountsTableState = getAccountsTableStateFactory();
|
||||
const accountsTableStateChanged = accountsTableStateChangedFactory();
|
||||
|
||||
|
||||
@@ -13,4 +13,4 @@ const mapActionsToProps = (dispatch) => ({
|
||||
dispatch(setAccountsSelectedRows(selectedRows)),
|
||||
});
|
||||
|
||||
export default connect(null, mapActionsToProps);
|
||||
export const withAccountsTableActions = connect(null, mapActionsToProps);
|
||||
|
||||
@@ -11,4 +11,4 @@ export const mapDispatchToProps = (dispatch) => ({
|
||||
closeAlert: (name, payload) => dispatch({ type: t.CLOSE_ALERT, name, payload }),
|
||||
});
|
||||
|
||||
export default connect(null, mapDispatchToProps);
|
||||
export const withAlertActions = connect(null, mapDispatchToProps);
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
getAlertPayloadFactory,
|
||||
} from '@/store/dashboard/dashboard.selectors';
|
||||
|
||||
export default (mapState) => {
|
||||
export const withAlertStoreConnect = (mapState) => {
|
||||
const isAlertOpen = isAlertOpenFactory();
|
||||
const getAlertPayload = getAlertPayloadFactory();
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ import intl from 'react-intl-universal';
|
||||
import { Intent, Alert } from '@blueprintjs/core';
|
||||
import { AppToaster, FormattedMessage as T } from '@/components';
|
||||
|
||||
import withAlertStoreConnect from '@/containers/Alert/withAlertStoreConnect';
|
||||
import withAlertActions from '@/containers/Alert/withAlertActions';
|
||||
import { withAlertStoreConnect } from '@/containers/Alert/withAlertStoreConnect';
|
||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||
|
||||
import { useActivateAccount } from '@/hooks/query';
|
||||
import { compose } from '@/utils';
|
||||
|
||||
@@ -5,8 +5,8 @@ import { Intent, Alert } from '@blueprintjs/core';
|
||||
import { queryCache } from 'react-query';
|
||||
import { FormattedMessage as T, AppToaster } from '@/components';
|
||||
|
||||
import withAlertStoreConnect from '@/containers/Alert/withAlertStoreConnect';
|
||||
import withAlertActions from '@/containers/Alert/withAlertActions';
|
||||
import { withAlertStoreConnect } from '@/containers/Alert/withAlertStoreConnect';
|
||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@ import { Intent, Alert } from '@blueprintjs/core';
|
||||
import { queryCache } from 'react-query';
|
||||
import { AppToaster } from '@/components';
|
||||
|
||||
import withAccountsActions from '@/containers/Accounts/withAccountsTableActions';
|
||||
import withAlertStoreConnect from '@/containers/Alert/withAlertStoreConnect';
|
||||
import withAlertActions from '@/containers/Alert/withAlertActions';
|
||||
// import { withAccountsActions } from '@/containers/Accounts/withAccountsTableActions';
|
||||
import { withAlertStoreConnect } from '@/containers/Alert/withAlertStoreConnect';
|
||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
|
||||
@@ -22,7 +22,7 @@ function AccountBulkInactivateAlert({
|
||||
|
||||
closeAlert,
|
||||
}) {
|
||||
|
||||
|
||||
const [isLoading, setLoading] = useState(false);
|
||||
const selectedRowsCount = 0;
|
||||
|
||||
@@ -41,7 +41,7 @@ function AccountBulkInactivateAlert({
|
||||
});
|
||||
queryCache.invalidateQueries('accounts-table');
|
||||
})
|
||||
.catch((errors) => {})
|
||||
.catch((errors) => { })
|
||||
.finally(() => {
|
||||
setLoading(false);
|
||||
closeAlert(name);
|
||||
@@ -68,5 +68,5 @@ function AccountBulkInactivateAlert({
|
||||
export default compose(
|
||||
withAlertStoreConnect(),
|
||||
withAlertActions,
|
||||
withAccountsActions,
|
||||
// withAccountsActions,
|
||||
)(AccountBulkInactivateAlert);
|
||||
|
||||
@@ -10,9 +10,9 @@ import {
|
||||
|
||||
import { handleDeleteErrors } from '@/containers/Accounts/utils';
|
||||
|
||||
import withAlertStoreConnect from '@/containers/Alert/withAlertStoreConnect';
|
||||
import withAlertActions from '@/containers/Alert/withAlertActions';
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import { withAlertStoreConnect } from '@/containers/Alert/withAlertStoreConnect';
|
||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
|
||||
|
||||
import { useDeleteAccount } from '@/hooks/query';
|
||||
import { compose } from '@/utils';
|
||||
|
||||
@@ -4,8 +4,8 @@ import intl from 'react-intl-universal';
|
||||
import { AppToaster, FormattedMessage as T } from '@/components';
|
||||
import { Intent, Alert } from '@blueprintjs/core';
|
||||
|
||||
import withAlertStoreConnect from '@/containers/Alert/withAlertStoreConnect';
|
||||
import withAlertActions from '@/containers/Alert/withAlertActions';
|
||||
import { withAlertStoreConnect } from '@/containers/Alert/withAlertStoreConnect';
|
||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
import { useInactivateAccount } from '@/hooks/query';
|
||||
|
||||
@@ -4,9 +4,9 @@ import intl from 'react-intl-universal';
|
||||
import { AppToaster, FormattedMessage as T } from '@/components';
|
||||
import { Intent, Alert } from '@blueprintjs/core';
|
||||
|
||||
import withAlertStoreConnect from '@/containers/Alert/withAlertStoreConnect';
|
||||
import withAlertActions from '@/containers/Alert/withAlertActions';
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import { withAlertStoreConnect } from '@/containers/Alert/withAlertStoreConnect';
|
||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
|
||||
|
||||
import { handleDeleteErrors } from '@/containers/Purchases/Bills/BillForm/utils';
|
||||
import { useDeleteBill } from '@/hooks/query';
|
||||
|
||||
@@ -7,8 +7,8 @@ import { useDeleteLandedCost } from '@/hooks/query';
|
||||
|
||||
import { AppToaster } from '@/components';
|
||||
|
||||
import withAlertActions from '@/containers/Alert/withAlertActions';
|
||||
import withAlertStoreConnect from '@/containers/Alert/withAlertStoreConnect';
|
||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||
import { withAlertStoreConnect } from '@/containers/Alert/withAlertStoreConnect';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ import { AppToaster, FormattedMessage as T } from '@/components';
|
||||
import intl from 'react-intl-universal';
|
||||
import { Intent, Alert } from '@blueprintjs/core';
|
||||
|
||||
import withAlertStoreConnect from '@/containers/Alert/withAlertStoreConnect';
|
||||
import withAlertActions from '@/containers/Alert/withAlertActions';
|
||||
import { withAlertStoreConnect } from '@/containers/Alert/withAlertStoreConnect';
|
||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||
|
||||
import { useOpenBill } from '@/hooks/query';
|
||||
import { compose } from '@/utils';
|
||||
|
||||
@@ -11,8 +11,8 @@ import { Intent, Alert } from '@blueprintjs/core';
|
||||
import { useDeleteBranch } from '@/hooks/query';
|
||||
import { handleDeleteErrors } from '@/containers/Preferences/Branches/utils';
|
||||
|
||||
import withAlertStoreConnect from '@/containers/Alert/withAlertStoreConnect';
|
||||
import withAlertActions from '@/containers/Alert/withAlertActions';
|
||||
import { withAlertStoreConnect } from '@/containers/Alert/withAlertStoreConnect';
|
||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ import { AppToaster, FormattedMessage as T } from '@/components';
|
||||
|
||||
import { useMarkBranchAsPrimary } from '@/hooks/query';
|
||||
|
||||
import withAlertActions from '@/containers/Alert/withAlertActions';
|
||||
import withAlertStoreConnect from '@/containers/Alert/withAlertStoreConnect';
|
||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||
import { withAlertStoreConnect } from '@/containers/Alert/withAlertStoreConnect';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
|
||||
|
||||
@@ -10,9 +10,9 @@ import {
|
||||
|
||||
import { useDeleteCashflowTransaction } from '@/hooks/query';
|
||||
|
||||
import withAlertStoreConnect from '@/containers/Alert/withAlertStoreConnect';
|
||||
import withAlertActions from '@/containers/Alert/withAlertActions';
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import { withAlertStoreConnect } from '@/containers/Alert/withAlertStoreConnect';
|
||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
import { DRAWERS } from '@/constants/drawers';
|
||||
|
||||
@@ -6,8 +6,8 @@ import { AppToaster, FormattedMessage as T } from '@/components';
|
||||
|
||||
import { useActivateContact } from '@/hooks/query';
|
||||
|
||||
import withAlertStoreConnect from '@/containers/Alert/withAlertStoreConnect';
|
||||
import withAlertActions from '@/containers/Alert/withAlertActions';
|
||||
import { withAlertStoreConnect } from '@/containers/Alert/withAlertStoreConnect';
|
||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ import { Intent, Alert } from '@blueprintjs/core';
|
||||
|
||||
import { useInactivateContact } from '@/hooks/query';
|
||||
|
||||
import withAlertStoreConnect from '@/containers/Alert/withAlertStoreConnect';
|
||||
import withAlertActions from '@/containers/Alert/withAlertActions';
|
||||
import { withAlertStoreConnect } from '@/containers/Alert/withAlertStoreConnect';
|
||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@ import {
|
||||
FormattedHTMLMessage,
|
||||
} from '@/components';
|
||||
|
||||
import withAlertStoreConnect from '@/containers/Alert/withAlertStoreConnect';
|
||||
import withAlertActions from '@/containers/Alert/withAlertActions';
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import { withAlertStoreConnect } from '@/containers/Alert/withAlertStoreConnect';
|
||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
|
||||
|
||||
import { useDeleteCreditNote } from '@/hooks/query';
|
||||
import { handleDeleteErrors } from '@/containers/Sales/CreditNotes/CreditNotesLanding/utils';
|
||||
|
||||
@@ -6,8 +6,8 @@ import { AppToaster, FormattedMessage as T } from '@/components';
|
||||
|
||||
import { useOpenCreditNote } from '@/hooks/query';
|
||||
|
||||
import withAlertStoreConnect from '@/containers/Alert/withAlertStoreConnect';
|
||||
import withAlertActions from '@/containers/Alert/withAlertActions';
|
||||
import { withAlertStoreConnect } from '@/containers/Alert/withAlertStoreConnect';
|
||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@ import {
|
||||
FormattedHTMLMessage,
|
||||
} from '@/components';
|
||||
|
||||
import withAlertStoreConnect from '@/containers/Alert/withAlertStoreConnect';
|
||||
import withAlertActions from '@/containers/Alert/withAlertActions';
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import { withAlertStoreConnect } from '@/containers/Alert/withAlertStoreConnect';
|
||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
|
||||
|
||||
import { useDeleteReconcileCredit } from '@/hooks/query';
|
||||
import { compose } from '@/utils';
|
||||
|
||||
@@ -6,9 +6,9 @@ import { FormattedMessage as T, AppToaster } from '@/components';
|
||||
|
||||
import { useDeleteRefundCreditNote } from '@/hooks/query';
|
||||
|
||||
import withAlertActions from '@/containers/Alert/withAlertActions';
|
||||
import withAlertStoreConnect from '@/containers/Alert/withAlertStoreConnect';
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||
import { withAlertStoreConnect } from '@/containers/Alert/withAlertStoreConnect';
|
||||
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
import { DRAWERS } from '@/constants/drawers';
|
||||
|
||||
@@ -10,8 +10,8 @@ import { Intent, Alert } from '@blueprintjs/core';
|
||||
|
||||
import { useDeleteCurrency } from '@/hooks/query';
|
||||
|
||||
import withAlertStoreConnect from '@/containers/Alert/withAlertStoreConnect';
|
||||
import withAlertActions from '@/containers/Alert/withAlertActions';
|
||||
import { withAlertStoreConnect } from '@/containers/Alert/withAlertStoreConnect';
|
||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ import { AppToaster, FormattedMessage as T } from '@/components';
|
||||
|
||||
import { useActivateContact } from '@/hooks/query';
|
||||
|
||||
import withAlertStoreConnect from '@/containers/Alert/withAlertStoreConnect';
|
||||
import withAlertActions from '@/containers/Alert/withAlertActions';
|
||||
import { withAlertStoreConnect } from '@/containers/Alert/withAlertStoreConnect';
|
||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ import { Intent, Alert } from '@blueprintjs/core';
|
||||
import { AppToaster } from '@/components';
|
||||
import { transformErrors } from '@/containers/Customers/utils';
|
||||
|
||||
import withAlertStoreConnect from '@/containers/Alert/withAlertStoreConnect';
|
||||
import withAlertActions from '@/containers/Alert/withAlertActions';
|
||||
import { withAlertStoreConnect } from '@/containers/Alert/withAlertStoreConnect';
|
||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
|
||||
|
||||
@@ -9,9 +9,9 @@ import {
|
||||
} from '@/components';
|
||||
import { transformErrors } from '@/containers/Customers/utils';
|
||||
|
||||
import withAlertStoreConnect from '@/containers/Alert/withAlertStoreConnect';
|
||||
import withAlertActions from '@/containers/Alert/withAlertActions';
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import { withAlertStoreConnect } from '@/containers/Alert/withAlertStoreConnect';
|
||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
|
||||
|
||||
import { useDeleteCustomer } from '@/hooks/query';
|
||||
import { compose } from '@/utils';
|
||||
|
||||
@@ -6,8 +6,8 @@ import { Intent, Alert } from '@blueprintjs/core';
|
||||
|
||||
import { useInactivateContact } from '@/hooks/query';
|
||||
|
||||
import withAlertStoreConnect from '@/containers/Alert/withAlertStoreConnect';
|
||||
import withAlertActions from '@/containers/Alert/withAlertActions';
|
||||
import { withAlertStoreConnect } from '@/containers/Alert/withAlertStoreConnect';
|
||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ import { queryCache } from 'react-query';
|
||||
|
||||
import { useApproveEstimate } from '@/hooks/query';
|
||||
|
||||
import withAlertStoreConnect from '@/containers/Alert/withAlertStoreConnect';
|
||||
import withAlertActions from '@/containers/Alert/withAlertActions';
|
||||
import { withAlertStoreConnect } from '@/containers/Alert/withAlertStoreConnect';
|
||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
|
||||
|
||||
@@ -10,9 +10,9 @@ import {
|
||||
|
||||
import { useDeleteEstimate } from '@/hooks/query';
|
||||
|
||||
import withAlertStoreConnect from '@/containers/Alert/withAlertStoreConnect';
|
||||
import withAlertActions from '@/containers/Alert/withAlertActions';
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import { withAlertStoreConnect } from '@/containers/Alert/withAlertStoreConnect';
|
||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
import { DRAWERS } from '@/constants/drawers';
|
||||
|
||||
@@ -6,8 +6,8 @@ import { Intent, Alert } from '@blueprintjs/core';
|
||||
|
||||
import { useDeliverEstimate } from '@/hooks/query';
|
||||
|
||||
import withAlertStoreConnect from '@/containers/Alert/withAlertStoreConnect';
|
||||
import withAlertActions from '@/containers/Alert/withAlertActions';
|
||||
import { withAlertStoreConnect } from '@/containers/Alert/withAlertStoreConnect';
|
||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user