1.8beta2 Statement Printing{solved}

There is a problem with Statements in 1.8

I adjusted our statements to use the hide parameter for statement items 

but that isnt the issue...

I have atleast 1 unfinalized transaction appearing on the statement.

What follows is a copy paste out my own account history.

 
 
Id
Date
Type
Amount
Description
Hidden
96208 17/06/2015 Invoice 115.00  
 
93998 14/05/2015 Credit -71.22  
 
92276 28/04/2015 Opening Balance 146.22  
 
92275 28/04/2015 Closing Balance -146.22  
 
90327 01/04/2015 Opening Balance 146.22  
 
90326 01/04/2015 Closing Balance -146.22  
 
89755 30/03/2015 Opening Balance 146.22  
 
89754 30/03/2015 Closing Balance -146.22  
 
88539 30/03/2015 Invoice 71.22  
 
89544 27/03/2015 Refund 0.01  
 
Id   Reference  
Date   Credit
Amount   Printed
Tax   Clinician
Benjamin Charlton B. V. Sc Qld 3177
Status   Location
Kalinga Park Veterinary Surgery
Notes      
 
1 Items
2 Customer Notes
   
Date
Patient
Product
Batch
Clinician
Quantity
Fixed Price
Unit Price
Discount
Tax
Total
17/06/2015
Bodie
Royal Canin Canine Mobility 14Kg
 
Benjamin Charlton B. V. Sc Qld 3177
1.00 $0.00 $115.00 $0.00 $10.46 $115.00

You can clearly see the most recent transaction The state of my account is:

Balance:190.00

Overdue:75.00

Current Amount:115.00

Unbilled:198.93

Projected Amount:388.93

Now a statement produced the following infomation

Quite clearly the last invoice in unfinalized yet appears on the statement.

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: 1.8beta2 Statement Printing

My other note is that statementItems has not had Non printing items supressed

The unfinalized invoice was produced by a template.  the 2nd item should not print it would be supressed.

Incidently the expression error above is produced by

$F{[party:getPatientMicrochip(target.patient.entity)]}

I am still working on displaying patient microchips next to the patient name on a statement.

Clearly I need to adjust the datasource as I dont have acccess to partyfunctions in the context of a subreport

$P{dataSource}.getDataSource("items", new String[]{"target.patient.entity.name", "target.startTime","[party:getPatientMicrochip($target.patient.entity)]}")

is the above likely to work I am out now and cant test.  The only issue is how to declare the 3rd variable in the subreport.

 

 

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: 1.8beta2 Statement Printing

If there is no act.customerAccountClosingBalance for the reporting period, the statement will show Finalised and Completed acts. I can't tell from your screenshot what the status of your invoice is, but I suspect it is Completed.

The statement report has not had the Print/Print Aggregate treatment as it was not part of the project specification.

The most likely reason $F{[party:getPatientMicrochip(target.patient.entity)]} is failing is because the target.patient.entity should be quoted i.e.:

$F{[party:getPatientMicrochip('target.patient.entity')]}

There should be a full stack trace in the logs indicating the cause.

Re: 1.8beta2 Statement Printing


01 Sep 2015 17:45:03,859 WARN AbstractExpressionEvaluator,statement subreports #1:130 - Ben - Failed to evaluate: [party:getPatientMicrochip('target.patient.entity')]
org.apache.commons.jxpath.JXPathFunctionNotFoundException: Undefined function: party:getPatientMicrochip
at org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.getFunction(JXPathContextReferenceImpl.java:760)
at org.apache.commons.jxpath.ri.axes.RootContext.getFunction(RootContext.java:140)
at org.apache.commons.jxpath.ri.compiler.ExtensionFunction.computeValue(ExtensionFunction.java:96)
at org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.getValue(JXPathContextReferenceImpl.java:353)
at org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.getValue(JXPathContextReferenceImpl.java:313)
at org.openvpms.report.AbstractExpressionEvaluator.evaluate(AbstractExpressionEvaluator.java:184)
at org.openvpms.report.AbstractExpressionEvaluator.getValue(AbstractExpressionEvaluator.java:121)
at org.openvpms.report.jasper.IMObjectDataSource.getFieldValue(IMObjectDataSource.java:172)
at org.openvpms.report.jasper.IMObjectCollectionDataSource.getFieldValue(IMObjectCollectionDataSource.java:168)
at net.sf.jasperreports.engine.fill.JRFillDataset.setOldValues(JRFillDataset.java:1358)
at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:1259)
at net.sf.jasperreports.engine.fill.SortFillDatasetRun.advanceDataset(DatasetSortUtil.java:399)
at net.sf.jasperreports.engine.fill.JRFillDatasetRun.iterate(JRFillDatasetRun.java:263)
at net.sf.jasperreports.engine.fill.SortFillDatasetRun.sort(DatasetSortUtil.java:349)
at net.sf.jasperreports.engine.fill.DatasetSortUtil.getSortedDataSource(DatasetSortUtil.java:110)
at net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource(JRFillDataset.java:698)
at net.sf.jasperreports.engine.fill.JRBaseFiller.setParameters(JRBaseFiller.java:1314)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:931)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:892)
at net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.java:669)
at net.sf.jasperreports.engine.fill.JRSubreportRunnable.run(JRSubreportRunnable.java:59)
at net.sf.jasperreports.engine.fill.AbstractThreadSubreportRunner.run(AbstractThreadSubreportRunner.java:203)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

 

