feat(tahesab): PDF invoice export for asnad cards
Add per-document PDF print from account details, plus org invoice settings for logo and texts separate from CRM invoices.
This commit is contained in:
@@ -22,6 +22,7 @@ import { TahesabProductLinkService } from './product-link.service';
|
||||
import { TahesabBalanceService } from './balance.service';
|
||||
import { TahesabDocumentsService } from './documents.service';
|
||||
import { TahesabAsnadReportService } from './asnad-report.service';
|
||||
import { TahesabInvoiceSettingsService } from './invoice-settings.service';
|
||||
import {
|
||||
CreateInTahesabDto,
|
||||
CreateTahesabConnectionDto,
|
||||
@@ -38,6 +39,7 @@ import {
|
||||
SyncAsnadReportDto,
|
||||
SyncGroupsPageDto,
|
||||
UpdateTahesabConnectionDto,
|
||||
UpdateTahesabInvoiceSettingsDto,
|
||||
} from './dto';
|
||||
|
||||
@Controller('integrations/tahesab')
|
||||
@@ -51,6 +53,7 @@ export class TahesabController {
|
||||
private readonly balance: TahesabBalanceService,
|
||||
private readonly documents: TahesabDocumentsService,
|
||||
private readonly asnadReport: TahesabAsnadReportService,
|
||||
private readonly invoiceSettings: TahesabInvoiceSettingsService,
|
||||
) {}
|
||||
|
||||
// —— Connections ——
|
||||
@@ -279,6 +282,21 @@ export class TahesabController {
|
||||
return this.products.importBulk(user.organizationId, dto);
|
||||
}
|
||||
|
||||
// —— تنظیمات فاکتور PDF اسناد تهحساب ——
|
||||
@Get('invoice-settings')
|
||||
getInvoiceSettings(@CurrentUser() user: { organizationId: string }) {
|
||||
return this.invoiceSettings.getOrCreate(user.organizationId);
|
||||
}
|
||||
|
||||
@Patch('invoice-settings')
|
||||
@Roles('owner', 'admin')
|
||||
updateInvoiceSettings(
|
||||
@CurrentUser() user: { organizationId: string },
|
||||
@Body() dto: UpdateTahesabInvoiceSettingsDto,
|
||||
) {
|
||||
return this.invoiceSettings.update(user.organizationId, dto);
|
||||
}
|
||||
|
||||
// —— گزارش فروش اسناد (اسنپشات DoListAsnad) ——
|
||||
@Post('reports/asnad/sync')
|
||||
@Roles('owner', 'admin', 'sales')
|
||||
|
||||
Reference in New Issue
Block a user