Skip to content

Commit

Permalink
fix(stock): ensure correct movement filter text
Browse files Browse the repository at this point in the history
This commit ensures that the entry/exit movement filter shows the
correct values when searching for the movement direction.

Closes #6445.
  • Loading branch information
jniles committed May 31, 2022
1 parent d23e9fa commit 3a8289d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/src/modules/stock/movements/modals/search.modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
<bh-clear on-clear="$ctrl.clear('is_exit')"></bh-clear>
<div>
<label class="radio-inline">
<input type="radio" name="movement_direction" id="entry" value="0" ng-model="$ctrl.searchQueries.is_exit">
<input type="radio" name="movement_direction" id="entry" ng-value="0" ng-model="$ctrl.searchQueries.is_exit">
<span translate>STOCK.INPUT</span>
</label>

<label class="radio-inline">
<input type="radio" name="movement_direction" id="exit" value="1" ng-model="$ctrl.searchQueries.is_exit">
<input type="radio" name="movement_direction" id="exit" ng-value="1" ng-model="$ctrl.searchQueries.is_exit">
<span translate>STOCK.OUTPUT</span>
</label>
</div>
Expand Down
5 changes: 5 additions & 0 deletions client/src/modules/stock/movements/modals/search.modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,12 @@ function SearchMovementsModalController(data, Instance, Periods, Store, util, St
vm.cancel = function cancel() { Instance.close(); };

vm.submit = () => {
if (vm.searchQueries.is_exit) {
vm.searchQueries.is_exit = Number(vm.searchQueries.is_exit);
}

const loggedChanges = SearchModal.getChanges(vm.searchQueries, changes, displayValues, lastDisplayValues);

return Instance.close(loggedChanges);
};
}

0 comments on commit 3a8289d

Please sign in to comment.