14087 - Питьсбург. Правки в админке

This commit is contained in:
bsv 2023-04-17 16:08:31 +04:00
parent 17691184e9
commit 1de86131c6
2 changed files with 3 additions and 58 deletions

View File

@ -159,7 +159,7 @@
<tr>
<td>{{pay.summ}}</td>
<td>{{pay.type | paymentType}}</td>
<td *ngIf="pay.type !== 'CASH'">{{pay.payload.status | paymentStatus}}</td>
<td *ngIf="pay.type !== 'CASH'">{{pay?.payload?.status | paymentStatus}}</td>
<!-- <td *ngIf="['PAID', 'NOTIFIED', 'INTERNAL_ERROR', 'PROCESSING'].includes(order[0].payment[0]?.payload?.status || '') && order[0].payment[0]?.type !== 'CASH'"> -->
<td>
<button (click)="cancelOrder(pay.payload?.id)">Отменить</button>
@ -167,22 +167,6 @@
</tr>
</ng-template>
</p-table>
<h2>Возвраты:</h2>
<p-table>
<ng-template pTemplate="header">
<tr>
<th width="70%">Сумма по возвратам:</th>
<th width="30%"></th>
</tr>
<tr>
<th>{{sumRef}}</th>
<th><button (click)="confirm(order[0].external_id, order[0].payment[0].type, order[0].id)">Отменить</button></th>
<!--<th><button [disabled]="order[0].payment[0].summ == sumRef || pay == false || this.order[0].payment == []" (click)="confirm(order[0].external_id, order[0].payment[0].payload.id)">Возврат ДС</button></th>-->
<!--<th><button disabled>Возврат ДС</button></th>-->
</tr>
</ng-template>
</p-table>
</div>
</ng-template>

View File

@ -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;