Nothing to see here

"; }else{ $row = mysqli_fetch_array($sql); $invoice_id = $row['invoice_id']; $invoice_prefix = $row['invoice_prefix']; $invoice_number = $row['invoice_number']; $invoice_scope = $row['invoice_scope']; $invoice_status = $row['invoice_status']; $invoice_date = $row['invoice_date']; $invoice_due = $row['invoice_due']; $invoice_amount = $row['invoice_amount']; $invoice_currency_code = $row['invoice_currency_code']; $invoice_note = $row['invoice_note']; $invoice_url_key = $row['invoice_url_key']; $invoice_created_at = $row['invoice_created_at']; $category_id = $row['category_id']; $client_id = $row['client_id']; $client_name = $row['client_name']; $client_address = $row['client_address']; $client_city = $row['client_city']; $client_state = $row['client_state']; $client_zip = $row['client_zip']; $client_email = $row['client_email']; $client_phone = $row['client_phone']; if(strlen($client_phone)>2){ $client_phone = substr($row['client_phone'],0,3)."-".substr($row['client_phone'],3,3)."-".substr($row['client_phone'],6,4); } $client_extension = $row['client_extension']; $client_mobile = $row['client_mobile']; if(strlen($client_mobile)>2){ $client_mobile = substr($row['client_mobile'],0,3)."-".substr($row['client_mobile'],3,3)."-".substr($row['client_mobile'],6,4); } $client_website = $row['client_website']; $client_currency_code = $row['client_currency_code']; $client_net_terms = $row['client_net_terms']; if($client_net_terms == 0){ $client_net_terms = $config_default_net_terms; } $company_name = $row['company_name']; $company_country = $row['company_country']; $company_address = $row['company_address']; $company_city = $row['company_city']; $company_state = $row['company_state']; $company_zip = $row['company_zip']; $company_phone = $row['company_phone']; if(strlen($company_phone)>2){ $company_phone = substr($row['company_phone'],0,3)."-".substr($row['company_phone'],3,3)."-".substr($row['company_phone'],6,4); } $company_email = $row['company_email']; $company_website = $row['company_website']; $company_logo = $row['company_logo']; if(!empty($company_logo)){ $company_logo_base64 = base64_encode(file_get_contents($row['company_logo'])); } $sql_history = mysqli_query($mysqli,"SELECT * FROM history WHERE invoice_id = $invoice_id ORDER BY history_id DESC"); $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; //check to see if overdue if($invoice_status !== "Paid" AND $invoice_status !== "Draft" AND $invoice_status !== "Cancelled"){ $unixtime_invoice_due = strtotime($invoice_due) + 86400; if($unixtime_invoice_due < time()){ $invoice_overdue = "Overdue"; } } //Set Badge color based off of invoice status if($invoice_status == "Sent"){ $invoice_badge_color = "warning text-white"; }elseif($invoice_status == "Viewed"){ $invoice_badge_color = "info"; }elseif($invoice_status == "Partial"){ $invoice_badge_color = "primary"; }elseif($invoice_status == "Paid"){ $invoice_badge_color = "success"; }elseif($invoice_status == "Cancelled"){ $invoice_badge_color = "danger"; }else{ $invoice_badge_color = "secondary"; } ?>

Invoice

Invoice Date
Due Date
Item Description Qty Price Tax Total
$ $ $
Notes
0){ ?> 0){ ?>
Subtotal $
Tax $
Paid to Date
$
Balance Due $

History
Date Status Description
Payments
Date Amount Reference Account Action
$