Skip to content

Commit

Permalink
Capitalize report description and use of reportDetails correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
mbayopanda committed Jun 15, 2019
1 parent 9b7f65c commit 0af0ec8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 23 deletions.
2 changes: 1 addition & 1 deletion client/src/i18n/en/report.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
"INCLUDE_LOSS_EXIT": "Include stock loss",
"SHOW_DETAILS": "Show Details",
"ENTRY_REPORT": "Stock Entry Report",
"ENTRY_REPORT_DESCRIPTION": "this report displays the different stock entries that took place in depots",
"ENTRY_REPORT_DESCRIPTION": "This report displays the different stock entries that took place in depots",
"INCLUDE_PURCHASE_ENTRY": "Include entries from purchases",
"INCLUDE_INTEGRATION_ENTRY": "Include entries from integrations",
"INCLUDE_DONATION_ENTRY": "Include entries from donation",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function StockEntryConfigController($sce, Notify, SavedReports, AppCache, report
onEntryTypeChange();

vm.onSelectDepot = depot => {
vm.depot = depot;
vm.reportDetails.depotUuid = depot.uuid;
};

vm.clear = key => {
Expand All @@ -47,20 +47,9 @@ function StockEntryConfigController($sce, Notify, SavedReports, AppCache, report
return 0;
}

const params = {
depotUuid : vm.depot.uuid,
dateFrom : vm.dateFrom,
dateTo : vm.dateTo,
includePurchaseEntry : vm.includePurchaseEntry,
includeIntegrationEntry : vm.includeIntegrationEntry,
includeDonationEntry : vm.includeDonationEntry,
includeTransferEntry : vm.includeTransferEntry,
showDetails : vm.showDetails,
};

// update cached configuration
cache.reportDetails = angular.copy(params);
angular.extend(vm.reportDetails, params, { lang : Languages.key });
cache.reportDetails = angular.copy(vm.reportDetails);
angular.extend(vm.reportDetails, { lang : Languages.key });

return SavedReports.requestPreview(reportUrl, reportData.id, angular.copy(vm.reportDetails))
.then((result) => {
Expand Down
16 changes: 8 additions & 8 deletions client/src/modules/reports/generate/stock_entry/stock_entry.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ <h3 translate>REPORT.STOCK.ENTRY_REPORT</h3>

<!-- select depot -->
<bh-depot-select
depot-uuid="ReportConfigCtrl.depot.uuid"
depot-uuid="ReportConfigCtrl.reportDetails.depotUuid"
on-select-callback="ReportConfigCtrl.onSelectDepot(depot)"
required="true">
</bh-depot-select>

<!-- date interval -->
<bh-date-interval
date-from="ReportConfigCtrl.dateFrom"
date-to="ReportConfigCtrl.dateTo"
date-from="ReportConfigCtrl.reportDetails.dateFrom"
date-to="ReportConfigCtrl.reportDetails.dateTo"
limit-min-fiscal
required="true">
</bh-date-interval>
Expand All @@ -43,28 +43,28 @@ <h3 translate>REPORT.STOCK.ENTRY_REPORT</h3>
<div ng-class="{'has-error': ConfigForm.$submitted && !ReportConfigCtrl.hasOneChecked}">
<div class="checkbox">
<label>
<input type="checkbox" ng-true-value="1" ng-false-value="0" ng-change="ReportConfigCtrl.onEntryTypeChange()" ng-model="ReportConfigCtrl.includePurchaseEntry">
<input type="checkbox" ng-true-value="1" ng-false-value="0" ng-change="ReportConfigCtrl.onEntryTypeChange()" ng-model="ReportConfigCtrl.reportDetails.includePurchaseEntry">
<span translate>REPORT.STOCK.INCLUDE_PURCHASE_ENTRY</span>
</label>
</div>

<div class="checkbox">
<label>
<input type="checkbox" ng-true-value="1" ng-false-value="0" ng-change="ReportConfigCtrl.onEntryTypeChange()" ng-model="ReportConfigCtrl.includeIntegrationEntry">
<input type="checkbox" ng-true-value="1" ng-false-value="0" ng-change="ReportConfigCtrl.onEntryTypeChange()" ng-model="ReportConfigCtrl.reportDetails.includeIntegrationEntry">
<span translate>REPORT.STOCK.INCLUDE_INTEGRATION_ENTRY</span>
</label>
</div>

<div class="checkbox">
<label>
<input type="checkbox" ng-true-value="1" ng-false-value="0" ng-change="ReportConfigCtrl.onEntryTypeChange()" ng-model="ReportConfigCtrl.includeDonationEntry">
<input type="checkbox" ng-true-value="1" ng-false-value="0" ng-change="ReportConfigCtrl.onEntryTypeChange()" ng-model="ReportConfigCtrl.reportDetails.includeDonationEntry">
<span translate>REPORT.STOCK.INCLUDE_DONATION_ENTRY</span>
</label>
</div>

<div class="checkbox">
<label>
<input type="checkbox" ng-true-value="1" ng-false-value="0" ng-change="ReportConfigCtrl.onEntryTypeChange()" ng-model="ReportConfigCtrl.includeTransferEntry">
<input type="checkbox" ng-true-value="1" ng-false-value="0" ng-change="ReportConfigCtrl.onEntryTypeChange()" ng-model="ReportConfigCtrl.reportDetails.includeTransferEntry">
<span translate>REPORT.STOCK.INCLUDE_TRANSFER_ENTRY</span>
</label>
</div>
Expand All @@ -75,7 +75,7 @@ <h3 translate>REPORT.STOCK.ENTRY_REPORT</h3>

<div class="checkbox">
<label>
<input type="checkbox" ng-true-value="1" ng-false-value="0" ng-model="ReportConfigCtrl.showDetails">
<input type="checkbox" ng-true-value="1" ng-false-value="0" ng-model="ReportConfigCtrl.reportDetails.showDetails">
<span translate>REPORT.STOCK.SHOW_DETAILS</span>
</label>
</div>
Expand Down

0 comments on commit 0af0ec8

Please sign in to comment.