Revised the #isQueryMatched method to match the current net balance instead of the net balance but the current form in the JavaScript OriginalLineItem class.
This commit is contained in:
		| @@ -366,6 +366,9 @@ class OriginalLineItem { | ||||
|         if (query === "") { | ||||
|             return true; | ||||
|         } | ||||
|         if (this.#getNetBalanceForQuery().includes(query.toLowerCase())) { | ||||
|             return true; | ||||
|         } | ||||
|         for (const queryValue of this.#queryValues) { | ||||
|             if (queryValue.toLowerCase().includes(query.toLowerCase())) { | ||||
|                 return true; | ||||
| @@ -374,6 +377,17 @@ class OriginalLineItem { | ||||
|         return false; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Returns the net balance in the format for query match. | ||||
|      * | ||||
|      * @return {string} the net balance in the format for query match | ||||
|      */ | ||||
|     #getNetBalanceForQuery() { | ||||
|         const frac = this.netBalance.modulo(1); | ||||
|         const whole = Number(this.netBalance.minus(frac)); | ||||
|         return String(whole) + String(frac).substring(1); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Sets whether the option is shown. | ||||
|      * | ||||
|   | ||||
		Reference in New Issue
	
	Block a user