webERP Forum
4.15 - PDFWOPrint.php Undefined Variable - Printable Version

+- webERP Forum (http://www.weberp.org/forum)
+-- Forum: webERP Discussion (http://www.weberp.org/forum/forumdisplay.php?fid=1)
+--- Forum: Problems / Bugs? (http://www.weberp.org/forum/forumdisplay.php?fid=8)
+--- Thread: 4.15 - PDFWOPrint.php Undefined Variable (/showthread.php?tid=8239)



4.15 - PDFWOPrint.php Undefined Variable - William Hunter - 11-08-2018

I created a new work order for the same item and get this when I try to print:

Notice: Undefined variable: IssuedAlreadyRow in /share/MD0_DATA/Web/webERP/PDFWOPrint.php on line 333

Warning: Cannot modify header information - headers already sent by (output started at /share/MD0_DATA/Web/webERP/PDFWOPrint.php:333) in /share/MD0_DATA/Web/webERP/includes/tcpdf/tcpdf.php on line 7693
TCPDF ERROR: Some data has already been output to browser, can't send PDF file

Thanks!





RE: 4.15 - PDFWOPrint.php Undefined Variable - TurboPT - 11-08-2018

Hmmm, sounds like there is nothing "Issued Already" (based on the handling between lines 301 to 309), so the array was never populated?

Anyway, try changing this: (line 289)
PHP Code:
if ($SelectedWO != 'Preview') { // It is a real order
    
$ErrMsg _('There was a problem retrieving the line details for order number') . ' ' $SelectedWO ' ' _('from the database'); 

...to this:
PHP Code:
if ($SelectedWO != 'Preview') { // It is a real order
    
$IssuedAlreadyRow = array(); // add this 
    
$ErrMsg _('There was a problem retrieving the line details for order number') . ' ' $SelectedWO ' ' _('from the database'); 

That will at least quell the error.


RE: 4.15 - PDFWOPrint.php Undefined Variable - William Hunter - 11-09-2018

This fixed the problem and you are correct, nothing had been issued yet. My vote is to commit the change. Thanks again!




RE: 4.15 - PDFWOPrint.php Undefined Variable - TurboPT - 11-09-2018

Change committed.