@using System.ComponentModel.DataAnnotations
|
@using System.Text.RegularExpressions
|
@using System.Reflection
|
@using HotelPms.Client.Blazor.Models;
|
@using HotelPms.Client.Blazor.ViewModel
|
@using HotelPms.Data.Common
|
@using HotelPms.Data.Common.Interface.Master
|
@using HotelPms.DataAccessGrpc.Client
|
@using HotelPms.Share.IO
|
@using HotelPms.Share.Util
|
@using ViewModel = HotelPms.Client.Blazor.ViewModel
|
@using static HotelPms.Client.Blazor.Util.SystemEnum
|
@inject IJSRuntime JSRuntime
|
@inject IDialogService DialogService
|
@inject ISnackbar Snackbar
|
|
<MudCard Elevation="4">
|
<MudCardHeader>
|
<CardHeaderContent>
|
<MudText Typo="Typo.body1">Address Details for <strong>伝票</strong></MudText>
|
<MudButton Variant="Variant.Filled" StartIcon="@Icons.Filled.ReadMore" OnClick="Save">登録</MudButton>
|
</CardHeaderContent>
|
</MudCardHeader>
|
<MudCardContent Class="mt-0 pt-0 mb-0 pb-3">
|
<MudTable Class="edit-grid pr-0" id="SaleInputTable" @ref="_table" T="SaleInputRow" Items="@Data.SaleList" Dense="true" Hover="true" ReadOnly="false" FixedHeader="true" Height="480px" Striped="true"
|
@bind-SelectedItem="selectedItem1" Elevation = "0">
|
<ToolBarContent>
|
<MudText Typo="Typo.body1">伝票情報</MudText>
|
<MudTextField T="string" Margin="Margin.Dense" />
|
<MudSpacer />
|
<MudTextField @bind-Value="searchString" Margin="Margin.Dense" Placeholder="Search" Adornment="Adornment.Start" AdornmentIcon="@Icons.Material.Filled.Search" IconSize="Size.Medium" Class="mt-0"></MudTextField>
|
</ToolBarContent>
|
<ColGroup>
|
<col style="width:50px;" />
|
<col style="width:100px;" />
|
<col />
|
<col style="width:70px;" />
|
<col style="width:70px;" />
|
<col style="width:100px;" />
|
<col style="width:80px;" />
|
<col style="width:130px;" />
|
<col style="width:100px;" />
|
<col style="width:50px;" />
|
<col style="width:60px;" />
|
</ColGroup>
|
<HeaderContent>
|
<MudTh>TYPE</MudTh>
|
<MudTh>部屋No</MudTh>
|
<MudTh>科目名称</MudTh>
|
<MudTh Style="text-align:center">人数</MudTh>
|
<MudTh Style="text-align:center">内女</MudTh>
|
<MudTh>基本単価</MudTh>
|
<MudTh>割引</MudTh>
|
<MudTh Style="text-align:right">合計金額</MudTh>
|
<MudTh>集計日</MudTh>
|
<MudTh>頁</MudTh>
|
<MudTh>詳細</MudTh>
|
</HeaderContent>
|
<RowTemplate>
|
<MudTd DataLabel="TYPE">@context.Cells[(int)SaleInputRow.ColType.RoomType].Text</MudTd>
|
<MudTd DataLabel="部屋No">@context.Cells[(int)SaleInputRow.ColType.RoomID].Text</MudTd>
|
<MudTd DataLabel="科目名称" Class="slip-row pr-0 pl-1">
|
<MudTextField class="input-pink" id="txtItemName" @ref="@context.Cells[(int)SaleInputRow.ColType.ItemName].Ref" @bind-Value="@context.Cells[(int)SaleInputRow.ColType.ItemName].Text" Margin="Margin.Dense"
|
OnKeyPress="@(e => KeyPress((int)SaleInputRow.ColType.ItemName, context, e))"
|
KeyPressPreventDefault="@keyPressPreventDefault"
|
OnKeyDown="@(e => KeyDown((int)SaleInputRow.ColType.ItemName, context, e))"
|
KeyDownPreventDefault="@keyDownPreventDefault"
|
OnBlur="@(e => Leave((int)SaleInputRow.ColType.ItemName, context, e))"
|
@onfocus="(e => Enter((int)SaleInputRow.ColType.ItemName, context, e))" />
|
</MudTd>
|
<MudTd DataLabel="人数" Class="slip-row pr-0 pl-1">
|
<MudTextField class="input-center" @ref="@context.Cells[(int)SaleInputRow.ColType.PersonCount].Ref" @bind-Value="@context.Cells[(int)SaleInputRow.ColType.PersonCount].Text" Margin="Margin.Dense"
|
OnKeyPress="@(e => KeyPress((int)SaleInputRow.ColType.PersonCount, context, e))"
|
KeyPressPreventDefault="@keyPressPreventDefault"
|
OnKeyDown="@(e => KeyDown((int)SaleInputRow.ColType.PersonCount, context, e))"
|
KeyDownPreventDefault="@keyDownPreventDefault"
|
OnBlur="@(e => Leave((int)SaleInputRow.ColType.PersonCount, context, e))"
|
@onfocus="(e => Enter((int)SaleInputRow.ColType.PersonCount, context, e))" />
|
</MudTd>
|
<MudTd DataLabel="内女" Class="slip-row pr-0 pl-1">
|
<MudTextField class="input-center" @ref="@context.Cells[(int)SaleInputRow.ColType.Woman].Ref" @bind-Value="@context.Cells[(int)SaleInputRow.ColType.Woman].Text" Margin="Margin.Dense"
|
OnKeyPress="@(e => KeyPress((int)SaleInputRow.ColType.Woman, context, e))"
|
KeyPressPreventDefault="@keyPressPreventDefault"
|
OnKeyDown="@(e => KeyDown((int)SaleInputRow.ColType.Woman, context, e))"
|
KeyDownPreventDefault="@keyDownPreventDefault"
|
OnBlur="@(e => Leave((int)SaleInputRow.ColType.Woman, context, e))"
|
@onfocus="(e => Enter((int)SaleInputRow.ColType.Woman, context, e))" />
|
</MudTd>
|
<MudTd DataLabel="基本単価" Class="slip-row pr-0 pl-1">
|
<MudTextField class="input-right" @ref="@context.Cells[(int)SaleInputRow.ColType.UnitPrice].Ref" @bind-Value="@context.Cells[(int)SaleInputRow.ColType.UnitPrice].Text" Margin="Margin.Dense"
|
OnKeyPress="@(e => KeyPress((int)SaleInputRow.ColType.UnitPrice, context, e))"
|
KeyPressPreventDefault="@keyPressPreventDefault"
|
OnKeyDown="@(e => KeyDown((int)SaleInputRow.ColType.UnitPrice, context, e))"
|
KeyDownPreventDefault="@keyDownPreventDefault"
|
OnBlur="@(e => Leave((int)SaleInputRow.ColType.UnitPrice, context, e))"
|
@onfocus="(e => Enter((int)SaleInputRow.ColType.UnitPrice, context, e))" />
|
</MudTd>
|
<MudTd DataLabel="割引" Class="slip-row pr-0 pl-1">
|
<MudTextField class="input-pink input-right" @ref="@context.Cells[(int)SaleInputRow.ColType.DiscountSummary].Ref" @bind-Value="@context.Cells[(int)SaleInputRow.ColType.DiscountSummary].Text" Margin="Margin.Dense"
|
OnKeyPress="@(e => KeyPress((int)SaleInputRow.ColType.DiscountSummary, context, e))"
|
KeyPressPreventDefault="@keyPressPreventDefault"
|
OnKeyDown="@(e => KeyDown((int)SaleInputRow.ColType.DiscountSummary, context, e))"
|
KeyDownPreventDefault="@keyDownPreventDefault"
|
OnBlur="@(e => Leave((int)SaleInputRow.ColType.DiscountSummary, context, e))"
|
@onfocus="(e => Enter((int)SaleInputRow.ColType.DiscountSummary, context, e))" />
|
</MudTd>
|
<MudTd DataLabel="合計金額" Class="slip-row pr-0 pl-1">
|
<MudTextField class="input-right" @ref="@context.Cells[(int)SaleInputRow.ColType.TotalSummary].Ref" ReadOnly="true" @bind-Value="@context.Cells[(int)SaleInputRow.ColType.TotalSummary].Text" Margin="Margin.Dense"
|
OnKeyPress="@(e => KeyPress((int)SaleInputRow.ColType.TotalSummary, context, e))"
|
KeyPressPreventDefault="@keyPressPreventDefault"
|
OnKeyDown="@(e => KeyDown((int)SaleInputRow.ColType.TotalSummary, context, e))"
|
KeyDownPreventDefault="@keyDownPreventDefault"
|
OnBlur="@(e => Leave((int)SaleInputRow.ColType.TotalSummary, context, e))"
|
@onfocus="(e => Enter((int)SaleInputRow.ColType.TotalSummary, context, e))" />
|
</MudTd>
|
<MudTd DataLabel="集計日" Class="slip-row pr-0 pl-1">
|
<MudTextField class="input-pink input-center" @ref="@context.Cells[(int)SaleInputRow.ColType.SumDate].Ref" @bind-Value="@context.Cells[(int)SaleInputRow.ColType.SumDate].Text" Margin="Margin.Dense"
|
OnKeyPress="@(e => KeyPress((int)SaleInputRow.ColType.SumDate, context, e))"
|
KeyPressPreventDefault="@keyPressPreventDefault"
|
OnKeyDown="@(e => KeyDown((int)SaleInputRow.ColType.SumDate, context, e))"
|
KeyDownPreventDefault="@keyDownPreventDefault"
|
OnBlur="@(e => Leave((int)SaleInputRow.ColType.SumDate, context, e))"
|
@onfocus="(e => Enter((int)SaleInputRow.ColType.SumDate, context, e))" />
|
</MudTd>
|
<MudTd DataLabel="頁" Class="slip-row pr-0 pl-1">
|
<MudTextField class="input-center" @ref="@context.Cells[(int)SaleInputRow.ColType.Page].Ref" @bind-Value="@context.Cells[(int)SaleInputRow.ColType.Page].Text" Margin="Margin.Dense"
|
OnKeyPress="@(e => KeyPress((int)SaleInputRow.ColType.Page, context, e))"
|
KeyPressPreventDefault="@keyPressPreventDefault"
|
OnKeyDown="@(e => KeyDown((int)SaleInputRow.ColType.Page, context, e))"
|
KeyDownPreventDefault="@keyDownPreventDefault"
|
OnBlur="@(e => Leave((int)SaleInputRow.ColType.Page, context, e))"
|
@onfocus="(e => Enter((int)SaleInputRow.ColType.Page, context, e))" />
|
</MudTd>
|
<MudTd>
|
<div style="display: flex; gap: 10px;">
|
<MudTooltip Text="Commit Edit">
|
<MudIconButton Size="Size.Small" Icon="@Icons.Filled.ReadMore" OnClick="@(e => DetailClick(context))"></MudIconButton>
|
</MudTooltip>
|
</div>
|
</MudTd>
|
</RowTemplate>
|
<ChildRowContent>
|
@if (context.ShowDetails)
|
{
|
<MudTr>
|
<td colspan="11">
|
<MudCard Class="mt-2 ml-5 mr-2 mb-2" Elevation="1">
|
<MudCardContent>
|
@if (context.ActiveCol == (int)SaleInputRow.ColType.Detail)
|
{
|
<MudGrid Spacing="3" Justify="Justify.FlexStart">
|
<MudItem lg="12" Class="mt-1 pt-1 mb-0 pb-0">
|
<MudStack Spacing="5" Row="true">
|
<MudText Typo="Typo.body2">パック明細情報</MudText>
|
<MudLink Href="#" Underline="Underline.Always" Typo="Typo.body2">追加</MudLink>
|
</MudStack>
|
</MudItem>
|
<MudItem lg="12" Class="mt-0 pt-0 mb-0 pb-0">
|
<MudTable id="SaleChildTable" Class="pr-0 mt-0 pt-0" Items="@SaleChildList" Dense="true" Hover="true" ReadOnly="true" Height="105px" Striped="true" HorizontalScrollbar="true" Elevation="0">
|
<ColGroup>
|
<col style="width:50px;" />
|
<col style="width:100px;" />
|
<col />
|
<col style="width:70px;" />
|
<col style="width:70px;" />
|
<col style="width:100px;" />
|
<col style="width:80px;" />
|
<col style="width:130px;" />
|
<col style="width:100px;" />
|
<col style="width:50px;" />
|
</ColGroup>
|
<HeaderContent>
|
<MudTh>TYPE</MudTh>
|
<MudTh>部屋No</MudTh>
|
<MudTh>科目名称</MudTh>
|
<MudTh Style="text-align:center">人数</MudTh>
|
<MudTh Style="text-align:center">内女</MudTh>
|
<MudTh>基本単価</MudTh>
|
<MudTh>割引</MudTh>
|
<MudTh Style="text-align:right">合計金額</MudTh>
|
<MudTh>集計日</MudTh>
|
</HeaderContent>
|
<RowTemplate Context = "childItem">
|
<MudTd DataLabel="TYPE" Class="table-row"><MudText Typo="Typo.body2">@childItem.Cells[(int)SaleChildRow.ColType.RoomType]</MudText></MudTd>
|
<MudTd DataLabel="部屋No">@childItem.Cells[(int)SaleChildRow.ColType.RoomID]</MudTd>
|
<MudTd DataLabel="科目名称">@childItem.Cells[(int)SaleChildRow.ColType.ItemName]</MudTd>
|
<MudTd DataLabel="人数">@childItem.Cells[(int)SaleChildRow.ColType.PersonCount]</MudTd>
|
<MudTd DataLabel="内女">@childItem.Cells[(int)SaleChildRow.ColType.Woman]</MudTd>
|
<MudTd DataLabel="基本単価">@childItem.Cells[(int)SaleChildRow.ColType.UnitPrice]</MudTd>
|
<MudTd DataLabel="割引">@childItem.Cells[(int)SaleChildRow.ColType.DiscountSummary]</MudTd>
|
<MudTd DataLabel="合計金額">@childItem.Cells[(int)SaleChildRow.ColType.TotalSummary]</MudTd>
|
<MudTd DataLabel="集計日">@childItem.Cells[(int)SaleChildRow.ColType.SumDate]</MudTd>
|
<MudTd>
|
</MudTd>
|
</RowTemplate>
|
</MudTable>
|
<MudDivider DividerType="DividerType.FullWidth" Class="my-1" />
|
</MudItem>
|
<MudItem lg="10" Class="mt-0 pt-0 mb-0 pb-0">
|
<MudGrid Spacing="3" Justify="Justify.FlexStart">
|
<MudItem lg="3">
|
<MudGrid Spacing="1" Justify="Justify.FlexStart">
|
<MudItem xs="9">
|
<MudGrid Spacing="0" Justify="Justify.FlexStart">
|
<MudItem xs="5">
|
<MudTextField Class="input-pink" @bind-Value="searchString" T="string" Label="サ料" AutoFocus="true" Margin="Margin.Dense" MaxLength="10" />
|
</MudItem>
|
<MudItem xs="7">
|
<MudField Margin="Margin.Dense">なし</MudField>
|
</MudItem>
|
</MudGrid>
|
</MudItem>
|
<MudItem xs="3">
|
<MudTextField @bind-Value="searchString" T="string" Label="サ率" Margin="Margin.Dense" MaxLength="10" />
|
</MudItem>
|
</MudGrid>
|
</MudItem>
|
<MudItem lg="6">
|
<MudGrid Spacing="1" Justify="Justify.FlexStart">
|
<MudItem xs="5">
|
<MudGrid Spacing="0" Justify="Justify.FlexStart">
|
<MudItem xs="5">
|
<MudTextField Class="input-pink" @bind-Value="searchString" T="string" Label="消費税" Margin="Margin.Dense" MaxLength="10" />
|
</MudItem>
|
<MudItem xs="7">
|
<MudField Margin="Margin.Dense">なし</MudField>
|
</MudItem>
|
</MudGrid>
|
</MudItem>
|
<MudItem xs="2">
|
<MudTextField @bind-Value="searchString" T="string" Label="税率" Margin="Margin.Dense" MaxLength="10" />
|
</MudItem>
|
<MudItem xs="5">
|
<MudGrid Spacing="0" Justify="Justify.FlexStart">
|
<MudItem xs="5">
|
<MudTextField Class="input-pink" @bind-Value="searchString" T="string" Label="タイプ" Margin="Margin.Dense" MaxLength="10" />
|
</MudItem>
|
<MudItem xs="7">
|
<MudField Margin="Margin.Dense">軽減税</MudField>
|
</MudItem>
|
</MudGrid>
|
</MudItem>
|
</MudGrid>
|
</MudItem>
|
<MudItem lg="3">
|
<MudGrid Spacing="0" Justify="Justify.FlexStart">
|
<MudItem xs="5">
|
<MudTextField Class="input-pink" @bind-Value="searchString" T="string" Label="入湯税" Margin="Margin.Dense" MaxLength="10" />
|
</MudItem>
|
<MudItem xs="7">
|
<MudField Margin="Margin.Dense">なし</MudField>
|
</MudItem>
|
</MudGrid>
|
</MudItem>
|
<MudItem lg="12">
|
<MudGrid Spacing="3" Justify="Justify.FlexStart">
|
<MudItem xs="4">
|
<MudGrid Spacing="1" Justify="Justify.FlexStart">
|
<MudItem xs="8">
|
<MudGrid Spacing="0" Justify="Justify.FlexStart">
|
<MudItem xs="5">
|
<MudTextField Class="input-pink" @bind-Value="searchString" T="string" Label="宿泊税" Margin="Margin.Dense" MaxLength="10" />
|
</MudItem>
|
<MudItem xs="7">
|
<MudField Margin="Margin.Dense">なし</MudField>
|
</MudItem>
|
</MudGrid>
|
</MudItem>
|
<MudItem xs="4">
|
<MudTextField @bind-Value="searchString" T="string" Label="宿泊税額" Margin="Margin.Dense" MaxLength="10" />
|
</MudItem>
|
</MudGrid>
|
</MudItem>
|
<MudItem xs="3">
|
<MudGrid Spacing="0" Justify="Justify.FlexStart">
|
<MudItem xs="5">
|
<MudTextField Class="input-pink" @bind-Value="searchString" T="string" Label="端数区分" Margin="Margin.Dense" MaxLength="10" />
|
</MudItem>
|
<MudItem xs="6">
|
<MudField Margin="Margin.Dense">なし</MudField>
|
</MudItem>
|
</MudGrid>
|
</MudItem>
|
<MudItem xs="3">
|
<MudGrid Spacing="0" Justify="Justify.FlexStart">
|
<MudItem xs="5">
|
<MudTextField Class="input-pink" @bind-Value="searchString" T="string" Label="印字区分" Margin="Margin.Dense" MaxLength="10" />
|
</MudItem>
|
<MudItem xs="7">
|
<MudField Margin="Margin.Dense">なし</MudField>
|
</MudItem>
|
</MudGrid>
|
</MudItem>
|
<MudItem xs="2">
|
<MudTextField Class="input-pink" @bind-Value="searchString" T="string" Label="集計日" Margin="Margin.Dense" MaxLength="7" />
|
</MudItem>
|
</MudGrid>
|
</MudItem>
|
</MudGrid>
|
</MudItem>
|
<MudItem lg="2" Class="mt-0 pt-0 mb-0 pb-0">
|
<MudGrid Spacing="1" Justify="Justify.FlexStart" Class="pt-2 pb-2">
|
@foreach(var feeItem in FeeDetailList)
|
{
|
<MudItem xs="5" Class="pt-0 pb-0">
|
<MudText Typo="Typo.body1" Align="Align.Left">@feeItem.Name</MudText>
|
</MudItem>
|
<MudItem xs="7" Class="pt-0 pb-0">
|
<MudText Typo="Typo.body1" Align="Align.Right">@feeItem.Value</MudText>
|
</MudItem>
|
}
|
</MudGrid>
|
</MudItem>
|
</MudGrid>
|
}
|
else if (context.ActiveCol == (int)SaleInputRow.ColType.ItemName)
|
{
|
|
}
|
</MudCardContent>
|
</MudCard>
|
</td>
|
<td></td>
|
</MudTr>
|
}
|
</ChildRowContent>
|
</MudTable>
|
</MudCardContent>
|
</MudCard>
|
|
<style>
|
div.slip-edit th:last-child {
|
display: none;
|
}
|
|
div.slip-edit td:last-child {
|
display: none;
|
}
|
|
div.slip-edit .mud-table-cell:nth-last-child(2) {
|
padding: 6px 2px 6px 16px;
|
padding-inline-start: 16px;
|
padding-inline-end: 2px;
|
}
|
</style>
|
|
@code {
|
private static RenderFragment RenderMessage(string text) =>@<MessageContext Text="@text" />;
|
}
|