Add Phase B: Inventory COGS auto-posting to GL on JobUsage transactions

When powder is consumed via a job (JobsController) or scan (InventoryController.LogUsage),
debit the item's CogsAccountId and credit its InventoryAccountId for the cost of the
quantity consumed (using AverageCost if available, else UnitCost). No-op when either
GL account is not configured on the InventoryItem.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-09 23:39:23 -04:00
parent 7e1676cfd7
commit 0afb474c3e
3 changed files with 26 additions and 3 deletions
@@ -138,7 +138,8 @@ public class QuoteAndReworkControllerFlowTests
Mock.Of<IPricingCalculationService>(),
new JobItemAssemblyService(),
Mock.Of<IHubContext<NotificationHub>>(),
Mock.Of<IHubContext<ShopHub>>());
Mock.Of<IHubContext<ShopHub>>(),
Mock.Of<IAccountBalanceService>());
var result = await controller.AddReworkRecord(new CreateReworkRecordDto
{