Index: fpdf/fpdf.php
===================================================================
--- fpdf/fpdf.php	(revision 672)
+++ fpdf/fpdf.php	(working copy)
@@ -1162,7 +1162,7 @@
 		$this->_out('endobj');
 	}
 	$mqr=get_magic_quotes_runtime();
-	set_magic_quotes_runtime(0);
+	@set_magic_quotes_runtime(0);
 	foreach($this->FontFiles as $file=>$info)
 	{
 		//Font file embedding
@@ -1200,7 +1200,7 @@
 		$this->_putstream($font);
 		$this->_out('endobj');
 	}
-	set_magic_quotes_runtime($mqr);
+	@set_magic_quotes_runtime($mqr);
 	foreach($this->fonts as $k=>$font)
 	{
 		//Font objects
Index: modules/base/report/notes_summary.php
===================================================================
--- modules/base/report/notes_summary.php	(revision 672)
+++ modules/base/report/notes_summary.php	(working copy)
@@ -103,8 +103,9 @@
 		$pdf->MultiCell($tempwidth-.5,.14,$therecord["content"],$border_debug,1,"L");
 		$pdf->Line($leftmargin+.25,$pdf->GetY(),$paperwidth-$rightmargin-.25,$pdf->GetY());
 		$pdf->SetY($pdf->GetY()+.25);
+		$filename = 'Notes_Summary_'.$therecord["id"].".pdf";
 	}// end fetch_array while loop
 
-	$pdf->Output();
+	$pdf->Output($filename, 'D');
 	exit();
 ?>
\ No newline at end of file
Index: modules/bms/report/aritems_clientstatement.php
===================================================================
--- modules/bms/report/aritems_clientstatement.php	(revision 672)
+++ modules/bms/report/aritems_clientstatement.php	(working copy)
@@ -480,7 +480,8 @@
 
 	function output($to = "screen"){
 
-		$this->pdf->Output();
+		$filename = 'clientstatement_'.date('Ymd').'.pdf';
+		$this->pdf->output($filename, 'D');
 
 	}//end method
 
Index: modules/bms/report/clients_folderlabels.php
===================================================================
--- modules/bms/report/clients_folderlabels.php	(revision 672)
+++ modules/bms/report/clients_folderlabels.php	(working copy)
@@ -86,6 +86,7 @@
 
 		return $pdf;
 	}
+	$filename = 'Folderlabels_clients_';
 
 	require("report/general_labels.php");
 ?>
\ No newline at end of file
Index: modules/bms/report/clients_mailinglabels.php
===================================================================
--- modules/bms/report/clients_mailinglabels.php	(revision 672)
+++ modules/bms/report/clients_mailinglabels.php	(working copy)
@@ -92,6 +92,7 @@
 
 		return $pdf;
 	}
+	$filename = 'Mailinglabels_clients_';
 
 	require("../../../report/general_labels.php");
 ?>
\ No newline at end of file
Index: modules/bms/report/clients_notesummary.php
===================================================================
--- modules/bms/report/clients_notesummary.php	(revision 672)
+++ modules/bms/report/clients_notesummary.php	(working copy)
@@ -161,9 +161,10 @@
 			$pdf->SetFont("Arial","",8);
 			$pdf->MultiCell($tempwidth-.375,.14,$therecord["content"],1,1,"L");
 			$pdf->SetY($pdf->GetY()+.25);
+			$filename = 'Client_Notes_'.$clientrecord["thename"];
 		}// end fetch_array while loop
 	}
 
-	$pdf->Output();
+	$pdf->Output($filename.'.pdf', 'D');
 	exit();
 ?>
\ No newline at end of file
Index: modules/bms/report/clients_shippinglabels.php
===================================================================
--- modules/bms/report/clients_shippinglabels.php	(revision 672)
+++ modules/bms/report/clients_shippinglabels.php	(working copy)
@@ -97,5 +97,6 @@
 		return $pdf;
 	}
 
+	$filename = 'Shippinglabels_clients_';
 	require("../../../report/general_labels.php");
 ?>
