Skip to content

Commit be50787

Browse files
authored
fix: billable field behaviour for MOBILE_CAPTURE expenses (#3994)
1 parent 6cec97e commit be50787

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/app/fyle/add-edit-expense/add-edit-expense.page.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3668,8 +3668,21 @@ export class AddEditExpensePage implements OnInit {
36683668
return null;
36693669
}
36703670

3671-
getBillable(): boolean {
3672-
return this.getFormValues()?.billable;
3671+
/**
3672+
* If billable checkbox is visible (project selected + org has billable option),
3673+
*
3674+
* @returns the actual checkbox value (true/false),
3675+
* otherwise return billableValue `undefined` because billable checkbox is hidden
3676+
*/
3677+
getBillable(): boolean | undefined {
3678+
const formValues = this.getFormValues();
3679+
const billableValue = formValues?.billable;
3680+
3681+
if (formValues?.project && this.showBillable) {
3682+
return billableValue === true;
3683+
}
3684+
3685+
return billableValue;
36733686
}
36743687

36753688
getSkipRemibursement(): boolean {

0 commit comments

Comments
 (0)