feat: remplazando formulario compra manual por formulario django
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
<!doctype html>
|
||||
<form method="POST">
|
||||
{% csrf_token %}
|
||||
{{ sale_form}}
|
||||
{{ linea_formset.management_form }}
|
||||
{% for form in linea_formset %}
|
||||
<table style="border: solid 1px blue; margin: 10px">
|
||||
{{ form.as_table }}
|
||||
</table>
|
||||
{% endfor %}
|
||||
<br/><button name="form" type="submit" >Comprar</button>
|
||||
</form>
|
||||
@@ -1,43 +1,12 @@
|
||||
<!doctype html>
|
||||
<form action="{% url 'buy'%}" method="POST">
|
||||
<form method="POST">
|
||||
{% csrf_token %}
|
||||
<fieldset>
|
||||
<legend>Purchase</legend>
|
||||
<label for="customer">Customer</label>:
|
||||
<input type="search" name="customer" id="customer"/>
|
||||
|
||||
<label for="date">Date</label>:
|
||||
<input type="date" name="date" id="date"/>
|
||||
|
||||
<label for="description">Description</label>:
|
||||
<input type="text" name="description" id="description"/>
|
||||
|
||||
<fieldset>
|
||||
<legend>Purchase Line</legend>
|
||||
<label for="product">Product</label>:
|
||||
<input type="search" name="product" id="product"/>
|
||||
|
||||
<label for="unit_price">Unit Price</label>:
|
||||
<input type="number" name="unit_price" min="0" id="unit_price"/>
|
||||
|
||||
<label for="quantity">Quantity</label>:
|
||||
<input type="number" name="quantity" min="0" id="quantity"/>
|
||||
|
||||
<label for="subtotal">Subtotal</label>:
|
||||
<input type="number" name="subtotal" min="0" id="line_amount"/>
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<label for="total_amount">Total</label>:
|
||||
<input type="number" name="total_amount" min="0" id="total_amount"/>
|
||||
|
||||
<label for="Paid">Paid:</label>
|
||||
<select id="paid" name="paid">
|
||||
<option value="yes">Yes</option>
|
||||
<option value="no">No</option>
|
||||
</select>
|
||||
</fieldset>
|
||||
<div class="button-container">
|
||||
<button name="form" type="submit">Enviar</button>
|
||||
</div>
|
||||
{{ sale_form}}
|
||||
{{ linea_formset.management_form }}
|
||||
{% for form in linea_formset %}
|
||||
<table style="border: solid 1px blue; margin: 10px">
|
||||
{{ form.as_table }}
|
||||
</table>
|
||||
{% endfor %}
|
||||
<br/><button name="form" type="submit" >Comprar</button>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user