\ No newline at end of file
Index: modules/bms/report/invoices_pdf_class.php
===================================================================
--- modules/bms/report/invoices_pdf_class.php	(revision 672)
+++ modules/bms/report/invoices_pdf_class.php	(working copy)
@@ -608,7 +608,7 @@
 			switch($destination){
 
 				case "screen":
-					$this->pdf->Output();
+					$this->pdf->Output($userinfo, 'D');
 					break;
 
 				case "email":
Index: modules/bms/report/invoices_pdfinvoice.php
===================================================================
--- modules/bms/report/invoices_pdfinvoice.php	(revision 672)
+++ modules/bms/report/invoices_pdfinvoice.php	(working copy)
@@ -45,16 +45,17 @@
 	session_cache_limiter('private');
 
 	//set encoding to latin1 (fpdf doesnt like utf8)
-	$sqlEncoding = "latin1";	
+	$sqlEncoding = "latin1";
 	require_once("../../../include/session.php");
-	
+
 	include("modules/bms/report/invoices_pdf_class.php");
-	
+
 	$report = new invoicePDF($db, 'P', 'in', 'Letter');
 	$report->setupFromPrintScreen();
 	$report->generate();
-	$report->output();
-	
+	$filename = 'Invoices_'.$report->invoicerecord["company"].'_'.$report->invoicerecord["id"].'.pdf';
+	$report->output('screen', $filename);
+
 }//end if
 
 ?>
\ No newline at end of file
Index: modules/bms/report/invoices_pdfpackinglist.php
===================================================================
--- modules/bms/report/invoices_pdfpackinglist.php	(revision 672)
+++ modules/bms/report/invoices_pdfpackinglist.php	(working copy)
@@ -38,49 +38,49 @@
 */
 
 	if(!isset($_SESSION["userinfo"]["id"])){
-	
+
 		//IE needs caching to be set to private in order to display PDFS
 		session_cache_limiter('private');
-	
+
 		//set encoding to latin1 (fpdf doesnt like utf8)
-		$sqlEncoding = "latin1";	
+		$sqlEncoding = "latin1";
 		require_once("../../../include/session.php");
-	
+
 	}//end if
-	
+
 	if(!class_exists("invoicePDF"))
 		include("invoices_pdf_class.php");
