-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
242 additions
and
25 deletions.
There are no files selected for viewing
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from django import forms | ||
|
||
class SaleForm(forms.Form): | ||
reference_code = forms.IntegerField(label='Código de Referência') | ||
customer = forms.ChoiceField(label='Cliente') | ||
discount = forms.DecimalField(label='Desconto', decimal_places=2, max_digits=5, ) | ||
|
||
class ProductForm(forms.Form): | ||
product_id = forms.CharField(label='Produto') | ||
quantity = forms.IntegerField(label='Quantidade') | ||
discount = forms.DecimalField(label='Desconto', max_digits=5, decimal_places=2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 3.2.3 on 2021-10-12 16:10 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('product', '0004_remove_product_weight'), | ||
('order', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.RenameModel( | ||
old_name='SaleItens', | ||
new_name='SaleItem', | ||
), | ||
] |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{% extends 'base.html' %} | ||
{% block title %}Deletar Venda{% endblock %} | ||
|
||
{% load crispy_forms_tags %} | ||
{% block content %} | ||
|
||
|
||
<div class="app-wrapper"> | ||
<div class="app-content pt-3 p-md-3 p-lg-4"> | ||
<div class="container-xl"> | ||
<div class="row col-10"> | ||
<div class="row my-4"> | ||
<div class="col-md-6 offset-md-3"> | ||
<div class="border p-3 bg-white"> | ||
<h3>Excluir Produto</h3> | ||
<hr> | ||
<form method="POST"> | ||
<div class="alert alert-danger"> | ||
<h4>Tem certeza que deseja excluir a venda "{{ sale.reference_code }}" ? <br>Lembre-se que essa ação é irreversível</h4> | ||
</div> | ||
{% csrf_token %} | ||
{{ form|crispy }} | ||
<a class="btn btn-secondary btn-sm" href="{% url 'order:list' %}">Cancelar</a> | ||
<input class="btn btn-danger btn-sm" type="submit" value="Confirmar"> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div><!--//container-fluid--> | ||
</div><!--//app-content--> | ||
</div><!--//app-wrapper--> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{% extends "base.html"%} | ||
{% block title %}Nova Ordem de Venda {% endblock title%} | ||
|
||
{% block content %} | ||
|
||
{% load crispy_forms_tags %} | ||
|
||
<div class="app-wrapper"> | ||
<div class="app-content pt-3 p-md-3 p-lg-4"> | ||
<div class="container-xl"> | ||
<h1 class="app-page-title">Cabeçalho Venda {{ sale_obj.reference_code }} </h1> | ||
<h5> Preço {{ sale_obj.price }}</h5> | ||
<form method="POST" action='{% url 'order:new' %}'> | ||
{% csrf_token %} | ||
<label for='reference_code'>Código de Referência</label><br> | ||
<input type='text' class='form-control'name='reference_code' value="{{reference_code}}" placeholder='9999'> | ||
<label for='customer'>Cliente</label><br> | ||
<input type='text' class='form-control'name='customer' value='{{customer}}' placeholder='Só números'> | ||
<label for='discount'>Desconto</label><br> | ||
<input type='number' class='form-control'name='discount' value='{{discount}}' placeholder='0,00'> | ||
<input type="hidden" name="sale_id" value='{{sale_obj.id}}'> | ||
<input class="btn btn-primary"type="submit" value="Criar"> | ||
</form> | ||
{% if sale_obj %} | ||
<h4>Adicionar Produtos </h4> | ||
<form action='{% url 'order:add_product' sale_obj.id %}' method='POST'> | ||
{% csrf_token %} | ||
<label for='product_id'>Id do Produto</label><br> | ||
<input type='text' class='form-control'name='product_id' value="{{product_id}}" placeholder='9999'> | ||
<label for='quantity'>Quantidade</label><br> | ||
<input type='number' class='form-control'name='quantity' value="{{quantity}}" placeholder='1~99'> | ||
<label for='discount'>Desconto</label><br> | ||
<input type='number' class='form-control'name='discount' value="{{discount}}" placeholder='0'> | ||
<button class="btn btn-primary" type="submit">Incluir</button> | ||
</form> | ||
<h2>Listagem de Itens :</h2> | ||
<table class="table"> | ||
<thread> | ||
<tr> | ||
<th scope="col">Id</th> | ||
<th scope="col">Nome</th> | ||
<th scope="col">Quantidade</th> | ||
<th scope="col">Desconto</th> | ||
</tr> | ||
</thread> | ||
<tbody> | ||
{% for item in itens %} | ||
<tr> | ||
<td>{{ item.id }}</td> | ||
<td>{{ item.product.name }}</td> | ||
<td>{{ item.quantity }}</td> | ||
<td>{{ item.discount }}</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
{% endif %} | ||
</div><!--//container-fluid--> | ||
</div><!--//app-content--> | ||
</div><!--//app-wrapper--> | ||
|
||
{% endblock content%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{% extends "base.html"%} | ||
{% block title %}Nova Ordem de Venda {% endblock title%} | ||
|
||
{% block content %} | ||
|
||
{% load crispy_forms_tags %} | ||
|
||
<div class="app-wrapper"> | ||
<div class="app-content pt-3 p-md-3 p-lg-4"> | ||
<div class="container-xl"> | ||
<h1 class="app-page-title">Cabeçalho Venda {{ sale_obj.reference_code }} </h1> | ||
<h5> Preço {{ sale_obj.price }}</h5> | ||
<form method="POST" action='{% url 'order:new' %}'> | ||
{% csrf_token %} | ||
<label for='reference_code'>Código de Referência</label><br> | ||
<input type='text' class='form-control'name='reference_code' value="{{reference_code}}" placeholder='9999'> | ||
<label for='customer'>Cliente</label><br> | ||
<input type='text' class='form-control'name='customer' value='{{customer}}' placeholder='Só números'> | ||
<label for='discount'>Desconto</label><br> | ||
<input type='number' class='form-control'name='discount' value='{{discount}}' placeholder='0,00'> | ||
<input type="hidden" name="sale_id" value='{{sale_obj.id}}'> | ||
<input class="btn btn-primary"type="submit" value="Criar"> | ||
</form> | ||
{% if sale_obj %} | ||
<h4>Adicionar Produtos </h4> | ||
<form action='{% url 'order:add_product' sale_obj.id %}' method='POST'> | ||
{% csrf_token %} | ||
<label for='product_id'>Id do Produto</label><br> | ||
<input type='text' class='form-control'name='product_id' value="{{product_id}}" placeholder='9999'> | ||
<label for='quantity'>Quantidade</label><br> | ||
<input type='number' class='form-control'name='quantity' value="{{quantity}}" placeholder='1~99'> | ||
<label for='discount'>Desconto</label><br> | ||
<input type='number' class='form-control'name='discount' value="{{discount}}" placeholder='0'> | ||
<button class="btn btn-primary" type="submit">Incluir</button> | ||
</form> | ||
<h2>Listagem de Itens :</h2> | ||
<table class="table"> | ||
<thread> | ||
<tr> | ||
<th scope="col">Id</th> | ||
<th scope="col">Nome</th> | ||
<th scope="col">Quantidade</th> | ||
<th scope="col">Desconto</th> | ||
</tr> | ||
</thread> | ||
<tbody> | ||
{% for item in itens %} | ||
<tr> | ||
<td>{{ item.id }}</td> | ||
<td>{{ item.product.name }}</td> | ||
<td>{{ item.quantity }}</td> | ||
<td>{{ item.discount }}</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
{% endif %} | ||
</div><!--//container-fluid--> | ||
</div><!--//app-content--> | ||
</div><!--//app-wrapper--> | ||
|
||
{% endblock content%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.