Skip to content

Commit

Permalink
Merge #4124 #4125
Browse files Browse the repository at this point in the history
4124: chore(stock): do not require description r=jniles a=jniles

Removes the requirement that a user type a description on entry/exit since we automagically template in that description.

Closes #4082.

4125: Feat(Inventories in stock) considere filters while exporting r=jniles a=jeremielodi

closes #4067

Co-authored-by: Jonathan Niles <jonathanwniles@gmail.com>
Co-authored-by: jeremielodi <jeremielodi@gmail.com>
  • Loading branch information
3 people committed Jan 24, 2020
3 parents af405ca + 6ea9602 + e16763d commit 6cdecbe
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
10 changes: 5 additions & 5 deletions client/src/modules/stock/entry/entry.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@
<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>
</div>
ng-maxlength="StockCtrl.maxLength">
</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>
Expand Down
3 changes: 1 addition & 2 deletions client/src/modules/stock/exit/exit.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@
name="description"
ng-model="StockCtrl.movement.description"
placeholder="{{ 'FORM.PLACEHOLDERS.DESCRIPTION' | translate }}"
ng-maxlength="StockCtrl.maxLength"
required>
ng-maxlength="StockCtrl.maxLength">
</textarea>
<div class="help-block" ng-messages="StockExitForm.description.$error" ng-show="StockExitForm.$submitted">
<div ng-messages-include="modules/templates/messages.tmpl.html"></div>
Expand Down
4 changes: 2 additions & 2 deletions client/src/modules/stock/inventories/registry.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@

<li role="separator" class="divider"></li>
<li role="menuitem">
<a ng-href="/reports/stock/inventories/?{{ StockCtrl.getQueryString('inventory', 'pdf') }}" download="{{ 'TREE.STOCK_INVENTORY' | translate }}">
<a ng-href="/reports/stock/inventories/?{{ StockCtrl.exportTo('pdf') }}" download="{{ 'TREE.STOCK_INVENTORY' | translate }}">
<span class="fa fa-file-pdf-o"></span> <span translate>DOWNLOADS.PDF</span>
</a>
</li>
<li role="menuitem">
<a ng-href="/reports/stock/inventories/?{{ StockCtrl.getQueryString('inventory', 'csv') }}" download="{{ 'TREE.STOCK_INVENTORY' | translate }}">
<a ng-href="/reports/stock/inventories/?{{ StockCtrl.exportTo('csv') }}" download="{{ 'TREE.STOCK_INVENTORY' | translate }}">
<span class="fa fa-file-excel-o"></span> <span translate>DOWNLOADS.CSV</span>
</a>
</li>
Expand Down
11 changes: 11 additions & 0 deletions client/src/modules/stock/inventories/registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,17 @@ function StockInventoriesController(
vm.latestViewFilters = stockInventoryFilters.formatView();
}

vm.exportTo = (renderer) => {
const filterOpts = stockInventoryFilters.formatHTTP();
const defaultOpts = {
renderer,
lang : Languages.key,
};
const options = angular.merge(defaultOpts, filterOpts);
// return serialized options
return $httpParamSerializer(options);
};

vm.downloadExcel = () => {
const filterOpts = stockInventoryFilters.formatHTTP();
const defaultOpts = {
Expand Down

0 comments on commit 6cdecbe

Please sign in to comment.