From 1de86131c63942bd39df28528974499014469c96 Mon Sep 17 00:00:00 2001 From: bsv Date: Mon, 17 Apr 2023 16:08:31 +0400 Subject: [PATCH] =?UTF-8?q?14087=20-=20=D0=9F=D0=B8=D1=82=D1=8C=D1=81?= =?UTF-8?q?=D0=B1=D1=83=D1=80=D0=B3.=20=D0=9F=D1=80=D0=B0=D0=B2=D0=BA?= =?UTF-8?q?=D0=B8=20=D0=B2=20=D0=B0=D0=B4=D0=BC=D0=B8=D0=BD=D0=BA=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/pages/orders/orders.component.html | 18 +-------- src/app/pages/orders/orders.component.ts | 43 +--------------------- 2 files changed, 3 insertions(+), 58 deletions(-) diff --git a/src/app/pages/orders/orders.component.html b/src/app/pages/orders/orders.component.html index 201c266..2fb70a1 100644 --- a/src/app/pages/orders/orders.component.html +++ b/src/app/pages/orders/orders.component.html @@ -159,7 +159,7 @@ {{pay.summ}} {{pay.type | paymentType}} - {{pay.payload.status | paymentStatus}} + {{pay?.payload?.status | paymentStatus}} @@ -167,22 +167,6 @@ - -

Возвраты:

- - - - Сумма по возвратам: - - - - {{sumRef}} - - - - - - diff --git a/src/app/pages/orders/orders.component.ts b/src/app/pages/orders/orders.component.ts index 0c447c8..4f602be 100644 --- a/src/app/pages/orders/orders.component.ts +++ b/src/app/pages/orders/orders.component.ts @@ -41,7 +41,6 @@ export class OrdersComponent implements OnInit { public map_due = new Map(); public myAudioP = new Audio(); public myAudioA = new Audio(); - public refund!: Refund; public sumRef: number = 0; public sumRef0: any = 0; public sumRef1: any = 0; @@ -291,7 +290,6 @@ export class OrdersComponent implements OnInit { }, }); this.view = false; - setTimeout(() => this.getOrderRefunds(this.order[0].external_id), 400); } getPaymentData() { @@ -323,14 +321,14 @@ export class OrdersComponent implements OnInit { ]).subscribe({ next: ([paymentData, paymentStatus]) => { const payment_request = paymentData.result.payment_request; - this.order[0].payment.push({ + this.order[0].payment = [{ summ: payment_request.amount, type: payment_request.type, payload: { id: payment_request.id, status: paymentStatus.result.status, }, - }); + }]; }, error: (error) => { console.log('ERROR: ', error); @@ -406,43 +404,6 @@ export class OrdersComponent implements OnInit { }); } - async getOrderRefunds(id: any) { - await this.jsonRpcService - .rpc2( - { - method: 'getOrderRefunds', - params: { external_id: id }, - }, - RpcService.authService, - false - ) - .subscribe({ - next: (result) => { - let data = result.result; - this.refund = data; - - if (this.refund.admin_return.status == 'COMPLETED') { - this.sumRef0 = this.refund.admin_return.amount; - } else this.sumRef0 = 0; - if (this.refund.difference_return.status == 'COMPLETED') { - this.sumRef1 = this.refund.difference_return.amount; - } else this.sumRef1 = 0; - if (this.refund.full_return.status == 'COMPLETED') { - this.sumRef2 = this.refund.full_return.amount; - } else this.sumRef2 = 0; - this.sumRef3 = this.sumRef0 + this.sumRef1 + this.sumRef2; - this.sumRef = parseFloat(this.sumRef3.toFixed(2)); - }, - error: (err) => { - console.log('ERROR: ', err); - this.messageService.add({ - severity: 'error', - summary: 'Произошла ошибка!', - }); - }, - }); - } - doAdminRefund(id: any, type: any, id_: any) { this.dis = false; let qr_id: string;