view: improve reconciliate_jar.

This commit is contained in:
Mono Mono 2024-07-13 17:48:57 -05:00
parent 74d2e0d234
commit 08deb9d4ec
4 changed files with 36 additions and 11 deletions

View File

@ -48,6 +48,6 @@ class ReconciliationJarForm(forms.ModelForm):
'cash_taken',
'cash_discrepancy',
]
# widgets = {
# 'date_time': DateTimeInput(attrs={'type': 'datetime-local'})
# }
widgets = {
'date_time': DateTimeInput(attrs={'type': 'datetime-local'})
}

View File

@ -0,0 +1,19 @@
# Generated by Django 5.0.6 on 2024-07-13 22:39
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('don_confiao', '0021_rename_reconciler_reconciliationjar_reconcilier'),
]
operations = [
migrations.AlterField(
model_name='payment',
name='reconciliation_jar',
field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.RESTRICT, to='don_confiao.reconciliationjar'),
),
]

View File

@ -106,6 +106,7 @@ class Payment(models.Model):
ReconciliationJar,
null=True,
default=None,
blank=True,
on_delete=models.RESTRICT
)
description = models.CharField(max_length=255, null=True, blank=True)

View File

@ -1,22 +1,27 @@
<!doctype html>
{% if summary.total %}
<div class="reconciliate_jar summary">
<div class="reconciliate_jar summary" style="border: solid 1px brown; margin: 10px">
<h2>Pagos No reconciliados</h2>
<table>
<table style="border: solid 1px blue; margin: 10px">
<thead>
<th><td>Fecha</td>Monto</th>
{% for payment in summary.payments %}
<tr><td>payment.date_time</td><td>payment.amount</td></tr>
{% endfor %}
<tr><th>Fecha</th><th>Monto</th></tr>
</thead>
{{ summary.total }}
<tbody>
{% for payment in summary.payments %}
<tr><td>{{ payment.date_time }}</td><td>{{ payment.amount }}</td></tr>
{% endfor %}
</tbody>
<tfoot>
<tr><th>Total</th><td>{{ summary.total }}</td></tr>
</tfoot>
</table>
</div>
<form method="POST">
<table style="border: solid 1px blue; margin: 10px">
{% csrf_token %}
{{ form.as_table }}
</table>
<br/><button name="form" type="submit" >Comprar</button>
<br/><button name="form" type="submit" >Recoger dinero</button>
</form>
{% else %}
<div class="reconciliate_jar information noform">