diff --git a/client_certificates.php b/client_certificates.php
index 2f6ea275..51adf31d 100644
--- a/client_certificates.php
+++ b/client_certificates.php
@@ -24,7 +24,15 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
@@ -43,22 +51,18 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
-
-
-
-
-
-
-
-
diff --git a/client_documents.php b/client_documents.php
index 87cb35d9..67b3749c 100644
--- a/client_documents.php
+++ b/client_documents.php
@@ -155,10 +155,19 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
@@ -201,7 +206,4 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
'On Receipt',
'7'=>'7 Days',
'10'=>'10 Days',
@@ -139,19 +143,19 @@ $net_terms_array = array(
'90'=>'90 Days'
);
-$records_per_page_array = array('5','10','15','20','30','50','100');
+$records_per_page_array = array ('5','10','15','20','30','50','100');
include_once "settings_localization_array.php";
-$category_types_array = array(
+$category_types_array = array (
'Expense',
'Income',
'Payment Method',
'Referral'
);
-$asset_types_array = array(
+$asset_types_array = array (
'Laptop'=>'fa-laptop',
'Desktop'=>'fa-desktop',
'Server'=>'fa-server',
@@ -168,7 +172,7 @@ $asset_types_array = array(
'Other'=>'fa-tag'
);
-$software_types_array = array(
+$software_types_array = array (
'SaaS',
'Application',
'Mobile',
@@ -177,18 +181,18 @@ $software_types_array = array(
'Misc'
);
-$license_types_array = array(
+$license_types_array = array (
'Device',
'User'
);
-$document_types_array = array(
+$document_types_array = array (
'0'=>'Document',
'1'=>'Template',
'2'=>'Global Template'
);
-$asset_status_array = array(
+$asset_status_array = array (
'Ready to Deploy',
'Deployed',
'Out for Repair',
@@ -197,7 +201,7 @@ $asset_status_array = array(
'Retired'
);
-$ticket_status_array = array(
+$ticket_status_array = array (
'Pending-Assignment',
'Assigned',
'In-Progress',
@@ -207,3 +211,39 @@ $ticket_status_array = array(
'Scheduled',
'Closed'
);
+
+$industry_select_array = array(
+ "Accounting",
+ "Agriculture",
+ "Automotive",
+ "Construction",
+ "Education",
+ "Entertainent",
+ "Finance",
+ "Government",
+ "Healthcare",
+ "Hospititality",
+ "Information Technology",
+ "Insurance",
+ "Pharmacy",
+ "Law",
+ "Manufacturing",
+ "Marketing & Advertising",
+ "Military",
+ "Non-Profit",
+ "Real Estate",
+ "Retail",
+ "Services",
+ "Transportation",
+ "Other" // An 'Other' option for industries not listed
+);
+
+$start_page_select_array = array (
+ 'dashboard.php'=>'Personal Dashboard',
+ 'dashboard_financial.php'=>'Administrative Dashboard',
+ 'dashboard_technical.php' => 'Technical Dashboard',
+ 'clients.php'=> 'Client Management',
+ 'tickets.php'=> 'Support Tickets',
+ 'invoices.php' => 'Invoices'
+);
+
diff --git a/global_search.php b/global_search.php
index 86fe2b16..b059138c 100644
--- a/global_search.php
+++ b/global_search.php
@@ -39,6 +39,13 @@ if (isset($_GET['query'])) {
AND (vendor_name LIKE '%$query%' OR vendor_phone LIKE '%$phone_query%')
ORDER BY vendor_id DESC LIMIT 5"
);
+
+ $sql_domains = mysqli_query($mysqli, "SELECT * FROM domains
+ LEFT JOIN clients ON domain_client_id = client_id
+ WHERE domain_archived_at IS NULL
+ AND domain_name LIKE '%$query%'
+ ORDER BY domain_id DESC LIMIT 5"
+ );
$sql_products = mysqli_query($mysqli, "SELECT * FROM products
WHERE product_archived_at IS NULL
@@ -240,6 +247,50 @@ if (isset($_GET['query'])) {
+ 0) { ?>
+
+
+
+
+
+
+
+
+
+ | Name |
+ Expiry |
+ Client |
+
+
+
+
+
+ |
+ | |
+ |
+
+
+
+
+
+
+
+
+
+
+
+
0) { ?>
diff --git a/guest_view_invoice.php b/guest_view_invoice.php
index 0e1d19ae..981da396 100644
--- a/guest_view_invoice.php
+++ b/guest_view_invoice.php
@@ -185,7 +185,7 @@ $sql_invoice_items = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE it
Date |
|
-
+
| Due |
|
@@ -212,7 +212,7 @@ $sql_invoice_items = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE it
+
+ | Subtotal |
+ |
+
0) {
?>
| Discount |
- |
+ - |
-
-
-
- | Subtotal |
- |
-
0) { ?>
| Tax |
|
+
+ | Total |
+ |
+
0) { ?>
Paid |
@@ -397,11 +399,11 @@ $sql_invoice_items = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE it
{},
{
text: 'Due',
- style: 'invoiceDateTitle'
+ style: 'invoiceDueDateTitle'
},
{
text: ,
- style: 'invoiceDateValue'
+ style: 'invoiceDueDateValue'
},
],
]
@@ -520,7 +522,7 @@ $sql_invoice_items = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE it
],
[
{
- rowSpan: 5,
+ rowSpan: '*',
text: ,
style: 'notesText'
},
@@ -533,6 +535,20 @@ $sql_invoice_items = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE it
style: 'itemsFooterSubValue'
}
],
+ 0) { ?>
+ [
+ {},
+ {
+ text: 'Discount',
+ style: 'itemsFooterSubTitle'
+ },
+ {
+ text: ,
+ style: 'itemsFooterSubValue'
+ }
+ ],
+
+ 0) { ?>
[
{},
{
@@ -544,6 +560,7 @@ $sql_invoice_items = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE it
style: 'itemsFooterSubValue'
}
],
+
[
{},
{
@@ -555,6 +572,7 @@ $sql_invoice_items = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE it
style: 'itemsFooterSubValue'
}
],
+ 0) { ?>
[
{},
{
@@ -566,6 +584,7 @@ $sql_invoice_items = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE it
style: 'itemsFooterSubValue'
}
],
+
[
{},
{
@@ -631,7 +650,7 @@ $sql_invoice_items = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE it
alignment: 'right',
margin: [0,0,0,30]
},
- // Invoice Dates
+ // Invoice Date
invoiceDateTitle: {
fontSize: 10,
alignment: 'left',
@@ -642,6 +661,19 @@ $sql_invoice_items = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE it
alignment: 'right',
margin: [0,5,0,5]
},
+ // Invoice Due Date
+ invoiceDueDateTitle: {
+ fontSize: 10,
+ bold: true,
+ alignment: 'left',
+ margin: [0,5,0,5]
+ },
+ invoiceDueDateValue: {
+ fontSize: 10,
+ bold: true,
+ alignment: 'right',
+ margin: [0,5,0,5]
+ },
// Items Header
itemsHeader: {
fontSize: 10,
diff --git a/guest_view_quote.php b/guest_view_quote.php
index c8df34da..d1502026 100644
--- a/guest_view_quote.php
+++ b/guest_view_quote.php
@@ -154,7 +154,7 @@ if ($quote_status == "Draft" || $quote_status == "Sent" || $quote_status == "Vie
Date |
|
-
+
| Expire |
|
@@ -233,21 +233,16 @@ if ($quote_status == "Draft" || $quote_status == "Sent" || $quote_status == "Vie
- 0) {
- ?>
-
- | Discount |
- |
-
-
| Subtotal |
|
+ 0) { ?>
+
+ | Discount |
+ |
+
+
0) { ?>
| Tax |
@@ -378,11 +373,11 @@ if ($quote_status == "Draft" || $quote_status == "Sent" || $quote_status == "Vie
{},
{
text: 'Expire',
- style: 'invoiceDateTitle'
+ style: 'invoiceDueDateTitle'
},
{
text: ,
- style: 'invoiceDateValue'
+ style: 'invoiceDueDateValue'
},
],
]
@@ -501,7 +496,7 @@ if ($quote_status == "Draft" || $quote_status == "Sent" || $quote_status == "Vie
],
[
{
- rowSpan: 3,
+ rowSpan: '*',
text: ,
style: 'notesText'
},
@@ -514,6 +509,20 @@ if ($quote_status == "Draft" || $quote_status == "Sent" || $quote_status == "Vie
style: 'itemsFooterSubValue'
}
],
+ 0) { ?>
+ [
+ {},
+ {
+ text: 'Discount',
+ style: 'itemsFooterSubTitle'
+ },
+ {
+ text: ,
+ style: 'itemsFooterSubValue'
+ }
+ ],
+
+ 0) { ?>
[
{},
{
@@ -525,15 +534,16 @@ if ($quote_status == "Draft" || $quote_status == "Sent" || $quote_status == "Vie
style: 'itemsFooterSubValue'
}
],
+
[
{},
{
text: 'Total',
- style: 'itemsFooterSubTitle'
+ style: 'itemsFooterTotalTitle'
},
{
text: ,
- style: 'itemsFooterSubValue'
+ style: 'itemsFooterTotalValue'
}
],
]
@@ -600,6 +610,19 @@ if ($quote_status == "Draft" || $quote_status == "Sent" || $quote_status == "Vie
alignment: 'right',
margin: [0,5,0,5]
},
+ // Invoice Due Dates
+ invoiceDueDateTitle: {
+ fontSize: 10,
+ bold: true,
+ alignment: 'left',
+ margin: [0,5,0,5]
+ },
+ invoiceDueDateValue: {
+ fontSize: 10,
+ bold: true,
+ alignment: 'right',
+ margin: [0,5,0,5]
+ },
// Items Header
itemsHeader: {
fontSize: 10,
diff --git a/inc_all_client.php b/inc_all_client.php
index 7dc50c58..7e895995 100644
--- a/inc_all_client.php
+++ b/inc_all_client.php
@@ -32,6 +32,7 @@ if (isset($_GET['client_id'])) {
$row = mysqli_fetch_array($sql);
$client_name = nullable_htmlentities($row['client_name']);
+ $client_is_lead = intval($row['client_lead']);
$client_type = nullable_htmlentities($row['client_type']);
$client_website = nullable_htmlentities($row['client_website']);
$client_referral = nullable_htmlentities($row['client_referral']);
diff --git a/inc_client_top_head.php b/inc_client_top_head.php
index f8ad8209..d782bf06 100644
--- a/inc_client_top_head.php
+++ b/inc_client_top_head.php
@@ -159,7 +159,3 @@ require_once "client_edit_modal.php";
require_once "client_delete_modal.php";
require_once "client_download_pdf_modal.php";
-
-require_once "category_quick_add_modal.php";
-
-
diff --git a/invoice.php b/invoice.php
index b5983fb6..8b1471eb 100644
--- a/invoice.php
+++ b/invoice.php
@@ -242,7 +242,7 @@ if (isset($_GET['invoice_id'])) {
Date |
|
-
+
| Due |
|
@@ -403,28 +403,31 @@ if (isset($_GET['invoice_id'])) {
+
+ | Subtotal |
+ |
+
0) {
?>
| Discount |
- |
+ - |
-
-
-
- | Subtotal |
- |
-
0) { ?>
| Tax |
|
-
+
+ | Total |
+ |
+
+ 0) { ?>
Paid |
@@ -680,11 +683,11 @@ require_once "footer.php";
{},
{
text: 'Due',
- style: 'invoiceDateTitle'
+ style: 'invoiceDueDateTitle'
},
{
text: ,
- style: 'invoiceDateValue'
+ style: 'invoiceDueDateValue'
},
],
]
@@ -803,7 +806,7 @@ require_once "footer.php";
],
[
{
- rowSpan: 5,
+ rowSpan: '*',
text: ,
style: 'notesText'
},
@@ -816,6 +819,20 @@ require_once "footer.php";
style: 'itemsFooterSubValue'
}
],
+ 0) { ?>
+ [
+ {},
+ {
+ text: 'Discount',
+ style: 'itemsFooterSubTitle'
+ },
+ {
+ text: ,
+ style: 'itemsFooterSubValue'
+ }
+ ],
+
+ 0) { ?>
[
{},
{
@@ -827,6 +844,7 @@ require_once "footer.php";
style: 'itemsFooterSubValue'
}
],
+
[
{},
{
@@ -838,6 +856,7 @@ require_once "footer.php";
style: 'itemsFooterSubValue'
}
],
+ 0) { ?>
[
{},
{
@@ -849,6 +868,7 @@ require_once "footer.php";
style: 'itemsFooterSubValue'
}
],
+
[
{},
{
@@ -858,7 +878,7 @@ require_once "footer.php";
{
text: ,
- style: 'itemsFooterTotalTitle'
+ style: 'itemsFooterTotalValue'
}
],
]
@@ -914,7 +934,7 @@ require_once "footer.php";
alignment: 'right',
margin: [0,0,0,30]
},
- // Invoice Dates
+ // Invoice Date
invoiceDateTitle: {
fontSize: 10,
alignment: 'left',
@@ -925,6 +945,19 @@ require_once "footer.php";
alignment: 'right',
margin: [0,5,0,5]
},
+ // Invoice Due Date
+ invoiceDueDateTitle: {
+ fontSize: 10,
+ bold: true,
+ alignment: 'left',
+ margin: [0,5,0,5]
+ },
+ invoiceDueDateValue: {
+ fontSize: 10,
+ bold: true,
+ alignment: 'right',
+ margin: [0,5,0,5]
+ },
// Items Header
itemsHeader: {
fontSize: 10,
diff --git a/invoice_add_modal.php b/invoice_add_modal.php
index e1171764..b2e33e31 100644
--- a/invoice_add_modal.php
+++ b/invoice_add_modal.php
@@ -73,7 +73,7 @@
?>
diff --git a/invoice_edit_modal.php b/invoice_edit_modal.php
index abc451b7..8f5cbf5b 100644
--- a/invoice_edit_modal.php
+++ b/invoice_edit_modal.php
@@ -56,7 +56,7 @@
?>
@@ -67,7 +67,7 @@
-
+
diff --git a/invoice_payment_add_modal.php b/invoice_payment_add_modal.php
index 7a25845d..a7aa2a41 100644
--- a/invoice_payment_add_modal.php
+++ b/invoice_payment_add_modal.php
@@ -36,7 +36,7 @@
-
+
diff --git a/invoices.php b/invoices.php
index f70a83b7..1b8c6bc6 100644
--- a/invoices.php
+++ b/invoices.php
@@ -162,13 +162,13 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
@@ -326,7 +326,5 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
-
+
diff --git a/js/ticket_add_remove_watchers.js b/js/ticket_add_remove_watchers.js
deleted file mode 100644
index 50224e73..00000000
--- a/js/ticket_add_remove_watchers.js
+++ /dev/null
@@ -1,41 +0,0 @@
-function addWatcher(button) {
- var container = button.previousElementSibling;
- var textFieldWrapper = document.createElement("div");
- textFieldWrapper.className = "input-group mb-3";
-
- var prependWrapper = document.createElement("div");
- prependWrapper.className = "input-group-prepend";
- var iconSpan = document.createElement("span");
- iconSpan.className = "input-group-text";
- iconSpan.innerHTML = "";
- prependWrapper.appendChild(iconSpan);
-
- var textField = document.createElement("input");
- textField.type = "email";
- textField.className = "form-control";
- textField.name = "watchers[]";
- textField.placeholder = "Enter an email";
-
- var removeButtonWrapper = document.createElement("div");
- removeButtonWrapper.className = "input-group-append";
-
- var removeButton = document.createElement("button");
- removeButton.className = "btn btn-danger";
- removeButton.type = "button";
- removeButton.innerHTML = "";
- removeButton.onclick = function() {
- removeWatcher(this);
- };
-
- removeButtonWrapper.appendChild(removeButton);
- textFieldWrapper.appendChild(prependWrapper);
- textFieldWrapper.appendChild(textField);
- textFieldWrapper.appendChild(removeButtonWrapper);
- container.appendChild(textFieldWrapper);
-}
-
-function removeWatcher(button) {
- var container = button.parentNode.parentNode.parentNode; // Navigate to the container
- var textFieldWrapper = button.parentNode.parentNode;
- container.removeChild(textFieldWrapper);
-}
\ No newline at end of file
diff --git a/js/ticket_time_tracking.js b/js/ticket_time_tracking.js
index ddcd41e7..5a715958 100644
--- a/js/ticket_time_tracking.js
+++ b/js/ticket_time_tracking.js
@@ -125,6 +125,7 @@
}
}
+
function updateRunningTicketsCount() {
var runningTickets = parseInt(document.getElementById('runningTicketsCount').innerText, 10);
@@ -136,6 +137,16 @@
document.getElementById('runningTicketsCount').innerText = runningTickets.toString();
}
+
+ // Function to check status and pause timer
+ function checkStatusAndPauseTimer() {
+ var status = document.querySelector('select[name="status"]').value;
+ if (status.includes("Pending")) {
+ pauseTimer();
+ }
+ }
+
+
document.getElementById("hours").addEventListener('change', updateTimeFromInput);
document.getElementById("minutes").addEventListener('change', updateTimeFromInput);
@@ -146,6 +157,9 @@
document.getElementById("minutes").addEventListener('focus', handleInputFocus);
document.getElementById("seconds").addEventListener('focus', handleInputFocus);
+ document.querySelector('select[name="status"]').addEventListener('change', checkStatusAndPauseTimer);
+
+
document.getElementById("startStopTimer").addEventListener('click', function() {
if (timerInterval === null) {
startTimer();
@@ -162,16 +176,17 @@
// Wait for other synchronous actions (if any) to complete before resetting the timer.
setTimeout(forceResetTimer, 100); // 100ms delay should suffice, but you can adjust as needed.
});
-
+
try {
displayTime();
if (!localStorage.getItem(getLocalStorageKey("startTime")) && !localStorage.getItem(getLocalStorageKey("pausedTime"))) {
- // If first time, start the timer automatically
startTimer();
} else if (localStorage.getItem(getLocalStorageKey("startTime"))) {
- // Continue timer if it was running before
startTimer();
}
+
+ // Check and pause timer if status is pending
+ checkStatusAndPauseTimer();
} catch (error) {
console.error("There was an issue initializing the timer:", error);
}
diff --git a/login.php b/login.php
index 0bb66c69..f78f6b54 100644
--- a/login.php
+++ b/login.php
@@ -310,6 +310,12 @@ if (isset($_POST['login'])) {
+
diff --git a/portal/login_microsoft.php b/portal/login_microsoft.php
index 0428da25..b3d32273 100644
--- a/portal/login_microsoft.php
+++ b/portal/login_microsoft.php
@@ -110,7 +110,7 @@ if (isset($_POST['code']) && $_POST['state'] == session_id()) {
header("Location: index.php");
} else {
- $_SESSION['login_message'] = 'Something went wrong with login. Ensure you are setup for SSO.';
+ $_SESSION['login_message'] = 'Something went wrong with logging you in: Your account is not configured for Azure SSO. Please ensure you are setup in ITFlow as a contact and have Azure SSO configured.';
header("Location: index.php");
}
}
diff --git a/post/client.php b/post/client.php
index efc99a47..a06bdf59 100644
--- a/post/client.php
+++ b/post/client.php
@@ -26,6 +26,7 @@ if (isset($_POST['add_client'])) {
$extended_log_description = '';
+ // Create client
mysqli_query($mysqli, "INSERT INTO clients SET client_name = '$name', client_type = '$type', client_website = '$website', client_referral = '$referral', client_rate = $rate, client_currency_code = '$currency_code', client_net_terms = $net_terms, client_tax_id_number = '$tax_id_number', client_lead = $lead, client_notes = '$notes', client_accessed_at = NOW()");
$client_id = mysqli_insert_id($mysqli);
@@ -35,7 +36,15 @@ if (isset($_POST['add_client'])) {
file_put_contents("uploads/clients/$client_id/index.php", "");
}
- //Add Location
+ // Create Referral if it doesn't exist
+ $sql = mysqli_query($mysqli, "SELECT category_name FROM categories WHERE category_type = 'Referral' AND category_archived_at IS NULL AND category_name = '$referral'");
+ if(mysqli_num_rows($sql) == 0) {
+ mysqli_query($mysqli, "INSERT INTO categories SET category_name = '$referral', category_type = 'Referral'");
+ // Logging
+ mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Category', log_action = 'Create', log_description = '$name', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_user_id = $session_user_id");
+ }
+
+ // Create Location
if (!empty($location_phone) || !empty($address) || !empty($city) || !empty($state) || !empty($zip)) {
mysqli_query($mysqli, "INSERT INTO locations SET location_name = 'Primary', location_address = '$address', location_city = '$city', location_state = '$state', location_zip = '$zip', location_phone = '$location_phone', location_country = '$country', location_primary = 1, location_client_id = $client_id");
@@ -44,7 +53,7 @@ if (isset($_POST['add_client'])) {
}
- //Add Contact
+ // Create Contact
if (!empty($contact) || !empty($title) || !empty($contact_phone) || !empty($contact_mobile) || !empty($contact_email)) {
mysqli_query($mysqli, "INSERT INTO contacts SET contact_name = '$contact', contact_title = '$title', contact_phone = '$contact_phone', contact_extension = '$contact_extension', contact_mobile = '$contact_mobile', contact_email = '$contact_email', contact_primary = 1, contact_important = 1, contact_client_id = $client_id");
@@ -52,7 +61,7 @@ if (isset($_POST['add_client'])) {
$extended_log_description .= ", primary contact $contact added";
}
- //Add Tags
+ // Add Tags
if (isset($_POST['tags'])) {
foreach($_POST['tags'] as $tag) {
$tag = intval($tag);
@@ -60,7 +69,7 @@ if (isset($_POST['add_client'])) {
}
}
- //Add domain to domains/certificates
+ // Create domain in domains/certificates
if (!empty($website) && filter_var($website, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)) {
// Get domain expiry date
$expire = getDomainExpirationDate($website);
@@ -96,7 +105,7 @@ if (isset($_POST['add_client'])) {
}
- //Logging
+ // Logging
mysqli_query($mysqli, "INSERT INTO logs SET log_type = 'Client', log_action = 'Create', log_description = '$session_name created client $name$extended_log_description', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_client_id = $client_id, log_user_id = $session_user_id, log_entity_id = $client_id");
$_SESSION['alert_message'] = "Client $name created";
@@ -110,24 +119,31 @@ if (isset($_POST['edit_client'])) {
require_once 'post/client_model.php';
-
validateAdminRole();
$client_id = intval($_POST['client_id']);
mysqli_query($mysqli, "UPDATE clients SET client_name = '$name', client_type = '$type', client_website = '$website', client_referral = '$referral', client_rate = $rate, client_currency_code = '$currency_code', client_net_terms = $net_terms, client_tax_id_number = '$tax_id_number', client_lead = $lead, client_notes = '$notes' WHERE client_id = $client_id");
- //Tags
- //Delete existing tags
+ // Create Referral if it doesn't exist
+ $sql = mysqli_query($mysqli, "SELECT category_name FROM categories WHERE category_type = 'Referral' AND category_archived_at IS NULL AND category_name = '$referral'");
+ if(mysqli_num_rows($sql) == 0) {
+ mysqli_query($mysqli, "INSERT INTO categories SET category_name = '$referral', category_type = 'Referral'");
+ // Logging
+ mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Category', log_action = 'Create', log_description = '$name', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_user_id = $session_user_id");
+ }
+
+ // Tags
+ // Delete existing tags
mysqli_query($mysqli, "DELETE FROM client_tags WHERE client_tag_client_id = $client_id");
- //Add new tags
+ // Add new tags
foreach($_POST['tags'] as $tag) {
$tag = intval($tag);
mysqli_query($mysqli, "INSERT INTO client_tags SET client_tag_client_id = $client_id, client_tag_tag_id = $tag");
}
- //Logging
+ // Logging
mysqli_query($mysqli, "INSERT INTO logs SET log_type = 'Client', log_action = 'Modify', log_description = '$session_name modified client $name', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_client_id = $client_id, log_user_id = $session_user_id, log_entity_id = $client_id");
$_SESSION['alert_message'] = "Client $client_name updated";
diff --git a/post/document.php b/post/document.php
index b209de14..59846391 100644
--- a/post/document.php
+++ b/post/document.php
@@ -134,6 +134,9 @@ if (isset($_POST['edit_document'])) {
// vendor documents
mysqli_query($mysqli,"UPDATE vendor_documents SET document_id = $new_document_id WHERE document_id = $document_id");
+ // Service document
+ mysqli_query($mysqli,"UPDATE service_documents SET document_id = $new_document_id WHERE document_id = $document_id");
+
//Logging
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Document', log_action = 'Edit', log_description = '$session_name Edited document $name previous version was kept', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_client_id = $client_id, log_user_id = $session_user_id, log_entity_id = $new_document_id");
@@ -424,6 +427,9 @@ if (isset($_GET['archive_document'])) {
// Vendor Associations
mysqli_query($mysqli,"DELETE FROM vendor_documents WHERE document_id = $document_id");
+ // Service Associations
+ mysqli_query($mysqli,"DELETE FROM service_documents WHERE document_id = $document_id");
+
//logging
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Document', log_action = 'Archive', log_description = '$session_name archived document $document_name', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_client_id = $client_id, log_user_id = $session_user_id, log_entity_id = $document_id");
@@ -458,6 +464,9 @@ if (isset($_GET['delete_document'])) {
// Vendor Associations
mysqli_query($mysqli,"DELETE FROM vendor_documents WHERE document_id = $document_id");
+ // Service Associations
+ mysqli_query($mysqli,"DELETE FROM service_documents WHERE document_id = $document_id");
+
//Logging
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Document', log_action = 'Delete', log_description = '$document_id', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_user_id = $session_user_id");
diff --git a/post/setting.php b/post/setting.php
index c877999c..bba3113a 100644
--- a/post/setting.php
+++ b/post/setting.php
@@ -265,8 +265,9 @@ if (isset($_POST['edit_default_settings'])) {
$transfer_to_account = intval($_POST['transfer_to_account']);
$calendar = intval($_POST['calendar']);
$net_terms = intval($_POST['net_terms']);
+ $hourly_rate = floatval($_POST['hourly_rate']);
- mysqli_query($mysqli,"UPDATE settings SET config_start_page = '$start_page', config_default_expense_account = $expense_account, config_default_payment_account = $payment_account, config_default_payment_method = '$payment_method', config_default_expense_payment_method = '$expense_payment_method', config_default_transfer_from_account = $transfer_from_account, config_default_transfer_to_account = $transfer_to_account, config_default_calendar = $calendar, config_default_net_terms = $net_terms WHERE company_id = 1");
+ mysqli_query($mysqli,"UPDATE settings SET config_start_page = '$start_page', config_default_expense_account = $expense_account, config_default_payment_account = $payment_account, config_default_payment_method = '$payment_method', config_default_expense_payment_method = '$expense_payment_method', config_default_transfer_from_account = $transfer_from_account, config_default_transfer_to_account = $transfer_to_account, config_default_calendar = $calendar, config_default_net_terms = $net_terms, config_default_hourly_rate = $hourly_rate WHERE company_id = 1");
//Logging
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Settings', log_action = 'Modify', log_description = '$session_name modified default settings', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_user_id = $session_user_id");
diff --git a/post/trip.php b/post/trip.php
index 8d4567f5..b2f46d97 100644
--- a/post/trip.php
+++ b/post/trip.php
@@ -59,11 +59,11 @@ if (isset($_GET['delete_trip'])) {
if (isset($_POST['export_trips_csv'])) {
$date_from = sanitizeInput($_POST['date_from']);
$date_to = sanitizeInput($_POST['date_to']);
- if(!empty($date_from) && !empty($date_to)){
- $date_query = "AND DATE(trip_date) BETWEEN '$date_from' AND '$date_to'";
+ if (!empty($date_from) && !empty($date_to)){
+ $date_query = "DATE(trip_date) BETWEEN '$date_from' AND '$date_to'";
$file_name_date = "$date_from-to-$date_to";
- }else{
- $date_query = "";
+ } else {
+ $date_query = "trip_date IS NOT NULL";
$file_name_date = date('Y-m-d');
}
diff --git a/product_add_modal.php b/product_add_modal.php
index 07a38629..b62dd51a 100644
--- a/product_add_modal.php
+++ b/product_add_modal.php
@@ -42,7 +42,7 @@
?>
diff --git a/product_edit_modal.php b/product_edit_modal.php
index af9b20f8..aaf2beeb 100644
--- a/product_edit_modal.php
+++ b/product_edit_modal.php
@@ -42,7 +42,7 @@
?>
@@ -55,7 +55,7 @@
-
+
diff --git a/products.php b/products.php
index 5ac07d1a..cd1214da 100644
--- a/products.php
+++ b/products.php
@@ -123,7 +123,4 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
require_once "product_add_modal.php";
-require_once "category_quick_add_modal.php";
-
require_once "footer.php";
-
diff --git a/quote.php b/quote.php
index 650a9034..81c51cf8 100644
--- a/quote.php
+++ b/quote.php
@@ -99,7 +99,7 @@ if (isset($_GET['quote_id'])) {
$json_products = json_encode($products);
}
- ?>
+?>
-
@@ -135,10 +135,10 @@ if (isset($_GET['quote_id'])) {
-
+
Accept
-
+
Decline
@@ -167,8 +167,7 @@ if (isset($_GET['quote_id'])) {
Print
- ');">
+ ');">
Download PDF
@@ -207,7 +206,9 @@ if (isset($_GET['quote_id'])) {
-
+ -
+
+
@@ -216,7 +217,9 @@ if (isset($_GET['quote_id'])) {
-
+ -
+
+
@@ -234,7 +237,7 @@ if (isset($_GET['quote_id'])) {
Date |
|
-
+
| Expire |
|
@@ -250,151 +253,154 @@ if (isset($_GET['quote_id'])) {
@@ -422,31 +428,26 @@ if (isset($_GET['quote_id'])) {
- 0) {
- ?>
- | Discount |
- |
+ Subtotal |
+ |
-
-
- | Subtotal |
- |
-
- 0) { ?>
+ 0) { ?>
+
+ | Discount |
+ - |
+
+
+ 0) { ?>
+
+ | Tax |
+ |
+
+
- | Tax |
- |
+ Total |
+ |
-
-
- | Total |
- |
-
@@ -475,29 +476,29 @@ if (isset($_GET['quote_id'])) {
-
- | Date |
- Status |
- Description |
-
+
+ | Date |
+ Status |
+ Description |
+
-
-
- |
- |
- |
-
+
+ |
+ |
+ |
+
+ }
+ ?>
@@ -506,7 +507,7 @@ if (isset($_GET['quote_id'])) {
-
+
\ No newline at end of file
diff --git a/quote_add_modal.php b/quote_add_modal.php
index 08e232b6..fed4f2fc 100644
--- a/quote_add_modal.php
+++ b/quote_add_modal.php
@@ -71,7 +71,7 @@
diff --git a/quote_edit_modal.php b/quote_edit_modal.php
index 5188b69d..90563cf4 100644
--- a/quote_edit_modal.php
+++ b/quote_edit_modal.php
@@ -42,7 +42,7 @@
@@ -54,7 +54,7 @@
-
+
diff --git a/quotes.php b/quotes.php
index a8c3e1d1..fc8f10dc 100644
--- a/quotes.php
+++ b/quotes.php
@@ -38,13 +38,14 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
@@ -206,7 +207,5 @@ require_once "quote_add_modal.php";
require_once "quote_edit_modal.php";
-require_once "category_quick_add_modal.php";
-
require_once "footer.php";
diff --git a/recurring_expense_create_modal.php b/recurring_expense_create_modal.php
index b3b9be43..811bff14 100644
--- a/recurring_expense_create_modal.php
+++ b/recurring_expense_create_modal.php
@@ -68,7 +68,7 @@
-
+
@@ -137,7 +137,7 @@
?>
@@ -182,7 +182,7 @@
?>
diff --git a/recurring_expense_edit_modal.php b/recurring_expense_edit_modal.php
index 48b5fc85..9ab5cb2f 100644
--- a/recurring_expense_edit_modal.php
+++ b/recurring_expense_edit_modal.php
@@ -69,7 +69,7 @@
-
+
@@ -141,7 +141,7 @@
?>
@@ -186,7 +186,7 @@
?>
diff --git a/recurring_invoice.php b/recurring_invoice.php
index 8bba5ac6..57a63b24 100644
--- a/recurring_invoice.php
+++ b/recurring_invoice.php
@@ -356,31 +356,25 @@ if (isset($_GET['recurring_id'])) {
- 0) {
- ?>
-
- | Discount |
- |
-
-
-
| Subtotal |
|
+ 0) { ?>
+
+ | Discount |
+ |
+
+
0) { ?>
| Tax |
|
-
- | Total |
- |
+
+ | Total |
+ |
@@ -441,9 +435,6 @@ if (isset($_GET['recurring_id'])) {
require_once "recurring_invoice_note_modal.php";
- require_once "category_quick_add_modal.php";
-
-
}
require_once "footer.php";
diff --git a/recurring_invoice_add_modal.php b/recurring_invoice_add_modal.php
index 324d8dd1..c3df89ca 100644
--- a/recurring_invoice_add_modal.php
+++ b/recurring_invoice_add_modal.php
@@ -98,7 +98,7 @@
?>
diff --git a/recurring_invoice_edit_modal.php b/recurring_invoice_edit_modal.php
index 42654ec9..0dfef318 100644
--- a/recurring_invoice_edit_modal.php
+++ b/recurring_invoice_edit_modal.php
@@ -75,7 +75,7 @@
?>
@@ -86,7 +86,7 @@
-
+
diff --git a/recurring_invoices.php b/recurring_invoices.php
index 7e70acc3..7d5097be 100644
--- a/recurring_invoices.php
+++ b/recurring_invoices.php
@@ -183,9 +183,4 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
require_once "recurring_invoice_add_modal.php";
-require_once "category_quick_add_modal.php";
-
require_once "footer.php";
-
-
-?>
diff --git a/revenue_add_modal.php b/revenue_add_modal.php
index 6aa58242..05fb8d7d 100644
--- a/revenue_add_modal.php
+++ b/revenue_add_modal.php
@@ -114,7 +114,7 @@
?>
diff --git a/revenue_edit_modal.php b/revenue_edit_modal.php
index d439d0e0..69f0a7cd 100644
--- a/revenue_edit_modal.php
+++ b/revenue_edit_modal.php
@@ -44,7 +44,7 @@
-
+
@@ -120,7 +120,7 @@
?>
diff --git a/revenues.php b/revenues.php
index e56d00b6..738fb8ea 100644
--- a/revenues.php
+++ b/revenues.php
@@ -105,7 +105,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
}
$revenue_date = nullable_htmlentities($row['revenue_date']);
$revenue_payment_method = nullable_htmlentities($row['revenue_payment_method']);
- $revenue_amount = number_format(floatval($row['revenue_amount']),2);
+ $revenue_amount = floatval($row['revenue_amount']);
$revenue_currency_code = nullable_htmlentities($row['revenue_currency_code']);
$revenue_created_at = nullable_htmlentities($row['revenue_created_at']);
$account_id = intval($row['account_id']);
@@ -161,10 +161,4 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
require_once "revenue_add_modal.php";
-require_once "category_quick_add_modal.php";
-
-
require_once "footer.php";
-
-
-?>
diff --git a/settings_defaults.php b/settings_defaults.php
index 7bb782be..7557a3d8 100644
--- a/settings_defaults.php
+++ b/settings_defaults.php
@@ -16,7 +16,17 @@ require_once "inc_all_settings.php";
-
+
@@ -197,6 +207,16 @@ require_once "inc_all_settings.php";
+
+
diff --git a/side_nav.php b/side_nav.php
index aa0a9649..26b82b14 100644
--- a/side_nav.php
+++ b/side_nav.php
@@ -43,9 +43,16 @@
-
- if ($config_module_enable_accounting == 1) { ?>
+
+ ">
+
+ Calendar
+
+
+
+
@@ -126,25 +133,17 @@
Budget
-
-
-
-
-
-
- ">
-
- Calendar
-
-
-
-
+
">
Trips
+
+
+
+
">
diff --git a/ticket_add_modal.php b/ticket_add_modal.php
index 618db36d..f6c2d37c 100644
--- a/ticket_add_modal.php
+++ b/ticket_add_modal.php
@@ -169,8 +169,22 @@
diff --git a/ticket_invoice_add_modal.php b/ticket_invoice_add_modal.php
index 5d74fe99..cf7f6f4e 100644
--- a/ticket_invoice_add_modal.php
+++ b/ticket_invoice_add_modal.php
@@ -155,7 +155,7 @@
-
+
diff --git a/tickets.php b/tickets.php
index 53ee893a..16e2ac8e 100644
--- a/tickets.php
+++ b/tickets.php
@@ -98,7 +98,7 @@ $user_active_assigned_tickets = intval($row['total_tickets_assigned']);
max-width: 600px;
}
-
+
diff --git a/trip_add_modal.php b/trip_add_modal.php
index ee613ae3..8b6e7651 100644
--- a/trip_add_modal.php
+++ b/trip_add_modal.php
@@ -53,7 +53,25 @@
-
+
@@ -72,8 +90,10 @@
1 AND user_archived_at IS NULL ORDER BY user_name ASC"
+ );
while ($row = mysqli_fetch_array($sql)) {
$user_id = intval($row['user_id']);
$user_name = nullable_htmlentities($row['user_name']);
diff --git a/trip_copy_modal.php b/trip_copy_modal.php
index 6ffd8b6e..624d7cf9 100644
--- a/trip_copy_modal.php
+++ b/trip_copy_modal.php
@@ -54,13 +54,32 @@
-
+
-
+
@@ -75,9 +94,11 @@
1 AND user_archived_at > '$trip_created_at' ORDER BY user_name ASC"
+ );
+ while ($row = mysqli_fetch_array($sql_users)) {
$user_id_select = intval($row['user_id']);
$user_name_select = nullable_htmlentities($row['user_name']);
?>
diff --git a/trips.php b/trips.php
index fae2af1f..729f2796 100644
--- a/trips.php
+++ b/trips.php
@@ -47,7 +47,6 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
@@ -81,6 +80,12 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
+