@extends('layouts.app') @section('title', 'Backfill Supplier Categories') @section('content')
Administration Backfill Supplier Categories

Backfill Supplier Categories

Tag pharmacy-likely suppliers as Pharmaceutical so they appear in the Receive Products dropdown.

@if(session('success'))
{{ session('success') }}
@endif

How this works

The Receive Products dropdown now only shows suppliers tagged as Pharmaceutical. Suppliers created via the Pharmacy module historically had no category set — they would be invisible in the dropdown without this fix.

This tool scans suppliers with no category (or category = "General") and tags them as Pharmaceutical if their name matches any of: {{ implode(', ', $patterns) }}. Suppliers with other categories (Utilities, Services, etc.) are left untouched.

{{-- Will be tagged --}}

Will be tagged as Pharmaceutical ({{ count($toTag) }})

@if(count($toTag) > 0)
@csrf
@endif
@if(count($toTag) === 0)
No suppliers match a pharmacy pattern. Nothing to tag.
@else
@foreach($toTag as $row) @endforeach
Supplier Current Category Matched Keyword After
{{ $row['name'] }} {{ $row['before'] }} {{ $row['matched'] }} Pharmaceutical
@endif
{{-- Will NOT be tagged --}}

Will NOT be tagged ({{ count($skipped) }})

These untagged suppliers don't match any pharmacy keyword. If any of them are actually pharmacy suppliers, tag them manually via Expenses › Suppliers → Edit → Category → Pharmaceutical.

@if(count($skipped) === 0)
No leftover untagged suppliers.
@else
@foreach($skipped as $row) @endforeach
Supplier Current Category
{{ $row['name'] }} {{ $row['before'] }}
@endif
@endsection