Start adding MonthlyInventory

This commit is contained in:
2016-09-16 12:22:50 -04:00
parent 3bdd202e81
commit 679ef75152
6 changed files with 38 additions and 5 deletions
@@ -57,5 +57,16 @@ namespace InventoryTraker.Web.Controllers
return BetterJson(report.ToArray());
}
[HttpGet]
public ActionResult MonthlyInventory()
{
return View();
}
public ActionResult MonthlyInventory(DateTime month)
{
return BetterJson(true);
}
}
}
@@ -246,6 +246,7 @@
<Content Include="js\inventory\InventoryEditDirective.js" />
<Content Include="js\inventory\InventoryDistributeDirective.js" />
<Content Include="js\profile\EditProfileController.js" />
<Content Include="js\report\MonthlyInventoryReportController.js" />
<Content Include="js\report\DistributionReportDirective.js" />
<Content Include="js\report\DistributionReportQueryDirective.js" />
<Content Include="js\report\DistributionReportController.js" />
@@ -395,6 +396,7 @@
<Content Include="Views\Transaction\Index.cshtml" />
<Content Include="Views\InventoryType\Index.cshtml" />
<Content Include="Views\Report\Distribution.cshtml" />
<Content Include="Views\Report\MonthlyInventory.cshtml" />
<None Include="Web.Debug.config">
<DependentUpon>Web.config</DependentUpon>
</None>
@@ -11,14 +11,14 @@
<div class="col-md-9">
<div class="panel panel-default">
<div class="panel-body">
<monthly-report-query></monthly-report-query>
<monthly-inventory-report-query></monthly-inventory-report-query>
</div>
</div>
</div>
</div>
<div class="row" ng-show="vm.inventoryData.length">
<div class="row" ng-show="vm.monthlyInventoryData.length">
<div class="col-md-12">
<monthly-report distribution-data="vm.distributionData"></monthly-report>
<monthly-inventory-report distribution-data="vm.monthlyInventoryData"></monthly-inventory-report>
</div>
</div>
</div>
@@ -39,7 +39,7 @@
<a href="@(Html.BuildUrlFromExpression<ReportController>(c => c.Distribution()))"><i class="fa fa-file-o"></i> Distribution</a>
</li>
<li>
<a href="@(Html.BuildUrlFromExpression<ReportController>(c => c.Distribution()))"><i class="fa fa-file-o"></i> Monthly Inventory</a>
<a href="@(Html.BuildUrlFromExpression<ReportController>(c => c.MonthlyInventory()))"><i class="fa fa-file-o"></i> Monthly Inventory</a>
</li>
</ul>
</li>
@@ -0,0 +1,11 @@
(function () {
'use strict';
window.app.controller('MonthlyInventoryReportController', MonthlyInventoryReportController);
MonthlyInventoryReportController.$inject = ['$scope', 'reportSvc'];
function MonthlyInventoryReportController($scope, reportSvc) {
var vm = this;
vm.monthlyInventoryData = reportSvc.monthlyInventoryData;
}
})();
+10 -1
View File
@@ -4,13 +4,15 @@
reportSvc.$inject = ['$http'];
function reportSvc($http) {
var distributionData = [];
var monthlyInventoryData = [];
var svc = {
distributionData: distributionData,
monthlyInventoryData: monthlyInventoryData,
loadDistributionReport: loadDistributionReport
};
//loadDistributionReport({ startDate: '2015-06-01', endDate: '2016-01-01' });
loadDistributionReport({ startDate: '2015-05-01', endDate: '2016-01-01' });
return svc;
function loadDistributionReport(query) {
@@ -19,5 +21,12 @@
angular.copy(data, distributionData);
});
}
function loadMonthlyInventoryData(query) {
return $http.post('/Report/MonthlyInventory', query)
.success(function (data) {
angular.copy(data, monthlyInventoryData);
});
}
}
})();