m1m02530125 commited on
Commit
b3e4e35
·
1 Parent(s): 42a2b89

勤務統計から推計勤務時間の表示を削除

Browse files

- 集計テーブルの「推計時間」列・per期間内訳・合計行を削除(人件費が無い場合はテーブル自体を非表示)
- 「スタッフ別推計勤務時間」グラフをスマホでの視認性のため削除

Files changed (1) hide show
  1. templates/schedule/stats_multi.html +5 -63
templates/schedule/stats_multi.html CHANGED
@@ -16,7 +16,6 @@
16
  .stat-table th, .stat-table td { white-space: nowrap; }
17
  .stat-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
18
  .cost-col { color: #fbbf24; font-weight: 700; }
19
- .hours-col { color: #34d399; }
20
  .chart-wrap { position: relative; height: 220px; }
21
  </style>
22
  {% endblock %}
@@ -58,6 +57,7 @@
58
  <div class="alert alert-info small">期間を選択してください。</div>
59
  {% else %}
60
 
 
61
  <!-- 集計テーブル -->
62
  <div class="card mb-3">
63
  <div class="card-body p-0">
@@ -66,44 +66,17 @@
66
  <thead class="table-dark">
67
  <tr>
68
  <th>名前</th>
69
- {% if sel_periods|length > 1 %}
70
- {% for p in sel_periods %}
71
- <th class="text-center hours-col" title="{{ p.start_date }}〜{{ p.end_date }}">
72
- {{ p.start_date[5:] }}〜
73
- </th>
74
- {% endfor %}
75
- {% endif %}
76
- <th class="text-center hours-col">推計時間</th>
77
- {% if any_wage %}
78
  <th class="text-center cost-col">推計人件費</th>
79
- {% endif %}
80
  </tr>
81
  </thead>
82
  <tbody>
83
- {% set total_hours = namespace(v=0.0) %}
84
- {% set total_cost = namespace(v=0.0) %}
85
  {% for emp in employees %}
86
  {% set d = stats_data.get(emp.id, {}) %}
87
- {% set shifts = d.get('shifts', 0) %}
88
- {% set hours = d.get('hours', 0.0) %}
89
- {% set cost = d.get('cost', 0.0) %}
90
- {% set total_hours.v = total_hours.v + hours %}
91
- {% set total_cost.v = total_cost.v + cost %}
92
  <tr>
93
  <td class="fw-semibold">{{ emp.name }}</td>
94
- {% if sel_periods|length > 1 %}
95
- {% for p in sel_periods %}
96
- {% set bp = d.get('by_period', {}).get(p.id, {}) %}
97
- <td class="num text-center hours-col">
98
- {% if bp.get('hours', 0) > 0 %}{{ "%.1f"|format(bp.hours) }}h
99
- {% else %}<span class="text-muted">—</span>{% endif %}
100
- </td>
101
- {% endfor %}
102
- {% endif %}
103
- <td class="num text-center hours-col">
104
- {% if hours > 0 %}{{ "%.1f"|format(hours) }}h{% else %}—{% endif %}
105
- </td>
106
- {% if any_wage %}
107
  <td class="num text-center">
108
  {% if emp.employment_type.value == 'full_time' %}
109
  <span class="text-muted small">対象外</span>
@@ -113,35 +86,20 @@
113
  <span class="text-muted small">時給未設定</span>
114
  {% else %}—{% endif %}
115
  </td>
116
- {% endif %}
117
  </tr>
118
  {% endfor %}
119
  </tbody>
120
  <tfoot class="table-dark fw-bold">
121
  <tr>
122
  <td>合計</td>
123
- {% if sel_periods|length > 1 %}
124
- {% for p in sel_periods %}
125
- <td class="num text-center hours-col">
126
- {% set p_total = namespace(v=0.0) %}
127
- {% for emp in employees %}
128
- {% set bp = stats_data.get(emp.id, {}).get('by_period', {}).get(p.id, {}) %}
129
- {% set p_total.v = p_total.v + bp.get('hours', 0.0) %}
130
- {% endfor %}
131
- {{ "%.1f"|format(p_total.v) }}h
132
- </td>
133
- {% endfor %}
134
- {% endif %}
135
- <td class="num text-center hours-col">{{ "%.1f"|format(total_hours.v) }}h</td>
136
- {% if any_wage %}
137
  <td class="num text-center cost-col">¥{{ "{:,.0f}".format(total_cost.v) }}</td>
138
- {% endif %}
139
  </tr>
140
  </tfoot>
141
  </table>
142
  </div>
143
  </div>
144
  </div>
 
145
 
146
  <!-- 36協定チェック -->
147
  <div class="card mb-3 {% if overtime_alerts %}border-warning{% endif %}">
@@ -301,18 +259,7 @@
301
  </div>
302
  {% endif %}
303
 
304
- <!-- 勤務時間グラフ -->
305
- <div class="card mb-3">
306
- <div class="card-body">
307
- <div class="small fw-semibold text-muted mb-3">スタッフ別推計勤務時間</div>
308
- <div class="chart-wrap">
309
- <canvas id="hoursChart"></canvas>
310
- </div>
311
- </div>
312
- </div>
313
-
314
  <p class="text-muted small px-1">
315
- ※ 推計時間はシフト希望のパターン時刻をもとに算出します。<br>
316
  ※ 人件費は(基本給+個人昇給額)×時間(朝食は早朝手当加算)の概算です。休憩・交通費等は含みません。<br>
317
  ※ 基本給・早朝手当・昇給額は設定画面の「人件費設定」で変更できます。
318
  </p>
@@ -328,10 +275,6 @@ const EMPLOYEES = {{ employees | map(attribute='name') | list | tojson }};
328
  const STATS = {{ stats_data | tojson }};
329
  const EMP_IDS = {{ employees | map(attribute='id') | list | tojson }};
330
 
331
- const hours = EMP_IDS.map(id => {
332
- const d = STATS[String(id)];
333
- return d ? parseFloat(d.hours.toFixed(1)) : 0;
334
- });
335
  const costs = EMP_IDS.map(id => {
336
  const d = STATS[String(id)];
337
  return d ? Math.round(d.cost) : 0;
@@ -369,7 +312,6 @@ function mkChart(id, label, data, color) {
369
  });
370
  }
371
 
372
- mkChart('hoursChart', '推計勤務時間 (h)', hours, '#34d399');
373
  mkChart('costChart', '推計人件費 (¥)', costs, '#fbbf24');
374
  </script>
375
  {% endblock %}
 
16
  .stat-table th, .stat-table td { white-space: nowrap; }
17
  .stat-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
18
  .cost-col { color: #fbbf24; font-weight: 700; }
 
19
  .chart-wrap { position: relative; height: 220px; }
20
  </style>
21
  {% endblock %}
 
57
  <div class="alert alert-info small">期間を選択してください。</div>
58
  {% else %}
59
 
60
+ {% if any_wage %}
61
  <!-- 集計テーブル -->
62
  <div class="card mb-3">
63
  <div class="card-body p-0">
 
66
  <thead class="table-dark">
67
  <tr>
68
  <th>名前</th>
 
 
 
 
 
 
 
 
 
69
  <th class="text-center cost-col">推計人件費</th>
 
70
  </tr>
71
  </thead>
72
  <tbody>
73
+ {% set total_cost = namespace(v=0.0) %}
 
74
  {% for emp in employees %}
75
  {% set d = stats_data.get(emp.id, {}) %}
76
+ {% set cost = d.get('cost', 0.0) %}
77
+ {% set total_cost.v = total_cost.v + cost %}
 
 
 
78
  <tr>
79
  <td class="fw-semibold">{{ emp.name }}</td>
 
 
 
 
 
 
 
 
 
 
 
 
 
80
  <td class="num text-center">
81
  {% if emp.employment_type.value == 'full_time' %}
82
  <span class="text-muted small">対象外</span>
 
86
  <span class="text-muted small">時給未設定</span>
87
  {% else %}—{% endif %}
88
  </td>
 
89
  </tr>
90
  {% endfor %}
91
  </tbody>
92
  <tfoot class="table-dark fw-bold">
93
  <tr>
94
  <td>合計</td>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
  <td class="num text-center cost-col">¥{{ "{:,.0f}".format(total_cost.v) }}</td>
 
96
  </tr>
97
  </tfoot>
98
  </table>
99
  </div>
100
  </div>
101
  </div>
102
+ {% endif %}
103
 
104
  <!-- 36協定チェック -->
105
  <div class="card mb-3 {% if overtime_alerts %}border-warning{% endif %}">
 
259
  </div>
260
  {% endif %}
261
 
 
 
 
 
 
 
 
 
 
 
262
  <p class="text-muted small px-1">
 
263
  ※ 人件費は(基本給+個人昇給額)×時間(朝食は早朝手当加算)の概算です。休憩・交通費等は含みません。<br>
264
  ※ 基本給・早朝手当・昇給額は設定画面の「人件費設定」で変更できます。
265
  </p>
 
275
  const STATS = {{ stats_data | tojson }};
276
  const EMP_IDS = {{ employees | map(attribute='id') | list | tojson }};
277
 
 
 
 
 
278
  const costs = EMP_IDS.map(id => {
279
  const d = STATS[String(id)];
280
  return d ? Math.round(d.cost) : 0;
 
312
  });
313
  }
314
 
 
315
  mkChart('costChart', '推計人件費 (¥)', costs, '#fbbf24');
316
  </script>
317
  {% endblock %}