Skip to content
Permalink
Browse files
updated reallocation
  • Loading branch information
ebohm committed Oct 21, 2020
1 parent 5cb1253 commit 0d3c54f5c40d093de343a6e0b13471393198196a
Show file tree
Hide file tree
Showing 11 changed files with 81 additions and 165 deletions.
BIN +4 KB (100%) EDMS/db.sqlite3
Binary file not shown.
@@ -0,0 +1,18 @@
# Generated by Django 3.1.2 on 2020-10-20 15:37

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('shoppingCart', '0011_auto_20201019_1709'),
]

operations = [
migrations.RenameField(
model_name='storeorder',
old_name='date_created',
new_name='date',
),
]
@@ -0,0 +1,18 @@
# Generated by Django 3.1.2 on 2020-10-20 16:06

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('shoppingCart', '0012_auto_20201020_1637'),
]

operations = [
migrations.AlterField(
model_name='storeorder',
name='date',
field=models.DateTimeField(),
),
]
@@ -1,5 +1,6 @@
from django.db import models
from django.contrib.auth.models import User
from datetime import timezone, datetime

# Create your models here.

@@ -52,7 +53,8 @@ class StoreOrder(models.Model):
product = models.ForeignKey(Product, on_delete=models.SET_NULL, blank=True, null=True)
status = models.CharField(max_length=200, null=True, choices=STATUS)
quantity = models.IntegerField(default=0, null=True, blank=True)
date_created = models.DateTimeField(auto_now_add=True, null=True, blank=True)
date = models.DateTimeField(auto_now=0)


def __str__(self):
return self.product.name
@@ -8,7 +8,7 @@
<title></title>
</head>
<body>

</body>
</html>
{% endblock content %}

This file was deleted.

This file was deleted.

@@ -3,7 +3,7 @@
<div class="row">
<div class="col">
<div class="col-md">
<div class="card text-white bg-secondary mb-3" id="total-orders">
<div class="card text-white bg-secondary mb-3" id="total-stores">
<div class="card-header">
<h5 class="card-title">Total Stores Available</h5>
</div>
@@ -16,12 +16,12 @@

<div class="col">
<div class="col-md">
<div class="card text-white bg-success mb-3" id="orders-delivered">
<div class="card text-white bg-success mb-3" id="storeorders-delivered">
<div class="card-header">
<h5 class="card-title">Orders Delivered To Stores</h5>
</div>
<div class="card-body">
<h5 class="card-title">{{delivered}}</h5>
<h3 class="card-title">{{delivered}}</h3>
</div>
</div>
</div>

This file was deleted.

@@ -17,63 +17,59 @@

{% include 'shoppingCart/status_row.html' %}

<br>

<div class="card text-center">
<div class="row">
<div class="col-md-5">
<div class="col-md-4">

<hr>

<div class="card card-body">
<a class="card text-white bg-dark mb-3" href="#">Create Store</a>
<table class="table table-sm">
<table class="table table-striped table-hover table-condensed table-sm">

<tr>
<th></th>
<th>Name</th>
<th>Location</th>
<th>Available</th>
<th>Sent </th>
</tr>
{% for store in store %}

<tr>
<td></td>
<td><p class="text-sm-left">{{store}}</p></td>
<td><p class="text-sm-left">{{store.location}}</p></td>
<td>{{store.available}}</td>
<td>{{store.capacity}}</td>
<td><small><p class="text-sm-left">{{store}}</p></small></td>
<td><small><p class="text-sm-left">{{store.location}}</small></h6></td>
</tr>

{% endfor %}
</table>
</div>
</div>

<div class="col-md-7">
<hr>


<div class="col-md-8">

<div class="card card-body">
<a class="card text-white bg-success mb-3"href="{% url 'allocate' %}">Allocate Orders</a>
<table class="table table-sm">
<table id="dtVerticalScrollExample" class="table table-condensed table-striped table-bordered table-sm" cellspacing="0"
width="10%">
<tr>
<th>Stores</th>
<th>Products</th>
<th>Orders</th>
<th>Quantity</th>
<th>Status</th>
<th>Allocated</th>
<th>Update</th>
<th>Remove</th>

<th>STORE ORDER</th>
<th>STORE</th>
<th>QUANTITY</th>
<th>DATE</th>
<th>STATUS</th>
</tr>
{% for storeorder in storeorder %}
{% for i in storeorder %}

<tr>
<td>{{store}}</td>
<td>{{store.product}}</td>
<td>{{store.storeorder}}</td>
<td>{{store.quantity}}</td>
<td>{{store.status}}</td>
<td>{{store.date_created}}</td>
<td><a class="btn btn-sm btn-warning" href="#">Update</a></td>
<td><a class="btn btn-sm btn-danger" href="#">Cancel</a></td>
<td><p class="text-sm-left">{{i}}</p></td>
<td><p class="text-sm-left">{{i.store}}</p></td>
<td><p class="text-sm-left">{{i.quantity}}</p></td>
<td><p class="text-sm-left">{{i.date}}</p></td>
<td><p class="text-sm-left">{{i.status}}</p></td>
<td><p class="text-sm-left">{{i.date_created}}</p></td>

</tr>
{% endfor %}
</table>
@@ -82,7 +78,11 @@
</div>
</div>
{% endblock content %}
</div>




</div>

</body>

@@ -47,11 +47,15 @@ def updateItem(request):
print('ProductID: ', productId, 'Action:',action)
return JsonResponse('item added', safe=False)

def store_dashBoard(request):
def store_dashBoard(request):
store = Store.objects.all()
total_stores = store.count()
products = Product.objects.all()
delivered = StoreOrder.objects.filter(status='Delivered').count()

context = {'store': store, 'total_stores':total_stores, }
storeorder = StoreOrder.objects.all()

context = {'store': store, 'total_stores':total_stores,'products':products, 'storeorder':storeorder, 'delivered':delivered, }
return render(request, 'ShoppingCart/store_dashBoard.html', context)

def products(request):

0 comments on commit 0d3c54f

Please sign in to comment.