-	
+
 	class  packinglistPDF extends invoicePDF{
-	
+
 		var $title = "Packing List";
 		var $showShipNameInShipTo = false;
-				
+
 		function packinglistPDF($db, $orientation='P', $unit='mm', $format='Letter'){
-	
+
 			$this->invoicePDF($db, $orientation, $unit, $format);
-			
+
 		}//end method
-	
 
+
 		function initialize(){
 			//This function will set column headings, sizes and formatting
 
 			$pdf = &$this->pdf;
-			
+
 			$topinfo = array();
 			$topinfo[] = new pdfColumn("Order ID", "id", 0.75);
 			$topinfo[] = new pdfColumn("Order Date", "orderdate", 1, "date");
 			$topinfo[] = new pdfColumn("Client PO", "ponumber", 0);
-			
+
 			$size = 0;
 			foreach($topinfo as $column)
 				$size += $column->size;
-				
+
 			$topinfo[2]->size = $pdf->paperwidth - $pdf->leftmargin - $pdf->rightmargin - $size;
 
-			$this->topinfo = $topinfo;			
-			
+			$this->topinfo = $topinfo;
+
 			$lineitems = array();
 			$lineitems[] = new pdfColumn("Product / (Part Number)", "parts", 0);
 			$lineitems[] = new pdfColumn("Prepackaged", "isprepackaged", 0.75, "boolean", "C");
@@ -88,54 +88,54 @@
 			$lineitems[] = new pdfColumn("Unit Weight", "unitweight", 0.75, "real", "R");
 			$lineitems[] = new pdfColumn("Qty", "quantity", 0.5, "real","R");
 			$lineitems[] = new pdfColumn("Weight Ext.", "extended", 0.75, "real", "R");
-						
+
 			$size = 0;
 			foreach($lineitems as $column)
 				$size += $column->size;
-				
+
 			$lineitems[0]->size = $pdf->paperwidth - $pdf->leftmargin - $pdf->rightmargin - $size;
-			
+
 			$this->lineitems = $lineitems;
-			
+
 			$totalsinfo = array();
 			$totalsinfo[] = new pdfColumn("Shipping Method", "shippingname", 0);
 			$totalsinfo[] = new pdfColumn("Estimated Boxes", "estimatedboxes", 1, NULL, "C");
 			$totalsinfo[] = new pdfColumn("Total Weight", "totalweight", 1, "real", "R");
 			$totalsinfo[] = new pdfColumn("Shipping", "shipping", 1, "currency", "R");
-									
+
 			$size = 0;
 			foreach($totalsinfo as $column)
 				$size += $column->size;
-				
+
 			$totalsinfo[0]->size = $pdf->paperwidth - $pdf->leftmargin - $pdf->rightmargin - $size;
 
 			$this->totalsinfo = $totalsinfo;
 
 		}//end method
 
-			
+
 		function _addNotes(){
-		
+
 			$pdf = &$this->pdf;
-		
+
 			$height = 1;
 			$nextPos = $pdf->GetY() + $height + 0.125;
-		
+
 			$pdf->Rect($pdf->GetX(), $pdf->GetY(), $pdf->paperwidth - $pdf->leftmargin - $pdf->rightmargin, $height);
 			$pdf->setStyle("header");
 			$pdf->Cell($pdf->paperwidth - $pdf->leftmargin - $pdf->rightmargin, 0.18, "Special Instructions", 1, 2, "L", 1);
-						
+
 			$pdf->setStyle("normal");
 			$pdf->SetXY($pdf->GetX() + .06125, $pdf->GetY() + .06125);
 			$pdf->MultiCell($pdf->paperwidth - $pdf->leftmargin - $pdf->rightmargin - 0.125, 0.18, $this->invoicerecord["specialinstructions"]);
-			
+
 			$pdf->SetXY($pdf->leftmargin, $nextPos);
-		
+
 		}//end method
-		
-		
+
+
 		function _getLineItems(){
-		
+
 			$querystatement = "
 			SELECT
 				lineitems.*,
@@ -153,52 +153,52 @@
 				displayorder";
 
 			$queryresult = $this->db->query($querystatement);
-			
+
 			//determine estimated total boxes
 			$this->invoicerecord["estimatedboxes"] = 0;
 			while($therecord = $this->db->fetchArray($queryresult)){
-			
+
 				if($therecord["isprepackaged"])
 					$this->invoicerecord["estimatedboxes"] += $therecord["quantity"];
 				else
 					$this->invoicerecord["estimatedboxes"] += $therecord["quantity"] * $therecord["packagesperitem"];
-				
+
 			}//endwhile
-			
+
 			$this->db->seek($queryresult, 0);
-			
+
 			return $queryresult;
-		
+
 		}//end method
-		
+
 		function _addTotals(){
 
 			$pdf = &$this->pdf;
-							
+
 			$height = .5;
 			$nextPos = $pdf->GetY() + $height + 0.125;
-		
+
 			$pdf->Rect($pdf->GetX(), $pdf->GetY(), $pdf->paperwidth - $pdf->leftmargin - $pdf->rightmargin, $height);
-			
+
 			$pdf->setStyle("header");
 			foreach($this->totalsinfo as $column)
 				$pdf->Cell($column->size, 0.18, $column->title, 1, 0, $column->align, 1);
-			
+
 			$pdf->setStyle("normal");
 			$pdf->SetFont("Arial", "B", 10);
 			$pdf->SetXY($pdf->leftmargin, $pdf->GetY() + 0.18 + 0.0625);
-			
+
 			foreach($this->totalsinfo as $column){
-			
+
 				if($column->format != "")
 					$value = formatVariable($this->invoicerecord[$column->fieldname], $column->format);
 				else
-					$value = $this->invoicerecord[$column->fieldname];				
-			
+					$value = $this->invoicerecord[$column->fieldname];
+
 				$pdf->Cell($column->size, 0.18, $value, $pdf->borderDebug, 0, $column->align);
 
 			}//end foreach
-					
+
 		}//end method
 
 	}//end class
@@ -207,12 +207,13 @@
 	//PROCESSING
 	//=============================================================================
 	if(!isset($noOutput)){
-			
+
 		$report = new packinglistPDF($db, 'P', 'in', 'Letter');
-		
+
 		$report->setupFromPrintScreen();
 		$report->generate();
-		$report->output();
-		
+		$filename = 'Packing_List_'.$report->invoicerecord["company"].'_'.$report->invoicerecord["id"].'.pdf';
+		$report->output('screen', $filename);
+
 	}//end if
 ?>
