Ticket #334: pdf.patch
| File pdf.patch, 17.1 KB (added by Andreas Tangemann <a.tangemann@…>, 3 years ago) |
|---|
-
fpdf/fpdf.php
1162 1162 $this->_out('endobj'); 1163 1163 } 1164 1164 $mqr=get_magic_quotes_runtime(); 1165 set_magic_quotes_runtime(0);1165 @set_magic_quotes_runtime(0); 1166 1166 foreach($this->FontFiles as $file=>$info) 1167 1167 { 1168 1168 //Font file embedding … … 1200 1200 $this->_putstream($font); 1201 1201 $this->_out('endobj'); 1202 1202 } 1203 set_magic_quotes_runtime($mqr);1203 @set_magic_quotes_runtime($mqr); 1204 1204 foreach($this->fonts as $k=>$font) 1205 1205 { 1206 1206 //Font objects -
modules/base/report/notes_summary.php
103 103 $pdf->MultiCell($tempwidth-.5,.14,$therecord["content"],$border_debug,1,"L"); 104 104 $pdf->Line($leftmargin+.25,$pdf->GetY(),$paperwidth-$rightmargin-.25,$pdf->GetY()); 105 105 $pdf->SetY($pdf->GetY()+.25); 106 $filename = 'Notes_Summary_'.$therecord["id"].".pdf"; 106 107 }// end fetch_array while loop 107 108 108 $pdf->Output( );109 $pdf->Output($filename, 'D'); 109 110 exit(); 110 111 ?> 112 No newline at end of file -
modules/bms/report/aritems_clientstatement.php
480 480 481 481 function output($to = "screen"){ 482 482 483 $this->pdf->Output(); 483 $filename = 'clientstatement_'.date('Ymd').'.pdf'; 484 $this->pdf->output($filename, 'D'); 484 485 485 486 }//end method 486 487 -
modules/bms/report/clients_folderlabels.php
86 86 87 87 return $pdf; 88 88 } 89 $filename = 'Folderlabels_clients_'; 89 90 90 91 require("report/general_labels.php"); 91 92 ?> 93 No newline at end of file -
modules/bms/report/clients_mailinglabels.php
92 92 93 93 return $pdf; 94 94 } 95 $filename = 'Mailinglabels_clients_'; 95 96 96 97 require("../../../report/general_labels.php"); 97 98 ?> 99 No newline at end of file -
modules/bms/report/clients_notesummary.php
161 161 $pdf->SetFont("Arial","",8); 162 162 $pdf->MultiCell($tempwidth-.375,.14,$therecord["content"],1,1,"L"); 163 163 $pdf->SetY($pdf->GetY()+.25); 164 $filename = 'Client_Notes_'.$clientrecord["thename"]; 164 165 }// end fetch_array while loop 165 166 } 166 167 167 $pdf->Output( );168 $pdf->Output($filename.'.pdf', 'D'); 168 169 exit(); 169 170 ?> 171 No newline at end of file -
modules/bms/report/clients_shippinglabels.php
97 97 return $pdf; 98 98 } 99 99 100 $filename = 'Shippinglabels_clients_'; 100 101 require("../../../report/general_labels.php"); 101 102 ?> 103 No newline at end of file -
modules/bms/report/invoices_pdf_class.php
608 608 switch($destination){ 609 609 610 610 case "screen": 611 $this->pdf->Output( );611 $this->pdf->Output($userinfo, 'D'); 612 612 break; 613 613 614 614 case "email": -
modules/bms/report/invoices_pdfinvoice.php
45 45 session_cache_limiter('private'); 46 46 47 47 //set encoding to latin1 (fpdf doesnt like utf8) 48 $sqlEncoding = "latin1"; 48 $sqlEncoding = "latin1"; 49 49 require_once("../../../include/session.php"); 50 50 51 51 include("modules/bms/report/invoices_pdf_class.php"); 52 52 53 53 $report = new invoicePDF($db, 'P', 'in', 'Letter'); 54 54 $report->setupFromPrintScreen(); 55 55 $report->generate(); 56 $report->output(); 57 56 $filename = 'Invoices_'.$report->invoicerecord["company"].'_'.$report->invoicerecord["id"].'.pdf'; 57 $report->output('screen', $filename); 58 58 59 }//end if 59 60 60 61 ?> 62 No newline at end of file -
modules/bms/report/invoices_pdfpackinglist.php
38 38 */ 39 39 40 40 if(!isset($_SESSION["userinfo"]["id"])){ 41 41 42 42 //IE needs caching to be set to private in order to display PDFS 43 43 session_cache_limiter('private'); 44 44 45 45 //set encoding to latin1 (fpdf doesnt like utf8) 46 $sqlEncoding = "latin1"; 46 $sqlEncoding = "latin1"; 47 47 require_once("../../../include/session.php"); 48 48 49 49 }//end if 50 50 51 51 if(!class_exists("invoicePDF")) 52 52 include("invoices_pdf_class.php"); 53 53 54 54 class packinglistPDF extends invoicePDF{ 55 55 56 56 var $title = "Packing List"; 57 57 var $showShipNameInShipTo = false; 58 58 59 59 function packinglistPDF($db, $orientation='P', $unit='mm', $format='Letter'){ 60 60 61 61 $this->invoicePDF($db, $orientation, $unit, $format); 62 62 63 63 }//end method 64 65 64 65 66 66 function initialize(){ 67 67 //This function will set column headings, sizes and formatting 68 68 69 69 $pdf = &$this->pdf; 70 70 71 71 $topinfo = array(); 72 72 $topinfo[] = new pdfColumn("Order ID", "id", 0.75); 73 73 $topinfo[] = new pdfColumn("Order Date", "orderdate", 1, "date"); 74 74 $topinfo[] = new pdfColumn("Client PO", "ponumber", 0); 75 75 76 76 $size = 0; 77 77 foreach($topinfo as $column) 78 78 $size += $column->size; 79 79 80 80 $topinfo[2]->size = $pdf->paperwidth - $pdf->leftmargin - $pdf->rightmargin - $size; 81 81 82 $this->topinfo = $topinfo; 83 82 $this->topinfo = $topinfo; 83 84 84 $lineitems = array(); 85 85 $lineitems[] = new pdfColumn("Product / (Part Number)", "parts", 0); 86 86 $lineitems[] = new pdfColumn("Prepackaged", "isprepackaged", 0.75, "boolean", "C"); … … 88 88 $lineitems[] = new pdfColumn("Unit Weight", "unitweight", 0.75, "real", "R"); 89 89 $lineitems[] = new pdfColumn("Qty", "quantity", 0.5, "real","R"); 90 90 $lineitems[] = new pdfColumn("Weight Ext.", "extended", 0.75, "real", "R"); 91 91 92 92 $size = 0; 93 93 foreach($lineitems as $column) 94 94 $size += $column->size; 95 95 96 96 $lineitems[0]->size = $pdf->paperwidth - $pdf->leftmargin - $pdf->rightmargin - $size; 97 97 98 98 $this->lineitems = $lineitems; 99 99 100 100 $totalsinfo = array(); 101 101 $totalsinfo[] = new pdfColumn("Shipping Method", "shippingname", 0); 102 102 $totalsinfo[] = new pdfColumn("Estimated Boxes", "estimatedboxes", 1, NULL, "C"); 103 103 $totalsinfo[] = new pdfColumn("Total Weight", "totalweight", 1, "real", "R"); 104 104 $totalsinfo[] = new pdfColumn("Shipping", "shipping", 1, "currency", "R"); 105 105 106 106 $size = 0; 107 107 foreach($totalsinfo as $column) 108 108 $size += $column->size; 109 109 110 110 $totalsinfo[0]->size = $pdf->paperwidth - $pdf->leftmargin - $pdf->rightmargin - $size; 111 111 112 112 $this->totalsinfo = $totalsinfo; 113 113 114 114 }//end method 115 115 116 116 117 117 function _addNotes(){ 118 118 119 119 $pdf = &$this->pdf; 120 120 121 121 $height = 1; 122 122 $nextPos = $pdf->GetY() + $height + 0.125; 123 123 124 124 $pdf->Rect($pdf->GetX(), $pdf->GetY(), $pdf->paperwidth - $pdf->leftmargin - $pdf->rightmargin, $height); 125 125 $pdf->setStyle("header"); 126 126 $pdf->Cell($pdf->paperwidth - $pdf->leftmargin - $pdf->rightmargin, 0.18, "Special Instructions", 1, 2, "L", 1); 127 127 128 128 $pdf->setStyle("normal"); 129 129 $pdf->SetXY($pdf->GetX() + .06125, $pdf->GetY() + .06125); 130 130 $pdf->MultiCell($pdf->paperwidth - $pdf->leftmargin - $pdf->rightmargin - 0.125, 0.18, $this->invoicerecord["specialinstructions"]); 131 131 132 132 $pdf->SetXY($pdf->leftmargin, $nextPos); 133 133 134 134 }//end method 135 136 135 136 137 137 function _getLineItems(){ 138 138 139 139 $querystatement = " 140 140 SELECT 141 141 lineitems.*, … … 153 153 displayorder"; 154 154 155 155 $queryresult = $this->db->query($querystatement); 156 156 157 157 //determine estimated total boxes 158 158 $this->invoicerecord["estimatedboxes"] = 0; 159 159 while($therecord = $this->db->fetchArray($queryresult)){ 160 160 161 161 if($therecord["isprepackaged"]) 162 162 $this->invoicerecord["estimatedboxes"] += $therecord["quantity"]; 163 163 else 164 164 $this->invoicerecord["estimatedboxes"] += $therecord["quantity"] * $therecord["packagesperitem"]; 165 165 166 166 }//endwhile 167 167 168 168 $this->db->seek($queryresult, 0); 169 169 170 170 return $queryresult; 171 171 172 172 }//end method 173 173 174 174 function _addTotals(){ 175 175 176 176 $pdf = &$this->pdf; 177 177 178 178 $height = .5; 179 179 $nextPos = $pdf->GetY() + $height + 0.125; 180 180 181 181 $pdf->Rect($pdf->GetX(), $pdf->GetY(), $pdf->paperwidth - $pdf->leftmargin - $pdf->rightmargin, $height); 182 182 183 183 $pdf->setStyle("header"); 184 184 foreach($this->totalsinfo as $column) 185 185 $pdf->Cell($column->size, 0.18, $column->title, 1, 0, $column->align, 1); 186 186 187 187 $pdf->setStyle("normal"); 188 188 $pdf->SetFont("Arial", "B", 10); 189 189 $pdf->SetXY($pdf->leftmargin, $pdf->GetY() + 0.18 + 0.0625); 190 190 191 191 foreach($this->totalsinfo as $column){ 192 192 193 193 if($column->format != "") 194 194 $value = formatVariable($this->invoicerecord[$column->fieldname], $column->format); 195 195 else 196 $value = $this->invoicerecord[$column->fieldname]; 197 196 $value = $this->invoicerecord[$column->fieldname]; 197 198 198 $pdf->Cell($column->size, 0.18, $value, $pdf->borderDebug, 0, $column->align); 199 199 200 200 }//end foreach 201 201 202 202 }//end method 203 203 204 204 }//end class … … 207 207 //PROCESSING 208 208 //============================================================================= 209 209 if(!isset($noOutput)){ 210 210 211 211 $report = new packinglistPDF($db, 'P', 'in', 'Letter'); 212 212 213 213 $report->setupFromPrintScreen(); 214 214 $report->generate(); 215 $report->output(); 216 215 $filename = 'Packing_List_'.$report->invoicerecord["company"].'_'.$report->invoicerecord["id"].'.pdf'; 216 $report->output('screen', $filename); 217 217 218 }//end if 218 219 ?> 220 No newline at end of file -
modules/bms/report/invoices_pdfquote.php
42 42 session_cache_limiter('private'); 43 43 44 44 //set encoding to latin1 (fpdf doesnt like utf8) 45 $sqlEncoding = "latin1"; 45 $sqlEncoding = "latin1"; 46 46 require_once("../../../include/session.php"); 47 47 48 48 }//end if … … 57 57 function quotePDF($db, $orientation='P', $unit='mm', $format='Letter'){ 58 58 59 59 $this->invoicePDF($db, $orientation, $unit, $format); 60 60 61 61 }//end method 62 62 63 63 function initialize(){ 64 64 parent::initialize(); 65 65 66 66 unset($this->totalsinfo[5]); 67 67 68 68 }//end method 69 69 70 70 }//end class … … 72 72 //PROCESSING 73 73 //============================================================================= 74 74 if(!isset($noOutput)){ 75 75 76 76 $report = new quotePDF($db, 'P', 'in', 'Letter'); 77 77 $report->showShipNameInShipTo = false; 78 78 79 79 $report->setupFromPrintScreen(); 80 80 $report->generate(); 81 $report->output(); 82 81 $filename = 'Quote_'.$report->invoicerecord["company"].'_'.$report->invoicerecord["id"].'.pdf'; 82 $report->output('screen', $filename); 83 83 84 }//end if 84 85 85 86 -
modules/bms/report/invoices_pdfworkorder.php
37 37 +-------------------------------------------------------------------------+ 38 38 */ 39 39 if(!isset($_SESSION["userinfo"]["id"])){ 40 40 41 41 //IE needs caching to be set to private in order to display PDFS 42 42 session_cache_limiter('private'); 43 43 44 44 //set encoding to latin1 (fpdf doesnt like utf8) 45 $sqlEncoding = "latin1"; 45 $sqlEncoding = "latin1"; 46 46 require_once("../../../include/session.php"); 47 47 48 48 }//end if 49 49 50 50 if(!class_exists("invoicePDF")) 51 51 include("invoices_pdf_class.php"); 52 52 53 53 class workorderPDF extends invoicePDF{ 54 54 55 55 var $title = "Work Order"; 56 56 var $lineitemBoxHeight = 3.75; 57 57 58 58 function workorderPDF($db, $orientation='P', $unit='mm', $format='Letter'){ 59 59 60 60 $this->invoicePDF($db, $orientation, $unit, $format); 61 61 62 62 }//end method 63 64 63 64 65 65 function _addNotes(){ 66 66 67 67 $pdf = &$this->pdf; 68 68 69 69 $height = 1; 70 70 $nextPos = $pdf->GetY() + $height + 0.125; 71 71 72 72 $pdf->Rect($pdf->GetX(), $pdf->GetY(), $pdf->paperwidth - $pdf->leftmargin - $pdf->rightmargin, $height); 73 73 $pdf->setStyle("header"); 74 74 $pdf->Cell($pdf->paperwidth - $pdf->leftmargin - $pdf->rightmargin, 0.18, "Special Instructions", 1, 2, "L", 1); 75 75 76 76 $pdf->setStyle("normal"); 77 77 $pdf->SetXY($pdf->GetX() + .06125, $pdf->GetY() + .06125); 78 78 $pdf->MultiCell($pdf->paperwidth - $pdf->leftmargin - $pdf->rightmargin - 0.125, 0.18, $this->invoicerecord["specialinstructions"]); 79 79 80 80 $pdf->SetXY($pdf->leftmargin, $nextPos); 81 81 82 82 }//end method 83 83 84 84 function _addPaymentDetails(){ 85 85 86 86 $pdf = &$this->pdf; … … 89 89 $columns[] = new pdfColumn("Payment Method", "paymentname", 0); 90 90 91 91 switch($this->invoicerecord["paymenttype"]){ 92 92 93 93 case "draft": 94 94 $columns[0]->size = 1.5; 95 95 $columns[] = new pdfColumn("Check Number", "checkno", 1); … … 101 101 $columns[] = new pdfColumn("Number", "ccnumber", 1.5); 102 102 $columns[] = new pdfColumn("Exp.", "ccexpiration", 1); 103 103 $columns[] = new pdfColumn("Verification/Pin", "ccverification", 1); 104 break; 105 104 break; 105 106 106 }//end switch 107 107 108 108 $size = 0; 109 109 foreach($columns as $column) 110 110 $size += $column->size; 111 111 112 112 $i = count($columns) -1; 113 113 114 114 $columns[$i]->size += $pdf->paperwidth - $pdf->leftmargin - $pdf->rightmargin - $size; 115 115 116 116 $height = 0.5; 117 117 $nextPos = $pdf->GetY() + $height + 0.125; 118 118 119 119 $pdf->Rect($pdf->GetX(), $pdf->GetY(), $pdf->paperwidth - $pdf->leftmargin - $pdf->rightmargin, $height); 120 120 121 121 $pdf->setStyle("header"); 122 122 123 123 foreach($columns as $column) 124 124 $pdf->Cell($column->size, 0.18, $column->title, 1, 0, $column->align, 1); 125 125 126 126 $pdf->SetXY($pdf->leftmargin, $pdf->GetY() + 0.18 + 0.0625); 127 127 128 128 $pdf->setStyle("normal"); 129 129 $pdf->SetFont("Arial", "B", 10); 130 130 foreach($columns as $column) 131 131 $pdf->Cell($column->size, 0.18, $this->invoicerecord[$column->fieldname], $pdf->borderDebug, 0, $column->align); 132 132 133 133 }//end method 134 134 135 135 }//end class 136 136 137 137 138 138 //PROCESSING 139 139 //============================================================================= 140 140 if(!isset($noOutput)){ 141 141 142 142 $report = new workorderPDF($db, 'P', 'in', 'Letter'); 143 143 144 144 $report->setupFromPrintScreen(); 145 145 $report->generate(); 146 $report->output(); 147 146 $filename = 'Work_Order'.$report->invoicerecord["company"].'_'.$report->invoicerecord["id"].'.pdf'; 147 $report->output('screen', $filename); 148 148 149 }//end if 149 150 150 151 ?> -
modules/bms/report/invoices_shippinglabels.php
110 110 111 111 return $pdf; 112 112 } 113 113 $filename = 'Shippinglabels_invoice_'; 114 114 session_cache_limiter('private'); 115 115 require_once("../../../include/session.php"); 116 116 require_once("../../../fpdf/fpdf.php"); -
modules/bms/report/receipts_pdf.php
631 631 switch($destination){ 632 632 633 633 case "screen": 634 $this->pdf->Output( );634 $this->pdf->Output($userinfo, 'D'); 635 635 break; 636 636 637 637 case "email": … … 702 702 $report = new receiptPDF($db, 'P', 'in', 'Letter'); 703 703 $report->setupFromPrintScreen(); 704 704 $report->generate(); 705 $report->output(); 705 $filename = 'Receipts_'.$report->receiptrecord["company"].'_'.$report->receiptrecord["id"].'.pdf'; 706 $report->output('screen', $filename); 706 707 707 708 }//end if 708 709 -
report/general_labels.php
115 115 116 116 $they+=$labelheight; 117 117 $rowcount++; 118 $filename .=$therecord["company"].'.pdf'; 118 119 }// end fetch_array while loop 119 120 120 $pdf->Output( );121 $pdf->Output($filename, 'D'); 121 122 exit(); 122 123 } else { 123 124 … … 138 139 </p> 139 140 <p align="right"> 140 141 <input name="command" type="submit" class="Buttons" id="print" value="print" /> 141 <input name="cancel" type="button" class="Buttons" id="cancel" value="can el" onclick="window.close();" />142 <input name="cancel" type="button" class="Buttons" id="cancel" value="cancel" onclick="window.close();" /> 142 143 </p> 143 144 </div> 144 145 </form>