Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
Chethan-Fyle committed May 27, 2024
1 parent ed1c434 commit db77503
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
24 changes: 24 additions & 0 deletions src/app/core/mock-data/platform/v1/expense.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { AccountType } from 'src/app/core/models/platform/v1/account.model';
import { Expense, TransactionStatus } from 'src/app/core/models/platform/v1/expense.model';
import { FileType } from 'src/app/core/models/platform/v1/file.model';
import { CustomFieldTypes } from 'src/app/core/enums/platform/v1/custom-fields-type.enum';
import { CommuteDeduction } from 'src/app/core/enums/commute-deduction.enum';

export const expenseData: Expense = deepFreeze({
accounting_export_summary: {},
Expand Down Expand Up @@ -267,6 +268,29 @@ export const mileageExpense: Expense = deepFreeze({
category_id: 247012,
claim_amount: 459,
code: null,
commute_deduction: CommuteDeduction.ONE_WAY,
commute_details: {
distance: 2.92,
distance_unit: 'MILES',
home_location: {
city: 'Bengaluru',
country: 'India',
formatted_address: 'Bengaluru, Karnataka, India',
latitude: 13.0035068,
longitude: 77.5890953,
state: 'Karnataka',
},
id: 96,
work_location: {
city: 'Bengaluru',
country: 'India',
formatted_address: 'Sarjapura, Bengaluru, Karnataka 562125, India',
latitude: 12.8575579,
longitude: 77.7864057,
state: 'Karnataka',
},
},
commute_details_id: 96,
cost_center: {
code: null,
id: 2885,
Expand Down
4 changes: 2 additions & 2 deletions src/app/fyle/view-mileage/view-mileage.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,8 @@ export class ViewMileagePage {
forkJoin([this.expenseFields$, this.mileageExpense$.pipe(take(1))])
.pipe(
map(([expenseFieldsMap, expense]) => {
this.projectFieldName = expenseFieldsMap?.project_id && expenseFieldsMap?.project_id[0]?.field_name;
const isProjectMandatory = expenseFieldsMap?.project_id && expenseFieldsMap?.project_id[0]?.is_mandatory;
this.projectFieldName = expenseFieldsMap?.project_id && expenseFieldsMap.project_id[0]?.field_name;
const isProjectMandatory = expenseFieldsMap?.project_id && expenseFieldsMap.project_id[0]?.is_mandatory;
this.isProjectShown = this.orgSettings?.projects?.enabled && (!!expense.project?.name || isProjectMandatory);
})
)
Expand Down

0 comments on commit db77503

Please sign in to comment.