Rename Monthly Inventory to Movement
This commit is contained in:
@@ -58,18 +58,18 @@ namespace InventoryTraker.Web.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public ActionResult MonthlyInventory()
|
public ActionResult Movement()
|
||||||
{
|
{
|
||||||
return View();
|
return View();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ActionResult MonthlyInventory(DateTime month)
|
public ActionResult Movement(DateTime month)
|
||||||
{
|
{
|
||||||
var startDate = month;
|
var startDate = month;
|
||||||
var endDate = startDate.AddMonths(1);
|
var endDate = startDate.AddMonths(1);
|
||||||
|
|
||||||
var inventoryTypeReport
|
var inventoryTypeReport
|
||||||
= new InventoryTypeReport
|
= new MovementReport
|
||||||
{
|
{
|
||||||
Items = GetInventoryTypeReportItems(startDate, endDate),
|
Items = GetInventoryTypeReportItems(startDate, endDate),
|
||||||
Month = month
|
Month = month
|
||||||
@@ -78,7 +78,7 @@ namespace InventoryTraker.Web.Controllers
|
|||||||
return BetterJson(inventoryTypeReport);
|
return BetterJson(inventoryTypeReport);
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerable<InventoryTypeReportItem> GetInventoryTypeReportItems(DateTime startDate, DateTime endDate)
|
private IEnumerable<MovementReportItem> GetInventoryTypeReportItems(DateTime startDate, DateTime endDate)
|
||||||
{
|
{
|
||||||
var transactionsMostRecentBefore =
|
var transactionsMostRecentBefore =
|
||||||
(from transaction in _context.Transactions
|
(from transaction in _context.Transactions
|
||||||
@@ -128,7 +128,7 @@ namespace InventoryTraker.Web.Controllers
|
|||||||
sums => sums.Inventory.Id, // pk
|
sums => sums.Inventory.Id, // pk
|
||||||
(before, sums, r) =>
|
(before, sums, r) =>
|
||||||
{
|
{
|
||||||
var item = new InventoryReportItem();
|
var item = new MovementReportInventoryItem();
|
||||||
|
|
||||||
if (before != null)
|
if (before != null)
|
||||||
{
|
{
|
||||||
@@ -163,7 +163,7 @@ namespace InventoryTraker.Web.Controllers
|
|||||||
from item in inventoryReportItems
|
from item in inventoryReportItems
|
||||||
group item by item.Inventory.InventoryType
|
group item by item.Inventory.InventoryType
|
||||||
into grp
|
into grp
|
||||||
select new InventoryTypeReportItem
|
select new MovementReportItem
|
||||||
{
|
{
|
||||||
InventoryType = Mapper.Map<InventoryTypeViewModel>(grp.Key),
|
InventoryType = Mapper.Map<InventoryTypeViewModel>(grp.Key),
|
||||||
BeginningQuantity = grp.Sum(g => g.BeginningQuantity),
|
BeginningQuantity = grp.Sum(g => g.BeginningQuantity),
|
||||||
@@ -176,4 +176,15 @@ namespace InventoryTraker.Web.Controllers
|
|||||||
return inventoryTypeReportItems;
|
return inventoryTypeReportItems;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal class MovementReportInventoryItem
|
||||||
|
{
|
||||||
|
public Inventory Inventory { get; set; }
|
||||||
|
public int BeginningQuantity { get; set; }
|
||||||
|
public int AddedQuantity { get; set; }
|
||||||
|
public int TotalAvailableQuantity { get; set; }
|
||||||
|
public int DistributedQuantity { get; set; }
|
||||||
|
public int AdjustmentQuantity { get; set; }
|
||||||
|
public int EndingQuantity { get; set; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -246,8 +246,8 @@
|
|||||||
<Content Include="js\inventory\InventoryEditDirective.js" />
|
<Content Include="js\inventory\InventoryEditDirective.js" />
|
||||||
<Content Include="js\inventory\InventoryDistributeDirective.js" />
|
<Content Include="js\inventory\InventoryDistributeDirective.js" />
|
||||||
<Content Include="js\profile\EditProfileController.js" />
|
<Content Include="js\profile\EditProfileController.js" />
|
||||||
<Content Include="js\report\MonthlyInventoryReportDirective.js" />
|
<Content Include="js\report\MovementReportDirective.js" />
|
||||||
<Content Include="js\report\MonthlyInventoryReportController.js" />
|
<Content Include="js\report\MovementReportController.js" />
|
||||||
<Content Include="js\report\DistributionReportDirective.js" />
|
<Content Include="js\report\DistributionReportDirective.js" />
|
||||||
<Content Include="js\utility\MonthQueryDirective.js" />
|
<Content Include="js\utility\MonthQueryDirective.js" />
|
||||||
<Content Include="js\utility\DateRangeQueryDirective.js" />
|
<Content Include="js\utility\DateRangeQueryDirective.js" />
|
||||||
@@ -309,7 +309,7 @@
|
|||||||
<Content Include="js\report\templates\distributionReport.tmpl.cshtml" />
|
<Content Include="js\report\templates\distributionReport.tmpl.cshtml" />
|
||||||
<Content Include="js\utility\templates\statusMessage.tmpl.cshtml" />
|
<Content Include="js\utility\templates\statusMessage.tmpl.cshtml" />
|
||||||
<Content Include="js\utility\templates\monthQuery.tmpl.cshtml" />
|
<Content Include="js\utility\templates\monthQuery.tmpl.cshtml" />
|
||||||
<Content Include="js\report\templates\monthlyInventoryReport.tmpl.cshtml" />
|
<Content Include="js\report\templates\movementReport.tmpl.cshtml" />
|
||||||
<None Include="NLog.xsd">
|
<None Include="NLog.xsd">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</None>
|
</None>
|
||||||
@@ -374,8 +374,8 @@
|
|||||||
<Compile Include="Models\InventoryQuantityForm.cs" />
|
<Compile Include="Models\InventoryQuantityForm.cs" />
|
||||||
<Compile Include="Models\InventoryRemoveForm.cs" />
|
<Compile Include="Models\InventoryRemoveForm.cs" />
|
||||||
<Compile Include="Models\InventoryReportItem.cs" />
|
<Compile Include="Models\InventoryReportItem.cs" />
|
||||||
<Compile Include="Models\InventoryTypeReport.cs" />
|
<Compile Include="Models\MovementReport.cs" />
|
||||||
<Compile Include="Models\InventoryTypeReportItem.cs" />
|
<Compile Include="Models\MovementReportItem.cs" />
|
||||||
<Compile Include="Models\InventoryTypeViewModel.cs" />
|
<Compile Include="Models\InventoryTypeViewModel.cs" />
|
||||||
<Compile Include="Models\InventoryViewModel.cs" />
|
<Compile Include="Models\InventoryViewModel.cs" />
|
||||||
<Compile Include="Models\LoginForm.cs" />
|
<Compile Include="Models\LoginForm.cs" />
|
||||||
@@ -388,6 +388,7 @@
|
|||||||
<Compile Include="Utilities\InventoryTypeParser.cs" />
|
<Compile Include="Utilities\InventoryTypeParser.cs" />
|
||||||
<Compile Include="Utilities\DateExtensions.cs" />
|
<Compile Include="Utilities\DateExtensions.cs" />
|
||||||
<Compile Include="Utilities\JsonExtensions.cs" />
|
<Compile Include="Utilities\JsonExtensions.cs" />
|
||||||
|
<Compile Include="Utilities\MovementReportWriter.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="Views\web.config" />
|
<Content Include="Views\web.config" />
|
||||||
@@ -410,7 +411,7 @@
|
|||||||
<Content Include="Views\Transaction\Index.cshtml" />
|
<Content Include="Views\Transaction\Index.cshtml" />
|
||||||
<Content Include="Views\InventoryType\Index.cshtml" />
|
<Content Include="Views\InventoryType\Index.cshtml" />
|
||||||
<Content Include="Views\Report\Distribution.cshtml" />
|
<Content Include="Views\Report\Distribution.cshtml" />
|
||||||
<Content Include="Views\Report\MonthlyInventory.cshtml" />
|
<Content Include="Views\Report\Movement.cshtml" />
|
||||||
<None Include="Web.Debug.config">
|
<None Include="Web.Debug.config">
|
||||||
<DependentUpon>Web.config</DependentUpon>
|
<DependentUpon>Web.config</DependentUpon>
|
||||||
</None>
|
</None>
|
||||||
|
|||||||
@@ -2,14 +2,5 @@ using InventoryTraker.Web.Core;
|
|||||||
|
|
||||||
namespace InventoryTraker.Web.Models
|
namespace InventoryTraker.Web.Models
|
||||||
{
|
{
|
||||||
public class InventoryReportItem
|
|
||||||
{
|
|
||||||
public Inventory Inventory { get; set; }
|
|
||||||
public int BeginningQuantity { get; set; }
|
|
||||||
public int AddedQuantity { get; set; }
|
|
||||||
public int TotalAvailableQuantity { get; set; }
|
|
||||||
public int DistributedQuantity { get; set; }
|
|
||||||
public int AdjustmentQuantity { get; set; }
|
|
||||||
public int EndingQuantity { get; set; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
+2
-2
@@ -3,9 +3,9 @@ using System.Collections.Generic;
|
|||||||
|
|
||||||
namespace InventoryTraker.Web.Models
|
namespace InventoryTraker.Web.Models
|
||||||
{
|
{
|
||||||
public class InventoryTypeReport
|
public class MovementReport
|
||||||
{
|
{
|
||||||
public DateTime Month { get; set; }
|
public DateTime Month { get; set; }
|
||||||
public IEnumerable<InventoryTypeReportItem> Items { get; set; }
|
public IEnumerable<MovementReportItem> Items { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
namespace InventoryTraker.Web.Models
|
namespace InventoryTraker.Web.Models
|
||||||
{
|
{
|
||||||
public class InventoryTypeReportItem
|
public class MovementReportItem
|
||||||
{
|
{
|
||||||
public InventoryTypeViewModel InventoryType { get; set; }
|
public InventoryTypeViewModel InventoryType { get; set; }
|
||||||
public int BeginningQuantity { get; set; }
|
public int BeginningQuantity { get; set; }
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using CsvHelper.Configuration;
|
||||||
|
using InventoryTraker.Web.Models;
|
||||||
|
|
||||||
|
namespace InventoryTraker.Web.Utilities
|
||||||
|
{
|
||||||
|
public class MovementReportWriter
|
||||||
|
{
|
||||||
|
public sealed class InventoryTypeReportMap : CsvClassMap<MovementReportItem>
|
||||||
|
{
|
||||||
|
public InventoryTypeReportMap()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
+5
-5
@@ -3,12 +3,12 @@
|
|||||||
ViewBag.Title = "Monthly Inventory Report";
|
ViewBag.Title = "Monthly Inventory Report";
|
||||||
}
|
}
|
||||||
|
|
||||||
<div ng-controller="MonthlyInventoryReportController as vm">
|
<div ng-controller="MovementReportController as vm">
|
||||||
<h1 class="page-header">
|
<h1 class="page-header">
|
||||||
<i class="fa fa-file-o"></i> @ViewBag.Title
|
<i class="fa fa-file-o"></i> @ViewBag.Title
|
||||||
</h1>
|
</h1>
|
||||||
<div class="row hidden-print">
|
<div class="row hidden-print">
|
||||||
<div class="col-md-9">
|
<div class="col-md-4">
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<month-query query-fn="vm.loadData"></month-query>
|
<month-query query-fn="vm.loadData"></month-query>
|
||||||
@@ -16,10 +16,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row" ng-show="vm.monthlyInventoryData.items.length">
|
<div class="row" ng-show="vm.movementData.items.length">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<h3>{{vm.monthlyInventoryData.month | date:'MMMM yyyy'}}</h3>
|
<h3>{{vm.movementData.month | date:'MMMM yyyy'}}</h3>
|
||||||
<monthly-inventory-report monthly-inventory-data="vm.monthlyInventoryData"></monthly-inventory-report>
|
<movement-report movement-data="vm.movementData"></movement-report>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
<a href="@(Html.BuildUrlFromExpression<ReportController>(c => c.Distribution()))"><i class="fa fa-file-o"></i> Distribution</a>
|
<a href="@(Html.BuildUrlFromExpression<ReportController>(c => c.Distribution()))"><i class="fa fa-file-o"></i> Distribution</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="@(Html.BuildUrlFromExpression<ReportController>(c => c.MonthlyInventory()))"><i class="fa fa-file-o"></i> Monthly Inventory</a>
|
<a href="@(Html.BuildUrlFromExpression<ReportController>(c => c.Movement()))"><i class="fa fa-file-o"></i> Monthly Inventory</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
(function () {
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
window.app.controller('MonthlyInventoryReportController', MonthlyInventoryReportController);
|
|
||||||
|
|
||||||
MonthlyInventoryReportController.$inject = ['$scope', 'reportSvc'];
|
|
||||||
function MonthlyInventoryReportController($scope, reportSvc) {
|
|
||||||
var vm = this;
|
|
||||||
vm.loadData = reportSvc.loadMonthlyInventoryData;
|
|
||||||
vm.monthlyInventoryData = reportSvc.monthlyInventoryData;
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
(function () {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
window.app.controller('MovementReportController', MovementReportController);
|
||||||
|
|
||||||
|
MovementReportController.$inject = ['$scope', 'reportSvc'];
|
||||||
|
function MovementReportController($scope, reportSvc) {
|
||||||
|
var vm = this;
|
||||||
|
vm.loadData = reportSvc.loadMovementData;
|
||||||
|
vm.movementData = reportSvc.movementData;
|
||||||
|
}
|
||||||
|
})();
|
||||||
+5
-5
@@ -1,11 +1,11 @@
|
|||||||
(function() {
|
(function() {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
window.app.directive('monthlyInventoryReport', monthlyInventoryReport);
|
window.app.directive('movementReport', movementReport);
|
||||||
function monthlyInventoryReport() {
|
function movementReport() {
|
||||||
return {
|
return {
|
||||||
scope: { monthlyInventoryData: "=" },
|
scope: { movementData: "=" },
|
||||||
templateUrl: '/report/template/monthlyInventoryReport.tmpl.cshtml',
|
templateUrl: '/report/template/movementReport.tmpl.cshtml',
|
||||||
controller: controller,
|
controller: controller,
|
||||||
controllerAs: 'vm'
|
controllerAs: 'vm'
|
||||||
}
|
}
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
controller.$inject = ['$scope', '$uibModal', 'inventorySvc'];
|
controller.$inject = ['$scope', '$uibModal', 'inventorySvc'];
|
||||||
function controller($scope, $uibModal, inventorySvc) {
|
function controller($scope, $uibModal, inventorySvc) {
|
||||||
var vm = this;
|
var vm = this;
|
||||||
vm.monthlyInventoryData = $scope.monthlyInventoryData;
|
vm.movementData = $scope.movementData;
|
||||||
|
|
||||||
vm.editInventory = function (inventoryId) {
|
vm.editInventory = function (inventoryId) {
|
||||||
inventorySvc.find(inventoryId)
|
inventorySvc.find(inventoryId)
|
||||||
@@ -4,13 +4,13 @@
|
|||||||
reportSvc.$inject = ['$http'];
|
reportSvc.$inject = ['$http'];
|
||||||
function reportSvc($http) {
|
function reportSvc($http) {
|
||||||
var distributionData = [];
|
var distributionData = [];
|
||||||
var monthlyInventoryData = {};
|
var movementData = {};
|
||||||
|
|
||||||
var svc = {
|
var svc = {
|
||||||
distributionData: distributionData,
|
distributionData: distributionData,
|
||||||
loadDistributionReport: loadDistributionReport,
|
loadDistributionReport: loadDistributionReport,
|
||||||
monthlyInventoryData: monthlyInventoryData,
|
movementData: movementData,
|
||||||
loadMonthlyInventoryData: loadMonthlyInventoryData
|
loadMovementData: loadMovementData
|
||||||
};
|
};
|
||||||
|
|
||||||
return svc;
|
return svc;
|
||||||
@@ -22,10 +22,10 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadMonthlyInventoryData(query) {
|
function loadMovementData(query) {
|
||||||
return $http.post('/Report/MonthlyInventory', query)
|
return $http.post('/Report/Movement', query)
|
||||||
.success(function (data) {
|
.success(function (data) {
|
||||||
angular.copy(data, monthlyInventoryData);
|
angular.copy(data, movementData);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -13,7 +13,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr ng-repeat="item in vm.monthlyInventoryData.items | orderBy:'inventoryType.name'">
|
<tr ng-repeat="item in vm.movementData.items | orderBy:'inventoryType.name'">
|
||||||
@*<td><a href="" ng-click="vm.editInventory(item.inventory.id)"><i class="fa fa-edit"></i></a> </td>*@
|
@*<td><a href="" ng-click="vm.editInventory(item.inventory.id)"><i class="fa fa-edit"></i></a> </td>*@
|
||||||
<td>{{item.inventoryType.name}}</td>
|
<td>{{item.inventoryType.name}}</td>
|
||||||
<td>{{item.inventoryType.unitsPerCase}} / {{item.inventoryType.containerType}}</td>
|
<td>{{item.inventoryType.unitsPerCase}} / {{item.inventoryType.containerType}}</td>
|
||||||
@@ -16,7 +16,6 @@
|
|||||||
class="form-control"
|
class="form-control"
|
||||||
bs-datepicker="" />
|
bs-datepicker="" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user