Skip to content

Commit

Permalink
fix(inventory): do not allow negative prices
Browse files Browse the repository at this point in the history
This commit fixes the inventory module to restrict users from putting in
negative prices.

Closes #955.
  • Loading branch information
Jonathan Niles committed Nov 29, 2016
1 parent 8b0b859 commit aa28cdf
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions client/src/partials/inventory/list/modals/actions.tmpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,20 @@
</div>
</div>

<div class="form-group">
<div class="checkbox">
<label>
<input type="checkbox" name="consumable"
ng-true-value="1" ng-false-value="0"
ng-model="$ctrl.item.consumable">
<input type="checkbox" name="consumable" ng-true-value="1" ng-false-value="0" ng-model="$ctrl.item.consumable">
{{ 'FORM.LABELS.CONSUMABLE' | translate }}
</label>
</div>

<div class="form-group"
ng-class="{ 'has-error' : ActionForm.$submitted && ActionForm.price.$invalid }">
<label class="control-label">{{ 'FORM.LABELS.PRICE' | translate }}</label>
<input class="form-control" type="text" name="price"
<input class="form-control"
type="number"
ng-min="0"
name="price"
ng-model="$ctrl.item.price"
placeholder="{{ 'FORM.PLACEHOLDERS.PRICE' | translate }}..."
required>
Expand Down Expand Up @@ -122,8 +123,7 @@

<div class="form-group">
<label class="control-label">{{ 'FORM.LABELS.UNIT_VOLUME' | translate }}</label>
<input class="form-control" type="number" step="1" name="unit_volume"
ng-model="$ctrl.item.unit_volume"
<input class="form-control" type="number" step="1" name="unit_volume" ng-model="$ctrl.item.unit_volume"
placeholder="{{ 'FORM.PLACEHOLDERS.UNIT_VOLUME' | translate }}...">
</div>

Expand Down

0 comments on commit aa28cdf

Please sign in to comment.