Changeset 693 for trunk/phpbms/modules/bms/report/invoices_pdfquote.php
- Timestamp:
- 12/31/09 13:36:45 (2 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/phpbms/modules/bms/report/invoices_pdfquote.php
r673 r693 37 37 +-------------------------------------------------------------------------+ 38 38 */ 39 if(!isset($_SESSION["userinfo"]["id"])){40 41 //IE needs caching to be set to private in order to display PDFS42 session_cache_limiter('private');43 44 //set encoding to latin1 (fpdf doesnt like utf8)45 $sqlEncoding = "latin1";46 require_once("../../../include/session.php");47 48 }//end if49 50 39 if(!class_exists("invoicePDF")) 51 include("invoices_pdf_class.php");40 include("invoices_pdf_class.php"); 52 41 53 42 class quotePDF extends invoicePDF{ 54 43 55 var $title = "Quote"; 44 function quotePDF($db, $reportUUID, $tabledefUUID, $orientation='P', $unit='mm', $format='Letter'){ 56 45 57 function quotePDF($db, $orientation='P', $unit='mm', $format='Letter'){ 46 $this->invoicePDF($db, $reportUUID, $tabledefUUID, $orientation, $unit, $format); 58 47 59 $this->invoicePDF($db, $orientation, $unit, $format); 48 }//end method 60 49 61 }//end method62 50 63 function initialize(){ 64 parent::initialize(); 51 /** 52 * function checkForDefaultSettings 53 * 54 * Checks to make sure loaded report Settings exist and are correct 55 */ 56 function checkForDefaultSettings(){ 65 57 66 unset($this->totalsinfo[5]); 58 if(!isset($this->settings["reportTitle"])) 59 $this->settings["reportTitle"] = "Quote"; 67 60 68 }//end method 61 parent::checkForDefaultSettings(); 62 63 }//end function checkForDefaultSettings 64 65 66 function initialize(){ 67 68 parent::initialize(); 69 70 unset($this->totalsinfo[5]); 71 72 }//end method 73 74 75 /** 76 * function addingRecordDefaultSettings 77 * 78 * Creates an array of settings associative arrays for use by the system when 79 * a new report record is added that references the file containing this class 80 * 81 * @retrun array of settings. Each setting should itself be 82 * an associative array containing the following 83 * name: name of the setting 84 * defaultvalue: default value for setting 85 * type: (string, int, real, bool) type for value of setting 86 * required: (0,1) whether the setting is required or not 87 * description: brief description for what this setting is used for. 88 */ 89 function addingRecordDefaultSettings(){ 90 91 $settings = parent::addingRecordDefaultSettings(); 92 93 for($i=0; $i< count($settings); $i++){ 94 95 switch($settings[$i]["name"]){ 96 97 case "reportTitle": 98 $settings[$i]["defaultValue"] = "Quote"; 99 100 }//endswitch 101 102 }//end foreach 103 104 return $settings; 105 106 }//endfunction addingRecordDefaultSettings 69 107 70 108 }//end class 71 109 72 //PROCESSING 73 //============================================================================= 110 111 /** 112 * PROCESSING 113 * ============================================================================= 114 */ 74 115 if(!isset($noOutput)){ 75 116 76 $report = new quotePDF($db, 'P', 'in', 'Letter'); 77 $report->showShipNameInShipTo = false;117 //IE needs caching to be set to private in order to display PDFS 118 session_cache_limiter('private'); 78 119 79 $report->setupFromPrintScreen(); 80 $report->generate(); 81 82 $filename = "Quote"; 83 if($report->count === 1){ 84 85 if($report->invoicerecord["company"]) 86 $filename .= "_".$report->invoicerecord["company"]; 87 88 $filename .= "_".$report->invoicerecord["id"]; 89 90 }elseif((int)$report->count) 91 $filename .= "_Multiple"; 92 93 $filename .= ".pdf"; 94 95 $report->output('screen', $filename); 120 //set encoding to latin1 (fpdf doesnt like utf8) 121 $sqlEncoding = "latin1"; 122 require_once("../../../include/session.php"); 123 124 checkForReportArguments(); 125 126 $report = new quotePDF($db, $_GET["rid"], $_GET["tid"], 'P', 'in', 'Letter'); 127 $report->showShipNameInShipTo = false; 128 129 $report->setupFromPrintScreen(); 130 $report->generate(); 131 132 $filename = "Quote"; 133 if($report->count === 1){ 134 135 if($report->invoicerecord["company"]) 136 $filename .= "_".$report->invoicerecord["company"]; 137 138 $filename .= "_".$report->invoicerecord["id"]; 139 140 }elseif((int)$report->count) 141 $filename .= "_Multiple"; 142 143 $filename .= ".pdf"; 144 145 $report->output('screen', $filename); 96 146 97 147 }//end if 98 148 99 149 150 /** 151 * When adding a new report record, the add/edit needs to know what the class 152 * name is so that it can instantiate it, and grab it's default settings. 153 */ 154 if(isset($addingReportRecord)) 155 $reportClass ="quotePDF"; 100 156 ?>