\ No newline at end of file
Index: modules/bms/report/invoices_pdfquote.php
===================================================================
--- modules/bms/report/invoices_pdfquote.php	(revision 672)
+++ modules/bms/report/invoices_pdfquote.php	(working copy)
@@ -42,7 +42,7 @@
 	session_cache_limiter('private');
 
 	//set encoding to latin1 (fpdf doesnt like utf8)
-	$sqlEncoding = "latin1";	
+	$sqlEncoding = "latin1";
 	require_once("../../../include/session.php");
 
 }//end if
@@ -57,14 +57,14 @@
 	function quotePDF($db, $orientation='P', $unit='mm', $format='Letter'){
 
 		$this->invoicePDF($db, $orientation, $unit, $format);
-		
+
 	}//end method
-	
+
 	function initialize(){
 		parent::initialize();
-		
+
 		unset($this->totalsinfo[5]);
-				
+
 	}//end method
 
 }//end class
@@ -72,14 +72,15 @@
 //PROCESSING
 //=============================================================================
 if(!isset($noOutput)){
-		
+
 	$report = new quotePDF($db, 'P', 'in', 'Letter');
 	$report->showShipNameInShipTo = false;
-	
+
 	$report->setupFromPrintScreen();
 	$report->generate();
-	$report->output();
-	
+	$filename = 'Quote_'.$report->invoicerecord["company"].'_'.$report->invoicerecord["id"].'.pdf';
+	$report->output('screen', $filename);
+
 }//end if
 
 
Index: modules/bms/report/invoices_pdfworkorder.php
===================================================================
--- modules/bms/report/invoices_pdfworkorder.php	(revision 672)
+++ modules/bms/report/invoices_pdfworkorder.php	(working copy)
@@ -37,50 +37,50 @@
  +-------------------------------------------------------------------------+
 */
 	if(!isset($_SESSION["userinfo"]["id"])){
-	
+
 		//IE needs caching to be set to private in order to display PDFS
 		session_cache_limiter('private');
 
 		//set encoding to latin1 (fpdf doesnt like utf8)
-		$sqlEncoding = "latin1";	
+		$sqlEncoding = "latin1";
 		require_once("../../../include/session.php");
-	
+
 	}//end if
-	
+
 	if(!class_exists("invoicePDF"))
 		include("invoices_pdf_class.php");
