- Replace two-tab supplier selector with two-step wizard (method select → suppliers → summary) - Add per-item channel picker (Email / WhatsApp / Both) in By Item mode - Add confirmation summary step before submitting By Item supplier assignments - Add type-to-confirm delete on pipeline list rows - Redirect purchase.requests.index to pipeline (same data, single entry point) - Remove Purchase Requests from sidebar nav - Add edit-request-modal, supplier-invite-list components - Add address coordinates migration for settings_locations Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
77 lines
3.3 KiB
PHP
77 lines
3.3 KiB
PHP
@extends('layouts.app')
|
|
|
|
@section('title', 'Purchase Pipeline')
|
|
|
|
@section('content')
|
|
<style>
|
|
.hidden-tab { display:none; }
|
|
.pr-row:hover { background:#f8fafc; cursor:pointer; }
|
|
.stage-pill { display:inline-block; font-size:11px; font-weight:700; padding:3px 10px; border-radius:20px; white-space:nowrap; }
|
|
</style>
|
|
|
|
<div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:24px;flex-wrap:wrap;gap:12px;">
|
|
<div>
|
|
<h1 style="font-size:22px;font-weight:700;color:#0f172a;">Purchase Pipeline</h1>
|
|
<p style="font-size:13px;color:#64748b;margin-top:3px;">Track every purchase from request to payment</p>
|
|
</div>
|
|
<x-purchase.request-modal />
|
|
</div>
|
|
|
|
{{-- Tabs --}}
|
|
<div style="display:flex;gap:0;border-bottom:2px solid #e2e8f0;margin-bottom:20px;">
|
|
<button id="tab-active" onclick="switchTab('active')"
|
|
style="padding:10px 22px;font-size:13px;font-weight:700;border:none;background:none;cursor:pointer;color:#2563eb;border-bottom:2px solid #2563eb;margin-bottom:-2px;">
|
|
Active
|
|
<span style="margin-left:6px;background:#dbeafe;color:#1d4ed8;font-size:11px;font-weight:700;padding:2px 8px;border-radius:20px;">{{ $active->count() }}</span>
|
|
</button>
|
|
<button id="tab-completed" onclick="switchTab('completed')"
|
|
style="padding:10px 22px;font-size:13px;font-weight:700;border:none;background:none;cursor:pointer;color:#64748b;border-bottom:2px solid transparent;margin-bottom:-2px;">
|
|
Completed
|
|
<span style="margin-left:6px;background:#f1f5f9;color:#64748b;font-size:11px;font-weight:700;padding:2px 8px;border-radius:20px;">{{ $completed->count() }}</span>
|
|
</button>
|
|
</div>
|
|
|
|
{{-- Active tab --}}
|
|
<div id="pane-active">
|
|
@if($active->isEmpty())
|
|
<div style="text-align:center;padding:60px 0;color:#94a3b8;">
|
|
<div style="font-size:44px;margin-bottom:12px;">✅</div>
|
|
<div style="font-size:15px;font-weight:600;">No active pipelines</div>
|
|
<div style="font-size:13px;margin-top:4px;">All purchases are complete, or create a new request.</div>
|
|
</div>
|
|
@else
|
|
@include('purchase.pipeline._table', ['rows' => $active, 'stages' => $stages])
|
|
@endif
|
|
</div>
|
|
|
|
{{-- Completed tab --}}
|
|
<div id="pane-completed" class="hidden-tab">
|
|
@if($completed->isEmpty())
|
|
<div style="text-align:center;padding:60px 0;color:#94a3b8;">
|
|
<div style="font-size:44px;margin-bottom:12px;">📋</div>
|
|
<div style="font-size:15px;font-weight:600;">No completed purchases yet</div>
|
|
</div>
|
|
@else
|
|
@include('purchase.pipeline._table', ['rows' => $completed, 'stages' => $stages])
|
|
@endif
|
|
</div>
|
|
|
|
<script>
|
|
function switchTab(tab) {
|
|
document.getElementById('pane-active').classList.toggle('hidden-tab', tab !== 'active');
|
|
document.getElementById('pane-completed').classList.toggle('hidden-tab', tab !== 'completed');
|
|
|
|
var btnActive = document.getElementById('tab-active');
|
|
var btnCompleted = document.getElementById('tab-completed');
|
|
|
|
if (tab === 'active') {
|
|
btnActive.style.color = '#2563eb'; btnActive.style.borderBottomColor = '#2563eb';
|
|
btnCompleted.style.color = '#64748b'; btnCompleted.style.borderBottomColor = 'transparent';
|
|
} else {
|
|
btnCompleted.style.color = '#2563eb'; btnCompleted.style.borderBottomColor = '#2563eb';
|
|
btnActive.style.color = '#64748b'; btnActive.style.borderBottomColor = 'transparent';
|
|
}
|
|
}
|
|
</script>
|
|
@endsection
|