= 2; $can_delete = lookupUserPermission('module_sales') >= 3; $can_take_payment = $can_edit && lookupUserPermission('module_financial') >= 2 && invoiceCanPay($invoice, $state); $can_manage_payments = lookupUserPermission('module_sales') >= 3 && lookupUserPermission('module_financial') >= 3; $can_edit_lines = billingCanEditItems('invoice', $invoice); $mail_ready = !empty($config_smtp_provider) && billingEmailableContacts('invoice', $client_id) > 0; $saved_card = $can_take_payment && in_array($status, ['Sent', 'Viewed'], true) && invoiceHasSavedCard($client_id); $unbilled_tickets = $can_edit && $can_edit_lines && $config_module_enable_ticketing ? count(billingUnbilledTickets($client_id)) : 0; $guest_url = billingGuestUrl('invoice', $invoice); $csrf = $_SESSION['csrf_token']; // Made by a recurring invoice? $recurring = intval($invoice['invoice_recurring_invoice_id']) ? mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT recurring_invoice_id, recurring_invoice_prefix, recurring_invoice_number FROM recurring_invoices WHERE recurring_invoice_id = " . intval($invoice['invoice_recurring_invoice_id']))) : null; $progress = $state['paid'] > 0 && $totals['total'] > 0 ? min(100, round($state['paid'] / $totals['total'] * 100)) : 0; // Override Tab Title // No Sanitizing needed as this var will only be used in the tab title $tab_title = $invoice['client_name']; $page_title = $number; $paper = [ 'type' => 'invoice', 'row' => $invoice, 'items' => $items, 'totals' => $totals, 'paid' => $state['paid'], 'balance' => $state['balance'], 'edit' => $can_edit_lines, 'notes_edit' => $can_edit, 'taxes' => $can_edit_lines ? billingTaxes($invoice['invoice_created_at']) : [], 'logo_url' => billingCompany()['logo_url'], 'csrf' => $csrf, ]; ?>

Invoice

From Created

Payment

of
Paid
in ' . count($payments) . ' payment' . (count($payments) === 1 ? '' : 's') . '' : '' ?>
Due
Terms
days
Client
Not sent yet - the client can't see it

Payments

No payments yet.

Tickets

worked
unbilled ticket for could go on this invoice.

History