/** * Save invoice from Ajax */ function save_invoice() { $invoice_id = WPI_Functions::save_invoice($_REQUEST['wpi_invoice']); if ($invoice_id) { echo sprintf(__("Saved. <a target='_blank' href='%s'>View Invoice</a>", WPI), get_invoice_permalink($invoice_id)).". ".__('Invoice id #', WPI)."<span id='new_invoice_id'>$invoice_id</span>."; } else { echo __("There was a problem with saving the invoice. Reference the log for troubleshooting.", WPI); } die(); }