データベースルールにowner_typeとis_canceledを追加し、is_businessを廃止。Expenseモデルと関連するマイグレーションを実施。明細編集UIをowner_type選択に更新し、取り消し済みの経費を一覧から除外。作業ログをdiary.mdに追記。
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
<th>金額</th>
|
||||
<th>店舗区分</th>
|
||||
<th>経費区分</th>
|
||||
<th>会社/家計</th>
|
||||
<th>区分</th>
|
||||
<th>備考</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -50,39 +50,17 @@
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<label>
|
||||
<input
|
||||
class="js-expense-field"
|
||||
data-field="is_business"
|
||||
type="radio"
|
||||
name="is_business_{{ expense.id }}"
|
||||
value="true"
|
||||
{% if expense.is_business is True %}checked{% endif %}
|
||||
>
|
||||
会社
|
||||
</label>
|
||||
<label>
|
||||
<input
|
||||
class="js-expense-field"
|
||||
data-field="is_business"
|
||||
type="radio"
|
||||
name="is_business_{{ expense.id }}"
|
||||
value="false"
|
||||
{% if expense.is_business is False %}checked{% endif %}
|
||||
>
|
||||
家計
|
||||
</label>
|
||||
<label>
|
||||
<input
|
||||
class="js-expense-field"
|
||||
data-field="is_business"
|
||||
type="radio"
|
||||
name="is_business_{{ expense.id }}"
|
||||
value=""
|
||||
{% if expense.is_business is None %}checked{% endif %}
|
||||
>
|
||||
未設定
|
||||
</label>
|
||||
<select class="js-expense-field" data-field="owner_type">
|
||||
<option value="pending" {% if expense.owner_type == "pending" %}selected{% endif %}>
|
||||
未設定
|
||||
</option>
|
||||
<option value="company" {% if expense.owner_type == "company" %}selected{% endif %}>
|
||||
会社
|
||||
</option>
|
||||
<option value="personal" {% if expense.owner_type == "personal" %}selected{% endif %}>
|
||||
家計
|
||||
</option>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<input
|
||||
@@ -119,12 +97,6 @@
|
||||
}
|
||||
|
||||
function coerceValue(field, value) {
|
||||
if (field === 'is_business') {
|
||||
if (value === '') {
|
||||
return null;
|
||||
}
|
||||
return value === 'true';
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user