-	
+
 	class  workorderPDF extends invoicePDF{
-	
+
 		var $title = "Work Order";
 		var $lineitemBoxHeight = 3.75;
-		
+
 		function workorderPDF($db, $orientation='P', $unit='mm', $format='Letter'){
-	
+
 			$this->invoicePDF($db, $orientation, $unit, $format);
-			
+
 		}//end method
-	
-	
+
+
 		function _addNotes(){
-		
+
 			$pdf = &$this->pdf;
-		
+
 			$height = 1;
 			$nextPos = $pdf->GetY() + $height + 0.125;
-		
+
 			$pdf->Rect($pdf->GetX(), $pdf->GetY(), $pdf->paperwidth - $pdf->leftmargin - $pdf->rightmargin, $height);
 			$pdf->setStyle("header");
 			$pdf->Cell($pdf->paperwidth - $pdf->leftmargin - $pdf->rightmargin, 0.18, "Special Instructions", 1, 2, "L", 1);
-						
+
 			$pdf->setStyle("normal");
 			$pdf->SetXY($pdf->GetX() + .06125, $pdf->GetY() + .06125);
 			$pdf->MultiCell($pdf->paperwidth - $pdf->leftmargin - $pdf->rightmargin - 0.125, 0.18, $this->invoicerecord["specialinstructions"]);
-			
+
 			$pdf->SetXY($pdf->leftmargin, $nextPos);
-		
+
 		}//end method
-		
+
 		function _addPaymentDetails(){
 
 			$pdf = &$this->pdf;
@@ -89,7 +89,7 @@
 			$columns[] = new pdfColumn("Payment Method", "paymentname", 0);
 
 			switch($this->invoicerecord["paymenttype"]){
-			
+
 				case "draft":
 					$columns[0]->size = 1.5;
 					$columns[] = new pdfColumn("Check Number", "checkno", 1);
@@ -101,50 +101,51 @@
 					$columns[] = new pdfColumn("Number", "ccnumber", 1.5);
 					$columns[] = new pdfColumn("Exp.", "ccexpiration", 1);
 					$columns[] = new pdfColumn("Verification/Pin", "ccverification", 1);
-					break;					
-			
+					break;
+
 			}//end switch
-						
+
 			$size = 0;
 			foreach($columns as $column)
 				$size += $column->size;
-							
+
 			$i = count($columns) -1;
-				
+
 			$columns[$i]->size += $pdf->paperwidth - $pdf->leftmargin - $pdf->rightmargin - $size;
-			
+
 			$height = 0.5;
 			$nextPos = $pdf->GetY() + $height + 0.125;
-		
+
 			$pdf->Rect($pdf->GetX(), $pdf->GetY(), $pdf->paperwidth - $pdf->leftmargin - $pdf->rightmargin, $height);
-			
+
 			$pdf->setStyle("header");
 
 			foreach($columns as $column)
 				$pdf->Cell($column->size, 0.18, $column->title, 1, 0, $column->align, 1);
-				
+
 			$pdf->SetXY($pdf->leftmargin, $pdf->GetY() + 0.18 + 0.0625);
-			
+
 			$pdf->setStyle("normal");
 			$pdf->SetFont("Arial", "B", 10);
 			foreach($columns as $column)
 				$pdf->Cell($column->size, 0.18, $this->invoicerecord[$column->fieldname], $pdf->borderDebug, 0, $column->align);
 
 		}//end method
-		
+
 	}//end class
 
 
 //PROCESSING
 //=============================================================================
 if(!isset($noOutput)){
-		
+
 	$report = new workorderPDF($db, 'P', 'in', 'Letter');
-	
+
 	$report->setupFromPrintScreen();
 	$report->generate();
-	$report->output();
-	
+	$filename = 'Work_Order'.$report->invoicerecord["company"].'_'.$report->invoicerecord["id"].'.pdf';
+	$report->output('screen', $filename);
+
 }//end if
 
 ?>
Index: modules/bms/report/invoices_shippinglabels.php
===================================================================
--- modules/bms/report/invoices_shippinglabels.php	(revision 672)
+++ modules/bms/report/invoices_shippinglabels.php	(working copy)
@@ -110,7 +110,7 @@
 
 		return $pdf;
 	}
-
+	$filename = 'Shippinglabels_invoice_';
 	session_cache_limiter('private');
 	require_once("../../../include/session.php");
 	require_once("../../../fpdf/fpdf.php");
Index: modules/bms/report/receipts_pdf.php
===================================================================
--- modules/bms/report/receipts_pdf.php	(revision 672)
+++ modules/bms/report/receipts_pdf.php	(working copy)
@@ -631,7 +631,7 @@
 			switch($destination){
 
 				case "screen":
-					$this->pdf->Output();
+					$this->pdf->Output($userinfo, 'D');
 					break;
 
 				case "email":
@@ -702,7 +702,8 @@
 	$report = new receiptPDF($db, 'P', 'in', 'Letter');
 	$report->setupFromPrintScreen();
 	$report->generate();
-	$report->output();
+	$filename = 'Receipts_'.$report->receiptrecord["company"].'_'.$report->receiptrecord["id"].'.pdf';
+	$report->output('screen', $filename);
 
 }//end if
 
Index: report/general_labels.php
===================================================================
--- report/general_labels.php	(revision 672)
+++ report/general_labels.php	(working copy)
@@ -115,9 +115,10 @@
 
 			$they+=$labelheight;
 			$rowcount++;
+			$filename .=$therecord["company"].'.pdf';
 		}// end fetch_array while loop
 
-		$pdf->Output();
+		$pdf->Output($filename, 'D');
 		exit();
 	} else {
 
@@ -138,7 +139,7 @@
 		</p>
 		<p align="right">
 			<input name="command" type="submit" class="Buttons" id="print" value="print" />
-			<input name="cancel" type="button" class="Buttons" id="cancel" value="canel" onclick="window.close();" />
+			<input name="cancel" type="button" class="Buttons" id="cancel" value="cancel" onclick="window.close();" />
 		</p>
 </div>
 </form>

