@page "/magazzino/inventario"
@page "/magazzino/inventario/{Id:long}"
@attribute [Authorize]
@using Khaemhat.Application.Documents
@using Khaemhat.Application.Inventory
@using Khaemhat.Application.Items
@using Khaemhat.Application.Security
@using Khaemhat.Application.Tables
@using Khaemhat.Core.Documents
@using Khaemhat.Core.Inventory
@using Khaemhat.Core.Tables
@using Khaemhat.Web.Documents
@using Khaemhat.Web.Items
@using Khaemhat.Web.Parties
@using Khaemhat.Web.Tables
@inject ShellSession Session
@inject StockTakeService StockTakes
@inject ItemService Items
@inject TableService Tables
@inject ToastService Toasts
@inject DialogService Dialogs
@inject NavigationManager Navigation
@inject TimeProvider Clock
@* The physical stock take (SPEC §11.6, mockup 038): opened on a warehouse at a date (and perhaps a category), it freezes
the book quantity and cost of each item; the counts are typed on the list or read from a scanner file; posting turns
the differences into gain and loss movements at the date of the count. *@
@T["Common.Loading"]
} else if (Session.Company is null) { } else if (!Session.Permissions.Allows(InventoryService.EntryReadPermission)) { } else if (Id is null) {@T["Inventory.StockTake.Hint"]
@T["Inventory.StockTake.None"]
} else {| @T["Inventory.StockTake.Date"] | @T["Inventory.StockTake.Description"] | @T["Inventory.Fields.Warehouse"] | @T["Items.Radar.State"] |
|---|---|---|---|
| @T.Date(take.TakeDate) | @take.Description | @PartyScreens.Describe(_warehouses, take.WarehouseId) |
| @T["Items.Fields.Code"] | @T["Items.Fields.Description"] | @T["Items.Radar.Unit"] | @T["Inventory.StockTake.Book"] | @T["Inventory.StockTake.Counted"] | @T["Inventory.StockTake.Difference"] | @if (_costs) {@T["Inventory.Movements.UnitCost"] | @T["Inventory.StockTake.DifferenceValue"] | }@T["Items.Radar.State"] |
|---|---|---|---|---|---|---|---|---|
| @line.Code | @line.Description | @PartyScreens.Describe(_lookups.Units, line.UnitOfMeasureId) | @Qty(line.Line.BookQuantity) | @if (IsOpen && CanWrite) { SetCount(id, e.Value?.ToString())" /> } else { @(counted is { } v ? Qty(v) : "—") } | 0m ? "ok" : null)">@(counted is null ? null : Qty(difference)) | @if (_costs) {@T.Money(line.Line.UnitCost) | @(counted is null ? null : T.Money(Math.Round(difference * line.Line.UnitCost, 2))) | }
@if (counted is null)
{
|