完璧に動作しています。

テスト	結果
確定取消 API	 is_confirmed: false, confirmed_at: null
USE トランザクション削除	 current_stock が 27.5→32 に復帰
引当再作成	 reserved_stock = 5.000 に復帰
追加した変更:

stock_service.py:81-93 — unconfirm_spreading(): USE削除→確定フラグリセット→引当再作成
fertilizer/views.py — unconfirm アクション(POST /api/fertilizer/plans/{id}/unconfirm/)
fertilizer/page.tsx — 一覧に「確定取消」ボタン(確定済み計画のみ表示)
FertilizerEditPage.tsx — 編集画面ヘッダーに「確定取消」ボタン + 在庫情報再取得
This commit is contained in:
Akira
2026-03-15 13:28:02 +09:00
parent 42b11a5df8
commit 72b4d670fe
18 changed files with 807 additions and 60 deletions

View File

@@ -73,8 +73,18 @@ export default function StockOverview({
</td>
<td className="px-4 py-3 text-gray-600">{item.material_type_display}</td>
<td className="px-4 py-3 text-gray-600">{item.maker || '-'}</td>
<td className="px-4 py-3 text-right font-semibold text-gray-900">
{item.current_stock}
<td className="px-4 py-3 text-right">
<div className="font-semibold text-gray-900">
{item.current_stock}
{item.reserved_stock !== '0.000' && (
<span className="ml-1 text-xs font-normal text-amber-600">
{item.reserved_stock}
</span>
)}
</div>
<div className="text-xs text-gray-500">
{item.available_stock}
</div>
</td>
<td className="px-4 py-3 text-gray-600">{item.stock_unit_display}</td>
<td className="px-4 py-3 text-gray-600">