Container Modal problemleri
This commit is contained in:
parent
811a575ff7
commit
57796d1177
4 changed files with 635 additions and 710 deletions
|
|
@ -82,7 +82,7 @@ define(['./workbox-a959eb95'], (function (workbox) { 'use strict';
|
|||
"revision": "3ca0b8505b4bec776b69afdba2768812"
|
||||
}, {
|
||||
"url": "/index.html",
|
||||
"revision": "0.daul0044rt"
|
||||
"revision": "0.hml46tc2c78"
|
||||
}], {});
|
||||
workbox.cleanupOutdatedCaches();
|
||||
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("/index.html"), {
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import CheckNoteDetails from './CheckNoteDetails'
|
|||
import CollectionDialog from './CollectionDialog'
|
||||
import EndorsementDialog from './EndorsementDialog'
|
||||
import Widget from '../../../components/common/Widget'
|
||||
import { Container } from '@/components/shared'
|
||||
|
||||
interface CheckNoteManagementProps {
|
||||
checks: FiCheck[]
|
||||
|
|
@ -662,92 +663,217 @@ const CheckNoteManagement: React.FC<CheckNoteManagementProps> = ({
|
|||
})
|
||||
|
||||
return (
|
||||
<div className="space-y-2">
|
||||
{/* Header */}
|
||||
<div className="flex items-center justify-between">
|
||||
<div>
|
||||
<h2 className="text-2xl font-bold text-gray-900">Çek & Senet Takibi</h2>
|
||||
<p className="text-gray-600">Alınan ve verilen çek & senet yönetimi</p>
|
||||
<Container>
|
||||
<div className="space-y-2">
|
||||
{/* Header */}
|
||||
<div className="flex items-center justify-between">
|
||||
<div>
|
||||
<h2 className="text-2xl font-bold text-gray-900">Çek & Senet Takibi</h2>
|
||||
<p className="text-gray-600">Alınan ve verilen çek & senet yönetimi</p>
|
||||
</div>
|
||||
<div className="flex gap-2 text-sm">
|
||||
<button
|
||||
onClick={handleAddNote}
|
||||
className="flex items-center gap-2 px-3 py-1.5 bg-green-600 text-white rounded-md hover:bg-green-700 transition-colors"
|
||||
>
|
||||
<FaFileAlt className="w-4 h-4" />
|
||||
Yeni Senet
|
||||
</button>
|
||||
<button
|
||||
onClick={handleAddCheck}
|
||||
className="flex items-center gap-2 px-3 py-1.5 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors"
|
||||
>
|
||||
<FaCreditCard className="w-4 h-4" />
|
||||
Yeni Çek
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex gap-2 text-sm">
|
||||
<button
|
||||
onClick={handleAddNote}
|
||||
className="flex items-center gap-2 px-3 py-1.5 bg-green-600 text-white rounded-md hover:bg-green-700 transition-colors"
|
||||
>
|
||||
<FaFileAlt className="w-4 h-4" />
|
||||
Yeni Senet
|
||||
</button>
|
||||
<button
|
||||
onClick={handleAddCheck}
|
||||
className="flex items-center gap-2 px-3 py-1.5 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors"
|
||||
>
|
||||
<FaCreditCard className="w-4 h-4" />
|
||||
Yeni Çek
|
||||
</button>
|
||||
|
||||
{/* Stats Cards */}
|
||||
<div className="grid grid-cols-1 md:grid-cols-4 gap-4">
|
||||
<Widget
|
||||
title="Toplam Çek"
|
||||
value={formatCurrency(totalCheckAmount)}
|
||||
color="blue"
|
||||
icon="FaCreditCard"
|
||||
subTitle={`${checks.length} adet`}
|
||||
/>
|
||||
<Widget
|
||||
title="Toplam Senet"
|
||||
value={formatCurrency(totalNoteAmount)}
|
||||
color="green"
|
||||
icon="FaFileAlt"
|
||||
subTitle={`${promissoryNotes.length} adet`}
|
||||
/>
|
||||
<Widget
|
||||
title="Alacak Çek"
|
||||
value={formatCurrency(receivedCheckAmount)}
|
||||
color="green"
|
||||
icon="FaCreditCard"
|
||||
/>
|
||||
<Widget
|
||||
title="Alacak Senet"
|
||||
value={formatCurrency(receivedNoteAmount)}
|
||||
color="green"
|
||||
icon="FaFileAlt"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Stats Cards */}
|
||||
<div className="grid grid-cols-1 md:grid-cols-4 gap-4">
|
||||
<Widget
|
||||
title="Toplam Çek"
|
||||
value={formatCurrency(totalCheckAmount)}
|
||||
color="blue"
|
||||
icon="FaCreditCard"
|
||||
subTitle={`${checks.length} adet`}
|
||||
/>
|
||||
<Widget
|
||||
title="Toplam Senet"
|
||||
value={formatCurrency(totalNoteAmount)}
|
||||
color="green"
|
||||
icon="FaFileAlt"
|
||||
subTitle={`${promissoryNotes.length} adet`}
|
||||
/>
|
||||
<Widget
|
||||
title="Alacak Çek"
|
||||
value={formatCurrency(receivedCheckAmount)}
|
||||
color="green"
|
||||
icon="FaCreditCard"
|
||||
/>
|
||||
<Widget
|
||||
title="Alacak Senet"
|
||||
value={formatCurrency(receivedNoteAmount)}
|
||||
color="green"
|
||||
icon="FaFileAlt"
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Alerts */}
|
||||
{(dueChecks.length > 0 ||
|
||||
dueNotes.length > 0 ||
|
||||
overdueChecks.length > 0 ||
|
||||
overdueNotes.length > 0) && (
|
||||
<div className="space-y-3">
|
||||
{(dueChecks.length > 0 || dueNotes.length > 0) && (
|
||||
<div className="bg-yellow-50 border border-yellow-200 rounded-lg p-3">
|
||||
<div className="flex items-center gap-2">
|
||||
<FaClock className="w-5 h-5 text-yellow-600" />
|
||||
<h3 className="text-base font-semibold text-yellow-900">Vadesi Yaklaşan</h3>
|
||||
{/* Alerts */}
|
||||
{(dueChecks.length > 0 ||
|
||||
dueNotes.length > 0 ||
|
||||
overdueChecks.length > 0 ||
|
||||
overdueNotes.length > 0) && (
|
||||
<div className="space-y-3">
|
||||
{(dueChecks.length > 0 || dueNotes.length > 0) && (
|
||||
<div className="bg-yellow-50 border border-yellow-200 rounded-lg p-3">
|
||||
<div className="flex items-center gap-2">
|
||||
<FaClock className="w-5 h-5 text-yellow-600" />
|
||||
<h3 className="text-base font-semibold text-yellow-900">Vadesi Yaklaşan</h3>
|
||||
</div>
|
||||
<p className="text-sm text-yellow-700 mt-1">
|
||||
{dueChecks.length} çek ve {dueNotes.length} senet 7 gün içinde vadesi dolacak.
|
||||
</p>
|
||||
</div>
|
||||
<p className="text-sm text-yellow-700 mt-1">
|
||||
{dueChecks.length} çek ve {dueNotes.length} senet 7 gün içinde vadesi dolacak.
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{(overdueChecks.length > 0 || overdueNotes.length > 0) && (
|
||||
<div className="bg-red-50 border border-red-200 rounded-lg p-3">
|
||||
<div className="flex items-center gap-2">
|
||||
<FaExclamationTriangle className="w-5 h-5 text-red-600" />
|
||||
<h3 className="text-base font-semibold text-red-900">Vadesi Geçmiş</h3>
|
||||
</div>
|
||||
<p className="text-sm text-red-700 mt-1">
|
||||
{overdueChecks.length} çek ve {overdueNotes.length} senet vadesi geçmiş durumda.
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Tabs */}
|
||||
<div className="border-b border-gray-200">
|
||||
<nav className="-mb-px flex space-x-6">
|
||||
<button
|
||||
onClick={() => setActiveTab('checks')}
|
||||
className={`py-3 px-1 border-b-2 font-medium text-sm ${
|
||||
activeTab === 'checks'
|
||||
? 'border-blue-500 text-blue-600'
|
||||
: 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'
|
||||
}`}
|
||||
>
|
||||
Çekler ({checks.length})
|
||||
</button>
|
||||
<button
|
||||
onClick={() => setActiveTab('notes')}
|
||||
className={`py-3 px-1 border-b-2 font-medium text-sm ${
|
||||
activeTab === 'notes'
|
||||
? 'border-blue-500 text-blue-600'
|
||||
: 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'
|
||||
}`}
|
||||
>
|
||||
Senetler ({promissoryNotes.length})
|
||||
</button>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
{/* Filters */}
|
||||
<div className="flex gap-3 items-center">
|
||||
<div className="flex-1 relative">
|
||||
<FaSearch className="w-4 h-4 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400" />
|
||||
<input
|
||||
type="text"
|
||||
placeholder={
|
||||
activeTab === 'checks'
|
||||
? 'Çek no, keşideci, lehtar veya banka ara...'
|
||||
: 'Senet no, keşideci veya lehtar ara...'
|
||||
}
|
||||
value={searchTerm}
|
||||
onChange={(e) => setSearchTerm(e.target.value)}
|
||||
className="w-full pl-10 pr-3 py-1.5 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<select
|
||||
value={selectedType}
|
||||
onChange={(e) =>
|
||||
setSelectedType(e.target.value as CheckTypeEnum | NoteTypeEnum | 'all')
|
||||
}
|
||||
className="px-3 py-1.5 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||
>
|
||||
<option value="all">Tüm Türler</option>
|
||||
<option value="RECEIVED">Alınan</option>
|
||||
<option value="ISSUED">Verilen</option>
|
||||
</select>
|
||||
|
||||
{activeTab === 'checks' ? (
|
||||
<select
|
||||
value={selectedCheckStatus}
|
||||
onChange={(e) => setSelectedCheckStatus(e.target.value as CheckStatusEnum | 'all')}
|
||||
className="px-3 py-1.5 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||
>
|
||||
<option value="all">Tüm Durumlar</option>
|
||||
{Object.values(CheckStatusEnum).map((status) => (
|
||||
<option key={status} value={status}>
|
||||
{getCheckStatusLabel(status)}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
) : (
|
||||
<select
|
||||
value={selectedNoteStatus}
|
||||
onChange={(e) => setSelectedNoteStatus(e.target.value as NoteStatusEnum | 'all')}
|
||||
className="px-3 py-1.5 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||
>
|
||||
<option value="all">Tüm Durumlar</option>
|
||||
{Object.values(NoteStatusEnum).map((status) => (
|
||||
<option key={status} value={status}>
|
||||
{getNoteStatusLabel(status)}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
)}
|
||||
|
||||
{(overdueChecks.length > 0 || overdueNotes.length > 0) && (
|
||||
<div className="bg-red-50 border border-red-200 rounded-lg p-3">
|
||||
<div className="flex items-center gap-2">
|
||||
<FaExclamationTriangle className="w-5 h-5 text-red-600" />
|
||||
<h3 className="text-base font-semibold text-red-900">Vadesi Geçmiş</h3>
|
||||
</div>
|
||||
<p className="text-sm text-red-700 mt-1">
|
||||
{overdueChecks.length} çek ve {overdueNotes.length} senet vadesi geçmiş durumda.
|
||||
</p>
|
||||
</div>
|
||||
<select
|
||||
value={sortBy}
|
||||
onChange={(e) => setSortBy(e.target.value as 'dueDate' | 'amount' | 'issueDate')}
|
||||
className="px-3 py-1.5 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||
>
|
||||
<option value="dueDate">Vade Tarihine Göre</option>
|
||||
<option value="amount">Tutara Göre</option>
|
||||
<option value="issueDate">Düzenleme Tarihine Göre</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
{/* Data Table */}
|
||||
<div className="bg-white rounded-lg shadow-sm border overflow-x-auto">
|
||||
{activeTab === 'checks' ? (
|
||||
<DataTable data={filteredChecks} columns={checkColumns} />
|
||||
) : (
|
||||
<DataTable data={filteredNotes} columns={noteColumns} />
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Empty State */}
|
||||
{((activeTab === 'checks' && filteredChecks.length === 0) ||
|
||||
(activeTab === 'notes' && filteredNotes.length === 0)) && (
|
||||
<div className="text-center py-10">
|
||||
{activeTab === 'checks' ? (
|
||||
<FaCreditCard className="w-12 h-12 text-gray-400 mx-auto mb-4" />
|
||||
) : (
|
||||
<FaFileAlt className="w-12 h-12 text-gray-400 mx-auto mb-4" />
|
||||
)}
|
||||
<h3 className="text-lg font-medium text-gray-900 mb-2">
|
||||
{activeTab === 'checks' ? 'Çek bulunamadı' : 'Senet bulunamadı'}
|
||||
</h3>
|
||||
<p className="text-sm text-gray-500">
|
||||
{activeTab === 'checks'
|
||||
? 'Yeni bir çek ekleyin veya arama kriterlerinizi değiştirin.'
|
||||
: 'Yeni bir senet ekleyin veya arama kriterlerinizi değiştirin.'}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Modal Components */}
|
||||
<CheckForm
|
||||
|
|
@ -787,128 +913,7 @@ const CheckNoteManagement: React.FC<CheckNoteManagementProps> = ({
|
|||
isOpen={showEndorsementDialog}
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* Tabs */}
|
||||
<div className="border-b border-gray-200">
|
||||
<nav className="-mb-px flex space-x-6">
|
||||
<button
|
||||
onClick={() => setActiveTab('checks')}
|
||||
className={`py-3 px-1 border-b-2 font-medium text-sm ${
|
||||
activeTab === 'checks'
|
||||
? 'border-blue-500 text-blue-600'
|
||||
: 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'
|
||||
}`}
|
||||
>
|
||||
Çekler ({checks.length})
|
||||
</button>
|
||||
<button
|
||||
onClick={() => setActiveTab('notes')}
|
||||
className={`py-3 px-1 border-b-2 font-medium text-sm ${
|
||||
activeTab === 'notes'
|
||||
? 'border-blue-500 text-blue-600'
|
||||
: 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'
|
||||
}`}
|
||||
>
|
||||
Senetler ({promissoryNotes.length})
|
||||
</button>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
{/* Filters */}
|
||||
<div className="flex gap-3 items-center">
|
||||
<div className="flex-1 relative">
|
||||
<FaSearch className="w-4 h-4 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400" />
|
||||
<input
|
||||
type="text"
|
||||
placeholder={
|
||||
activeTab === 'checks'
|
||||
? 'Çek no, keşideci, lehtar veya banka ara...'
|
||||
: 'Senet no, keşideci veya lehtar ara...'
|
||||
}
|
||||
value={searchTerm}
|
||||
onChange={(e) => setSearchTerm(e.target.value)}
|
||||
className="w-full pl-10 pr-3 py-1.5 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<select
|
||||
value={selectedType}
|
||||
onChange={(e) => setSelectedType(e.target.value as CheckTypeEnum | NoteTypeEnum | 'all')}
|
||||
className="px-3 py-1.5 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||
>
|
||||
<option value="all">Tüm Türler</option>
|
||||
<option value="RECEIVED">Alınan</option>
|
||||
<option value="ISSUED">Verilen</option>
|
||||
</select>
|
||||
|
||||
{activeTab === 'checks' ? (
|
||||
<select
|
||||
value={selectedCheckStatus}
|
||||
onChange={(e) => setSelectedCheckStatus(e.target.value as CheckStatusEnum | 'all')}
|
||||
className="px-3 py-1.5 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||
>
|
||||
<option value="all">Tüm Durumlar</option>
|
||||
{Object.values(CheckStatusEnum).map((status) => (
|
||||
<option key={status} value={status}>
|
||||
{getCheckStatusLabel(status)}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
) : (
|
||||
<select
|
||||
value={selectedNoteStatus}
|
||||
onChange={(e) => setSelectedNoteStatus(e.target.value as NoteStatusEnum | 'all')}
|
||||
className="px-3 py-1.5 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||
>
|
||||
<option value="all">Tüm Durumlar</option>
|
||||
{Object.values(NoteStatusEnum).map((status) => (
|
||||
<option key={status} value={status}>
|
||||
{getNoteStatusLabel(status)}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
)}
|
||||
|
||||
<select
|
||||
value={sortBy}
|
||||
onChange={(e) => setSortBy(e.target.value as 'dueDate' | 'amount' | 'issueDate')}
|
||||
className="px-3 py-1.5 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||
>
|
||||
<option value="dueDate">Vade Tarihine Göre</option>
|
||||
<option value="amount">Tutara Göre</option>
|
||||
<option value="issueDate">Düzenleme Tarihine Göre</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
{/* Data Table */}
|
||||
<div className="bg-white rounded-lg shadow-sm border overflow-x-auto">
|
||||
{activeTab === 'checks' ? (
|
||||
<DataTable data={filteredChecks} columns={checkColumns} />
|
||||
) : (
|
||||
<DataTable data={filteredNotes} columns={noteColumns} />
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Empty State */}
|
||||
{((activeTab === 'checks' && filteredChecks.length === 0) ||
|
||||
(activeTab === 'notes' && filteredNotes.length === 0)) && (
|
||||
<div className="text-center py-10">
|
||||
{activeTab === 'checks' ? (
|
||||
<FaCreditCard className="w-12 h-12 text-gray-400 mx-auto mb-4" />
|
||||
) : (
|
||||
<FaFileAlt className="w-12 h-12 text-gray-400 mx-auto mb-4" />
|
||||
)}
|
||||
<h3 className="text-lg font-medium text-gray-900 mb-2">
|
||||
{activeTab === 'checks' ? 'Çek bulunamadı' : 'Senet bulunamadı'}
|
||||
</h3>
|
||||
<p className="text-sm text-gray-500">
|
||||
{activeTab === 'checks'
|
||||
? 'Yeni bir çek ekleyin veya arama kriterlerinizi değiştirin.'
|
||||
: 'Yeni bir senet ekleyin veya arama kriterlerinizi değiştirin.'}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</Container>
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -573,23 +573,23 @@ const ActivityRecords: React.FC = () => {
|
|||
<p className="text-gray-500">Arama kriterlerinizi değiştirmeyi deneyin.</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Modals */}
|
||||
<ActivityForm
|
||||
isOpen={isFormOpen}
|
||||
onClose={handleCloseForm}
|
||||
onSave={handleSaveActivity}
|
||||
activity={selectedActivity}
|
||||
mode={formMode}
|
||||
/>
|
||||
|
||||
<ActivityDetails
|
||||
isOpen={isDetailsOpen}
|
||||
onClose={handleCloseDetails}
|
||||
onEdit={handleEditFromDetails}
|
||||
activity={selectedActivity}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Modals */}
|
||||
<ActivityForm
|
||||
isOpen={isFormOpen}
|
||||
onClose={handleCloseForm}
|
||||
onSave={handleSaveActivity}
|
||||
activity={selectedActivity}
|
||||
mode={formMode}
|
||||
/>
|
||||
|
||||
<ActivityDetails
|
||||
isOpen={isDetailsOpen}
|
||||
onClose={handleCloseDetails}
|
||||
onEdit={handleEditFromDetails}
|
||||
activity={selectedActivity}
|
||||
/>
|
||||
</Container>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue