mirror of
https://github.com/itflow-org/itflow
synced 2026-03-11 00:04:50 +00:00
Fixups
This commit is contained in:
@@ -66,16 +66,16 @@ if(isset($_GET['invoice_id'], $_GET['url_key'])){
|
|||||||
$browser = get_web_browser();
|
$browser = get_web_browser();
|
||||||
$device = get_device();
|
$device = get_device();
|
||||||
|
|
||||||
//Mark viewed in history
|
|
||||||
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = '$invoice_status', history_description = 'Invoice viewed - $ip - $os - $browser - $device', history_created_at = NOW(), invoice_id = $invoice_id, company_id = $company_id");
|
|
||||||
|
|
||||||
mysqli_query($mysqli,"INSERT INTO alerts SET alert_type = 'Invoice Viewed', alert_message = 'Invoice $invoice_number has been viewed by $client_name - $ip - $os - $browser - $device', alert_date = NOW(), company_id = $company_id");
|
|
||||||
|
|
||||||
//Update status to Viewed only if invoice_status = "Sent"
|
//Update status to Viewed only if invoice_status = "Sent"
|
||||||
if($invoice_status == 'Sent'){
|
if($invoice_status == 'Sent'){
|
||||||
mysqli_query($mysqli,"UPDATE invoices SET invoice_status = 'Viewed' WHERE invoice_id = $invoice_id");
|
mysqli_query($mysqli,"UPDATE invoices SET invoice_status = 'Viewed' WHERE invoice_id = $invoice_id");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Mark viewed in history
|
||||||
|
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = '$invoice_status', history_description = 'Invoice viewed - $ip - $os - $browser - $device', history_created_at = NOW(), invoice_id = $invoice_id, company_id = $company_id");
|
||||||
|
|
||||||
|
mysqli_query($mysqli,"INSERT INTO alerts SET alert_type = 'Invoice Viewed', alert_message = 'Invoice $invoice_number has been viewed by $client_name - $ip - $os - $browser - $device', alert_date = NOW(), company_id = $company_id");
|
||||||
|
|
||||||
$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");
|
$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
|
//Add up all the payments for the invoice and get the total amount paid to the invoice
|
||||||
|
|||||||
@@ -63,16 +63,16 @@ if(isset($_GET['quote_id'], $_GET['url_key'])){
|
|||||||
$browser = get_web_browser();
|
$browser = get_web_browser();
|
||||||
$device = get_device();
|
$device = get_device();
|
||||||
|
|
||||||
//Mark viewed in history
|
|
||||||
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = '$quote_status', history_description = 'Quote viewed - $ip - $os - $browser - $device', history_created_at = NOW(), quote_id = $quote_id, company_id = $company_id");
|
|
||||||
|
|
||||||
mysqli_query($mysqli,"INSERT INTO alerts SET alert_type = 'Quote Viewed', alert_message = 'Quote $quote_number has been viewed by $client_name - $ip - $os - $browser - $device', alert_date = NOW(), company_id = $company_id");
|
|
||||||
|
|
||||||
//Update status to Viewed only if invoice_status = "Sent"
|
//Update status to Viewed only if invoice_status = "Sent"
|
||||||
if($quote_status == 'Sent'){
|
if($quote_status == 'Sent'){
|
||||||
mysqli_query($mysqli,"UPDATE quotes SET quote_status = 'Viewed' WHERE quote_id = $quote_id");
|
mysqli_query($mysqli,"UPDATE quotes SET quote_status = 'Viewed' WHERE quote_id = $quote_id");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Mark viewed in history
|
||||||
|
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = '$quote_status', history_description = 'Quote viewed - $ip - $os - $browser - $device', history_created_at = NOW(), quote_id = $quote_id, company_id = $company_id");
|
||||||
|
|
||||||
|
mysqli_query($mysqli,"INSERT INTO alerts SET alert_type = 'Quote Viewed', alert_message = 'Quote $quote_number has been viewed by $client_name - $ip - $os - $browser - $device', alert_date = NOW(), company_id = $company_id");
|
||||||
|
|
||||||
//Set Badge color based off of quote status
|
//Set Badge color based off of quote status
|
||||||
if($quote_status == "Sent"){
|
if($quote_status == "Sent"){
|
||||||
$quote_badge_color = "warning text-white";
|
$quote_badge_color = "warning text-white";
|
||||||
|
|||||||
Reference in New Issue
Block a user