2){ $client_phone = substr($row['client_phone'],0,3)."-".substr($row['client_phone'],3,3)."-".substr($row['client_phone'],6,4); } $client_website = $row['client_website']; if($recurring_invoice_status == 1){ $status = "Active"; $status_badge_color = "success"; }else{ $status = "Inactive"; $status_badge_color = "secondary"; } $sql_invoice_history = mysqli_query($mysqli,"SELECT * FROM invoice_history WHERE invoice_id = $invoice_id ORDER BY invoice_history_id ASC"); $sql_payments = mysqli_query($mysqli,"SELECT * FROM payments, accounts WHERE payments.account_id = accounts.account_id AND payments.invoice_id = $invoice_id ORDER BY payments.payment_id DESC"); //Add up all the payments for the invoice and get the total amount paid to the invoice $sql_amount_paid = mysqli_query($mysqli,"SELECT SUM(payment_amount) AS amount_paid FROM payments WHERE invoice_id = $invoice_id"); $row = mysqli_fetch_array($sql_amount_paid); $amount_paid = $row['amount_paid']; $balance = $invoice_amount - $amount_paid; ?>
From
Bill To
Details
  • Frequency:
  • Start Date:
  • Next Date:
  • Last Sent:
  • Net Terms:
    30 Day
Items
Item Description Unit Cost Quantity Tax Line Total
$ $ $
Notes

0){ ?> 0){ ?> 0){ ?>
Subtotal $
Discount $
Tax $
Paid to Date
$
Balance Due $
History
Date Sent Invoice Number