diff --git a/src/app/pages/orders/orders.component.ts b/src/app/pages/orders/orders.component.ts index 0f2d802..0f41731 100644 --- a/src/app/pages/orders/orders.component.ts +++ b/src/app/pages/orders/orders.component.ts @@ -33,6 +33,7 @@ export class OrdersComponent implements OnInit { public sumRef0: any = 0; public sumRef1: any = 0; public sumRef2: any = 0; + public sumRef3: any = 0; public matchModeOptions!: SelectItem[]; public dis: boolean = false; @@ -233,19 +234,16 @@ notif2() { 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.sumRef = this.sumRef0 + this.sumRef1 + this.sumRef2 + } 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) @@ -254,6 +252,7 @@ notif2() { summary: 'Произошла ошибка!', }) } + } );