mirror of
https://github.com/welton89/RRBEC.git
synced 2026-04-05 13:35:42 +00:00
feat: create app payments
This commit is contained in:
0
gestaoRaul/payments/__init__.py
Normal file
0
gestaoRaul/payments/__init__.py
Normal file
3
gestaoRaul/payments/admin.py
Normal file
3
gestaoRaul/payments/admin.py
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
from django.contrib import admin
|
||||||
|
|
||||||
|
# Register your models here.
|
||||||
6
gestaoRaul/payments/apps.py
Normal file
6
gestaoRaul/payments/apps.py
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
|
class PaymentsConfig(AppConfig):
|
||||||
|
default_auto_field = 'django.db.models.BigAutoField'
|
||||||
|
name = 'payments'
|
||||||
0
gestaoRaul/payments/migrations/__init__.py
Normal file
0
gestaoRaul/payments/migrations/__init__.py
Normal file
18
gestaoRaul/payments/models.py
Normal file
18
gestaoRaul/payments/models.py
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
from django.db import models
|
||||||
|
from typePay.models import TypePay
|
||||||
|
from comandas.models import Comanda
|
||||||
|
from clients.models import Client
|
||||||
|
|
||||||
|
|
||||||
|
class Payments(models.Model):
|
||||||
|
id = models.AutoField(primary_key=True)
|
||||||
|
value = models.DecimalField(max_digits=10, decimal_places=2)
|
||||||
|
type_pay = models.ForeignKey(TypePay, on_delete=models.PROTECT)
|
||||||
|
comanda = models.ForeignKey(Comanda, on_delete=models.PROTECT)
|
||||||
|
client = models.ForeignKey(Client, null=True , on_delete=models.PROTECT)
|
||||||
|
description = models.CharField(max_length=255)
|
||||||
|
datetime = models.DateTimeField(auto_now_add=True)
|
||||||
|
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return self.value
|
||||||
3
gestaoRaul/payments/tests.py
Normal file
3
gestaoRaul/payments/tests.py
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
from django.test import TestCase
|
||||||
|
|
||||||
|
# Create your tests here.
|
||||||
3
gestaoRaul/payments/views.py
Normal file
3
gestaoRaul/payments/views.py
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
from django.shortcuts import render
|
||||||
|
|
||||||
|
# Create your views here.
|
||||||
Reference in New Issue
Block a user