Ray,
 
A little additional testing revealed that the Invoice PDF generation will fail 
if the Amount value in a line item is empty (it will succeed if the amount is 
'0').
 
The business scenario that led to the error was the use the Workeffort 
Timesheet feature as a reporting tool to track a workers time on a task. If a 
rate is not assigned to the worker in the Party module then the amount is empty 
in the Invoice.
 
In this case an attempt was made to use the Invoice as a report on a workers 
hours and there was no interest in cost or billing.


If this is perceived as a defect there are several places in the code where it 
could be addressed:
At the Party level have a default value of 0 for Party Rate
At Invoice creation in Edit Time-sheet default the invoice line item amount to 0
At PDF creation default the invoice line item amount to 0
Alert the user to empty amounts, prompt for an amount or cancel the operation
All of the above
 Any thoughts?

Tom

----- Original Message ----
From: Tom Burns <[EMAIL PROTECTED]>
To: [email protected]
Sent: Friday, March 23, 2007 9:38:36 PM
Subject: Re: Invoice PDF Error


Ray,

The code I am working with is a fresh compile "svn update / ant clean-all / 
ant" as of today. The problem is manifest on two systems that are independent 
of one another, a desktop and notebook.

The common element is that the invoices were created in the work effort module 
from time-sheets. To try to reproduce, create a time sheet, add an entry, from 
the time sheet view, enter a Bill From Party and Bill To Party then select 'Add 
Work Effort Time To New Invoice'.

Select the Accounting Tab >  Show All Invoices > Click on the last invoice in 
the Invoice Id column. Click the 'PDF' button. Under some condition the PDF 
creation will fail (and under others  it will succeed, as I am finding out). 
It's getting late, I'll do some more testing in the morning.

Thanks for taking a look,

Tom


----- Original Message ----
From: Ray Barlow <[EMAIL PROTECTED]>
To: [email protected]
Sent: Friday, March 23, 2007 3:39:14 PM
Subject: Re: Invoice PDF Error


Tom,

Is this standard OFBiz code and data? I just did a clean download, build
and test and the invoice PDF came up OK.

Maybe you could furnish a few more details like OFBiz version, platform,
DB and most useful if you can reproduce using the default data what
products did you add to your order?

Ray


Brettonwoods wrote:
> Hi All,
>
> Got this error when trying to create a PDF file for an Invoice. 
> Target exception:... is repeated four times in the actual error, seems like
> it's failing on some iteration but I can't nail it down.
>
> Thanks for any help.
>
> Tom
>
> org.ofbiz.base.util.GeneralException: Error rendering screen
> [component://accounting/widget/AccountingPrintForms.xml#InvoicePDF]:
> org.ofbiz.base.util.GeneralException: Error running BSH script at location
> [component://accounting/webapp/accounting/WEB-INF/actions/invoice/editInvoice.bsh]:
> org.ofbiz.base.util.GeneralException: Error running BSH script at
> [component://accounting/webapp/accounting/WEB-INF/actions/invoice/editInvoice.bsh],
> line [89]: Sourced file:
>
>

Reply via email to