feat: implementing form to reconciliation jar.
This commit is contained in:
@@ -2,8 +2,8 @@ from django.shortcuts import render
|
||||
from django.http import HttpResponse, HttpResponseRedirect, JsonResponse
|
||||
from django.template import loader
|
||||
|
||||
from .models import Sale, Product, ProductCategory
|
||||
from .forms import ImportProductsForm, PurchaseForm, LineaFormSet
|
||||
from .models import Sale, Product, ProductCategory, Payment
|
||||
from .forms import ImportProductsForm, PurchaseForm, LineaFormSet, ReconciliationJarForm
|
||||
|
||||
import csv
|
||||
import io
|
||||
@@ -69,6 +69,21 @@ def import_products(request):
|
||||
{'form': form}
|
||||
)
|
||||
|
||||
|
||||
def reconciliate_jar(request):
|
||||
if request.method == 'POST':
|
||||
return HttpResponseRedirect("cuadres")
|
||||
|
||||
form = ReconciliationJarForm()
|
||||
summary = Payment.get_reconciliation_jar_summary()
|
||||
# raise Exception(Payment.get_reconciliation_jar_summary().payments)
|
||||
return render(
|
||||
request,
|
||||
"don_confiao/reconciliate_jar.html",
|
||||
{'summary': summary, 'form': form}
|
||||
)
|
||||
|
||||
|
||||
def _categories_from_csv_string(categories_string, separator="&"):
|
||||
categories = categories_string.split(separator)
|
||||
clean_categories = [c.strip() for c in categories]
|
||||
|
||||
Reference in New Issue
Block a user