|
@ -148,50 +148,31 @@ export class CreateOrUpdateActivityDialog implements OnDestroy { |
|
|
], |
|
|
], |
|
|
updateAccountBalance: [false] |
|
|
updateAccountBalance: [false] |
|
|
}); |
|
|
}); |
|
|
this.activityForm.get('quantity').valueChanges.subscribe(async () => { |
|
|
this.activityForm.valueChanges |
|
|
|
|
|
.pipe( |
|
|
|
|
|
// Slightly delay until the more specific form control value changes have
|
|
|
|
|
|
// completed
|
|
|
|
|
|
delay(300), |
|
|
|
|
|
takeUntil(this.unsubscribeSubject) |
|
|
|
|
|
) |
|
|
|
|
|
.subscribe(async () => { |
|
|
const activity = { quantity: this.activityForm.get('quantity').value }; |
|
|
const activity = { quantity: this.activityForm.get('quantity').value }; |
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
const ignoredFields = [ |
|
|
|
|
|
'accountId', |
|
|
|
|
|
'assetClass', |
|
|
|
|
|
'assetSubClass', |
|
|
|
|
|
'comment', |
|
|
|
|
|
'currency', |
|
|
|
|
|
'customCurrency', |
|
|
|
|
|
'dataSource', |
|
|
|
|
|
'date', |
|
|
|
|
|
'fee', |
|
|
|
|
|
'symbol', |
|
|
|
|
|
'tags', |
|
|
|
|
|
'type', |
|
|
|
|
|
'unitPrice', |
|
|
|
|
|
'updateAccountBalance' |
|
|
|
|
|
]; |
|
|
|
|
|
if (this.mode === 'create') { |
|
|
if (this.mode === 'create') { |
|
|
await validateObjectForForm({ |
|
|
await validateObjectForForm({ |
|
|
classDto: CreateOrderDto, |
|
|
classDto: CreateOrderDto, |
|
|
form: this.activityForm, |
|
|
form: this.activityForm, |
|
|
ignoreFields: ignoredFields, |
|
|
|
|
|
object: activity |
|
|
object: activity |
|
|
}); |
|
|
}); |
|
|
} else { |
|
|
} else { |
|
|
await validateObjectForForm({ |
|
|
await validateObjectForForm({ |
|
|
classDto: UpdateOrderDto, |
|
|
classDto: UpdateOrderDto, |
|
|
form: this.activityForm, |
|
|
form: this.activityForm, |
|
|
ignoreFields: ignoredFields, |
|
|
|
|
|
object: activity |
|
|
object: activity |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
} catch (error) {} |
|
|
} catch (error) {} |
|
|
}); |
|
|
|
|
|
this.activityForm.valueChanges |
|
|
|
|
|
.pipe( |
|
|
|
|
|
// Slightly delay until the more specific form control value changes have
|
|
|
|
|
|
// completed
|
|
|
|
|
|
delay(300), |
|
|
|
|
|
takeUntil(this.unsubscribeSubject) |
|
|
|
|
|
) |
|
|
|
|
|
.subscribe(async () => { |
|
|
|
|
|
let exchangeRateOfUnitPrice = 1; |
|
|
let exchangeRateOfUnitPrice = 1; |
|
|
|
|
|
|
|
|
this.activityForm.get('feeInCustomCurrency').setErrors(null); |
|
|
this.activityForm.get('feeInCustomCurrency').setErrors(null); |
|
|