HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=27)
-   -   Billing module - SOAP-ENV:ServerCall to a member function fault() on a non-object (http://www.howtoforge.com/forums/showthread.php?t=60585)

arek_bednarczyk 15th February 2013 13:58

Billing module - SOAP-ENV:ServerCall to a member function fault() on a non-object
 
Hi,
I'm trying use a remote billing_invoice_get_pdf function, if invoice number is like 0001 pdf is created. But if number is like 2013/AB/0001 then this not work, and I see this one error message:

SOAP-ENV:ServerCall to a member function fault() on a non-object
SOAP Error: Call to a member function fault() on a non-object

Is this bug in billing remote module? With normal work in ispconfig everything work properly.

Br.
Arek

till 15th February 2013 15:22

Which billing module version and ispconfig version do you use?

arek_bednarczyk 15th February 2013 15:33

Quote:

Originally Posted by till (Post 292129)
Which billing module version and ispconfig version do you use?

Sorry,

ISPConfig Version: 3.0.4.6
Billing module: REV-3

till 15th February 2013 16:00

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.

arek_bednarczyk 15th February 2013 16:07

Quote:

Originally Posted by till (Post 292136)
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:


Code:

function remote_billing_invoice_get_pdf($invoice_id) {
        require('lib/config.inc.php');
       
        $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
                file_put_contents($file_path,$content_decoded);

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


till 15th February 2013 16:38

Quote:

I know this, but I want save invoices as invoice[$invoice_id].pdf
Here is function for saving invoices:
The problem is not your remote function here. As ispconfig billing module does not support slashes in invoice numbers in the rev3 release, the pdf invoice can not be saved to disk when you call the finalize function of the remote api or click on finalize in the interface. The function billing_invoice_get_pdf(...) is just trying to read the pdf file from disk that was created before and then hands it over to your script. So when the pdf can not be saved to disk in the first step, then you can not retrieve it with the billing_invoice_get_pdf later.

It might be possible to replace the internal get_invoice_filename(...) function of the interface/lib/classes/billing_functions.inc.php with the one from the rev 4 release. If you want to try that, send me an email to the address were you received the billing module from and I will send you the rev4 version RC.

arek_bednarczyk 27th February 2013 16:42

Quote:

Originally Posted by till (Post 292142)
It might be possible to replace the internal get_invoice_filename(...) function of the interface/lib/classes/billing_functions.inc.php with the one from the rev 4 release. If you want to try that, send me an email to the address were you received the billing module from and I will send you the rev4 version RC.

Thanks!
As I remember this was arek[at]linux.pl address.


All times are GMT +2. The time now is 16:06.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.