コード例 #1
0
	function setup_total() {

		$total[] = array("Total" => "Subtotal", "Amount" => SureInvoice::getCurrencySymbolPDF().number_format($this->subtotal, 2));
		$total[] = array("Total" => "Tax Amount", "Amount" => SureInvoice::getCurrencySymbolPDF().number_format($this->tax_amount, 2));
		$total[] = array("Total" => "Total", "Amount" => SureInvoice::getCurrencySymbolPDF().number_format($this->total, 2));
		if($this->payment_total > 0){
			$total[] = array("Total" => "Total Payments", "Amount" => "-".SureInvoice::getCurrencySymbolPDF().number_format($this->payment_total, 2));
			$total[] = array("Total" => "Amount Due", "Amount" => SureInvoice::getCurrencySymbolPDF().number_format(($this->total - $this->payment_total), 2));
		}

		$this->pdf->ezTable($total,null,'',array('showHeadings' => 0, 'xPos' => 'left', 'xOrientation' => 'right',
				'fontSize' => 10, 
				'colGap' => 2, 
				'protectRows' => 3,
				'cols' =>
					array('Total'=>array("width" => "413",  "justification" => "right"),
						'Amount'=>array("width" => "100",  "justification" => "right")
					)
				)
		);
	}