Skip to content

Commit

Permalink
feat(grid): Alert a user if there is not stock in the depot
Browse files Browse the repository at this point in the history
  • Loading branch information
DedrickEnc committed Oct 24, 2017
1 parent f044cfe commit 097461a
Show file tree
Hide file tree
Showing 7 changed files with 210 additions and 217 deletions.
1 change: 1 addition & 0 deletions client/src/i18n/en/stock.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"DETAILS" : "Details",
"DOCUMENT" : "Document",
"DONATION" : "Donation",
"EMPTY" : "No stock found",
"ENTRY" : "Stock Entry",
"ENTRY_DATE" : "Entry Date",
"ENTRY_DOCUMENT" : "Entry Document",
Expand Down
1 change: 1 addition & 0 deletions client/src/i18n/fr/stock.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"DETAILS" : "Details",
"DOCUMENT" : "Document",
"DONATION" : "Donation",
"EMPTY" : "Pas de stock trouvé",
"ENTRY" : "Entrée de stock",
"ENTRY_DATE" : "Date d'entrée",
"ENTRY_DOCUMENT" : "Document d'entrée",
Expand Down
1 change: 1 addition & 0 deletions client/src/js/components/bhGridLoadingIndicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ angular.module('bhima.components')
loadingState : '<',
emptyState : '<',
errorState : '<',
messageState : '<?',
},
templateUrl : 'modules/templates/bhGridLoadingIndicator.tmpl.html',
});
116 changes: 50 additions & 66 deletions client/src/modules/stock/entry/entry.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,90 +39,74 @@

<form name="StockEntryForm" bh-submit="StockCtrl.submit(StockEntryForm)" novalidate>

<!-- activator -->
<div class="row">
<bh-stock-entry-exit-type
on-entry-exit-type-select-callback="StockCtrl.selectEntryType(type)"
reference="StockCtrl.reference"
display-name="StockCtrl.displayName"
is-entry="true">
</bh-stock-entry-exit-type>
</div>
<!-- activator -->
<div class="row">
<bh-stock-entry-exit-type on-entry-exit-type-select-callback="StockCtrl.selectEntryType(type)" reference="StockCtrl.reference"
display-name="StockCtrl.displayName" is-entry="true">
</bh-stock-entry-exit-type>
</div>

<!-- date and note -->
<div class="row">
<div class="col-md-6 col-xs-12">
<!-- date -->
<bh-date-editor
date-value="StockCtrl.movement.date"
max-date="StockCtrl.timestamp" >
</bh-date-editor>
<!-- date and note -->
<div class="row">
<div class="col-md-6 col-xs-12">
<!-- date -->
<bh-date-editor date-value="StockCtrl.movement.date" max-date="StockCtrl.timestamp">
</bh-date-editor>

<!-- note -->
<div class="form-group"
ng-class="{ 'has-error' : StockEntryForm.$submitted && StockEntryForm.description.$invalid }">
<label class="control-label">
<!-- note -->
<div class="form-group" ng-class="{ 'has-error' : StockEntryForm.$submitted && StockEntryForm.description.$invalid }">
<label class="control-label">
<span translate>FORM.LABELS.DESCRIPTION</span>
</label>
<textarea
class="form-control"
name="description"
ng-model="StockCtrl.movement.description"
placeholder="{{ 'FORM.PLACEHOLDERS.DESCRIPTION' | translate }}"
ng-maxlength="StockCtrl.maxLength"
required>
</textarea>
<div class="help-block" ng-messages="StockEntryForm.description.$error" ng-show="StockEntryForm.$submitted">
<div ng-messages-include="modules/templates/messages.tmpl.html"></div>
<textarea class="form-control" name="description" ng-model="StockCtrl.movement.description" placeholder="{{ 'FORM.PLACEHOLDERS.DESCRIPTION' | translate }}"
ng-maxlength="StockCtrl.maxLength" required>
</textarea>
<div class="help-block" ng-messages="StockEntryForm.description.$error" ng-show="StockEntryForm.$submitted">
<div ng-messages-include="modules/templates/messages.tmpl.html"></div>
</div>
</div>
</div>
</div>
</div>

<!-- add and recovery -->
<div class="row" style="padding-bottom : 5px;">
<div class="col-xs-12">
<!-- add and recovery -->
<div class="row" style="padding-bottom : 5px;">
<div class="col-xs-12">

<!-- info -->
<p
style="padding-top : 10px;"
class="text-info"
ng-show="!StockCtrl.movement.entry_type">
<span class="fa fa-info-circle"></span>
<span translate>FORM.INFO.NO_SOURCE</span>
</p>
<!-- info -->
<p style="padding-top : 10px;" class="text-info" ng-show="!StockCtrl.movement.entry_type">
<span class="fa fa-info-circle"></span>
<span translate>FORM.INFO.NO_SOURCE</span>
</p>

<!-- "Add number of grid rows" input-group -->
<bh-add-item
disable = "StockCtrl.entryOption"
callback = "StockCtrl.addItems(numItem)">
</bh-add-item>
<!-- "Add number of grid rows" input-group -->
<bh-add-item disable="StockCtrl.entryOption" callback="StockCtrl.addItems(numItem)">
</bh-add-item>

</div>
</div>
</div>

<!-- grid -->
<div id="stock-entry-grid"
ui-grid="StockCtrl.gridOptions"
style="height: 300px; width: 100%;"
ui-grid-auto-resize
ui-grid-resize-columns>
</div>
<!-- grid -->
<div
id="stock-entry-grid"
ui-grid="StockCtrl.gridOptions"
style="height: 300px; width: 100%;"
ui-grid-auto-resize ui-grid-resize-columns>
</div>

<!-- footer -->
<div class="row" style="margin-top: 5px;">
<div class="col-xs-6 col-xs-offset-6">
<div class="text-right">
<button class="btn btn-default" ng-click="StockCtrl.suspend(StockEntryForm)" type="button" translate>
<!-- footer -->
<div class="row" style="margin-top: 5px;">
<div class="col-xs-6 col-xs-offset-6">
<div class="text-right">
<button class="btn btn-default" ng-click="StockCtrl.suspend(StockEntryForm)" type="button" translate>
FORM.BUTTONS.SUSPEND
</button>

<bh-loading-button loading-state="StockCtrl.$loading" disabled="!StockCtrl.hasValidInput">
<span translate>FORM.BUTTONS.SUBMIT</span>
</bh-loading-button>
<bh-loading-button loading-state="StockCtrl.$loading" disabled="!StockCtrl.hasValidInput">
<span translate>FORM.BUTTONS.SUBMIT</span>
</bh-loading-button>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
6 changes: 6 additions & 0 deletions client/src/modules/stock/exit/exit.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@
style="height: 300px; width: 100%;"
ui-grid-auto-resize
ui-grid-resize-columns>
<bh-grid-loading-indicator
loading-state="StockCtrl.loading"
empty-state="StockCtrl.selectableInventories.length === 0"
error-state="StockCtrl.hasError"
message-state="StockCtrl.message">
</bh-grid-loading-indicator>
</div>

<!-- footer -->
Expand Down

0 comments on commit 097461a

Please sign in to comment.