ホテル管理システム
ogi
yesterday 1a1c8e71fcd14858f595029f089b2d4a00202b32
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
@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" />;
}