Fix time entry 500 and inventory edit pencil visibility

- Remove parseInt() from time entry worker select — GUIDs were destroyed
  to NaN → sent as null → FindByIdAsync(null) threw 500
- Ledger pencil: also show for Adjustment rows (no PO) so scan-without-job
  entries get an edit button, not just JobUsage rows
- InventoryController: always write JobUsage type for scan-based logs;
  accept Adjustment in edit endpoints; promote Adjustment→JobUsage when
  a job is assigned via edit

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-05 21:46:05 -04:00
parent 010d0437c2
commit c45a6826bd
3 changed files with 13 additions and 7 deletions
@@ -205,7 +205,7 @@
</td>
<td><small class="text-muted">@t.Notes</small></td>
<td>
@if (t.TransactionType == "JobUsage")
@if (t.TransactionType == "JobUsage" || (t.TransactionType == "Adjustment" && t.PurchaseOrderId == null))
{
<button type="button" class="btn btn-outline-secondary btn-sm py-0 px-1"
title="Edit usage record"
@@ -2795,7 +2795,7 @@
async function save() {
const id = parseInt(document.getElementById('teEntryId').value);
const workerId = parseInt(document.getElementById('teWorkerId').value);
const workerId = document.getElementById('teWorkerId').value;
const workDate = document.getElementById('teWorkDate').value;
const hours = parseFloat(document.getElementById('teHoursWorked').value);
const stage = document.getElementById('teStage').value.trim();