From bcc099b3d06d8fc88cdddbe1453b791e4f0c712f Mon Sep 17 00:00:00 2001 From: shanu Date: Sat, 29 Oct 2011 12:24:08 -0200 Subject: [PATCH] Shanu: Added print functionality --- application.properties | 4 +- grails-app/conf/Config.groovy | 28 ++++------ grails-app/views/voucher/invoiceEntry.gsp | 2 +- grails-app/views/voucher/printInvoice.gsp | 66 ++++++++++++++++++++--- 4 files changed, 71 insertions(+), 29 deletions(-) diff --git a/application.properties b/application.properties index 4f22157..40ec8ec 100644 --- a/application.properties +++ b/application.properties @@ -1,10 +1,10 @@ #Grails Metadata file -#Mon Oct 10 21:26:48 BRT 2011 +#Sat Oct 29 10:58:59 BRST 2011 app.grails.version=1.3.4 app.name=VMS app.servlet.version=2.4 app.version=0.1 plugins.hibernate=1.3.4 -plugins.jasper=1.1.6.3 +plugins.jasper=1.2.2 plugins.spring-security-core=1.0.1 plugins.tomcat=1.3.4 diff --git a/grails-app/conf/Config.groovy b/grails-app/conf/Config.groovy index 12e4e2b..8092726 100644 --- a/grails-app/conf/Config.groovy +++ b/grails-app/conf/Config.groovy @@ -46,23 +46,6 @@ grails.logging.jul.usebridge = true // packages to include in Spring bean scanning grails.spring.bean.packages = [] -// set per-environment serverURL stem for creating absolute links -environments { - production { - grails.serverURL = "http://www.changeme.com" - jasper.dir.reports = 'WEB-INF/reports' - } - development { - grails.serverURL = "http://localhost:8080/${appName}" - jasper.dir.reports = 'WEB-INF/reports' - - } - test { - grails.serverURL = "http://localhost:8080/${appName}" - jasper.dir.reports = '/WEB-INF/reports' - } - -} // log4j configuration log4j = { @@ -103,4 +86,13 @@ grails.plugins.springsecurity.interceptUrlMap = [ '/user/**': ['ROLE_USER', 'IS_AUTHENTICATED_FULLY'], '/**': ['IS_AUTHENTICATED_FULLY'] ] -grails.converters.json.default.deep = true \ No newline at end of file +grails.converters.json.default.deep = true +environments { + development { + jasper.dir.reports = 'WEB-INF/reports' + } + production { + // relative to web-app + jasper.dir.reports = 'WEB-INF/reports' + } + } diff --git a/grails-app/views/voucher/invoiceEntry.gsp b/grails-app/views/voucher/invoiceEntry.gsp index 63ff49e..44e8a2a 100644 --- a/grails-app/views/voucher/invoiceEntry.gsp +++ b/grails-app/views/voucher/invoiceEntry.gsp @@ -118,7 +118,7 @@ h3 { } function printInvoice(invoiceNumber){ var url = $("#printInvoiceLink").attr("href") + "?invoiceId="+invoiceNumber - window.open($("#printInvoiceLink").attr('href'),'Print Link',"menubar=1,resizable=1,width=350,height=250"); + window.open(url,'Print Link',"menubar=1,resizable=1,width=750,height=450"); }
diff --git a/grails-app/views/voucher/printInvoice.gsp b/grails-app/views/voucher/printInvoice.gsp index b026e55..3a25fbc 100644 --- a/grails-app/views/voucher/printInvoice.gsp +++ b/grails-app/views/voucher/printInvoice.gsp @@ -1,33 +1,83 @@ - - + + + + + +
+
Invoice Report
+
- + - + - + - +
Invoice Number ${invoice.invoiceNumber} Invoice Date${invoice.invoiceDate}
Total${invoice.totalAmount} Discount${invoice.discount}
Net total${invoice.netTotal} Item ${invoice.item.name}
- +
+ + + + + + + + + - + + + + +
Voucher Seq#BarcodeCompany NameValue
${it.sequenceNumber}${it.barcodeAlpha}${it.voucherRequest.client.name}
+