some update
This commit is contained in:
Vendored
+3
-3
@@ -9,9 +9,8 @@
|
||||
"editor.formatOnSave": true
|
||||
},
|
||||
"[typescript]": {
|
||||
"editor.defaultFormatter": "vscode.typescript-language-features"
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"editor.formatOnSave": true,
|
||||
"cSpell.words": [
|
||||
"ARVANCLOUD",
|
||||
"autoincrement",
|
||||
@@ -27,5 +26,6 @@
|
||||
"setm",
|
||||
"spro",
|
||||
"sstid"
|
||||
]
|
||||
],
|
||||
"editor.formatOnSave": true
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ export default {
|
||||
SUN: 'سان',
|
||||
},
|
||||
TspProviderResponseStatus: {
|
||||
[TspProviderResponseStatus.SUCCESS]: 'موفق',
|
||||
[TspProviderResponseStatus.SUCCESS]: 'تایید شده',
|
||||
[TspProviderResponseStatus.FAILURE]: 'ناموفق',
|
||||
[TspProviderResponseStatus.NOT_SEND]: 'ارسال نشده',
|
||||
[TspProviderResponseStatus.QUEUED]: 'در صف ارسال',
|
||||
|
||||
@@ -95,7 +95,7 @@ export class ResponseMappingInterceptor implements NestInterceptor {
|
||||
meta = {
|
||||
totalRecords: total,
|
||||
totalPages: Math.max(1, Math.ceil(total / perPage)),
|
||||
page,
|
||||
page: parseInt(page),
|
||||
perPage,
|
||||
}
|
||||
break
|
||||
@@ -188,7 +188,7 @@ export class ResponseMappingInterceptor implements NestInterceptor {
|
||||
meta = {
|
||||
totalRecords: total,
|
||||
totalPages: Math.max(1, Math.ceil(total / perPage)),
|
||||
page,
|
||||
page: parseInt(page),
|
||||
perPage,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,8 +47,8 @@ export class SalesInvoicesFilterDto {
|
||||
|
||||
@ApiPropertyOptional()
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
code?: string
|
||||
@IsNumber()
|
||||
invoice_number?: number
|
||||
|
||||
@ApiPropertyOptional()
|
||||
@IsOptional()
|
||||
|
||||
@@ -163,10 +163,8 @@ export class SalesInvoicesService {
|
||||
},
|
||||
}
|
||||
|
||||
if (query.code?.trim()) {
|
||||
where.code = {
|
||||
contains: query.code.trim(),
|
||||
}
|
||||
if (query.invoice_number) {
|
||||
where.invoice_number = parseInt(query.invoice_number + '')
|
||||
}
|
||||
|
||||
if (query.invoice_date_from || query.invoice_date_to) {
|
||||
|
||||
@@ -420,7 +420,16 @@ export async function buildOriginalPayload(
|
||||
throw new NotFoundException('فاکتور مورد نظر یافت نشد.')
|
||||
}
|
||||
|
||||
const { pos, id, invoice_number, invoice_date, total_amount, discount_amount, tax_amount, settlement_type } = invoice
|
||||
const {
|
||||
pos,
|
||||
id,
|
||||
invoice_number,
|
||||
invoice_date,
|
||||
total_amount,
|
||||
discount_amount,
|
||||
tax_amount,
|
||||
settlement_type,
|
||||
} = invoice
|
||||
const { business_activity: ba } = pos.complex
|
||||
|
||||
const unknown_customer = (invoice.unknown_customer || {}) as Record<string, string>
|
||||
@@ -478,9 +487,7 @@ export async function buildOriginalPayload(
|
||||
good_id: item.good_id,
|
||||
service_id: item.service_id,
|
||||
good_snapshot: item.good_snapshot,
|
||||
gold_type_payload: isGoldTypePayload(item.payload)
|
||||
? item.payload
|
||||
: undefined
|
||||
gold_type_payload: isGoldTypePayload(item.payload) ? item.payload : undefined,
|
||||
})),
|
||||
}
|
||||
}
|
||||
@@ -512,7 +519,6 @@ export async function onResult(
|
||||
provider_request_payload: result['provider_request_payload']
|
||||
? JSON.parse(JSON.stringify(result['provider_request_payload']))
|
||||
: undefined,
|
||||
provider_response: JSON.parse(JSON.stringify(result.provider_response)),
|
||||
status: result.status,
|
||||
received_at: result.received_at || new Date().toISOString(),
|
||||
message: resultMessage
|
||||
@@ -525,12 +531,19 @@ export async function onResult(
|
||||
tax_id: result['tax_id'] ? result['tax_id'] : undefined,
|
||||
},
|
||||
},
|
||||
error_message: result.error_message || undefined,
|
||||
}
|
||||
if (result.hasError) {
|
||||
attemptUpdatedData.error_message = result.error_message
|
||||
if (result.provider_response) {
|
||||
attemptUpdatedData.provider_response = JSON.parse(
|
||||
JSON.stringify(result.provider_response),
|
||||
)
|
||||
}
|
||||
if (result.validation_errors) {
|
||||
attemptUpdatedData.validation_errors = JSON.parse(
|
||||
JSON.stringify(result.validation_errors),
|
||||
)
|
||||
}
|
||||
if (result.fiscal_warnings) {
|
||||
attemptUpdatedData.fiscal_warnings = JSON.parse(
|
||||
JSON.stringify(result.fiscal_warnings),
|
||||
)
|
||||
@@ -562,7 +575,6 @@ export async function onResult(
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function isGoldTypePayload(value: unknown): value is goldTypePayload {
|
||||
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
||||
return typeof value === 'object' && value !== null && !Array.isArray(value)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user