Changeset 409
- Timestamp:
- 06/02/08 17:43:58
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/phpbms/modules/bms/report/aritems_clientstatement.php
r396 r409 58 58 else 59 59 $this->statementDate = mktime(0,0,0); 60 60 61 61 $this->showPayments = $showPayments; 62 62 $this->showClosed = $showClosed; 63 64 }//end method 63 64 }//end method aritemsClientStatements 65 65 66 66 67 67 function generate($whereclause = ""){ 68 69 68 69 70 70 if($whereclause) 71 71 $this->whereclause = $whereclause; … … 75 75 aritems.status = 'open' 76 76 AND aritems.posted = 1"; 77 78 77 78 79 79 //first we need to get the list of clients. 80 80 $querystatement = " … … 110 110 111 111 $querystatement = $this->assembleSQL($querystatement); 112 112 113 113 $clientresult = $this->db->query($querystatement); 114 114 115 115 if(!class_exists("phpbmsPDFReport")) 116 116 include("report/pdfreport_class.php"); 117 117 118 118 $this->pdf = new phpbmsPDFReport($this->db, "P","in","Letter"); 119 119 120 120 $pdf = &$this->pdf; 121 121 122 122 $this->itemColumns = array( 123 123 array("field" => "itemdate", "title" => "date", "size" => 1, "align" => "L", "nl" => 0), … … 130 130 131 131 $this->itemColumns[4]["size"] = $pdf->paperwidth - $pdf->leftmargin - $pdf->rightmargin - 5; 132 132 133 133 //uncomment the following line to help troubleshoot formatting 134 134 //$pdf->borderDebug = 1; 135 135 $pdf->hasComapnyHeader = true; 136 136 $pdf->SetMargins(); 137 137 138 138 while($clientrecord = $this->db->fetchArray($clientresult)){ 139 139 … … 141 141 142 142 $this->clientrecord = $clientrecord; 143 143 144 144 $this->_addPage(); 145 145 146 146 $this->_addItems(); 147 147 148 148 //footer 149 149 $pdf->setXY($pdf->leftmargin, 8.5 + $pdf->topmargin); … … 159 159 $pdf->SetX($pdf->GetX()+.02); 160 160 $pdf->Cell(1 - 0.02, 0.17, "Total Due", 1, 2, "R", 1); 161 161 162 162 $pdf->SetX($pdf->leftmargin); 163 163 … … 177 177 $this->term2Total = 0; 178 178 $this->term3Total = 0; 179 179 180 180 }//end while 181 181 … … 353 353 aritems 354 354 WHERE 355 posted = 1355 posted = 1 356 356 AND clientid = ".((int) $this->clientrecord["clientid"]); 357 357 … … 401 401 }//end if 402 402 403 $therecord["dayspd"] = $daysover; 403 if($therecord["due"] > 0) 404 $therecord["dayspd"] = $daysover; 405 else 406 $therecord["dayspd"] = "(paid in full)"; 404 407 405 408 }//endif 406 409 410 $keydate = $therecord["itemdate"]; 407 411 $therecord["itemdate"] = formatFromSQLDate($therecord["itemdate"]); 408 412 $therecord["amount"] = formatVariable($therecord["amount"], "currency"); … … 410 414 $therecord["due"] = formatVariable($therecord["due"], "currency"); 411 415 412 $returnArray[$ therecord["itemdate"]."-".$therecord["id"]] = $therecord;416 $returnArray[$keydate."-".$therecord["id"]] = $therecord; 413 417 414 418 }//end if … … 467 471 468 472 ksort($returnArray); 469 473 470 474 return $returnArray; 471 475 … … 566 570 567 571 $this->showPayments = isset($variables["showpayments"]); 568 572 569 573 if(!isset($variables["selrecords"])) 570 574 $variables["selrecords"] = "allOpen"; 571 575 572 576 switch($variables["selrecords"]){ 573 577 574 578 case "allOpen": 575 579 $this->generate(); … … 584 588 $this->generate(); 585 589 break; 586 590 587 591 }//endswitch 588 592