mirror of
https://github.com/Sosokker/Inventory-Management-System.git
synced 2025-12-18 23:24:05 +01:00
Update overview UI and sidebar UI
This commit is contained in:
parent
7053a03807
commit
2b2f8863bc
@ -109,7 +109,7 @@ AUTH_PASSWORD_VALIDATORS = [
|
|||||||
|
|
||||||
LANGUAGE_CODE = 'en-us'
|
LANGUAGE_CODE = 'en-us'
|
||||||
|
|
||||||
TIME_ZONE = 'UTC'
|
TIME_ZONE = 'Asia/Bangkok'
|
||||||
|
|
||||||
USE_I18N = True
|
USE_I18N = True
|
||||||
|
|
||||||
|
|||||||
@ -7,8 +7,9 @@ from django.contrib.auth.mixins import LoginRequiredMixin
|
|||||||
from django.contrib.auth.decorators import login_required
|
from django.contrib.auth.decorators import login_required
|
||||||
|
|
||||||
from inventory.models import Warehouse, Inventory, Item
|
from inventory.models import Warehouse, Inventory, Item
|
||||||
|
from transaction.models import Customer, Transfer, Order
|
||||||
from inventory.utils import stock_percentage_all, count_pending_supply
|
from inventory.utils import stock_percentage_all, count_pending_supply
|
||||||
from transaction.models import Customer
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
def Over(request):
|
def Over(request):
|
||||||
@ -24,6 +25,11 @@ class OverviewView(TemplateView, LoginRequiredMixin):
|
|||||||
context['customer_count'] = Customer.objects.count()
|
context['customer_count'] = Customer.objects.count()
|
||||||
context['stock_percentage'] = stock_percentage_all()
|
context['stock_percentage'] = stock_percentage_all()
|
||||||
context['pending_supply'] = count_pending_supply()
|
context['pending_supply'] = count_pending_supply()
|
||||||
|
context['inventory_list'] = Inventory.objects.all()
|
||||||
|
context['inventory_count'] = Inventory.objects.count()
|
||||||
|
context['item_count'] = Item.objects.count()
|
||||||
|
context['order_count'] = Order.objects.count()
|
||||||
|
context['transfer_count'] = Transfer.objects.count()
|
||||||
return context
|
return context
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,7 @@
|
|||||||
<div class="h5 mb-0 font-weight-bold text-gray-800">{{ warehouse_count }}</div>
|
<div class="h5 mb-0 font-weight-bold text-gray-800">{{ warehouse_count }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
<i class="fas fa-calendar fa-2x text-gray-300"></i>
|
<i class="fas fa-cube fa-2x text-gray-300"></i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -101,8 +101,81 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Inventory Count -->
|
||||||
|
<div class="col-xl-3 col-md-6 mb-4">
|
||||||
|
<div class="card border-left-success shadow h-100 py-2">
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="row no-gutters align-items-center">
|
||||||
|
<div class="col mr-2">
|
||||||
|
<div class="text-xs font-weight-bold text-success text-uppercase mb-1">
|
||||||
|
Inventory Count</div>
|
||||||
|
<div class="h5 mb-0 font-weight-bold text-gray-800">{{ inventory_count }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-auto">
|
||||||
|
<i class="fas fa-layer-group fa-2x text-gray-300"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Order Count -->
|
||||||
|
<div class="col-xl-3 col-md-6 mb-4">
|
||||||
|
<div class="card border-left-warning shadow h-100 py-2">
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="row no-gutters align-items-center">
|
||||||
|
<div class="col mr-2">
|
||||||
|
<div class="text-xs font-weight-bold text-warning text-uppercase mb-1">
|
||||||
|
Order Count</div>
|
||||||
|
<div class="h5 mb-0 font-weight-bold text-gray-800">{{ order_count }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-auto">
|
||||||
|
<i class="fas fa-pen fa-2x text-gray-300"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Item in Stock -->
|
||||||
|
<div class="col-xl-3 col-md-6 mb-4">
|
||||||
|
<div class="card border-left-info shadow h-100 py-2">
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="row no-gutters align-items-center">
|
||||||
|
<div class="col mr-2">
|
||||||
|
<div class="text-xs font-weight-bold text-info text-uppercase mb-1">
|
||||||
|
Item in Stock</div>
|
||||||
|
<div class="h5 mb-0 font-weight-bold text-gray-800">{{ item_count }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-auto">
|
||||||
|
<i class="fas fa-icons fa-2x text-gray-300"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Transfer Count -->
|
||||||
|
<div class="col-xl-3 col-md-6 mb-4">
|
||||||
|
<div class="card border-left-primary shadow h-100 py-2">
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="row no-gutters align-items-center">
|
||||||
|
<div class="col mr-2">
|
||||||
|
<div class="text-xs font-weight-bold text-primary text-uppercase mb-1">
|
||||||
|
Transfer Count</div>
|
||||||
|
<div class="h5 mb-0 font-weight-bold text-gray-800">{{ transfer_count }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-auto">
|
||||||
|
<i class="fas fa-paste fa-2x text-gray-300"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Stock -->
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<!-- Content Column -->
|
<!-- Content Column -->
|
||||||
@ -130,6 +203,36 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Inventory -->
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<!-- Content Column -->
|
||||||
|
<div class="col-lg mb-4">
|
||||||
|
|
||||||
|
<!-- Project Card Example -->
|
||||||
|
<div class="card shadow mb-4">
|
||||||
|
<div class="card-header py-3">
|
||||||
|
<h6 class="m-0 font-weight-bold text-primary">Inventory Stock Level</h6>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
{% if inventory_list|length != 0 %}
|
||||||
|
{% for inv in inventory_list %}
|
||||||
|
<h4 class="small font-weight-bold my-2">{{ inv.stock_identifier }} <span class="float-right">
|
||||||
|
{% if inv.stock_percentage == 100 %}Complete!{% else %}{{ inv.stock_percentage|floatformat:3 }}%{% endif %}
|
||||||
|
</span></h4>
|
||||||
|
<div class="progress">
|
||||||
|
<div class="progress-bar bg-success" role="progressbar" style="width: {{ inv.stock_percentage }}%" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100"></div>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
{% else %}
|
||||||
|
<h2>No Inventory Available!</h2>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
{% load tz %}
|
||||||
|
|
||||||
<!-- Sidebar -->
|
<!-- Sidebar -->
|
||||||
<ul class="navbar-nav bg-gradient-primary sidebar sidebar-dark accordion" id="accordionSidebar">
|
<ul class="navbar-nav bg-gradient-primary sidebar sidebar-dark accordion" id="accordionSidebar">
|
||||||
|
|
||||||
@ -30,7 +32,7 @@ Storage
|
|||||||
<!-- Nav Item - Warehouse -->
|
<!-- Nav Item - Warehouse -->
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href={% url "warehouse" %}>
|
<a class="nav-link" href={% url "warehouse" %}>
|
||||||
<i class="fas fa-fw fa-cog"></i>
|
<i class="fas fa-cube fa-cog"></i>
|
||||||
<span>Warehouse</span>
|
<span>Warehouse</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
@ -46,14 +48,14 @@ Manage
|
|||||||
<!-- Nav Item - Order -->
|
<!-- Nav Item - Order -->
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href={% url "customer-order" %}>
|
<a class="nav-link" href={% url "customer-order" %}>
|
||||||
<i class="fas fa-fw fa-chart-area"></i>
|
<i class="fas fa-pen"></i>
|
||||||
<span>Order</span></a>
|
<span>Order</span></a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<!-- Nav Item - Transfer -->
|
<!-- Nav Item - Transfer -->
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href={% url "transfer-list" %}>
|
<a class="nav-link" href={% url "transfer-list" %}>
|
||||||
<i class="fas fa-fw fa-table"></i>
|
<i class="fas fa-eye"></i>
|
||||||
<span>Transfer</span></a>
|
<span>Transfer</span></a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
@ -126,6 +128,8 @@ Manage
|
|||||||
</li>
|
</li>
|
||||||
|
|
||||||
<!-- Logout -->
|
<!-- Logout -->
|
||||||
|
<div class="topbar-divider d-none d-sm-block"></div>
|
||||||
|
|
||||||
<li class="nav-item dropdown no-arrow">
|
<li class="nav-item dropdown no-arrow">
|
||||||
<a class="nav-link dropdown-toggle" id="userDropdown" role="button" href={% url "logout" %}
|
<a class="nav-link dropdown-toggle" id="userDropdown" role="button" href={% url "logout" %}
|
||||||
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import datetime
|
from django.utils import timezone
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
|
||||||
@ -32,8 +32,8 @@ class Supply(models.Model):
|
|||||||
arrive_date = models.DateTimeField()
|
arrive_date = models.DateTimeField()
|
||||||
|
|
||||||
def pending_status(self) -> bool:
|
def pending_status(self) -> bool:
|
||||||
now = datetime.datetime.now()
|
now = timezone.now()
|
||||||
return self.arrive_date > now.date()
|
return self.arrive_date > now
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f"{self.supplier.name} - {self.item.name} - {self.quantity}"
|
return f"{self.supplier.name} - {self.item.name} - {self.quantity}"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user