update revoke
This commit is contained in:
@@ -470,6 +470,7 @@ export class SalesInvoiceTspService {
|
||||
select: {
|
||||
id: true,
|
||||
status: true,
|
||||
tax_id: true,
|
||||
},
|
||||
},
|
||||
pos: {
|
||||
@@ -531,7 +532,7 @@ export class SalesInvoiceTspService {
|
||||
fiscal_id: invoice.pos.complex.business_activity.fiscal_id,
|
||||
tsp_token: invoice.pos.complex.business_activity.partner_token,
|
||||
tsp_provider: partner.tsp_provider!,
|
||||
last_attempt_tax_id: invoice.tsp_attempts[0].id,
|
||||
last_attempt_tax_id: invoice.tsp_attempts[0].tax_id!,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -180,6 +180,8 @@ export class NamaProviderSwitchAdapter implements IProviderSwitchAdapter {
|
||||
const mappedRequest: NamaProviderRevokeRequestDto =
|
||||
this.namaProviderUtils.mapRevokeToNamaRequestDto(payload)
|
||||
|
||||
this.logger.debug('NAMA provider response', mappedRequest)
|
||||
|
||||
try {
|
||||
const response = await this.httpClient.request(
|
||||
this.buildSendUrl(),
|
||||
|
||||
@@ -5,7 +5,6 @@ import {
|
||||
IsArray,
|
||||
IsEnum,
|
||||
IsNumber,
|
||||
IsObject,
|
||||
IsOptional,
|
||||
IsString,
|
||||
Min,
|
||||
@@ -145,7 +144,11 @@ export class NamaProviderHeaderDto {
|
||||
@IsString()
|
||||
name: string
|
||||
|
||||
@ApiProperty({ required: true, description: 'نوع شخصیت خریدار' })
|
||||
@ApiProperty({
|
||||
required: false,
|
||||
description:
|
||||
'نوع شخصیت خریدار (در صورتیکه خریدار نوع ۲ باشه باید ۱ یا ۲ گذاشته بشه)',
|
||||
})
|
||||
@IsString()
|
||||
tob: string
|
||||
|
||||
@@ -296,6 +299,13 @@ export class NamaProviderRevokeHeaderDto {
|
||||
@IsString()
|
||||
inno: string
|
||||
|
||||
@ApiProperty({
|
||||
required: true,
|
||||
description: 'تاریخ و زمان صدور صورتحساب به صورت timestamp',
|
||||
})
|
||||
@IsString()
|
||||
indatim: string
|
||||
|
||||
@ApiProperty({
|
||||
required: true,
|
||||
description: 'آخرین شماره مالیاتی دریافت شده مربوط به فاکتور',
|
||||
@@ -315,9 +325,9 @@ export class NamaProviderRevokeRequestDto {
|
||||
// @ValidateNested({ each: true })
|
||||
// @Type(() => NamaProviderPaymentInfoDto)
|
||||
// payment: NamaProviderPaymentInfoDto[]
|
||||
@ApiProperty({ type: Object, required: true })
|
||||
@IsObject()
|
||||
body: {}
|
||||
// @ApiProperty({ type: Object, required: true })
|
||||
// @IsObject()
|
||||
// body: {}
|
||||
|
||||
@ApiProperty({ type: NamaProviderRevokeHeaderDto })
|
||||
@ValidateNested()
|
||||
|
||||
@@ -77,8 +77,8 @@ export class NamaProviderUtils {
|
||||
inno: payload.invoice_number.toString(),
|
||||
ins: this.mapTspProviderRequestType(TspProviderRequestType.REVOKE),
|
||||
irtaxid: payload.last_attempt_tax_id,
|
||||
indatim: new Date().getTime() + '',
|
||||
},
|
||||
body: {},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,17 +140,17 @@ export class NamaProviderUtils {
|
||||
case CustomerType.LEGAL:
|
||||
return '2'
|
||||
default:
|
||||
return '5'
|
||||
return ''
|
||||
}
|
||||
}
|
||||
|
||||
private mapCustomerInfo(customer?: CustomerInfoDto) {
|
||||
const info = {} as any
|
||||
info.tob = this.mapCustomerType(customer?.type)
|
||||
if (customer?.type === CustomerType.LEGAL && customer.legal_info) {
|
||||
info.name = customer.legal_info.name
|
||||
info.bid = customer.legal_info.economic_code
|
||||
info.address = ''
|
||||
info.tob = '2'
|
||||
} else if (customer?.type === CustomerType.INDIVIDUAL && customer.individual_info) {
|
||||
info.name = `${customer.individual_info?.first_name || ''} ${
|
||||
customer.individual_info?.last_name || ''
|
||||
@@ -158,6 +158,7 @@ export class NamaProviderUtils {
|
||||
info.bid = customer.individual_info.national_id
|
||||
info.mobile = customer.individual_info.mobile_number
|
||||
info.address = ''
|
||||
info.tob = '1'
|
||||
}
|
||||
return info
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user