payments
parent
d986fdf232
commit
f6c78a20a3
@ -0,0 +1,3 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
@ -0,0 +1,6 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class PaymentsConfig(AppConfig):
|
||||
default_auto_field = "django.db.models.BigAutoField"
|
||||
name = "payments"
|
||||
@ -0,0 +1,25 @@
|
||||
from django.contrib.auth.models import User
|
||||
from django.db import models
|
||||
|
||||
from accounts.models import DepotUser
|
||||
from common.models import CompanyModel
|
||||
from containers.models import Container
|
||||
|
||||
|
||||
# Create your models here.
|
||||
class Payment(models.Model):
|
||||
invoice_number = models.CharField(max_length=50, unique=True)
|
||||
total_amount = models.DecimalField(max_digits=10, decimal_places=2)
|
||||
company = models.ForeignKey(CompanyModel, related_name='payment_company', on_delete=models.CASCADE)
|
||||
created_on = models.DateTimeField(auto_now_add=True)
|
||||
created_by = models.ForeignKey(DepotUser, related_name='payments_user', on_delete=models.CASCADE)
|
||||
paid = models.BooleanField(default=False)
|
||||
paid_on = models.DateTimeField(auto_now_add=True)
|
||||
paid_info = models.TextField(blank=True, null=True)
|
||||
description = models.CharField(max_length=255, blank=True, null=True)
|
||||
|
||||
class PaymentItem(models.Model):
|
||||
payment = models.ForeignKey(Payment, related_name='payment_items', on_delete=models.CASCADE)
|
||||
container = models.ForeignKey(Container, related_name='payment_containers', on_delete=models.CASCADE)
|
||||
amount = models.DecimalField(max_digits=10, decimal_places=2)
|
||||
|
||||
@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
@ -0,0 +1,3 @@
|
||||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
@ -0,0 +1,10 @@
|
||||
{% extends 'employee-base.html' %}
|
||||
{% load static %}
|
||||
|
||||
{% block content %}
|
||||
<form id="lineForm" method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<input type="submit" value="Create line">
|
||||
</form>
|
||||
{% endblock content %}
|
||||
@ -0,0 +1,31 @@
|
||||
{% extends 'list-crud.html' %}
|
||||
{% load static %}
|
||||
|
||||
{% block table_header %}
|
||||
<th style="display: none;">Select</th>
|
||||
<th>Company name</th>
|
||||
<th>Line name</th>
|
||||
<th>Short name</th>
|
||||
<th>Description</th>
|
||||
{% endblock table_header %}
|
||||
|
||||
{% block table_data %}
|
||||
<td>{{ object.company }}</td>
|
||||
<td>{{ object.name }}</td>
|
||||
<td>{{ object.short_name }}</td>
|
||||
<td>{{ object.description }}</td>
|
||||
{% endblock %}
|
||||
|
||||
{% block buttons %}
|
||||
<a href="{% url 'client_line_create' %}" class="btn btn-primary">Create line</a>
|
||||
<a href="#" id="editBtn" data-url="{% url 'client_line_update' pk=0 %}" class="btn btn-primary" disabled>Edit Preinfo</a>
|
||||
<button id="deleteButton" class="btn btn-danger">Delete Preinfo</button>
|
||||
{% endblock buttons %}
|
||||
|
||||
{% block create_modal_header %}
|
||||
<h2>Create line</h2>
|
||||
{% endblock %}
|
||||
|
||||
{% block modal_header %}
|
||||
<h2>edit line</h2>
|
||||
{% endblock modal_header %}
|
||||
@ -0,0 +1,10 @@
|
||||
{% extends 'employee-base.html' %}
|
||||
{% load static %}
|
||||
|
||||
{% block content %}
|
||||
<form id="lineForm" method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<input type="submit" value="Update line">
|
||||
</form>
|
||||
{% endblock content %}
|
||||
@ -0,0 +1,10 @@
|
||||
{% extends 'employee-base.html' %}
|
||||
{% load static %}
|
||||
|
||||
{% block content %}
|
||||
<form id="companyForm" method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<input type="submit" value="Create Company">
|
||||
</form>
|
||||
{% endblock content %}
|
||||
@ -0,0 +1,29 @@
|
||||
{% extends 'list-crud.html' %}
|
||||
{% load static %}
|
||||
|
||||
{% block table_header %}
|
||||
<th style="display: none;">Select</th>
|
||||
<th>Company name</th>
|
||||
<th>Company short name</th>
|
||||
<th>Description</th>
|
||||
{% endblock table_header %}
|
||||
|
||||
{% block table_data %}
|
||||
<td>{{ object.name }}</td>
|
||||
<td>{{ object.short_name }}</td>
|
||||
<td>{{ object.description }}</td>
|
||||
{% endblock %}
|
||||
|
||||
{% block buttons %}
|
||||
<a href="{% url 'company_create' %}" class="btn btn-primary">Create company</a>
|
||||
<a href="#" id="editBtn" data-url="{% url 'company_update' pk=0 %}" class="btn btn-primary" disabled>Edit Preinfo</a>
|
||||
<button id="deleteButton" class="btn btn-danger">Delete Preinfo</button>
|
||||
{% endblock buttons %}
|
||||
|
||||
{% block create_modal_header %}
|
||||
<h2>Create company</h2>
|
||||
{% endblock %}
|
||||
|
||||
{% block modal_header %}
|
||||
<h2>edit company</h2>
|
||||
{% endblock modal_header %}
|
||||
@ -0,0 +1,10 @@
|
||||
{% extends 'employee-base.html' %}
|
||||
{% load static %}
|
||||
|
||||
{% block content %}
|
||||
<form id="companyForm" method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<input type="submit" value="Update Company">
|
||||
</form>
|
||||
{% endblock content %}
|
||||
@ -0,0 +1,10 @@
|
||||
{% extends 'client-base.html' %}
|
||||
{% load static %}
|
||||
|
||||
{% block content %}
|
||||
<form id="lineForm" method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<input type="submit" value="Create line">
|
||||
</form>
|
||||
{% endblock content %}
|
||||
@ -0,0 +1,29 @@
|
||||
{% extends 'list-crud.html' %}
|
||||
{% load static %}
|
||||
|
||||
{% block table_header %}
|
||||
<th style="display: none;">Select</th>
|
||||
<th>Line name</th>
|
||||
<th>Short name</th>
|
||||
<th>Description</th>
|
||||
{% endblock table_header %}
|
||||
|
||||
{% block table_data %}
|
||||
<td>{{ object.name }}</td>
|
||||
<td>{{ object.short_name }}</td>
|
||||
<td>{{ object.description }}</td>
|
||||
{% endblock %}
|
||||
|
||||
{% block buttons %}
|
||||
<a href="{% url 'client_line_create' %}" class="btn btn-primary">Create line</a>
|
||||
<a href="#" id="editBtn" data-url="{% url 'client_line_update' pk=0 %}" class="btn btn-primary" disabled>Edit Preinfo</a>
|
||||
<button id="deleteButton" class="btn btn-danger">Delete Preinfo</button>
|
||||
{% endblock buttons %}
|
||||
|
||||
{% block create_modal_header %}
|
||||
<h2>Create line</h2>
|
||||
{% endblock %}
|
||||
|
||||
{% block modal_header %}
|
||||
<h2>edit line</h2>
|
||||
{% endblock modal_header %}
|
||||
@ -0,0 +1,10 @@
|
||||
{% extends 'client-base.html' %}
|
||||
{% load static %}
|
||||
|
||||
{% block content %}
|
||||
<form id="lineForm" method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<input type="submit" value="Update line">
|
||||
</form>
|
||||
{% endblock content %}
|
||||
@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>$Title$</title>
|
||||
</head>
|
||||
<body>
|
||||
$END$
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>$Title$</title>
|
||||
</head>
|
||||
<body>
|
||||
$END$
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in New Issue