View Single Post
Old 15th February 2013, 17:07
arek_bednarczyk arek_bednarczyk is offline
Junior Member
Join Date: Jun 2009
Location: Poland
Posts: 22
Thanks: 4
Thanked 0 Times in 0 Posts

Originally Posted by till View Post
Slashes in invoice numbers are not supported in that version of the billing module as the invoice number is used as filename for the pdf invoices, so only chars that are allowed as filename on Linux can be used inside a invoice number. The billingmodule prerelease for ISPConfig 3.0.5 supports slashes as the invoice naming has been changed.
I know this, but I want save invoices as invoice[$invoice_id].pdf
Here is function for saving invoices:

function remote_billing_invoice_get_pdf($invoice_id) {
	$client = new SoapClient(null, array(	'location' => $soap_location,
                                     		'uri'      => $soap_uri,
									 												'trace' => 1,
									 												'exceptions' => 1));

	try {
		$session_id = $client->login($username,$password);
		//* Save the PDF file in the following path
		$file_path = 'invoices/invoice'.$invoice_id.'.pdf';
		//* Get the PDF file content (base64 encoded)
		$content = $client->billing_invoice_get_pdf($session_id, $invoice_id);
		//* Decode the content
		$content_decoded = base64_decode($content);
		//* Save the pdf file to disk

		// Logout remote user
	} catch (SoapFault $e) {
		echo $client->__getLastResponse();
		die('SOAP Error: '.$e->getMessage());
Reply With Quote