Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
default value set for expense states (#240)
Browse files Browse the repository at this point in the history
  • Loading branch information
vishalpandeynits authored Jan 16, 2023
1 parent f7880c1 commit 7e9c68a
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ export class ExportSettingsComponent implements OnInit, OnDestroy {
this.exportSettingsForm.controls.reimbursableExpense.valueChanges.subscribe((isReimbursableExpenseSelected) => {
if (isReimbursableExpenseSelected) {
this.exportSettingsForm.controls.expenseState.setValidators(Validators.required);
this.exportSettingsForm.controls.expenseState.setValue(this.exportSettings.expense_group_settings?.expense_state ? this.exportSettings.expense_group_settings?.expense_state : ExpenseState.PAYMENT_PROCESSING);
this.exportSettingsForm.controls.reimbursableExportType.setValidators(Validators.required);
this.exportSettingsForm.controls.reimbursableExportGroup.setValidators(Validators.required);
this.exportSettingsForm.controls.reimbursableExportDate.setValidators(Validators.required);
Expand All @@ -217,6 +218,7 @@ export class ExportSettingsComponent implements OnInit, OnDestroy {
this.exportSettingsForm.controls.creditCardExpense.valueChanges.subscribe((isCreditCardExpenseSelected) => {
if (isCreditCardExpenseSelected) {
this.exportSettingsForm.controls.cccExpenseState.setValidators(Validators.required);
this.exportSettingsForm.controls.cccExpenseState.setValue(this.exportSettings.expense_group_settings?.ccc_expense_state ? this.exportSettings.expense_group_settings?.ccc_expense_state : this.is_simplify_report_closure_enabled ? CCCExpenseState.APPROVED: CCCExpenseState.PAYMENT_PROCESSING);
this.exportSettingsForm.controls.creditCardExportType.setValidators(Validators.required);
this.exportSettingsForm.controls.creditCardExportGroup.setValidators(Validators.required);
this.exportSettingsForm.controls.creditCardExportDate.setValidators(Validators.required);
Expand Down Expand Up @@ -466,12 +468,12 @@ export class ExportSettingsComponent implements OnInit, OnDestroy {

this.expenseStateOptions = [
{
label: this.is_simplify_report_closure_enabled ? 'Approved' : 'Payment Processing',
value: this.is_simplify_report_closure_enabled ? CCCExpenseState.APPROVED: CCCExpenseState.PAYMENT_PROCESSING
label: this.is_simplify_report_closure_enabled ? 'Processing' : 'Payment Processing',
value: ExpenseState.PAYMENT_PROCESSING
},
{
label: this.is_simplify_report_closure_enabled ? 'Closed' : 'Paid',
value: CCCExpenseState.PAID
value: ExpenseState.PAID
}
];

Expand Down

0 comments on commit 7e9c68a

Please sign in to comment.