14087 - Питьсбург. Правки в админке
This commit is contained in:
parent
17691184e9
commit
1de86131c6
@ -159,7 +159,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>{{pay.summ}}</td>
|
<td>{{pay.summ}}</td>
|
||||||
<td>{{pay.type | paymentType}}</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 *ngIf="['PAID', 'NOTIFIED', 'INTERNAL_ERROR', 'PROCESSING'].includes(order[0].payment[0]?.payload?.status || '') && order[0].payment[0]?.type !== 'CASH'"> -->
|
||||||
<td>
|
<td>
|
||||||
<button (click)="cancelOrder(pay.payload?.id)">Отменить</button>
|
<button (click)="cancelOrder(pay.payload?.id)">Отменить</button>
|
||||||
@ -167,22 +167,6 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</p-table>
|
</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>
|
</div>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
|
|||||||
@ -41,7 +41,6 @@ export class OrdersComponent implements OnInit {
|
|||||||
public map_due = new Map();
|
public map_due = new Map();
|
||||||
public myAudioP = new Audio();
|
public myAudioP = new Audio();
|
||||||
public myAudioA = new Audio();
|
public myAudioA = new Audio();
|
||||||
public refund!: Refund;
|
|
||||||
public sumRef: number = 0;
|
public sumRef: number = 0;
|
||||||
public sumRef0: any = 0;
|
public sumRef0: any = 0;
|
||||||
public sumRef1: any = 0;
|
public sumRef1: any = 0;
|
||||||
@ -291,7 +290,6 @@ export class OrdersComponent implements OnInit {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
this.view = false;
|
this.view = false;
|
||||||
setTimeout(() => this.getOrderRefunds(this.order[0].external_id), 400);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getPaymentData() {
|
getPaymentData() {
|
||||||
@ -323,14 +321,14 @@ export class OrdersComponent implements OnInit {
|
|||||||
]).subscribe({
|
]).subscribe({
|
||||||
next: ([paymentData, paymentStatus]) => {
|
next: ([paymentData, paymentStatus]) => {
|
||||||
const payment_request = paymentData.result.payment_request;
|
const payment_request = paymentData.result.payment_request;
|
||||||
this.order[0].payment.push({
|
this.order[0].payment = [{
|
||||||
summ: payment_request.amount,
|
summ: payment_request.amount,
|
||||||
type: payment_request.type,
|
type: payment_request.type,
|
||||||
payload: {
|
payload: {
|
||||||
id: payment_request.id,
|
id: payment_request.id,
|
||||||
status: paymentStatus.result.status,
|
status: paymentStatus.result.status,
|
||||||
},
|
},
|
||||||
});
|
}];
|
||||||
},
|
},
|
||||||
error: (error) => {
|
error: (error) => {
|
||||||
console.log('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) {
|
doAdminRefund(id: any, type: any, id_: any) {
|
||||||
this.dis = false;
|
this.dis = false;
|
||||||
let qr_id: string;
|
let qr_id: string;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user