{#if !$clientSession}

Client Access Required

Sign in on the Hunter Premium Produce home page before viewing raw material pricing.

This workflow updates source inputs and pushes new values through mix and product calculations.

Return to sign-in
{:else} {#if successMessage}

{successMessage}

{/if} {#if errorMessage}

{errorMessage}

{/if} {#snippet rail()} (activeView = id as RawMaterialsView)} /> {/snippet}
{#if activeRailItem} {@const PanelIcon = activeRailItem.icon}

Workspace

{activeRailItem.label}

{activeRailItem.description}

{/if}
{#if activeView === 'overview'}
Total Spend Tracked {currency(totalSpend)}

Across current market values

Average Waste {(averageWaste * 100).toFixed(1)}%

Current blended input loss

Latest Price Update {formatDate(latestEffectiveDate)}

Most recent effective date on file

Downstream Snapshot

Mixes affected by current inputs

{#each pagedOverviewMixes as mix}
{mix.name} {mix.client_name}
{currency(mix.mix_cost_per_kg, 4)} / kg
{/each}
{#if data.mixes.length > pageSize} {/if}

Product Exposure

Finished outputs linked to live pricing

{#each pagedOverviewProducts as row}
{row.product_name} {row.warnings.length ? 'Check warnings' : 'Stable pricing'}
{currency(row.finished_product_delivered)}
{/each}
{#if data.productCosts.length > pageSize} {/if}
{:else if activeView === 'create'}

Create Input

Add a new raw material

Live costing source

Portfolio Health

Current input coverage

Active materials Ready for live calculations
{activeMaterials.length}
Total tracked Across all statuses
{data.rawMaterials.length}
Latest effective date Most recent seeded version
{formatDate(latestEffectiveDate)}
{:else if activeView === 'library'}
{#each pagedRawMaterials as material} {@const impactedMixes = getImpactedMixes(material.id)} {@const impactedProducts = getImpactedProducts(material.id)}
RM

{material.name}

{material.supplier || 'Supplier not set'} · {material.unit_of_measure} · {material.kg_per_unit} kg per unit

{material.status}
Market value {currency(material.current_price?.market_value)}
Waste {material.current_price ? `${(material.current_price.waste_percentage * 100).toFixed(1)}%` : 'N/A'}
Cost per kg {currency(material.current_price?.cost_per_kg, 4)}
Effective date {formatDate(material.current_price?.effective_date)}
handleAddPrice(event, material.id)}>

New Version

Record a fresh price

Impacted mixes

{impactedMixes.length}
{#if impactedMixes.length}
{#each impactedMixes as mix}
{mix.name} {mix.client_name}
{currency(mix.mix_cost_per_kg, 4)} / kg
{/each}
{:else}

No active mix currently references this material.

{/if}

Impacted products

{impactedProducts.length}
{#if impactedProducts.length}
{#each impactedProducts as product}
{product.name} {product.mix_name}
{currency(product.deliveredCost?.finished_product_delivered)}
{/each}
{:else}

No finished product currently depends on this material.

{/if}
{/each} {#if data.rawMaterials.length > pageSize} {/if}
{/if}
{/if}