Wierdly the trace says the function doesnt exist...

 

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: 1.8beta2 Statement Printing

Sorry - try:

$F{[party:getPatientMicrochip(openvpms:get(.,'target.patient.entity'))]}

You should also be able to do:

$F{[party:getPatientMicrochip(openvpms:get(.,'target'))]}

Re: 1.8beta2 Statement Printing

I am not sure the structure of the xpath is the issue ...the issue is the function party.getPatientMicrochip is undefined.

 

Same error with the version above


02 Sep 2015 16:18:03,223 WARN AbstractExpressionEvaluator,statement subreports #1:130 - Ben - Failed to evaluate: [party:getPatientMicrochip(openvpms.get(.,'target.patient.entity'))]
org.apache.commons.jxpath.JXPathException: Cannot invoke extension function openvpms.get; openvpms
at org.apache.commons.jxpath.PackageFunctions.getFunction(PackageFunctions.java:191)
at org.apache.commons.jxpath.FunctionLibrary.getFunction(FunctionLibrary.java:83)
at org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.getFunction(JXPathContextReferenceImpl.java:753)
at org.apache.commons.jxpath.ri.axes.RootContext.getFunction(RootContext.java:140)
at org.apache.commons.jxpath.ri.compiler.ExtensionFunction.computeValue(ExtensionFunction.java:96)
at org.apache.commons.jxpath.ri.compiler.ExtensionFunction.compute(ExtensionFunction.java:84)
at org.apache.commons.jxpath.ri.compiler.ExtensionFunction.computeValue(ExtensionFunction.java:92)
at org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.getValue(JXPathContextReferenceImpl.java:353)
at org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.getValue(JXPathContextReferenceImpl.java:313)
at org.openvpms.report.AbstractExpressionEvaluator.evaluate(AbstractExpressionEvaluator.java:184)
at org.openvpms.report.AbstractExpressionEvaluator.getValue(AbstractExpressionEvaluator.java:121)
at org.openvpms.report.jasper.IMObjectDataSource.getFieldValue(IMObjectDataSource.java:172)
at org.openvpms.report.jasper.IMObjectCollectionDataSource.getFieldValue(IMObjectCollectionDataSource.java:168)
at net.sf.jasperreports.engine.fill.JRFillDataset.setOldValues(JRFillDataset.java:1358)
at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:1259)
at net.sf.jasperreports.engine.fill.SortFillDatasetRun.advanceDataset(DatasetSortUtil.java:399)
at net.sf.jasperreports.engine.fill.JRFillDatasetRun.iterate(JRFillDatasetRun.java:263)
at net.sf.jasperreports.engine.fill.SortFillDatasetRun.sort(DatasetSortUtil.java:349)
at net.sf.jasperreports.engine.fill.DatasetSortUtil.getSortedDataSource(DatasetSortUtil.java:110)
at net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource(JRFillDataset.java:698)
at net.sf.jasperreports.engine.fill.JRBaseFiller.setParameters(JRBaseFiller.java:1314)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:931)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:892)
at net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.java:669)
at net.sf.jasperreports.engine.fill.JRSubreportRunnable.run(JRSubreportRunnable.java:59)
at net.sf.jasperreports.engine.fill.AbstractThreadSubreportRunner.run(AbstractThreadSubreportRunner.java:203)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: openvpms

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: 1.8beta2 Statement Printing

I've corrected a typo in my answer. Try now.

Re: 1.8beta2 Statement Printing

I noticed these import values in this file

    <import value="net.sf.jasperreports.engine.*"/>
    <import value="java.util.*"/>
    <import value="org.openvpms.component.business.domain.im.party.Party"/>
    <import value="net.sf.jasperreports.engine.data.*"/> 

statementitems subreport - I am not sure these party functions are available

 

I

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: 1.8beta2 Statement Printing{solved}

yeah thanks Tim seriously I need a flipping language checker in jasperreports. 

 

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au
Syndicate content