voidInvoice($id, $logging); }); $answer['success'] = 1; $answer['message'] = 'Invoice voided.'; notify_node('invoice_updated', [], $company_id); emit_notification_user($company_id, $user_id, 'Invoice Voided', 'The invoice has been voided.', 'warning'); } catch (PDOException $e) { $answer['message'] = 'Database error, please try again.'; http_response_code(500); } catch (Exception $e) { $answer['message'] = $e->getMessage(); http_response_code(400); } exit(json_encode($answer)); ?>