first commit
This commit is contained in:
7
.gitignore
vendored
7
.gitignore
vendored
@@ -1,4 +1,9 @@
|
||||
# created by virtualenv automatically
|
||||
# created by virtualenv automatically
|
||||
.venv
|
||||
venv
|
||||
.idea
|
||||
db.sqlite3
|
||||
media
|
||||
.idea
|
||||
*/__pycache__
|
||||
static
|
||||
15
Base/Forms/FormsBankAccounts.py
Normal file
15
Base/Forms/FormsBankAccounts.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from django import forms
|
||||
from Base import models
|
||||
|
||||
class FormsBankAccount(forms.ModelForm):
|
||||
class Meta:
|
||||
model = models.BankAccount
|
||||
fields = ['name','description']
|
||||
widgets = {
|
||||
'name': forms.TextInput({'class':'form-control'}),
|
||||
'description': forms.Textarea({'class':'form-control','rows':3 , }),
|
||||
}
|
||||
labels={
|
||||
'name':'Nome',
|
||||
'description':'Descrição',
|
||||
}
|
||||
24
Base/Forms/FormsChartOfAccount.py
Normal file
24
Base/Forms/FormsChartOfAccount.py
Normal file
@@ -0,0 +1,24 @@
|
||||
from django import forms
|
||||
from Base import models
|
||||
|
||||
class FormsChartOfAccount(forms.ModelForm):
|
||||
class Meta:
|
||||
model = models.ChartOfAccount
|
||||
fields = [
|
||||
'name',
|
||||
'debit',
|
||||
'firm',
|
||||
'notes',
|
||||
]
|
||||
widgets = {
|
||||
'name': forms.TextInput({'class':'form-control'}),
|
||||
'debit': forms.CheckboxInput({'class':''}),
|
||||
'firm': forms.CheckboxInput({'class':''}),
|
||||
'notes': forms.Textarea({'class':'form-control','rows':3 , }),
|
||||
}
|
||||
labels={
|
||||
'name':'Nome',
|
||||
'debit':'Debito',
|
||||
'firm':'Firma',
|
||||
'notes':'Notas',
|
||||
}
|
||||
24
Base/Forms/FormsPayMethod.py
Normal file
24
Base/Forms/FormsPayMethod.py
Normal file
@@ -0,0 +1,24 @@
|
||||
from django import forms
|
||||
from Base import models
|
||||
|
||||
class FormsPayMethod(forms.ModelForm):
|
||||
class Meta:
|
||||
model = models.PayMethod
|
||||
fields = [
|
||||
'name',
|
||||
'bank',
|
||||
'percentage',
|
||||
'description',
|
||||
]
|
||||
widgets = {
|
||||
'name': forms.TextInput({'class':'form-control'}),
|
||||
'bank': forms.Select({'class': 'form-select'}),
|
||||
'percentage': forms.NumberInput(attrs={'step': 1}),
|
||||
'description': forms.Textarea({'class': 'form-control', 'rows': 3, }),
|
||||
}
|
||||
labels={
|
||||
'name':'Nome',
|
||||
'bank':'Banco',
|
||||
'percentage':'Percentual',
|
||||
'description':'Descrição',
|
||||
}
|
||||
17
Base/Forms/FormsProductList.py
Normal file
17
Base/Forms/FormsProductList.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from django import forms
|
||||
from Base import models
|
||||
|
||||
class FormsProductList(forms.ModelForm):
|
||||
class Meta:
|
||||
model = models.ProductList
|
||||
fields = ['name','value','description']
|
||||
widgets = {
|
||||
'name': forms.TextInput({'class':'form-control'}),
|
||||
'value': forms.NumberInput(attrs={'step': 1}),
|
||||
'description': forms.Textarea({'class':'form-control','rows':3 , }),
|
||||
}
|
||||
labels={
|
||||
'name':'Nome',
|
||||
'value':'Valor',
|
||||
'description':'Descrição',
|
||||
}
|
||||
24
Base/Forms/FormsProfessional.py
Normal file
24
Base/Forms/FormsProfessional.py
Normal file
@@ -0,0 +1,24 @@
|
||||
from django import forms
|
||||
from Base import models
|
||||
|
||||
class FormsProfessional(forms.ModelForm):
|
||||
class Meta:
|
||||
model = models.Professional
|
||||
fields = [
|
||||
'name',
|
||||
'percentage',
|
||||
'symbol',
|
||||
'user',
|
||||
]
|
||||
widgets = {
|
||||
'name': forms.TextInput({'class':'form-control'}),
|
||||
'percentage': forms.NumberInput(attrs={'step': 1 }),
|
||||
'symbol': forms.TextInput({'class': 'form-control'}),
|
||||
'user': forms.Select({'class':'form-control'}),
|
||||
}
|
||||
labels={
|
||||
'name':'Nome',
|
||||
'percentage':'Porcentagem',
|
||||
'symbol':'Simbolo',
|
||||
'user':'User',
|
||||
}
|
||||
17
Base/Forms/FormsServiceList.py
Normal file
17
Base/Forms/FormsServiceList.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from django import forms
|
||||
from Base import models
|
||||
|
||||
class FormsServiceList(forms.ModelForm):
|
||||
class Meta:
|
||||
model = models.ServiceList
|
||||
fields = ['name','value','description']
|
||||
widgets = {
|
||||
'name': forms.TextInput({'class':'form-control'}),
|
||||
'value': forms.NumberInput(attrs={'step': 1}),
|
||||
'description': forms.Textarea({'class':'form-control','rows':3 , }),
|
||||
}
|
||||
labels={
|
||||
'name':'Nome',
|
||||
'value':'Valor',
|
||||
'description':'Descrição',
|
||||
}
|
||||
BIN
Base/Forms/__pycache__/FormsBankAccounts.cpython-312.pyc
Normal file
BIN
Base/Forms/__pycache__/FormsBankAccounts.cpython-312.pyc
Normal file
Binary file not shown.
BIN
Base/Forms/__pycache__/FormsChartOfAccount.cpython-312.pyc
Normal file
BIN
Base/Forms/__pycache__/FormsChartOfAccount.cpython-312.pyc
Normal file
Binary file not shown.
BIN
Base/Forms/__pycache__/FormsPayMethod.cpython-312.pyc
Normal file
BIN
Base/Forms/__pycache__/FormsPayMethod.cpython-312.pyc
Normal file
Binary file not shown.
BIN
Base/Forms/__pycache__/FormsProductList.cpython-312.pyc
Normal file
BIN
Base/Forms/__pycache__/FormsProductList.cpython-312.pyc
Normal file
Binary file not shown.
BIN
Base/Forms/__pycache__/FormsProfessional.cpython-312.pyc
Normal file
BIN
Base/Forms/__pycache__/FormsProfessional.cpython-312.pyc
Normal file
Binary file not shown.
BIN
Base/Forms/__pycache__/FormsServiceList.cpython-312.pyc
Normal file
BIN
Base/Forms/__pycache__/FormsServiceList.cpython-312.pyc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
24
Base/Metrics/Dashboard/get_sum_of_product.py
Normal file
24
Base/Metrics/Dashboard/get_sum_of_product.py
Normal file
@@ -0,0 +1,24 @@
|
||||
from django.db.models import Sum
|
||||
from Base.models import ProductList
|
||||
from Movement.models import Product
|
||||
|
||||
def metric(Day):
|
||||
products = ProductList.objects.all()
|
||||
product_mov = Product.objects.filter(date=Day).values()
|
||||
product_report = {}
|
||||
for product in products:
|
||||
product_item = product_mov.filter(
|
||||
product__name=product.name,
|
||||
).aggregate(Sum('gross_value'))['gross_value__sum'] or 0
|
||||
product_cont = product_mov.filter(
|
||||
product__name=product.name,
|
||||
).aggregate(Sum('quantity'))['quantity__sum'] or 0
|
||||
product_report[product.name] = {
|
||||
'product_item':product_item,
|
||||
'product_cont':product_cont,
|
||||
}
|
||||
sum_of_product = sum(item['product_item'] for item in product_report.values()) or 0
|
||||
return {
|
||||
'product_report':product_report,
|
||||
'sum_of_product':sum_of_product,
|
||||
}
|
||||
19
Base/Metrics/Dashboard/get_sum_of_professional.py
Normal file
19
Base/Metrics/Dashboard/get_sum_of_professional.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# from django.utils import timezone
|
||||
from django.db.models import Sum
|
||||
from Base.models import Professional
|
||||
from Movement.models import Calendar
|
||||
|
||||
def metric(Day):
|
||||
professionals = Professional.objects.all()
|
||||
professionals_report = {}
|
||||
for professional in professionals:
|
||||
service = Calendar.objects.filter(
|
||||
professional__name=professional.name,
|
||||
date=Day
|
||||
).aggregate(Sum('gross_value'))['gross_value__sum'] or 0
|
||||
professionals_report[professional.name] = service
|
||||
sum_of_professionals = sum(professionals_report.values()) or 0
|
||||
return {
|
||||
'professional':professionals_report,
|
||||
'sum_all_prof':sum_of_professionals,
|
||||
}
|
||||
31
Base/Metrics/Dashboard/get_sum_of_professional_detail.py
Normal file
31
Base/Metrics/Dashboard/get_sum_of_professional_detail.py
Normal file
@@ -0,0 +1,31 @@
|
||||
from Base.models import Professional , ServiceList
|
||||
from Movement.models import Calendar
|
||||
# from django.utils import timezone
|
||||
from django.db.models import Sum
|
||||
|
||||
def metric(Day):
|
||||
professionals = Professional.objects.all()
|
||||
services = ServiceList.objects.all()
|
||||
service_movement = Calendar.objects.filter(date=Day).values()
|
||||
professionals_report = {}
|
||||
for professional in professionals:
|
||||
professionals_report[professional.name] = {}
|
||||
for service in services:
|
||||
service_sum = service_movement.filter(
|
||||
professional__name=professional.name,
|
||||
service__name=service.name,
|
||||
)
|
||||
servSum =service_sum.aggregate(Sum('gross_value'))['gross_value__sum'] or 0
|
||||
servCont = service_sum.count()
|
||||
professionals_report[professional.name][service.name] = {
|
||||
'servSum':servSum,
|
||||
'servCont':servCont,
|
||||
}
|
||||
sum_of_prof = sum(
|
||||
sum(service['servSum'] for service in services.values())
|
||||
for services in professionals_report.values()
|
||||
)
|
||||
return {
|
||||
'professionals_report':professionals_report,
|
||||
'sum_of_prof':sum_of_prof,
|
||||
}
|
||||
19
Base/Metrics/Dashboard/get_sum_of_service.py
Normal file
19
Base/Metrics/Dashboard/get_sum_of_service.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# from django.utils import timezone
|
||||
from django.db.models import Sum
|
||||
from Base.models import ServiceList
|
||||
from Movement.models import Calendar
|
||||
|
||||
def metric(Day):
|
||||
Service = ServiceList.objects.all()
|
||||
Serv_report = {}
|
||||
for Serv in Service:
|
||||
service = Calendar.objects.filter(
|
||||
service__name=Serv.name,
|
||||
date=Day
|
||||
).aggregate(Sum('gross_value'))['gross_value__sum'] or 0
|
||||
Serv_report[Serv.name] = service
|
||||
sum_ = sum(Serv_report.values()) or 0
|
||||
return {
|
||||
'Service':Serv_report,
|
||||
'sum':sum_,
|
||||
}
|
||||
24
Base/Metrics/Dashboard/get_sum_of_stone.py
Normal file
24
Base/Metrics/Dashboard/get_sum_of_stone.py
Normal file
@@ -0,0 +1,24 @@
|
||||
from Base.models import ProductList
|
||||
from Movement.models import Stock , Product
|
||||
from django.db.models import Sum
|
||||
|
||||
def metric(Day):
|
||||
List = ProductList.objects.all()
|
||||
Products = Product.objects.all()
|
||||
Stones = Stock.objects.all()
|
||||
Stones_report = {}
|
||||
|
||||
for Prod in List:
|
||||
sum_ = Stones.filter(
|
||||
product__name=Prod.name,
|
||||
).aggregate(Sum('quantity'))['quantity__sum'] or 0
|
||||
|
||||
sum_v = Products.filter(
|
||||
product__name=Prod.name,
|
||||
).aggregate(Sum('quantity'))['quantity__sum'] or 0
|
||||
|
||||
Stones_report[Prod.name] = sum_ - sum_v
|
||||
|
||||
return {
|
||||
'Stone':Stones_report,
|
||||
}
|
||||
24
Base/Metrics/Dashboard/get_sum_payment_method_service.py
Normal file
24
Base/Metrics/Dashboard/get_sum_payment_method_service.py
Normal file
@@ -0,0 +1,24 @@
|
||||
from django.db.models import Sum
|
||||
from Base.models import PayMethod
|
||||
from Movement.models import Calendar , Product
|
||||
|
||||
|
||||
def metric(Day):
|
||||
# Total de despesas do dia
|
||||
payment_method = PayMethod.objects.all()
|
||||
serv_mov = Calendar.objects.filter(date=Day).values()
|
||||
prod_mov = Product.objects.filter(date=Day).values()
|
||||
bank_balance = {}
|
||||
for PayM in payment_method:
|
||||
sum_bank1 = serv_mov.filter(
|
||||
pay_method__name=PayM.name,
|
||||
).aggregate(Sum('gross_value'))['gross_value__sum'] or 0
|
||||
sum_bank2 = prod_mov.filter(
|
||||
pay_method__name=PayM.name,
|
||||
).aggregate(Sum('gross_value'))['gross_value__sum'] or 0
|
||||
bank_balance[PayM.name] = sum_bank1 + sum_bank2
|
||||
sum_of_bank = sum(bank_balance.values()) or 0
|
||||
return {
|
||||
'bank_balance':bank_balance,
|
||||
'sum_of_bank':sum_of_bank,
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
82
Base/Metrics/DashboardAdmin/get_total_bank.py
Normal file
82
Base/Metrics/DashboardAdmin/get_total_bank.py
Normal file
@@ -0,0 +1,82 @@
|
||||
from django.db.models import Sum
|
||||
from django.utils import timezone
|
||||
from Base.models import (
|
||||
PayMethod,
|
||||
BankAccount,
|
||||
)
|
||||
from Movement.models import (
|
||||
Calendar,
|
||||
Product,
|
||||
Expense,
|
||||
Stock
|
||||
)
|
||||
|
||||
def metric():
|
||||
# Lista de Bancos
|
||||
banks = BankAccount.objects.all()
|
||||
|
||||
# pegando total de Serviços
|
||||
sum_mov_serv = {}
|
||||
for bank in banks:
|
||||
sum_bank = Calendar.objects.filter(
|
||||
# active = True,
|
||||
pay_method__bank__name = bank.name,
|
||||
).aggregate(Sum('net_value'))['net_value__sum'] or 0
|
||||
sum_mov_serv[bank.name] = sum_bank
|
||||
|
||||
# pegando total de Produtos
|
||||
sum_mov_prod = {}
|
||||
for bank in banks:
|
||||
sum_bank = Product.objects.filter(
|
||||
# active=True,
|
||||
pay_method__bank__name=bank.name,
|
||||
).aggregate(Sum('net_value'))['net_value__sum'] or 0
|
||||
sum_mov_prod[bank.name] = sum_bank
|
||||
|
||||
# pegando total de Desspesas
|
||||
sum_expense = {}
|
||||
for bank in banks:
|
||||
sum_bank = Expense.objects.filter(
|
||||
# active=True,
|
||||
firm=True,
|
||||
bank__name=bank.name,
|
||||
).aggregate(Sum('gross_value'))['gross_value__sum'] or 0
|
||||
sum_expense[bank.name] = sum_bank
|
||||
|
||||
# pegando total de Desspesas Profissinal
|
||||
sum_expense_prof = {}
|
||||
for bank in banks:
|
||||
sum_bank = Expense.objects.filter(
|
||||
# active=True,
|
||||
firm=False,
|
||||
bank__name=bank.name,
|
||||
).aggregate(Sum('gross_value'))['gross_value__sum'] or 0
|
||||
sum_expense_prof[bank.name] = sum_bank
|
||||
|
||||
# Valores de entrada do estoque
|
||||
sum_stock = {}
|
||||
for bank in banks:
|
||||
sum_bank = Stock.objects.filter(
|
||||
# active=True,
|
||||
bank__name=bank.name,
|
||||
).aggregate(Sum('gross_value'))['gross_value__sum'] or 0
|
||||
sum_stock[bank.name] = sum_bank
|
||||
|
||||
# saldo total de tudo
|
||||
sum_total = {}
|
||||
for bank in banks:
|
||||
sum_mov_serv_get = sum_mov_serv.get(str(bank.name))
|
||||
sum_mov_prod_get = sum_mov_prod.get(str(bank.name))
|
||||
sum_expense_get = sum_expense.get(str(bank.name))
|
||||
sum_expense_prof_get = sum_expense_prof.get(str(bank.name))
|
||||
sum_sum_stock = sum_stock.get(str(bank.name))
|
||||
|
||||
sum_total[bank.name] = (
|
||||
sum_mov_serv_get +
|
||||
sum_mov_prod_get -
|
||||
sum_expense_get -
|
||||
sum_expense_prof_get -
|
||||
sum_sum_stock
|
||||
)
|
||||
|
||||
return sum_total
|
||||
39
Base/Metrics/DashboardAdmin/get_total_prof.py
Normal file
39
Base/Metrics/DashboardAdmin/get_total_prof.py
Normal file
@@ -0,0 +1,39 @@
|
||||
from django.db.models import Sum
|
||||
from django.utils import timezone
|
||||
from Base.models import Professional
|
||||
from Movement.models import Calendar, Expense
|
||||
|
||||
def metric():
|
||||
Professionals = Professional.objects.all()
|
||||
# current_month = timezone.localtime(timezone.now()).month
|
||||
# current_year = timezone.localtime(timezone.now()).year
|
||||
|
||||
sum_expense_prof = {}
|
||||
for Prof in Professionals:
|
||||
sum_ = Expense.objects.filter(
|
||||
# active=True,
|
||||
firm=False,
|
||||
professional__name=Prof.name,
|
||||
# date__month=current_month,
|
||||
# date__year=current_year
|
||||
).aggregate(Sum('gross_value'))['gross_value__sum'] or 0
|
||||
sum_expense_prof[Prof.name] = sum_
|
||||
|
||||
|
||||
sum_serv_prof = {}
|
||||
for Prof in Professionals:
|
||||
sum_ = Calendar.objects.filter(
|
||||
# active=True,
|
||||
professional__name=Prof.name,
|
||||
# date__month=current_month,
|
||||
# date__year=current_year
|
||||
).aggregate(Sum('prof_money'))['prof_money__sum'] or 0
|
||||
sum_serv_prof[Prof.name] = sum_
|
||||
|
||||
sum_total = {}
|
||||
for total in Professionals:
|
||||
sum1 = sum_serv_prof.get(str(total.name))
|
||||
sum2 = sum_expense_prof.get(str(total.name))
|
||||
sum_total[total.name] = ( sum1 - sum2 )
|
||||
|
||||
return sum_total
|
||||
BIN
Base/Urls/__pycache__/urlsBankAccount.cpython-312.pyc
Normal file
BIN
Base/Urls/__pycache__/urlsBankAccount.cpython-312.pyc
Normal file
Binary file not shown.
BIN
Base/Urls/__pycache__/urlsBase.cpython-312.pyc
Normal file
BIN
Base/Urls/__pycache__/urlsBase.cpython-312.pyc
Normal file
Binary file not shown.
BIN
Base/Urls/__pycache__/urlsChartOfAccount.cpython-312.pyc
Normal file
BIN
Base/Urls/__pycache__/urlsChartOfAccount.cpython-312.pyc
Normal file
Binary file not shown.
BIN
Base/Urls/__pycache__/urlsPaymentMethod.cpython-312.pyc
Normal file
BIN
Base/Urls/__pycache__/urlsPaymentMethod.cpython-312.pyc
Normal file
Binary file not shown.
BIN
Base/Urls/__pycache__/urlsProductList.cpython-312.pyc
Normal file
BIN
Base/Urls/__pycache__/urlsProductList.cpython-312.pyc
Normal file
Binary file not shown.
BIN
Base/Urls/__pycache__/urlsProfessional.cpython-312.pyc
Normal file
BIN
Base/Urls/__pycache__/urlsProfessional.cpython-312.pyc
Normal file
Binary file not shown.
BIN
Base/Urls/__pycache__/urlsServiceList.cpython-312.pyc
Normal file
BIN
Base/Urls/__pycache__/urlsServiceList.cpython-312.pyc
Normal file
Binary file not shown.
15
Base/Urls/urlsBankAccount.py
Normal file
15
Base/Urls/urlsBankAccount.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from django.urls import path
|
||||
# from django.contrib.auth import views as auth_views
|
||||
from Base.Views import (
|
||||
viewsBankAccounts ,
|
||||
)
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
# URLs de Bancos
|
||||
path('/', viewsBankAccounts.BankAccountsListView.as_view(), name='BankAccountsListView'),
|
||||
path('/Create', viewsBankAccounts.BankAccountsCreateView.as_view(), name='BankAccountsCreateView'),
|
||||
path('/<int:pk>/Detail', viewsBankAccounts.BankAccountsDetailView.as_view(), name='BankAccountsDetailView'),
|
||||
path('/<int:pk>/Update', viewsBankAccounts.BankAccountsUpdateView.as_view(), name='BankAccountsUpdateView'),
|
||||
path('/<int:pk>/Delete', viewsBankAccounts.BankAccountsDeleteView.as_view(), name='BankAccountsDeleteView'),
|
||||
]
|
||||
@@ -1,14 +1,15 @@
|
||||
from django.urls import path
|
||||
from django.contrib.auth import views as auth_views
|
||||
from Base.views import (
|
||||
from Base.Views import (
|
||||
views,
|
||||
)
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
# base das URLs
|
||||
path('', views.Home, name='Home'),
|
||||
path('login/', auth_views.LoginView.as_view(), name='login'),
|
||||
path('logout/', auth_views.LogoutView.as_view(), name='logout'),
|
||||
path('login', views.Login.as_view(), name='login'),
|
||||
path('logout', auth_views.LogoutView.as_view(), name='logout'),
|
||||
path('dashboard', views.Dashboard.as_view(), name='Dashboard'),
|
||||
path('DashboardAdmin', views.DashboardAdmin.as_view(), name='DashboardAdmin'),
|
||||
|
||||
]
|
||||
13
Base/Urls/urlsChartOfAccount.py
Normal file
13
Base/Urls/urlsChartOfAccount.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from django.urls import path
|
||||
from Base.Views import (
|
||||
viewsChartOfAccount ,
|
||||
)
|
||||
|
||||
urlpatterns = [
|
||||
# URLs de Professional
|
||||
path('/', viewsChartOfAccount.ChartOfAccountListView.as_view(), name='ChartOfAccountListView'),
|
||||
path('/Create', viewsChartOfAccount.ChartOfAccountCreateView.as_view(), name='ChartOfAccountCreateView'),
|
||||
path('/<int:pk>/Detail', viewsChartOfAccount.ChartOfAccountDetailView.as_view(), name='ChartOfAccountDetailView'),
|
||||
path('/<int:pk>/Update', viewsChartOfAccount.ChartOfAccountUpdateView.as_view(), name='ChartOfAccountUpdateView'),
|
||||
path('/<int:pk>/Delete', viewsChartOfAccount.ChartOfAccountDeleteView.as_view(), name='ChartOfAccountDeleteView'),
|
||||
]
|
||||
14
Base/Urls/urlsPaymentMethod.py
Normal file
14
Base/Urls/urlsPaymentMethod.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from django.urls import path
|
||||
# from django.contrib.auth import views as auth_views
|
||||
from Base.Views import (
|
||||
viewsPayMethod ,
|
||||
)
|
||||
|
||||
urlpatterns = [
|
||||
# URLs de Professional
|
||||
path('/', viewsPayMethod.PayMethodListView.as_view(), name='PayMethodListView'),
|
||||
path('/Create', viewsPayMethod.PayMethodCreateView.as_view(), name='PayMethodCreateView'),
|
||||
path('/<int:pk>/Detail', viewsPayMethod.PayMethodDetailView.as_view(), name='PayMethodDetailView'),
|
||||
path('/<int:pk>/Update', viewsPayMethod.PayMethodUpdateView.as_view(), name='PayMethodUpdateView'),
|
||||
path('/<int:pk>/Delete', viewsPayMethod.PayMethodDeleteView.as_view(), name='PayMethodDeleteView'),
|
||||
]
|
||||
14
Base/Urls/urlsProductList.py
Normal file
14
Base/Urls/urlsProductList.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from django.urls import path
|
||||
# from django.contrib.auth import views as auth_views
|
||||
from Base.Views import (
|
||||
viewsProductList ,
|
||||
)
|
||||
|
||||
urlpatterns = [
|
||||
# URLs de Professional
|
||||
path('/', viewsProductList.ProductListListView.as_view(), name='ProductListListView'),
|
||||
path('/Create', viewsProductList.ProductListCreateView.as_view(), name='ProductListCreateView'),
|
||||
path('/<int:pk>/Detail', viewsProductList.ProductListDetailView.as_view(), name='ProductListDetailView'),
|
||||
path('/<int:pk>/Update', viewsProductList.ProductListUpdateView.as_view(), name='ProductListUpdateView'),
|
||||
path('/<int:pk>/Delete', viewsProductList.ProductListDeleteView.as_view(), name='ProductListDeleteView'),
|
||||
]
|
||||
14
Base/Urls/urlsProfessional.py
Normal file
14
Base/Urls/urlsProfessional.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from django.urls import path
|
||||
# from django.contrib.auth import views as auth_views
|
||||
from Base.Views import (
|
||||
viewsProfessional ,
|
||||
)
|
||||
|
||||
urlpatterns = [
|
||||
# URLs de Professional
|
||||
path('/', viewsProfessional.ProfessionalListView.as_view(), name='ProfessionalListView'),
|
||||
path('/Create', viewsProfessional.ProfessionalCreateView.as_view(), name='ProfessionalCreateView'),
|
||||
path('/<int:pk>/Detail', viewsProfessional.ProfessionalDetailView.as_view(), name='ProfessionalDetailView'),
|
||||
path('/<int:pk>/Update', viewsProfessional.ProfessionalUpdateView.as_view(), name='ProfessionalUpdateView'),
|
||||
path('/<int:pk>/Delete', viewsProfessional.ProfessionalDeleteView.as_view(), name='ProfessionalDeleteView'),
|
||||
]
|
||||
14
Base/Urls/urlsServiceList.py
Normal file
14
Base/Urls/urlsServiceList.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from django.urls import path
|
||||
# from django.contrib.auth import views as auth_views
|
||||
from Base.Views import (
|
||||
viewsServiceList ,
|
||||
)
|
||||
|
||||
urlpatterns = [
|
||||
# URLs de Professional
|
||||
path('/', viewsServiceList.ServiceListListView.as_view(), name='ServiceListListView'),
|
||||
path('/Create', viewsServiceList.ServiceListCreateView.as_view(), name='ServiceListCreateView'),
|
||||
path('/<int:pk>/Detail', viewsServiceList.ServiceListDetailView.as_view(), name='ServiceListDetailView'),
|
||||
path('/<int:pk>/Update', viewsServiceList.ServiceListUpdateView.as_view(), name='ServiceListUpdateView'),
|
||||
path('/<int:pk>/Delete', viewsServiceList.ServiceListDeleteView.as_view(), name='ServiceListDeleteView'),
|
||||
]
|
||||
BIN
Base/Views/__pycache__/viewsBankAccounts.cpython-312.pyc
Normal file
BIN
Base/Views/__pycache__/viewsBankAccounts.cpython-312.pyc
Normal file
Binary file not shown.
BIN
Base/Views/__pycache__/viewsChartOfAccount.cpython-312.pyc
Normal file
BIN
Base/Views/__pycache__/viewsChartOfAccount.cpython-312.pyc
Normal file
Binary file not shown.
BIN
Base/Views/__pycache__/viewsPayMethod.cpython-312.pyc
Normal file
BIN
Base/Views/__pycache__/viewsPayMethod.cpython-312.pyc
Normal file
Binary file not shown.
BIN
Base/Views/__pycache__/viewsProductList.cpython-312.pyc
Normal file
BIN
Base/Views/__pycache__/viewsProductList.cpython-312.pyc
Normal file
Binary file not shown.
BIN
Base/Views/__pycache__/viewsProfessional.cpython-312.pyc
Normal file
BIN
Base/Views/__pycache__/viewsProfessional.cpython-312.pyc
Normal file
Binary file not shown.
BIN
Base/Views/__pycache__/viewsServiceList.cpython-312.pyc
Normal file
BIN
Base/Views/__pycache__/viewsServiceList.cpython-312.pyc
Normal file
Binary file not shown.
42
Base/Views/views.py
Normal file
42
Base/Views/views.py
Normal file
@@ -0,0 +1,42 @@
|
||||
from django.shortcuts import render
|
||||
from django.views.generic import TemplateView
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin #, PermissionRequiredMixin
|
||||
from django.utils import timezone
|
||||
from django.contrib.auth import views as auth_views
|
||||
from Base.Metrics.Dashboard import (
|
||||
get_sum_of_professional,
|
||||
get_sum_of_stone,
|
||||
get_sum_of_service,
|
||||
get_sum_of_professional_detail,
|
||||
get_sum_payment_method_service,
|
||||
get_sum_of_product
|
||||
)
|
||||
from Base.Metrics.DashboardAdmin import get_total_bank,get_total_prof
|
||||
|
||||
def Home(request):
|
||||
context = { 'ok':' Tudo ok', }
|
||||
return render(request,'Home.html',context )
|
||||
|
||||
class Login(auth_views.LoginView):
|
||||
template_name = 'Login/Login.html'
|
||||
|
||||
class Dashboard(LoginRequiredMixin, TemplateView):
|
||||
template_name = 'Login/Dashboard/index.html'
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
Day = timezone.localtime(timezone.now())
|
||||
context['Professional'] = get_sum_of_professional.metric(Day)
|
||||
context['Stone'] = get_sum_of_stone.metric(Day)
|
||||
context['Service'] = get_sum_of_service.metric(Day)
|
||||
context['Sum_of_professional_detail'] = get_sum_of_professional_detail.metric(Day)
|
||||
context['Sum_payment_method_service'] = get_sum_payment_method_service.metric(Day)
|
||||
context['Sum_of_product'] = get_sum_of_product.metric(Day)
|
||||
return context
|
||||
|
||||
class DashboardAdmin(LoginRequiredMixin, TemplateView):
|
||||
template_name = 'Login/DashboardAdmin/index.html'
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context['total_bank'] = get_total_bank.metric()
|
||||
context['total_prof'] = get_total_prof.metric()
|
||||
return context
|
||||
57
Base/Views/viewsBankAccounts.py
Normal file
57
Base/Views/viewsBankAccounts.py
Normal file
@@ -0,0 +1,57 @@
|
||||
from django.views.generic import ListView, CreateView, UpdateView, DeleteView, DetailView
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin, PermissionRequiredMixin
|
||||
from Base.Forms import FormsBankAccounts
|
||||
from Base import models
|
||||
from django.urls import reverse_lazy
|
||||
from django.contrib import messages
|
||||
|
||||
class BankAccountsListView(LoginRequiredMixin, PermissionRequiredMixin, ListView):
|
||||
model = models.BankAccount
|
||||
template_name = 'BankAccounts/List.html'
|
||||
context_object_name = 'BankAccounts'
|
||||
paginate_by = 10
|
||||
permission_required = 'Base.view_bankaccount'
|
||||
def get_queryset(self):
|
||||
queryset = super().get_queryset()
|
||||
name = self.request.GET.get('name')
|
||||
if name:
|
||||
queryset = queryset.filter(name__icontains=name)
|
||||
return queryset
|
||||
|
||||
class BankAccountsCreateView(LoginRequiredMixin, PermissionRequiredMixin, CreateView):
|
||||
model = models.BankAccount
|
||||
template_name = 'BankAccounts/Create.html'
|
||||
form_class = FormsBankAccounts.FormsBankAccount
|
||||
success_url = reverse_lazy('BankAccountsListView')
|
||||
permission_required = 'Base.add_bankaccount'
|
||||
|
||||
def get_form(self, form_class=None):
|
||||
form = super().get_form(form_class)
|
||||
return form
|
||||
|
||||
def form_valid(self, form):
|
||||
messages.success(self.request, 'Registro realizado com sucesso!')
|
||||
return super().form_valid(form)
|
||||
|
||||
def form_invalid(self, form):
|
||||
errors = form.errors.as_text()
|
||||
messages.error(self.request, f'Verifique os dados: {errors}')
|
||||
return super().form_invalid(form)
|
||||
|
||||
class BankAccountsDetailView(LoginRequiredMixin, PermissionRequiredMixin, DetailView):
|
||||
model = models.BankAccount
|
||||
template_name = 'BankAccounts/Detail.html'
|
||||
permission_required = 'Base.view_bankaccount'
|
||||
|
||||
class BankAccountsUpdateView(LoginRequiredMixin, PermissionRequiredMixin, UpdateView):
|
||||
model = models.BankAccount
|
||||
template_name = 'BankAccounts/Update.html'
|
||||
form_class = FormsBankAccounts.FormsBankAccount
|
||||
success_url = reverse_lazy('BankAccountsListView')
|
||||
permission_required = 'Base.change_bankaccount'
|
||||
|
||||
class BankAccountsDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteView):
|
||||
model = models.BankAccount
|
||||
template_name = 'BankAccounts/Delete.html'
|
||||
success_url = reverse_lazy('BankAccountsListView')
|
||||
permission_required = 'Base.delete_bankaccount'
|
||||
43
Base/Views/viewsChartOfAccount.py
Normal file
43
Base/Views/viewsChartOfAccount.py
Normal file
@@ -0,0 +1,43 @@
|
||||
from django.views.generic import ListView, CreateView, UpdateView, DeleteView, DetailView
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin, PermissionRequiredMixin
|
||||
from Base.Forms import FormsChartOfAccount
|
||||
from Base import models
|
||||
from django.urls import reverse_lazy
|
||||
|
||||
class ChartOfAccountListView(LoginRequiredMixin, PermissionRequiredMixin, ListView):
|
||||
model = models.ChartOfAccount
|
||||
template_name = 'ChartOfAccount/List.html'
|
||||
context_object_name = 'ChartOfAccount'
|
||||
paginate_by = 10
|
||||
permission_required = 'Base.view_'
|
||||
def get_queryset(self):
|
||||
queryset = super().get_queryset()
|
||||
name = self.request.GET.get('name')
|
||||
if name:
|
||||
queryset = queryset.filter(name__icontains=name)
|
||||
return queryset
|
||||
|
||||
class ChartOfAccountCreateView(LoginRequiredMixin, PermissionRequiredMixin, CreateView):
|
||||
model = models.ChartOfAccount
|
||||
template_name = 'ChartOfAccount/Create.html'
|
||||
form_class = FormsChartOfAccount.FormsChartOfAccount
|
||||
success_url = reverse_lazy('ChartOfAccountListView')
|
||||
permission_required = 'Base.add_'
|
||||
|
||||
class ChartOfAccountDetailView(LoginRequiredMixin, PermissionRequiredMixin, DetailView):
|
||||
model = models.ChartOfAccount
|
||||
template_name = 'ChartOfAccount/Detail.html'
|
||||
permission_required = 'Base.view_'
|
||||
|
||||
class ChartOfAccountUpdateView(LoginRequiredMixin, PermissionRequiredMixin, UpdateView):
|
||||
model = models.ChartOfAccount
|
||||
template_name = 'ChartOfAccount/Update.html'
|
||||
form_class = FormsChartOfAccount.FormsChartOfAccount
|
||||
success_url = reverse_lazy('ChartOfAccountListView')
|
||||
permission_required = 'Base.change_'
|
||||
|
||||
class ChartOfAccountDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteView):
|
||||
model = models.ChartOfAccount
|
||||
template_name = 'ChartOfAccount/Delete.html'
|
||||
success_url = reverse_lazy('ChartOfAccountListView')
|
||||
permission_required = 'Base.delete_'
|
||||
43
Base/Views/viewsPayMethod.py
Normal file
43
Base/Views/viewsPayMethod.py
Normal file
@@ -0,0 +1,43 @@
|
||||
from django.views.generic import ListView, CreateView, UpdateView, DeleteView, DetailView
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin, PermissionRequiredMixin
|
||||
from Base.Forms import FormsPayMethod
|
||||
from Base import models
|
||||
from django.urls import reverse_lazy
|
||||
|
||||
class PayMethodListView(LoginRequiredMixin, PermissionRequiredMixin, ListView):
|
||||
model = models.PayMethod
|
||||
template_name = 'PayMethod/List.html'
|
||||
context_object_name = 'PayMethod'
|
||||
paginate_by = 10
|
||||
permission_required = 'Base.view_'
|
||||
def get_queryset(self):
|
||||
queryset = super().get_queryset()
|
||||
name = self.request.GET.get('name')
|
||||
if name:
|
||||
queryset = queryset.filter(name__icontains=name)
|
||||
return queryset
|
||||
|
||||
class PayMethodCreateView(LoginRequiredMixin, PermissionRequiredMixin, CreateView):
|
||||
model = models.PayMethod
|
||||
template_name = 'PayMethod/Create.html'
|
||||
form_class = FormsPayMethod.FormsPayMethod
|
||||
success_url = reverse_lazy('PayMethodListView')
|
||||
permission_required = 'Base.add_'
|
||||
|
||||
class PayMethodDetailView(LoginRequiredMixin, PermissionRequiredMixin, DetailView):
|
||||
model = models.PayMethod
|
||||
template_name = 'PayMethod/Detail.html'
|
||||
permission_required = 'Base.view_'
|
||||
|
||||
class PayMethodUpdateView(LoginRequiredMixin, PermissionRequiredMixin, UpdateView):
|
||||
model = models.PayMethod
|
||||
template_name = 'PayMethod/Update.html'
|
||||
form_class = FormsPayMethod.FormsPayMethod
|
||||
success_url = reverse_lazy('PayMethodListView')
|
||||
permission_required = 'Base.change_'
|
||||
|
||||
class PayMethodDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteView):
|
||||
model = models.PayMethod
|
||||
template_name = 'PayMethod/Delete.html'
|
||||
success_url = reverse_lazy('PayMethodListView')
|
||||
permission_required = 'Base.delete_'
|
||||
43
Base/Views/viewsProductList.py
Normal file
43
Base/Views/viewsProductList.py
Normal file
@@ -0,0 +1,43 @@
|
||||
from django.views.generic import ListView, CreateView, UpdateView, DeleteView, DetailView
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin, PermissionRequiredMixin
|
||||
from Base.Forms import FormsProductList
|
||||
from Base import models
|
||||
from django.urls import reverse_lazy
|
||||
|
||||
class ProductListListView(LoginRequiredMixin, PermissionRequiredMixin, ListView):
|
||||
model = models.ProductList
|
||||
template_name = 'ProductList/List.html'
|
||||
context_object_name = 'ProductList'
|
||||
paginate_by = 10
|
||||
permission_required = 'Base.view_'
|
||||
def get_queryset(self):
|
||||
queryset = super().get_queryset()
|
||||
name = self.request.GET.get('name')
|
||||
if name:
|
||||
queryset = queryset.filter(name__icontains=name)
|
||||
return queryset
|
||||
|
||||
class ProductListCreateView(LoginRequiredMixin, PermissionRequiredMixin, CreateView):
|
||||
model = models.ProductList
|
||||
template_name = 'ProductList/Create.html'
|
||||
form_class = FormsProductList.FormsProductList
|
||||
success_url = reverse_lazy('ProductListListView')
|
||||
permission_required = 'Base.add_'
|
||||
|
||||
class ProductListDetailView(LoginRequiredMixin, PermissionRequiredMixin, DetailView):
|
||||
model = models.ProductList
|
||||
template_name = 'ProductList/Detail.html'
|
||||
permission_required = 'Base.view_'
|
||||
|
||||
class ProductListUpdateView(LoginRequiredMixin, PermissionRequiredMixin, UpdateView):
|
||||
model = models.ProductList
|
||||
template_name = 'ProductList/Update.html'
|
||||
form_class = FormsProductList.FormsProductList
|
||||
success_url = reverse_lazy('ProductListListView')
|
||||
permission_required = 'Base.change_'
|
||||
|
||||
class ProductListDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteView):
|
||||
model = models.ProductList
|
||||
template_name = 'ProductList/Delete.html'
|
||||
success_url = reverse_lazy('ProductListListView')
|
||||
permission_required = 'Base.delete_'
|
||||
43
Base/Views/viewsProfessional.py
Normal file
43
Base/Views/viewsProfessional.py
Normal file
@@ -0,0 +1,43 @@
|
||||
from django.views.generic import ListView, CreateView, UpdateView, DeleteView, DetailView
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin , PermissionRequiredMixin
|
||||
from Base.Forms import FormsProfessional
|
||||
from Base import models
|
||||
from django.urls import reverse_lazy
|
||||
|
||||
class ProfessionalListView(LoginRequiredMixin, PermissionRequiredMixin, ListView):
|
||||
model = models.Professional
|
||||
template_name = 'Professional/List.html'
|
||||
context_object_name = 'Professionals'
|
||||
paginate_by = 10
|
||||
permission_required = 'Base.view_professional'
|
||||
def get_queryset(self):
|
||||
queryset = super().get_queryset()
|
||||
name = self.request.GET.get('name')
|
||||
if name:
|
||||
queryset = queryset.filter(name__icontains=name)
|
||||
return queryset
|
||||
|
||||
class ProfessionalCreateView(LoginRequiredMixin,PermissionRequiredMixin, CreateView):
|
||||
model = models.Professional
|
||||
template_name = 'Professional/Create.html'
|
||||
form_class = FormsProfessional.FormsProfessional
|
||||
success_url = reverse_lazy('ProfessionalListView')
|
||||
permission_required = 'Base.add_professional'
|
||||
|
||||
class ProfessionalDetailView(LoginRequiredMixin,PermissionRequiredMixin, DetailView):
|
||||
model = models.Professional
|
||||
template_name = 'Professional/Detail.html'
|
||||
permission_required = 'Base.view_professional'
|
||||
|
||||
class ProfessionalUpdateView(LoginRequiredMixin,PermissionRequiredMixin, UpdateView):
|
||||
model = models.Professional
|
||||
template_name = 'Professional/Update.html'
|
||||
form_class = FormsProfessional.FormsProfessional
|
||||
success_url = reverse_lazy('ProfessionalListView')
|
||||
permission_required = 'Base.change_professional'
|
||||
|
||||
class ProfessionalDeleteView(LoginRequiredMixin,PermissionRequiredMixin, DeleteView):
|
||||
model = models.Professional
|
||||
template_name = 'Professional/Delete.html'
|
||||
success_url = reverse_lazy('ProfessionalListView')
|
||||
permission_required = 'Base.delete_professional'
|
||||
43
Base/Views/viewsServiceList.py
Normal file
43
Base/Views/viewsServiceList.py
Normal file
@@ -0,0 +1,43 @@
|
||||
from django.views.generic import ListView, CreateView, UpdateView, DeleteView, DetailView
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin, PermissionRequiredMixin
|
||||
from Base.Forms import FormsServiceList
|
||||
from Base import models
|
||||
from django.urls import reverse_lazy
|
||||
|
||||
class ServiceListListView(LoginRequiredMixin, PermissionRequiredMixin, ListView):
|
||||
model = models.ServiceList
|
||||
template_name = 'ServiceList/List.html'
|
||||
context_object_name = 'ServiceList'
|
||||
paginate_by = 10
|
||||
permission_required = 'Base.view_'
|
||||
def get_queryset(self):
|
||||
queryset = super().get_queryset()
|
||||
name = self.request.GET.get('name')
|
||||
if name:
|
||||
queryset = queryset.filter(name__icontains=name)
|
||||
return queryset
|
||||
|
||||
class ServiceListCreateView(LoginRequiredMixin, PermissionRequiredMixin, CreateView):
|
||||
model = models.ServiceList
|
||||
template_name = 'ServiceList/Create.html'
|
||||
form_class = FormsServiceList.FormsServiceList
|
||||
success_url = reverse_lazy('ServiceListListView')
|
||||
permission_required = 'Base.add_'
|
||||
|
||||
class ServiceListDetailView(LoginRequiredMixin, PermissionRequiredMixin, DetailView):
|
||||
model = models.ServiceList
|
||||
template_name = 'ServiceList/Detail.html'
|
||||
permission_required = 'Base.view_'
|
||||
|
||||
class ServiceListUpdateView(LoginRequiredMixin, PermissionRequiredMixin, UpdateView):
|
||||
model = models.ServiceList
|
||||
template_name = 'ServiceList/Update.html'
|
||||
form_class = FormsServiceList.FormsServiceList
|
||||
success_url = reverse_lazy('ServiceListListView')
|
||||
permission_required = 'Base.change_'
|
||||
|
||||
class ServiceListDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteView):
|
||||
model = models.ServiceList
|
||||
template_name = 'ServiceList/Delete.html'
|
||||
success_url = reverse_lazy('ServiceListListView')
|
||||
permission_required = 'Base.delete_'
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
91
Base/migrations/0001_initial.py
Normal file
91
Base/migrations/0001_initial.py
Normal file
@@ -0,0 +1,91 @@
|
||||
# Generated by Django 5.2.7 on 2025-11-01 11:15
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='BankAccount',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=50)),
|
||||
('description', models.TextField(blank=True, null=True)),
|
||||
],
|
||||
options={
|
||||
'ordering': ['name'],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='ChartOfAccount',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=100)),
|
||||
('debit', models.BooleanField(default=True)),
|
||||
('firm', models.BooleanField(default=True)),
|
||||
('notes', models.TextField(blank=True, null=True)),
|
||||
],
|
||||
options={
|
||||
'ordering': ['name'],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='ProductList',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=50)),
|
||||
('value', models.DecimalField(decimal_places=2, max_digits=6)),
|
||||
('description', models.TextField(blank=True, null=True)),
|
||||
],
|
||||
options={
|
||||
'ordering': ['name'],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='ServiceList',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=50)),
|
||||
('value', models.DecimalField(decimal_places=2, max_digits=6)),
|
||||
('description', models.TextField(blank=True, null=True)),
|
||||
],
|
||||
options={
|
||||
'ordering': ['name'],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='PayMethod',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=100)),
|
||||
('percentage', models.DecimalField(decimal_places=0, max_digits=3)),
|
||||
('description', models.TextField(blank=True, null=True)),
|
||||
('bank', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='PaymentMethodBank', to='Base.bankaccount')),
|
||||
],
|
||||
options={
|
||||
'ordering': ['bank', 'name'],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Professional',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=100, unique=True)),
|
||||
('percentage', models.DecimalField(decimal_places=0, max_digits=3)),
|
||||
('symbol', models.CharField(max_length=2, unique=True)),
|
||||
('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='ProfessionalUser', to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
options={
|
||||
'ordering': ['name'],
|
||||
},
|
||||
),
|
||||
]
|
||||
BIN
Base/migrations/__pycache__/0001_initial.cpython-312.pyc
Normal file
BIN
Base/migrations/__pycache__/0001_initial.cpython-312.pyc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,3 +1,84 @@
|
||||
from django.db import models
|
||||
from django.contrib.auth.models import User
|
||||
from django.utils import timezone
|
||||
|
||||
# Create your models here.
|
||||
#Base de varias tabelas
|
||||
class Base(models.Model):
|
||||
active = models.BooleanField(default=False)
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
updated_at = models.DateTimeField(auto_now=True)
|
||||
created_by = models.ForeignKey(User, related_name='%(class)s_created', on_delete=models.SET_NULL, null=True)
|
||||
updated_by = models.ForeignKey(User, related_name='%(class)s_updated', on_delete=models.SET_NULL, null=True)
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
||||
# Lista de Profissinal
|
||||
class Professional(models.Model):
|
||||
name = models.CharField(max_length=100, unique=True )
|
||||
percentage = models.DecimalField(max_digits=3, decimal_places=0)
|
||||
symbol = models.CharField(max_length=2, unique=True)
|
||||
user= models.ForeignKey(
|
||||
User,
|
||||
related_name='ProfessionalUser',
|
||||
on_delete=models.SET_NULL,
|
||||
null=True, blank=True
|
||||
)
|
||||
class Meta:
|
||||
ordering = ['name']
|
||||
def __str__(self):
|
||||
return f'{ self.name } { self.symbol }'
|
||||
|
||||
# Lista de Bancos
|
||||
class BankAccount(models.Model):
|
||||
name = models.CharField(max_length=50)
|
||||
description = models.TextField(null=True, blank=True)
|
||||
class Meta:
|
||||
ordering = ['name']
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
# Lista de serviços
|
||||
class ServiceList(models.Model):
|
||||
name = models.CharField(max_length=50)
|
||||
value = models.DecimalField(max_digits=6, decimal_places=2)
|
||||
description = models.TextField(null=True, blank=True)
|
||||
class Meta:
|
||||
ordering = ['name']
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
# Lista de Produtos
|
||||
class ProductList(models.Model):
|
||||
name = models.CharField(max_length=50)
|
||||
value = models.DecimalField(max_digits=6, decimal_places=2)
|
||||
description = models.TextField(null=True, blank=True)
|
||||
class Meta:
|
||||
ordering = ['name']
|
||||
def __str__(self):
|
||||
return f'{ self.name } - { self.value }'
|
||||
|
||||
# Lista de Contas
|
||||
class ChartOfAccount(models.Model):
|
||||
name = models.CharField(max_length=100)
|
||||
debit = models.BooleanField(default=True)
|
||||
firm = models.BooleanField(default=True)
|
||||
notes = models.TextField(null=True, blank=True)
|
||||
class Meta:
|
||||
ordering = ['name']
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
# metodos de pagamentos
|
||||
class PayMethod(models.Model):
|
||||
name = models.CharField(max_length=100)
|
||||
bank = models.ForeignKey(
|
||||
BankAccount,
|
||||
on_delete=models.PROTECT,
|
||||
related_name='PaymentMethodBank',
|
||||
)
|
||||
percentage = models.DecimalField(max_digits=3, decimal_places=0)
|
||||
description = models.TextField(null=True, blank=True)
|
||||
class Meta:
|
||||
ordering = ['bank','name',]
|
||||
def __str__(self):
|
||||
return f'{ self.bank } - { self.name }'
|
||||
19
Base/templates/BankAccounts/Create.html
Normal file
19
Base/templates/BankAccounts/Create.html
Normal file
@@ -0,0 +1,19 @@
|
||||
{% extends "BaseLogin.html" %}
|
||||
{% block title %} Bank Accounts List {% endblock %}
|
||||
{% block content %}
|
||||
|
||||
<div class="conteiner mt-4">
|
||||
<h3 class="display-6"> Cadastrar Banco </h3>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form method="post" class="form">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<button type="submit" class="btn btn-primary"> Salvar </button>
|
||||
</form>
|
||||
<a href="{% url 'BankAccountsListView' %}" class="btn btn-secondary mt-3 "> Cancelar e Voltar </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
18
Base/templates/BankAccounts/Delete.html
Normal file
18
Base/templates/BankAccounts/Delete.html
Normal file
@@ -0,0 +1,18 @@
|
||||
{% extends "BaseLogin.html" %}
|
||||
{% block title %} Bank Accounts List {% endblock %}
|
||||
{% block content %}
|
||||
<div class="conteiner mt-4">
|
||||
<h3 class="display-6"> Deletar da Marcar </h3>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h3 class="card-title">Tem certeza que quer deletar ? </h3>
|
||||
<strong>{{ object.name }}</strong>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
<button type="submit" class="btn btn-danger mt-3"> Deletar </button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<a href="{% url 'BankAccountsListView' %}" class="btn btn-secondary mt-3 "> Cancelar e Voltar </a>
|
||||
</div>
|
||||
{% endblock %}
|
||||
15
Base/templates/BankAccounts/Detail.html
Normal file
15
Base/templates/BankAccounts/Detail.html
Normal file
@@ -0,0 +1,15 @@
|
||||
{% extends "BaseLogin.html" %}
|
||||
{% block title %} Bank Accounts List {% endblock %}
|
||||
{% block content %}
|
||||
<div class="conteiner mt-4">
|
||||
<h3 class="display-6"> Detalhes do Banco </h3>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h3 class="card-title">{{ object.name }}</h3>
|
||||
<p class="card-text">Descrição: {{ object.description }}</p>
|
||||
{# <a href="{% url 'BrandsUpdate' object.id %}" class="btn btn-secondary mt-3 "> Editar </a>#}
|
||||
</div>
|
||||
</div>
|
||||
<a href="{% url 'BankAccountsListView' %}" class="btn btn-secondary mt-3 "> Cancelar e Voltar </a>
|
||||
</div>
|
||||
{% endblock %}
|
||||
62
Base/templates/BankAccounts/List.html
Normal file
62
Base/templates/BankAccounts/List.html
Normal file
@@ -0,0 +1,62 @@
|
||||
{% extends "BaseLogin.html" %}
|
||||
{% block title %} List {% endblock %}
|
||||
{% block content %}
|
||||
<h1> Bancos </h1><br>
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<form method="get" action="{% url 'BankAccountsListView' %}">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" name="name"
|
||||
placeholder="Nome" value="{{ request.GET.name }}">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="bi bi-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{# {% if perms.brands.add_brands %}#}
|
||||
<div class="col-md-6">
|
||||
<a href="{% url 'BankAccountsCreateView' %}" class="btn btn-success float-end">
|
||||
<i class="bi bi-plus"></i> Criar </a>
|
||||
</div>
|
||||
{# {% endif %}#}
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead class="thead-dark">
|
||||
<tr align="center">
|
||||
{# <th> ID </th>#}
|
||||
<th> Nome </th>
|
||||
<th > Descrição </th>
|
||||
<th width="15%"> Ações </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for Bank in BankAccounts %}
|
||||
<tr align="center">
|
||||
{# <td> {{ Bank.id }} </td>#}
|
||||
<td> {{ Bank.name }} </td>
|
||||
<td> {{ Bank.description }} </td>
|
||||
<td>
|
||||
<a href="{% url 'BankAccountsDetailView' Bank.id %}" class="btn btn-info btn-sm">
|
||||
<i class="bi bi-eye"></i>
|
||||
</a>
|
||||
{# {% if perms.brands.change_brands %}#}
|
||||
<a href="{% url 'BankAccountsUpdateView' Bank.id %}" class="btn btn-warning btn-sm">
|
||||
<i class="bi bi-pencil"></i>
|
||||
</a>
|
||||
{# {% endif %}#}
|
||||
{# {% if perms.brands.delete_brands %}#}
|
||||
<a href="{% url 'BankAccountsDeleteView' Bank.id %}" class="btn btn-danger btn-sm">
|
||||
<i class="bi bi-trash"></i>
|
||||
</a>
|
||||
{# {% endif %}#}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% include 'components/_pagination.html' %}
|
||||
{% endblock %}
|
||||
17
Base/templates/BankAccounts/Update.html
Normal file
17
Base/templates/BankAccounts/Update.html
Normal file
@@ -0,0 +1,17 @@
|
||||
{% extends "BaseLogin.html" %}
|
||||
{% block title %} Bank Accounts List {% endblock %}
|
||||
{% block content %}
|
||||
<div class="conteiner mt-4">
|
||||
<h3 class="display-6"> Editar Bancos </h3>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form method="post" class="form">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<button type="submit" class="btn btn-primary"> Salvar </button>
|
||||
</form>
|
||||
<a href="{% url 'BankAccountsListView' %}" class="btn btn-secondary mt-3 "> Cancelar e Voltar </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
19
Base/templates/ChartOfAccount/Create.html
Normal file
19
Base/templates/ChartOfAccount/Create.html
Normal file
@@ -0,0 +1,19 @@
|
||||
{% extends "BaseLogin.html" %}
|
||||
{% block title %} Cadastro {% endblock %}
|
||||
{% block content %}
|
||||
|
||||
<div class="conteiner mt-4">
|
||||
<h3 class="display-6"> Cadastrar </h3>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form method="post" class="form">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<button type="submit" class="btn btn-primary"> Salvar </button>
|
||||
</form>
|
||||
<a href="{% url 'ServiceListListView' %}" class="btn btn-secondary mt-3 "> Cancelar e Voltar </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
18
Base/templates/ChartOfAccount/Delete.html
Normal file
18
Base/templates/ChartOfAccount/Delete.html
Normal file
@@ -0,0 +1,18 @@
|
||||
{% extends "BaseLogin.html" %}
|
||||
{% block title %} Bank Accounts List {% endblock %}
|
||||
{% block content %}
|
||||
<div class="conteiner mt-4">
|
||||
<h3 class="display-6"> Deletar da Marcar </h3>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h3 class="card-title">Tem certeza que quer deletar ? </h3>
|
||||
<strong>{{ object.name }}</strong>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
<button type="submit" class="btn btn-danger mt-3"> Deletar </button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<a href="{% url 'ServiceListListView' %}" class="btn btn-secondary mt-3 "> Cancelar e Voltar </a>
|
||||
</div>
|
||||
{% endblock %}
|
||||
16
Base/templates/ChartOfAccount/Detail.html
Normal file
16
Base/templates/ChartOfAccount/Detail.html
Normal file
@@ -0,0 +1,16 @@
|
||||
{% extends "BaseLogin.html" %}
|
||||
{% block title %} Bank Accounts List {% endblock %}
|
||||
{% block content %}
|
||||
<div class="conteiner mt-4">
|
||||
<h3 class="display-6"> Detalhes </h3>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h3 class="card-title">{{ object.name }}</h3>
|
||||
<h3 class="card-title">{{ object.value }}</h3>
|
||||
<p class="card-text">Descrição: {{ object.description }}</p>
|
||||
{# <a href="{% url 'BrandsUpdate' object.id %}" class="btn btn-secondary mt-3 "> Editar </a>#}
|
||||
</div>
|
||||
</div>
|
||||
<a href="{% url 'ServiceListListView' %}" class="btn btn-secondary mt-3 "> Cancelar e Voltar </a>
|
||||
</div>
|
||||
{% endblock %}
|
||||
68
Base/templates/ChartOfAccount/List.html
Normal file
68
Base/templates/ChartOfAccount/List.html
Normal file
@@ -0,0 +1,68 @@
|
||||
{% extends "BaseLogin.html" %}
|
||||
{% block title %} List {% endblock %}
|
||||
{% block content %}
|
||||
<h1> Plano de Contas </h1><br>
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<form method="get" action="{% url 'ChartOfAccountListView' %}">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" name="name"
|
||||
placeholder="Nome" value="{{ request.GET.name }}">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="bi bi-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{# {% if perms.brands.add_brands %}#}
|
||||
<div class="col-md-6">
|
||||
<a href="{% url 'ChartOfAccountCreateView' %}" class="btn btn-success float-end">
|
||||
<i class="bi bi-plus"></i> Criar </a>
|
||||
</div>
|
||||
{# {% endif %}#}
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead class="thead-dark">
|
||||
<tr align="center">
|
||||
{# <th> ID </th>#}
|
||||
<th> Nome </th>
|
||||
<th > Notas </th>
|
||||
<th width="10%"> Debito </th>
|
||||
<th width="10%"> Firma </th>
|
||||
<th width="15%"> Ações </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for Chart in ChartOfAccount %}
|
||||
<tr align="center">
|
||||
{# <td> {{ Chart.id }} </td>#}
|
||||
<td> {{ Chart.name }} </td>
|
||||
<td> {{ Chart.notes }} </td>
|
||||
<td> {% if Chart.debit %} <i class="bi bi-check-circle-fill text-success "></i>
|
||||
{% else %} <i class="bi bi-x-circle-fill text-danger "></i> {% endif %} </td>
|
||||
<td> {% if Chart.firm %} <i class="bi bi-check-circle-fill text-success "></i>
|
||||
{% else %} <i class="bi bi-x-circle-fill text-danger "></i> {% endif %} </td>
|
||||
<td>
|
||||
<a href="{% url 'ChartOfAccountDetailView' Chart.id %}" class="btn btn-info btn-sm">
|
||||
<i class="bi bi-eye"></i>
|
||||
</a>
|
||||
{# {% if perms.brands.change_brands %}#}
|
||||
<a href="{% url 'ChartOfAccountUpdateView' Chart.id %}" class="btn btn-warning btn-sm">
|
||||
<i class="bi bi-pencil"></i>
|
||||
</a>
|
||||
{# {% endif %}#}
|
||||
{# {% if perms.brands.delete_brands %}#}
|
||||
<a href="{% url 'ChartOfAccountDeleteView' Chart.id %}" class="btn btn-danger btn-sm">
|
||||
<i class="bi bi-trash"></i>
|
||||
</a>
|
||||
{# {% endif %}#}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% include 'components/_pagination.html' %}
|
||||
{% endblock %}
|
||||
17
Base/templates/ChartOfAccount/Update.html
Normal file
17
Base/templates/ChartOfAccount/Update.html
Normal file
@@ -0,0 +1,17 @@
|
||||
{% extends "BaseLogin.html" %}
|
||||
{% block title %} Bank Accounts List {% endblock %}
|
||||
{% block content %}
|
||||
<div class="conteiner mt-4">
|
||||
<h3 class="display-6"> Editar Bancos </h3>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form method="post" class="form">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<button type="submit" class="btn btn-primary"> Salvar </button>
|
||||
</form>
|
||||
<a href="{% url 'BankAccountsListView' %}" class="btn btn-secondary mt-3 "> Cancelar e Voltar </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -1,11 +0,0 @@
|
||||
{% extends "BaseLogin.html" %}
|
||||
{% block title %} Dashboard {% endblock %}
|
||||
{% block content %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h1> {{ Day }} </h1>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
{% endblock %}
|
||||
24
Base/templates/Login/Dashboard/Professional.html
Normal file
24
Base/templates/Login/Dashboard/Professional.html
Normal file
@@ -0,0 +1,24 @@
|
||||
<h3> Professional </h3>
|
||||
<div class="row">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Banco</th>
|
||||
<th>Total</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for Prof, sum in Professional.professional.items %}
|
||||
{% if sum != 0 %}
|
||||
<tr class="table table-striped" >
|
||||
<td>{{ Prof }}</td>
|
||||
<td>R$ {{ sum|floatformat:2 }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% empty %} <tr> <td colspan="2"> Vazio. </td> </tr> {% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<p> Total : R$: {{ Professional.sum_all_prof|floatformat:2 }}</p>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
24
Base/templates/Login/Dashboard/Service.html
Normal file
24
Base/templates/Login/Dashboard/Service.html
Normal file
@@ -0,0 +1,24 @@
|
||||
<h3> Serviço </h3>
|
||||
<div class="row">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Produtos</th>
|
||||
<th>Total</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for Prod, sum in Service.Service.items %}
|
||||
{% if sum != 0 %}
|
||||
<tr class="table table-striped" >
|
||||
<td>{{ Prod }}</td>
|
||||
<td>R$ {{ sum|floatformat:2 }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% empty %} <tr> <td colspan="2"> Vazio. </td> </tr> {% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<p> Total R$: {{ Service.sum|floatformat:2 }}</p>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
23
Base/templates/Login/Dashboard/Stone.html
Normal file
23
Base/templates/Login/Dashboard/Stone.html
Normal file
@@ -0,0 +1,23 @@
|
||||
<h3> Estoque </h3>
|
||||
<div class="row">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Produtos</th>
|
||||
<th>Total</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for Prod, sum in Stone.Stone.items %}
|
||||
{% if sum != 0 %}
|
||||
<tr class="table table-striped" >
|
||||
<td>{{ Prod }}</td>
|
||||
<td>{{ sum|floatformat:0 }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% empty %} <tr> <td colspan="2"> Vazio. </td> </tr> {% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
22
Base/templates/Login/Dashboard/Sum_of_product.html
Normal file
22
Base/templates/Login/Dashboard/Sum_of_product.html
Normal file
@@ -0,0 +1,22 @@
|
||||
<h3> Produtos </h3>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Produto</th>
|
||||
<th>Total</th>
|
||||
<th>Quant.</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for name, value in Sum_of_product.product_report.items %}
|
||||
{% if value.product_item != 0 %}
|
||||
<tr class="table table-striped" >
|
||||
<td>{{ name }}</td>
|
||||
<td>R$ {{ value.product_item|floatformat:2 }}</td>
|
||||
<td>{{ value.product_cont }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% empty %} <tr> <td colspan="2"> Vazio. </td> </tr> {% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<p>Total da Venda : R$: {{ Sum_of_product.sum_of_product|floatformat:2 }}</p>
|
||||
@@ -0,0 +1,27 @@
|
||||
<h3 class="mb-4">Relatório de Profissionais</h3>
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Profissional</th>
|
||||
<th>Serviço</th>
|
||||
<th>Valor Bruto</th>
|
||||
<th>Quant.</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for professional, services in Sum_of_professional_detail.professionals_report.items %}
|
||||
{% for service, value in services.items %}
|
||||
{% if value.servSum != 0 %}
|
||||
<tr>
|
||||
<td>{{ professional }}</td>
|
||||
<td>{{ service }}</td>
|
||||
<td>R$ {{ value.servSum|floatformat:2 }}</td>
|
||||
<td>{{ value.servCont }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<p> Total de Hoje : R$: {{ Sum_of_professional_detail.sum_of_prof|floatformat:2 }}</p>
|
||||
<br>
|
||||
@@ -0,0 +1,20 @@
|
||||
<h3> Pagamentos </h3>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Banco</th>
|
||||
<th>Total</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for name, value in Sum_payment_method_service.bank_balance.items %}
|
||||
{% if value != 0 %}
|
||||
<tr class="table table-striped" >
|
||||
<td>{{ name }}</td>
|
||||
<td>R$ {{ value|floatformat:2 }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% empty %} <tr> <td colspan="2"> Vazio </td> </tr> {% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<p>Total : R$: {{ Sum_payment_method_service.sum_of_bank|floatformat:2 }}</p>
|
||||
28
Base/templates/Login/Dashboard/index.html
Normal file
28
Base/templates/Login/Dashboard/index.html
Normal file
@@ -0,0 +1,28 @@
|
||||
{% extends "BaseLogin.html" %}
|
||||
{% block title %} Dashboard {% endblock %}
|
||||
{% block content %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">{% include 'Login/Dashboard/Sum_of_professional_detail.html' %} </div>
|
||||
<div class="col-md-2"></div>
|
||||
<div class="col-md-3">{% include 'Login/Dashboard/Stone.html' %} </div>
|
||||
<div class="col-md-1"> </div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-2">
|
||||
<div class="col-md-12"> {% include 'Login/Dashboard/Sum_payment_method_service.html' %} </div>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<div class="col-md-12">{% include 'Login/Dashboard/Professional.html' %} </div>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<div class="col-md-12">{% include 'Login/Dashboard/Sum_of_product.html' %} </div>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<div class="col-md-12">{% include 'Login/Dashboard/Service.html' %} </div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
|
||||
{% endblock %}
|
||||
25
Base/templates/Login/DashboardAdmin/index.html
Normal file
25
Base/templates/Login/DashboardAdmin/index.html
Normal file
@@ -0,0 +1,25 @@
|
||||
{% extends "BaseLogin.html" %}
|
||||
{% block title %} Dashboard Admin {% endblock %}
|
||||
{% block content %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<a href="{% url 'ProfessionalListView' %}" class="btn btn-primary"> Professional </a><br>
|
||||
<a href="{% url 'BankAccountsListView' %}" class="btn btn-primary"> Banks </a><br>
|
||||
<a href="{% url 'PayMethodListView' %}" class="btn btn-primary"> Meio de Pagamento </a><br>
|
||||
<a href="{% url 'ServiceListListView' %}" class="btn btn-primary"> Lista de Serviços </a><br>
|
||||
<a href="{% url 'ProductListListView' %}" class="btn btn-primary"> Lista de Produtos </a><br>
|
||||
<a href="{% url 'ChartOfAccountListView' %}" class="btn btn-primary"> Plano de Contas </a><br>
|
||||
<a href="{% url 'MovStockListView' %}" class="btn btn-primary"> Estoque </a><br>
|
||||
<a href="{% url 'MovExpenseListView' %}" class="btn btn-primary"> Despesa </a><br>
|
||||
<a href="{% url 'MovProductListView' %}" class="btn btn-primary"> Venda de Produtos </a><br>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-md-3">{% include 'Login/DashboardAdmin/total_banck.html' %} </div>
|
||||
<div class="col-md-3"> {% include 'Login/DashboardAdmin/total_prof_month.html' %} </div>
|
||||
{# <div class="col-md-3"> </div>#}
|
||||
{# <div class="col-md-1"> </div>#}
|
||||
</div>
|
||||
{% endblock %}
|
||||
21
Base/templates/Login/DashboardAdmin/total_banck.html
Normal file
21
Base/templates/Login/DashboardAdmin/total_banck.html
Normal file
@@ -0,0 +1,21 @@
|
||||
<h3> Bancos </h3>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Banco</th>
|
||||
<th>Total</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for name, value in total_bank.items %}
|
||||
<tr class="table table-striped" >
|
||||
<td>{{ name }}</td>
|
||||
<td>R$ {{ value|floatformat:2 }}</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr>
|
||||
<td colspan="2"> Vazio. </td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
21
Base/templates/Login/DashboardAdmin/total_prof_month.html
Normal file
21
Base/templates/Login/DashboardAdmin/total_prof_month.html
Normal file
@@ -0,0 +1,21 @@
|
||||
<h3> Prof. </h3>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Prof.</th>
|
||||
<th>Total</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for name, value in total_prof.items %}
|
||||
<tr class="table table-striped" >
|
||||
<td>{{ name }}</td>
|
||||
<td>R$ {{ value|floatformat:2 }}</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr>
|
||||
<td colspan="2"> Vazio. </td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -11,7 +11,7 @@
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
<div class="mb-3">
|
||||
<label for="username" class="form-label">Usuário</label>
|
||||
<label for="username" class="form-label">Usuário </label>
|
||||
<input type="text" class="form-control" id="username" name="username" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
19
Base/templates/PayMethod/Create.html
Normal file
19
Base/templates/PayMethod/Create.html
Normal file
@@ -0,0 +1,19 @@
|
||||
{% extends "BaseLogin.html" %}
|
||||
{% block title %} Cadastro {% endblock %}
|
||||
{% block content %}
|
||||
|
||||
<div class="conteiner mt-4">
|
||||
<h3 class="display-6"> Cadastrar </h3>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form method="post" class="form">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<button type="submit" class="btn btn-primary"> Salvar </button>
|
||||
</form>
|
||||
<a href="{% url 'ServiceListListView' %}" class="btn btn-secondary mt-3 "> Cancelar e Voltar </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
18
Base/templates/PayMethod/Delete.html
Normal file
18
Base/templates/PayMethod/Delete.html
Normal file
@@ -0,0 +1,18 @@
|
||||
{% extends "BaseLogin.html" %}
|
||||
{% block title %} Bank Accounts List {% endblock %}
|
||||
{% block content %}
|
||||
<div class="conteiner mt-4">
|
||||
<h3 class="display-6"> Deletar da Marcar </h3>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h3 class="card-title">Tem certeza que quer deletar ? </h3>
|
||||
<strong>{{ object.name }}</strong>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
<button type="submit" class="btn btn-danger mt-3"> Deletar </button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<a href="{% url 'ServiceListListView' %}" class="btn btn-secondary mt-3 "> Cancelar e Voltar </a>
|
||||
</div>
|
||||
{% endblock %}
|
||||
16
Base/templates/PayMethod/Detail.html
Normal file
16
Base/templates/PayMethod/Detail.html
Normal file
@@ -0,0 +1,16 @@
|
||||
{% extends "BaseLogin.html" %}
|
||||
{% block title %} Bank Accounts List {% endblock %}
|
||||
{% block content %}
|
||||
<div class="conteiner mt-4">
|
||||
<h3 class="display-6"> Detalhes </h3>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h3 class="card-title">{{ object.name }}</h3>
|
||||
<h3 class="card-title">{{ object.value }}</h3>
|
||||
<p class="card-text">Descrição: {{ object.description }}</p>
|
||||
{# <a href="{% url 'BrandsUpdate' object.id %}" class="btn btn-secondary mt-3 "> Editar </a>#}
|
||||
</div>
|
||||
</div>
|
||||
<a href="{% url 'ServiceListListView' %}" class="btn btn-secondary mt-3 "> Cancelar e Voltar </a>
|
||||
</div>
|
||||
{% endblock %}
|
||||
66
Base/templates/PayMethod/List.html
Normal file
66
Base/templates/PayMethod/List.html
Normal file
@@ -0,0 +1,66 @@
|
||||
{% extends "BaseLogin.html" %}
|
||||
{% block title %} List {% endblock %}
|
||||
{% block content %}
|
||||
<h1> Serviços </h1><br>
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<form method="get" action="{% url 'PayMethodListView' %}">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" name="name"
|
||||
placeholder="Nome" value="{{ request.GET.name }}">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="bi bi-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{# {% if perms.brands.add_brands %}#}
|
||||
<div class="col-md-6">
|
||||
<a href="{% url 'PayMethodCreateView' %}" class="btn btn-success float-end">
|
||||
<i class="bi bi-plus"></i> Criar </a>
|
||||
</div>
|
||||
{# {% endif %}#}
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead class="thead-dark">
|
||||
<tr align="center">
|
||||
{# <th> ID </th>#}
|
||||
<th> Nome </th>
|
||||
<th> Banco </th>
|
||||
<th> Percentual </th>
|
||||
<th > Descrição </th>
|
||||
<th width="15%"> Ações </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for Payment in PayMethod %}
|
||||
<tr align="center">
|
||||
{# <td> {{ Payment.id }} </td>#}
|
||||
<td> {{ Payment.name }} </td>
|
||||
<td> {{ Payment.bank }} </td>
|
||||
<td> {{ Payment.percentage }} </td>
|
||||
<td> {{ Payment.description }} </td>
|
||||
<td>
|
||||
<a href="{% url 'PayMethodDetailView' Payment.id %}" class="btn btn-info btn-sm">
|
||||
<i class="bi bi-eye"></i>
|
||||
</a>
|
||||
{# {% if perms.brands.change_brands %}#}
|
||||
<a href="{% url 'PayMethodUpdateView' Payment.id %}" class="btn btn-warning btn-sm">
|
||||
<i class="bi bi-pencil"></i>
|
||||
</a>
|
||||
{# {% endif %}#}
|
||||
{# {% if perms.brands.delete_brands %}#}
|
||||
<a href="{% url 'PayMethodDeleteView' Payment.id %}" class="btn btn-danger btn-sm">
|
||||
<i class="bi bi-trash"></i>
|
||||
</a>
|
||||
{# {% endif %}#}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% include 'components/_pagination.html' %}
|
||||
{% endblock %}
|
||||
17
Base/templates/PayMethod/Update.html
Normal file
17
Base/templates/PayMethod/Update.html
Normal file
@@ -0,0 +1,17 @@
|
||||
{% extends "BaseLogin.html" %}
|
||||
{% block title %} Bank Accounts List {% endblock %}
|
||||
{% block content %}
|
||||
<div class="conteiner mt-4">
|
||||
<h3 class="display-6"> Editar Bancos </h3>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form method="post" class="form">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<button type="submit" class="btn btn-primary"> Salvar </button>
|
||||
</form>
|
||||
<a href="{% url 'BankAccountsListView' %}" class="btn btn-secondary mt-3 "> Cancelar e Voltar </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
19
Base/templates/ProductList/Create.html
Normal file
19
Base/templates/ProductList/Create.html
Normal file
@@ -0,0 +1,19 @@
|
||||
{% extends "BaseLogin.html" %}
|
||||
{% block title %} Cadastro {% endblock %}
|
||||
{% block content %}
|
||||
|
||||
<div class="conteiner mt-4">
|
||||
<h3 class="display-6"> Cadastrar </h3>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form method="post" class="form">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<button type="submit" class="btn btn-primary"> Salvar </button>
|
||||
</form>
|
||||
<a href="{% url 'ProductListListView' %}" class="btn btn-secondary mt-3 "> Cancelar e Voltar </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user