Auto commit: 2026-02-05T22:10:08.709Z
This commit is contained in:
parent
0159013c7e
commit
e6fa05f94e
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,3 +1,24 @@
|
||||
from django.contrib import admin
|
||||
from .models import Firma, Fatura, FaturaKalemi
|
||||
|
||||
# Register your models here.
|
||||
@admin.register(Firma)
|
||||
class FirmaAdmin(admin.ModelAdmin):
|
||||
list_display = ('ad', 'vergi_no', 'olusturulma_tarihi')
|
||||
search_fields = ('ad', 'vergi_no')
|
||||
|
||||
class FaturaKalemiInline(admin.TabularInline):
|
||||
model = FaturaKalemi
|
||||
extra = 1
|
||||
|
||||
@admin.register(Fatura)
|
||||
class FaturaAdmin(admin.ModelAdmin):
|
||||
list_display = ('fatura_no', 'firma', 'tarih', 'genel_toplam', 'islenmis')
|
||||
list_filter = ('islenmis', 'tarih', 'firma')
|
||||
search_fields = ('fatura_no', 'firma__ad')
|
||||
inlines = [FaturaKalemiInline]
|
||||
|
||||
@admin.register(FaturaKalemi)
|
||||
class FaturaKalemiAdmin(admin.ModelAdmin):
|
||||
list_display = ('urun_adi', 'fatura', 'adet', 'toplam_tutar')
|
||||
list_filter = ('fatura__firma',)
|
||||
search_fields = ('urun_adi', 'fatura__fatura_no')
|
||||
71
core/migrations/0001_initial.py
Normal file
71
core/migrations/0001_initial.py
Normal file
@ -0,0 +1,71 @@
|
||||
# Generated by Django 5.2.7 on 2026-02-05 22:03
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Fatura',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('fatura_no', models.CharField(max_length=50, unique=True, verbose_name='Fatura No')),
|
||||
('tarih', models.DateField(verbose_name='Fatura Tarihi')),
|
||||
('ara_toplam', models.DecimalField(decimal_places=2, default=0, max_digits=12, verbose_name='Ara Toplam')),
|
||||
('kdv_toplam', models.DecimalField(decimal_places=2, default=0, max_digits=12, verbose_name='KDV Toplam')),
|
||||
('genel_toplam', models.DecimalField(decimal_places=2, default=0, max_digits=12, verbose_name='Genel Toplam')),
|
||||
('pdf_dosyasi', models.FileField(upload_to='faturalar/%Y/%m/', verbose_name='PDF Dosyası')),
|
||||
('islenmis', models.BooleanField(default=False, verbose_name='İşlendi mi?')),
|
||||
('olusturulma_tarihi', models.DateTimeField(auto_now_add=True)),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Fatura',
|
||||
'verbose_name_plural': 'Faturalar',
|
||||
'ordering': ['-tarih'],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Firma',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('ad', models.CharField(max_length=255, verbose_name='Firma Adı')),
|
||||
('vergi_no', models.CharField(max_length=20, unique=True, verbose_name='Vergi No / TC Kimlik No')),
|
||||
('mersis_no', models.CharField(blank=True, max_length=30, null=True, verbose_name='MERSİS No')),
|
||||
('adres', models.TextField(blank=True, null=True, verbose_name='Adres')),
|
||||
('olusturulma_tarihi', models.DateTimeField(auto_now_add=True)),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Firma',
|
||||
'verbose_name_plural': 'Firmalar',
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='FaturaKalemi',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('urun_adi', models.CharField(max_length=255, verbose_name='Ürün Adı')),
|
||||
('adet', models.DecimalField(decimal_places=2, default=1, max_digits=10, verbose_name='Adet')),
|
||||
('birim_fiyat', models.DecimalField(decimal_places=2, max_digits=12, verbose_name='Birim Fiyat')),
|
||||
('kdv_orani', models.DecimalField(decimal_places=2, default=20, max_digits=5, verbose_name='KDV Oranı (%)')),
|
||||
('kdv_tutari', models.DecimalField(decimal_places=2, max_digits=12, verbose_name='KDV Tutarı')),
|
||||
('toplam_tutar', models.DecimalField(decimal_places=2, max_digits=12, verbose_name='Toplam Tutar')),
|
||||
('fatura', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='kalemler', to='core.fatura', verbose_name='Fatura')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Fatura Kalemi',
|
||||
'verbose_name_plural': 'Fatura Kalemleri',
|
||||
},
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='fatura',
|
||||
name='firma',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='faturalar', to='core.firma', verbose_name='Firma'),
|
||||
),
|
||||
]
|
||||
BIN
core/migrations/__pycache__/0001_initial.cpython-311.pyc
Normal file
BIN
core/migrations/__pycache__/0001_initial.cpython-311.pyc
Normal file
Binary file not shown.
@ -1,3 +1,50 @@
|
||||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
class Firma(models.Model):
|
||||
ad = models.CharField(max_length=255, verbose_name="Firma Adı")
|
||||
vergi_no = models.CharField(max_length=20, unique=True, verbose_name="Vergi No / TC Kimlik No")
|
||||
mersis_no = models.CharField(max_length=30, blank=True, null=True, verbose_name="MERSİS No")
|
||||
adres = models.TextField(blank=True, null=True, verbose_name="Adres")
|
||||
olusturulma_tarihi = models.DateTimeField(auto_now_add=True)
|
||||
|
||||
def __str__(self):
|
||||
return self.ad
|
||||
|
||||
class Meta:
|
||||
verbose_name = "Firma"
|
||||
verbose_name_plural = "Firmalar"
|
||||
|
||||
class Fatura(models.Model):
|
||||
firma = models.ForeignKey(Firma, on_delete=models.CASCADE, related_name="faturalar", verbose_name="Firma")
|
||||
fatura_no = models.CharField(max_length=50, unique=True, verbose_name="Fatura No")
|
||||
tarih = models.DateField(verbose_name="Fatura Tarihi")
|
||||
ara_toplam = models.DecimalField(max_digits=12, decimal_places=2, default=0, verbose_name="Ara Toplam")
|
||||
kdv_toplam = models.DecimalField(max_digits=12, decimal_places=2, default=0, verbose_name="KDV Toplam")
|
||||
genel_toplam = models.DecimalField(max_digits=12, decimal_places=2, default=0, verbose_name="Genel Toplam")
|
||||
pdf_dosyasi = models.FileField(upload_to="faturalar/%Y/%m/", verbose_name="PDF Dosyası")
|
||||
islenmis = models.BooleanField(default=False, verbose_name="İşlendi mi?")
|
||||
olusturulma_tarihi = models.DateTimeField(auto_now_add=True)
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.fatura_no} - {self.firma.ad}"
|
||||
|
||||
class Meta:
|
||||
verbose_name = "Fatura"
|
||||
verbose_name_plural = "Faturalar"
|
||||
ordering = ['-tarih']
|
||||
|
||||
class FaturaKalemi(models.Model):
|
||||
fatura = models.ForeignKey(Fatura, on_delete=models.CASCADE, related_name="kalemler", verbose_name="Fatura")
|
||||
urun_adi = models.CharField(max_length=255, verbose_name="Ürün Adı")
|
||||
adet = models.DecimalField(max_digits=10, decimal_places=2, default=1, verbose_name="Adet")
|
||||
birim_fiyat = models.DecimalField(max_digits=12, decimal_places=2, verbose_name="Birim Fiyat")
|
||||
kdv_orani = models.DecimalField(max_digits=5, decimal_places=2, default=20, verbose_name="KDV Oranı (%)")
|
||||
kdv_tutari = models.DecimalField(max_digits=12, decimal_places=2, verbose_name="KDV Tutarı")
|
||||
toplam_tutar = models.DecimalField(max_digits=12, decimal_places=2, verbose_name="Toplam Tutar")
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.urun_adi} ({self.fatura.fatura_no})"
|
||||
|
||||
class Meta:
|
||||
verbose_name = "Fatura Kalemi"
|
||||
verbose_name_plural = "Fatura Kalemleri"
|
||||
|
||||
@ -1,25 +1,173 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<html lang="tr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>{% block title %}Knowledge Base{% endblock %}</title>
|
||||
{% if project_description %}
|
||||
<meta name="description" content="{{ project_description }}">
|
||||
<meta property="og:description" content="{{ project_description }}">
|
||||
<meta property="twitter:description" content="{{ project_description }}">
|
||||
{% endif %}
|
||||
{% if project_image_url %}
|
||||
<meta property="og:image" content="{{ project_image_url }}">
|
||||
<meta property="twitter:image" content="{{ project_image_url }}">
|
||||
{% endif %}
|
||||
{% load static %}
|
||||
<link rel="stylesheet" href="{% static 'css/custom.css' %}?v={{ deployment_timestamp }}">
|
||||
{% block head %}{% endblock %}
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{% block title %}Fatura Yönetim Sistemi{% endblock %}</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
|
||||
{% load static %}
|
||||
<style>
|
||||
:root {
|
||||
--primary-color: #2563eb;
|
||||
--sidebar-bg: #1e293b;
|
||||
--sidebar-hover: #334155;
|
||||
--bg-body: #f8fafc;
|
||||
--text-main: #1e293b;
|
||||
--text-muted: #64748b;
|
||||
}
|
||||
body {
|
||||
font-family: 'Inter', sans-serif;
|
||||
background-color: var(--bg-body);
|
||||
color: var(--text-main);
|
||||
overflow-x: hidden;
|
||||
}
|
||||
#wrapper {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
align-items: stretch;
|
||||
}
|
||||
#sidebar {
|
||||
min-width: 260px;
|
||||
max-width: 260px;
|
||||
background: var(--sidebar-bg);
|
||||
color: #fff;
|
||||
transition: all 0.3s;
|
||||
min-height: 100vh;
|
||||
z-index: 1000;
|
||||
}
|
||||
#sidebar .sidebar-header {
|
||||
padding: 20px;
|
||||
background: rgba(0,0,0,0.1);
|
||||
}
|
||||
#sidebar ul.components {
|
||||
padding: 20px 0;
|
||||
}
|
||||
#sidebar ul li {
|
||||
padding: 0 10px;
|
||||
}
|
||||
#sidebar ul li a {
|
||||
padding: 12px 15px;
|
||||
display: block;
|
||||
color: #cbd5e1;
|
||||
text-decoration: none;
|
||||
border-radius: 8px;
|
||||
margin-bottom: 5px;
|
||||
font-weight: 500;
|
||||
transition: 0.2s;
|
||||
}
|
||||
#sidebar ul li a:hover, #sidebar ul li.active > a {
|
||||
color: #fff;
|
||||
background: var(--sidebar-hover);
|
||||
}
|
||||
#sidebar ul li a i {
|
||||
margin-right: 10px;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
#content {
|
||||
width: 100%;
|
||||
padding: 30px;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
.navbar {
|
||||
background: #fff;
|
||||
border-bottom: 1px solid #e2e8f0;
|
||||
margin-bottom: 30px;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 1px 3px rgba(0,0,0,0.05);
|
||||
}
|
||||
.card {
|
||||
border: none;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
.stat-card {
|
||||
padding: 24px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.stat-icon {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border-radius: 12px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 24px;
|
||||
margin-right: 16px;
|
||||
}
|
||||
.bg-primary-soft { background-color: #dbeafe; color: #2563eb; }
|
||||
.bg-success-soft { background-color: #d1fae5; color: #10b981; }
|
||||
.bg-warning-soft { background-color: #fef3c7; color: #f59e0b; }
|
||||
|
||||
.table thead th {
|
||||
background-color: #f8fafc;
|
||||
border-bottom: 2px solid #e2e8f0;
|
||||
text-transform: uppercase;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.05em;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
</style>
|
||||
{% block extra_css %}{% endblock %}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
{% block content %}{% endblock %}
|
||||
</body>
|
||||
<div id="wrapper">
|
||||
<!-- Sidebar -->
|
||||
<nav id="sidebar">
|
||||
<div class="sidebar-header">
|
||||
<h4 class="mb-0 fw-bold"><i class="bi bi-receipt-cutoff me-2"></i>FaturaYol</h4>
|
||||
</div>
|
||||
|
||||
</html>
|
||||
<ul class="list-unstyled components">
|
||||
<li class="{% if active_menu == 'dashboard' %}active{% endif %}">
|
||||
<a href="{% url 'home' %}"><i class="bi bi-speedometer2"></i> Gösterge Paneli</a>
|
||||
</li>
|
||||
<li class="{% if active_menu == 'archive' %}active{% endif %}">
|
||||
<a href="#"><i class="bi bi-archive"></i> Fatura Arşivi</a>
|
||||
</li>
|
||||
<li class="{% if active_menu == 'reports' %}active{% endif %}">
|
||||
<a href="#"><i class="bi bi-graph-up"></i> İstatistik & Raporlar</a>
|
||||
</li>
|
||||
<li class="mt-4 px-3">
|
||||
<span class="text-muted small text-uppercase fw-bold">Yönetim</span>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/admin/"><i class="bi bi-gear"></i> Sistem Ayarları</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<!-- Page Content -->
|
||||
<div id="content">
|
||||
<nav class="navbar navbar-expand-lg">
|
||||
<div class="container-fluid">
|
||||
<span class="navbar-text fw-semibold">Hoş geldiniz!</span>
|
||||
<div class="ms-auto d-flex align-items-center">
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-link text-dark text-decoration-none dropdown-toggle" type="button" data-bs-toggle="dropdown">
|
||||
<i class="bi bi-person-circle me-1"></i> Yönetici
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><a class="dropdown-item" href="#">Profil</a></li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li><a class="dropdown-item" href="#">Çıkış Yap</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||
{% block extra_js %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
@ -1,145 +1,137 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}{{ project_name }}{% endblock %}
|
||||
|
||||
{% block head %}
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
|
||||
<style>
|
||||
:root {
|
||||
--bg-color-start: #6a11cb;
|
||||
--bg-color-end: #2575fc;
|
||||
--text-color: #ffffff;
|
||||
--card-bg-color: rgba(255, 255, 255, 0.01);
|
||||
--card-border-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: 'Inter', sans-serif;
|
||||
background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end));
|
||||
color: var(--text-color);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-height: 100vh;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
body::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'><path d='M-10 10L110 10M10 -10L10 110' stroke-width='1' stroke='rgba(255,255,255,0.05)'/></svg>");
|
||||
animation: bg-pan 20s linear infinite;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
@keyframes bg-pan {
|
||||
0% {
|
||||
background-position: 0% 0%;
|
||||
}
|
||||
|
||||
100% {
|
||||
background-position: 100% 100%;
|
||||
}
|
||||
}
|
||||
|
||||
main {
|
||||
padding: 2rem;
|
||||
}
|
||||
|
||||
.card {
|
||||
background: var(--card-bg-color);
|
||||
border: 1px solid var(--card-border-color);
|
||||
border-radius: 16px;
|
||||
padding: 2.5rem 2rem;
|
||||
backdrop-filter: blur(20px);
|
||||
-webkit-backdrop-filter: blur(20px);
|
||||
box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: clamp(2.2rem, 3vw + 1.2rem, 3.2rem);
|
||||
font-weight: 700;
|
||||
margin: 0 0 1.2rem;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 0.5rem 0;
|
||||
font-size: 1.1rem;
|
||||
opacity: 0.92;
|
||||
}
|
||||
|
||||
.loader {
|
||||
margin: 1.5rem auto;
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
border: 4px solid rgba(255, 255, 255, 0.25);
|
||||
border-top-color: #fff;
|
||||
border-radius: 50%;
|
||||
animation: spin 1s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.runtime code {
|
||||
background: rgba(0, 0, 0, 0.25);
|
||||
padding: 0.15rem 0.45rem;
|
||||
border-radius: 4px;
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||
}
|
||||
|
||||
.sr-only {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
padding: 0;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
border: 0;
|
||||
}
|
||||
|
||||
footer {
|
||||
position: absolute;
|
||||
bottom: 1rem;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-size: 0.85rem;
|
||||
opacity: 0.75;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
{% block title %}Gösterge Paneli | FaturaYol{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<main>
|
||||
<div class="card">
|
||||
<h1>Analyzing your requirements and generating your app…</h1>
|
||||
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes">
|
||||
<span class="sr-only">Loading…</span>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12 mb-4">
|
||||
<h2 class="fw-bold">Gösterge Paneli</h2>
|
||||
<p class="text-muted">Fatura yönetim sistemine genel bakış.</p>
|
||||
</div>
|
||||
</div>
|
||||
<p class="hint">AppWizzy AI is collecting your requirements and applying the first changes.</p>
|
||||
<p class="hint">This page will refresh automatically as the plan is implemented.</p>
|
||||
<p class="runtime">
|
||||
Runtime: Django <code>{{ django_version }}</code> · Python <code>{{ python_version }}</code>
|
||||
— UTC <code>{{ current_time|date:"Y-m-d H:i:s" }}</code>
|
||||
</p>
|
||||
</div>
|
||||
</main>
|
||||
<footer>
|
||||
Page updated: {{ current_time|date:"Y-m-d H:i:s" }} (UTC)
|
||||
</footer>
|
||||
{% endblock %}
|
||||
|
||||
<!-- Stats Cards -->
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="card stat-card">
|
||||
<div class="stat-icon bg-primary-soft">
|
||||
<i class="bi bi-building"></i>
|
||||
</div>
|
||||
<div>
|
||||
<h6 class="text-muted mb-1">Toplam Firma</h6>
|
||||
<h3 class="fw-bold mb-0">{{ toplam_firma }}</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="card stat-card">
|
||||
<div class="stat-icon bg-success-soft">
|
||||
<i class="bi bi-file-earmark-text"></i>
|
||||
</div>
|
||||
<div>
|
||||
<h6 class="text-muted mb-1">Toplam Fatura</h6>
|
||||
<h3 class="fw-bold mb-0">{{ toplam_fatura }}</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="card stat-card">
|
||||
<div class="stat-icon bg-warning-soft">
|
||||
<i class="bi bi-currency-dollar"></i>
|
||||
</div>
|
||||
<div>
|
||||
<h6 class="text-muted mb-1">Toplam Harcama</h6>
|
||||
<h3 class="fw-bold mb-0">₺{{ toplam_harcama|floatformat:2 }}</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-4">
|
||||
<!-- Recent Invoices Table -->
|
||||
<div class="col-lg-8">
|
||||
<div class="card">
|
||||
<div class="card-header bg-white py-3 d-flex align-items-center justify-content-between">
|
||||
<h5 class="mb-0 fw-bold">Son Eklenen Faturalar</h5>
|
||||
<a href="#" class="btn btn-sm btn-outline-primary">Tümünü Gör</a>
|
||||
</div>
|
||||
<div class="card-body p-0">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="ps-4">Fatura No</th>
|
||||
<th>Firma</th>
|
||||
<th>Tarih</th>
|
||||
<th>Toplam</th>
|
||||
<th>Durum</th>
|
||||
<th class="text-end pe-4">İşlem</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for fatura in son_faturalar %}
|
||||
<tr>
|
||||
<td class="ps-4 fw-medium">{{ fatura.fatura_no }}</td>
|
||||
<td>{{ fatura.firma.ad }}</td>
|
||||
<td>{{ fatura.tarih|date:"d.m.Y" }}</td>
|
||||
<td class="fw-bold">₺{{ fatura.genel_toplam }}</td>
|
||||
<td>
|
||||
{% if fatura.islenmis %}
|
||||
<span class="badge bg-success-soft text-success">İşlendi</span>
|
||||
{% else %}
|
||||
<span class="badge bg-warning-soft text-warning">Bekliyor</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="text-end pe-4">
|
||||
<button class="btn btn-sm btn-light"><i class="bi bi-eye"></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr>
|
||||
<td colspan="6" class="text-center py-5 text-muted">Henüz fatura eklenmemiş.</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Quick Actions -->
|
||||
<div class="col-lg-4">
|
||||
<div class="card">
|
||||
<div class="card-header bg-white py-3">
|
||||
<h5 class="mb-0 fw-bold">Hızlı İşlemler</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="d-grid gap-2">
|
||||
<button class="btn btn-primary text-start py-3 px-4 rounded-3 d-flex align-items-center">
|
||||
<i class="bi bi-plus-circle-fill me-3 fs-4"></i>
|
||||
<div>
|
||||
<div class="fw-bold">Fatura Yükle</div>
|
||||
<div class="small opacity-75">PDF dosyasını sürükle bırak</div>
|
||||
</div>
|
||||
</button>
|
||||
<button class="btn btn-outline-secondary text-start py-3 px-4 rounded-3 d-flex align-items-center">
|
||||
<i class="bi bi-folder-plus me-3 fs-4"></i>
|
||||
<div>
|
||||
<div class="fw-bold">Klasör Tara</div>
|
||||
<div class="small opacity-75">Yerel dizindeki faturaları bul</div>
|
||||
</div>
|
||||
</button>
|
||||
<button class="btn btn-outline-secondary text-start py-3 px-4 rounded-3 d-flex align-items-center">
|
||||
<i class="bi bi-building-add me-3 fs-4"></i>
|
||||
<div>
|
||||
<div class="fw-bold">Yeni Firma Ekle</div>
|
||||
<div class="small opacity-75">Firma bilgilerini manuel tanımla</div>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
@ -1,25 +1,19 @@
|
||||
import os
|
||||
import platform
|
||||
|
||||
from django import get_version as django_version
|
||||
from django.shortcuts import render
|
||||
from django.utils import timezone
|
||||
|
||||
from django.db.models import Sum, Count
|
||||
from .models import Firma, Fatura
|
||||
|
||||
def home(request):
|
||||
"""Render the landing screen with loader and environment details."""
|
||||
host_name = request.get_host().lower()
|
||||
agent_brand = "AppWizzy" if host_name == "appwizzy.com" else "Flatlogic"
|
||||
now = timezone.now()
|
||||
"""Fatura Yönetimi Gösterge Paneli."""
|
||||
toplam_firma = Firma.objects.count()
|
||||
toplam_fatura = Fatura.objects.count()
|
||||
toplam_harcama = Fatura.objects.aggregate(Sum('genel_toplam'))['genel_toplam__sum'] or 0
|
||||
son_faturalar = Fatura.objects.select_related('firma').all()[:10]
|
||||
|
||||
context = {
|
||||
"project_name": "New Style",
|
||||
"agent_brand": agent_brand,
|
||||
"django_version": django_version(),
|
||||
"python_version": platform.python_version(),
|
||||
"current_time": now,
|
||||
"host_name": host_name,
|
||||
"project_description": os.getenv("PROJECT_DESCRIPTION", ""),
|
||||
"project_image_url": os.getenv("PROJECT_IMAGE_URL", ""),
|
||||
"toplam_firma": toplam_firma,
|
||||
"toplam_fatura": toplam_fatura,
|
||||
"toplam_harcama": toplam_harcama,
|
||||
"son_faturalar": son_faturalar,
|
||||
"active_menu": "dashboard"
|
||||
}
|
||||
return render(request, "core/index.html", context)
|
||||
return render(request, "core/index.html", context)
|
||||
Loading…
x
Reference in New Issue
Block a user