From 753ef5cb2a97d5e62bddde93ce66cdcc13f218bf Mon Sep 17 00:00:00 2001 From: GunpreetAhuja Date: Thu, 19 Jun 2014 13:22:48 +0530 Subject: [PATCH 01/10] path changed --- src/templates/print/form.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/templates/print/form.html b/src/templates/print/form.html index 4745a24..53d6112 100644 --- a/src/templates/print/form.html +++ b/src/templates/print/form.html @@ -3,7 +3,7 @@ Lab Reports -
+ {% csrf_token %} Material: - {% for name in forms.material_name %} - - {% endfor %} - -

Time span:

-

From: - To:

- + {% for name in forms.material_name %} + + {% endfor %} +

Time span:

+

From:(dd/mm/yyyy) + To:(dd/mm/yyyy)

+
From 356f9b3b565b31c50632b50dedc1abcadcf31bad Mon Sep 17 00:00:00 2001 From: GunpreetAhuja Date: Sun, 22 Jun 2014 17:49:46 +0530 Subject: [PATCH 07/10] formatting --- src/templates/print/form.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/templates/print/form.html b/src/templates/print/form.html index e74a063..b5a116c 100644 --- a/src/templates/print/form.html +++ b/src/templates/print/form.html @@ -6,11 +6,11 @@
{% csrf_token %} Material: - {% for name in forms.material_name %} {% endfor %} +

Time span:

From:(dd/mm/yyyy) To:(dd/mm/yyyy)

From 97a031851fdfb85b648f6a87dda1067a624e3e4a Mon Sep 17 00:00:00 2001 From: Gunpreet Ahuja Date: Mon, 23 Jun 2014 21:59:16 +0530 Subject: [PATCH 08/10] Delete reports.html --- src/templates/print/reports.html | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 src/templates/print/reports.html diff --git a/src/templates/print/reports.html b/src/templates/print/reports.html deleted file mode 100644 index 31543d7..0000000 --- a/src/templates/print/reports.html +++ /dev/null @@ -1,30 +0,0 @@ - -

GURU NANAK DEV ENGINEERING COLLEGE

- -

Punjab Govt. Aided Status, NBA Accredited ISO-9001-2008 Certified

-

Testing & Consultancy Cell

-

Gill Park, Gill Road, Ludhiana-141006

-

Website:http//tcc.gndec.ac.in Email:tcc@gndec.ac.in Ph:0161-2491193,5064509 Fax:0161-5064742

- -Lab Reports - - - - - - - - - -{{% for m in purchase_data}} - - - - - - - -{%endfor %} -
LAB REPORT
Receipt No. Date Client Company Amount
{{ m.Receipt}{{m.Date}}{{m.Client}}{{m.Amount}}
- - From 58ac92a46cafa5bcd15f9a89dcd1790a0820fc30 Mon Sep 17 00:00:00 2001 From: Gunpreet Ahuja Date: Mon, 23 Jun 2014 22:09:23 +0530 Subject: [PATCH 09/10] Delete views.py --- src/librehatti/print/views.py | 46 ----------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 src/librehatti/print/views.py diff --git a/src/librehatti/print/views.py b/src/librehatti/print/views.py deleted file mode 100644 index 3a940cb..0000000 --- a/src/librehatti/print/views.py +++ /dev/null @@ -1,46 +0,0 @@ -from django.shortcuts import render -from librehatti.catalog.models import * -from forms import DeptForm -from django.http import HttpResponseRedirect -from librehatti.catalog.models import Category, PurchaseOrder,PurchasedItem - - -def add_material(request): - purchase_data = PurchaseOrder.objects.all() - if request.method == 'POST': - form = DeptForm(request.POST) - if form.is_valid(): - cd = form.cleaned_data - start_date = cd['start_date'] - end_date = cd['end_date'] - dates(start_date, end_date) - purchase_data = PurchaseOrder.objects.filter(purchase_date__range - =(start_date,end_date)).values('buyer_id', - 'date_time', 'organisation') - purchase_data1 = PurchaseOrder.objects.filter(date_time__range - =(start_date,end_date)) - purchased_item = PurchasedItem.objects.get(buyer_id__in - =purchase_data1) - sub_total= purchased_item.qty* purchased_item.price - total_cost_temp = PurchasedItem.objects.filter(id__in= - purchase_data1).aggregate(Sum('sub_total')) - total_cost = total_cost_temp['total_cost__sum'] - return HttpResponseRedirect('/print/addmaterial') - return render(request, 'reports.html', {'purchase_data' : - purchase_data, 'start_date':start_date,'end_date':end_date, - 'total_cost':total_cost}) - - else: - form = DeptForm() - material_name = Category.objects.values('name') - return render(request,'print/form.html',{'material_name' : material_name, - 'form': form}) - else: - form = DeptForm() - material_name = Category.objects.values('name') - return render(request,'print/form.html',{'material_name' : material_name, - 'form': form}) - - - - From 3c4e5b97f435bd4c48700161e1abd6d173d9f186 Mon Sep 17 00:00:00 2001 From: GunpreetAhuja Date: Sat, 28 Jun 2014 21:21:47 +0530 Subject: [PATCH 10/10] final template --- src/librehatti/print/urls.py | 6 ++++++ src/templates/print/form.html | 22 +++++++++++----------- 2 files changed, 17 insertions(+), 11 deletions(-) create mode 100644 src/librehatti/print/urls.py diff --git a/src/librehatti/print/urls.py b/src/librehatti/print/urls.py new file mode 100644 index 0000000..c8b3929 --- /dev/null +++ b/src/librehatti/print/urls.py @@ -0,0 +1,6 @@ +from django.conf.urls import url, patterns + +urlpatterns = patterns('librehatti.print.views', + url(r'^addmaterial/', 'add_material'), + +) diff --git a/src/templates/print/form.html b/src/templates/print/form.html index b5a116c..bf18ce2 100644 --- a/src/templates/print/form.html +++ b/src/templates/print/form.html @@ -3,18 +3,18 @@ Lab Reports - - {% csrf_token %} + + {% csrf_token %} Material: - -

Time span:

-

From:(dd/mm/yyyy) - To:(dd/mm/yyyy)

- + +

Time span:

+

From: + To:

+