Author Topic: Generate paid invoice upon payment reciept  (Read 2270 times)

Offline jsneo

  • Full Member
  • ***
  • Posts: 28
    • View Profile
Re: Generate paid invoice upon payment reciept
« Reply #15 on: 14/July/2011, 07:26:31 PM »
Could you also share with me more about the input parameters for the function printPDFPopup, the 2 true input in
 
Code: [Select]
printPDFPopup($id_array, true, true, $invoice_filename);

Offline netshine

  • Administrator
  • Hero Member
  • *****
  • Posts: 4,959
    • View Profile
Re: Generate paid invoice upon payment reciept
« Reply #16 on: 14/July/2011, 08:38:56 PM »
I will take a look at this when I have time (might be next week, as I have a funeral to go to tomorrow), but as I warned before, it does go beyond the scope of support as nBill was not designed for this usage, so I can't promise to be able to help.

Offline jsneo

  • Full Member
  • ***
  • Posts: 28
    • View Profile
Re: Generate paid invoice upon payment reciept
« Reply #17 on: 14/July/2011, 08:48:55 PM »
oh im sorry to disturb you at such a bad time but do you think you can point a direction for me to look into, to possibly resolve this myself, as the client is really getting impatient with this.

Offline netshine

  • Administrator
  • Hero Member
  • *****
  • Posts: 4,959
    • View Profile
Re: Generate paid invoice upon payment reciept
« Reply #18 on: 15/July/2011, 09:35:25 AM »
Try this:

Code: [Select]
ob_start(); //Turn on output buffering so we can discard nBill's output, if any
$_REQUEST['action']='email';
$_REQUEST['hide_billing_menu'] = 1;
include_once($path_to_nbill . "/admin.nbill.php");
ob_end_clean(); //Discard buffer
$task = 'silent';
include_once($path_to_nbill . "/admin.proc/invoices.php");
include_once($path_to_nbill . "/framework/classes/nbill.email.class.php");
nbf_email::email_document($document_id);

Offline jsneo

  • Full Member
  • ***
  • Posts: 28
    • View Profile
Re: Generate paid invoice upon payment reciept
« Reply #19 on: 15/July/2011, 10:44:22 AM »
Hi Russell,

Not much luck here.. Is there any ways we are able to debug the issue?

Offline netshine

  • Administrator
  • Hero Member
  • *****
  • Posts: 4,959
    • View Profile
Re: Generate paid invoice upon payment reciept
« Reply #20 on: 15/July/2011, 12:35:09 PM »
Well you could use an IDE such as Eclipse or phpEd (I use phpEd), although getting ionCube to play nicely with them might be tricky. I tested that code myself, and it worked fine for me, but I am working with the soon-to-be-released nBill 2.1.2 code.

Offline jsneo

  • Full Member
  • ***
  • Posts: 28
    • View Profile
Re: Generate paid invoice upon payment reciept
« Reply #21 on: 15/July/2011, 12:44:55 PM »
I am using dreamweaver at this point of time. However, I have no clues how to interpret the return parameters from nbill methods

Offline netshine

  • Administrator
  • Hero Member
  • *****
  • Posts: 4,959
    • View Profile
Re: Generate paid invoice upon payment reciept
« Reply #22 on: 15/July/2011, 01:35:45 PM »
Here is the printPDFPopup function definition:

function printPDFPopup($id_array, $return_contents = false, $send_pdf_to_file = false, $pdf_file_name = "", $restrict_to_user = false)

$return_contents tells the function to return the contents of the PDF as a string instead of outputting it to the browser.
$send_pdf_to_file saves the PDF as a file in the file name specified in $pdf_file_name.
$restrict_to_user will exit the function if the invoice concerned does not belong to the currently logged in user (it is false by default because administrators need to be able to see other people's invoices).

...but I fear we are at the limit of the assistance I can offer on this now, sorry.