Index: main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py	(revision 11535)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py	(revision 11550)
@@ -38,5 +38,5 @@
 from waeup.kofa.browser.pdf import (
     ENTRY1_STYLE, format_html, NOTE_STYLE, HEADING_STYLE, 
-    get_signature_tables)
+    get_signature_tables, get_qrcode)
 from waeup.kofa.browser.interfaces import IPDFCreator
 from waeup.kofa.utils.helpers import to_timezone
@@ -105,5 +105,6 @@
         )
 
-def render_student_data(studentview, omit_fields=(), lang='en'):
+def render_student_data(studentview, context, omit_fields=(),
+                        lang='en', slipname=None):
     """Render student table for an existing frame.
     """
@@ -111,5 +112,5 @@
     set_up_widgets(studentview, ignore_request=True)
     data_left = []
-    data_right = []
+    data_middle = []
     style = getSampleStyleSheet()
     img = getUtility(IExtFileStore).getFileByContext(
@@ -126,5 +127,5 @@
     f_text = formatted_text(studentview.context.display_fullname)
     f_text = Paragraph(f_text, ENTRY1_STYLE)
-    data_right.append([f_label,f_text])
+    data_middle.append([f_label,f_text])
 
     for widget in studentview.widgets:
@@ -137,5 +138,5 @@
         f_text = formatted_text(widget(), lang=lang)
         f_text = Paragraph(f_text, ENTRY1_STYLE)
-        data_right.append([f_label,f_text])
+        data_middle.append([f_label,f_text])
 
     if getattr(studentview.context, 'certcode', None):
@@ -146,5 +147,5 @@
                 studentview.context['studycourse'].certificate.longtitle)
             f_text = Paragraph(f_text, ENTRY1_STYLE)
-            data_right.append([f_label,f_text])
+            data_middle.append([f_label,f_text])
         if not 'department' in omit_fields:
             f_label = trans(_('Department:'), lang)
@@ -155,5 +156,5 @@
                 )
             f_text = Paragraph(f_text, ENTRY1_STYLE)
-            data_right.append([f_label,f_text])
+            data_middle.append([f_label,f_text])
         if not 'faculty' in omit_fields:
             f_label = trans(_('Faculty:'), lang)
@@ -164,5 +165,5 @@
                 )
             f_text = Paragraph(f_text, ENTRY1_STYLE)
-            data_right.append([f_label,f_text])
+            data_middle.append([f_label,f_text])
         if not 'current_mode' in omit_fields:
             studymodes_dict = getUtility(IKofaUtils).STUDY_MODES_DICT
@@ -172,5 +173,5 @@
             f_text = formatted_text(sm)
             f_text = Paragraph(f_text, ENTRY1_STYLE)
-            data_right.append([f_label,f_text])
+            data_middle.append([f_label,f_text])
         if not 'entry_session' in omit_fields:
             f_label = trans(_('Entry Session:'), lang)
@@ -180,5 +181,5 @@
             f_text = formatted_text(entry_session)
             f_text = Paragraph(f_text, ENTRY1_STYLE)
-            data_right.append([f_label,f_text])
+            data_middle.append([f_label,f_text])
         # Requested by Uniben, does not really make sense
         if not 'current_level' in omit_fields:
@@ -191,5 +192,5 @@
             f_text = formatted_text(current_level)
             f_text = Paragraph(f_text, ENTRY1_STYLE)
-            data_right.append([f_label,f_text])
+            data_middle.append([f_label,f_text])
         if not 'date_of_birth' in omit_fields:
             f_label = trans(_('Date of Birth:'), lang)
@@ -202,9 +203,17 @@
             f_text = formatted_text(date_of_birth)
             f_text = Paragraph(f_text, ENTRY1_STYLE)
-            data_right.append([f_label,f_text])
+            data_middle.append([f_label,f_text])
+
+    # append QR code to the right
+    if slipname:
+        url = studentview.url(context, slipname)
+        data_right = [[get_qrcode(url, width=70.0)]]
+        table_right = Table(data_right,style=SLIP_STYLE)
+    else:
+        table_right = None
 
     table_left = Table(data_left,style=SLIP_STYLE)
-    table_right = Table(data_right,style=SLIP_STYLE, colWidths=[5*cm, 6*cm])
-    table = Table([[table_left, table_right],],style=SLIP_STYLE)
+    table_middle = Table(data_middle,style=SLIP_STYLE, colWidths=[5*cm, 5*cm])
+    table = Table([[table_left, table_middle, table_right],],style=SLIP_STYLE)
     return table
 
@@ -589,5 +598,7 @@
 
         # Student data
-        data.append(render_student_data(view, omit_fields, lang=portal_language))
+        data.append(render_student_data(view, student,
+                    omit_fields, lang=portal_language,
+                    slipname='admission_slip.pdf'))
 
         # Text after student data
@@ -649,5 +660,6 @@
             data.append(Paragraph(bd_translation, HEADING_STYLE))
             data.append(render_student_data(
-                studentview, omit_fields, lang=portal_language))
+                studentview, view.context, omit_fields, lang=portal_language,
+                slipname=filename))
 
         # Insert widgets
@@ -757,6 +769,7 @@
             #data.append(Paragraph(bd_translation, HEADING_STYLE))
             data.append(render_student_data(
-                studentview, omit_fields, lang=portal_language))
-
+                studentview, view.context,
+                omit_fields, lang=portal_language,
+                slipname=filename))
 
         transcript_data = view.context.getTranscriptData()
