mirror of
https://github.com/itflow-org/itflow
synced 2026-03-09 15:24:51 +00:00
Added Definable Client Abbreviation
This commit is contained in:
@@ -291,6 +291,16 @@
|
|||||||
|
|
||||||
<div class="tab-pane fade" id="pills-more">
|
<div class="tab-pane fade" id="pills-more">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Abbreviation</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-id-badge"></i></span>
|
||||||
|
</div>
|
||||||
|
<input type="text" class="form-control" name="abbreviation" placeholder="Abbreviated name for client" maxlength="5">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Notes</label>
|
<label>Notes</label>
|
||||||
<textarea class="form-control" rows="6" name="notes" placeholder="Enter some notes"></textarea>
|
<textarea class="form-control" rows="6" name="notes" placeholder="Enter some notes"></textarea>
|
||||||
|
|||||||
@@ -184,6 +184,16 @@
|
|||||||
|
|
||||||
<div class="tab-pane fade" id="pills-client-more<?php echo $client_id; ?>">
|
<div class="tab-pane fade" id="pills-client-more<?php echo $client_id; ?>">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Abbreviation</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-id-badge"></i></span>
|
||||||
|
</div>
|
||||||
|
<input type="text" class="form-control" name="abbreviation" placeholder="Abbreviated name for client" value="<?php echo $client_abbreviation; ?>" maxlength="5">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<textarea class="form-control" rows="8" placeholder="Enter some notes"
|
<textarea class="form-control" rows="8" placeholder="Enter some notes"
|
||||||
name="notes"><?php echo $client_notes; ?></textarea>
|
name="notes"><?php echo $client_notes; ?></textarea>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<aside class="main-sidebar sidebar-dark-<?php echo nullable_htmlentities($config_theme); ?> d-print-none">
|
<aside class="main-sidebar sidebar-dark-<?php echo nullable_htmlentities($config_theme); ?> d-print-none">
|
||||||
|
|
||||||
<a class="brand-link pb-1 mt-1" href="clients.php">
|
<a class="brand-link pb-1 mt-1" href="clients.php">
|
||||||
<p class="h5"><i class="nav-icon fas fa-arrow-left ml-3 mr-2"></i> Back | <strong><?php echo shortenClient($client_name); ?></strong></p>
|
<p class="h5"><i class="nav-icon fas fa-arrow-left ml-3 mr-2"></i> Back | <strong><?php if($client_abbreviation) { echo $client_abbreviation; } else { echo shortenClient($client_name); } ?></strong></p>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<!-- Sidebar -->
|
<!-- Sidebar -->
|
||||||
|
|||||||
@@ -286,6 +286,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||||||
$client_net_terms = intval($row['client_net_terms']);
|
$client_net_terms = intval($row['client_net_terms']);
|
||||||
$client_tax_id_number = nullable_htmlentities($row['client_tax_id_number']);
|
$client_tax_id_number = nullable_htmlentities($row['client_tax_id_number']);
|
||||||
$client_referral = nullable_htmlentities($row['client_referral']);
|
$client_referral = nullable_htmlentities($row['client_referral']);
|
||||||
|
$client_abbreviation = nullable_htmlentities($row['client_abbreviation']);
|
||||||
$client_notes = nullable_htmlentities($row['client_notes']);
|
$client_notes = nullable_htmlentities($row['client_notes']);
|
||||||
$client_created_at = date('Y-m-d', strtotime($row['client_created_at']));
|
$client_created_at = date('Y-m-d', strtotime($row['client_created_at']));
|
||||||
$client_updated_at = nullable_htmlentities($row['client_updated_at']);
|
$client_updated_at = nullable_htmlentities($row['client_updated_at']);
|
||||||
|
|||||||
@@ -1942,12 +1942,21 @@ if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) {
|
|||||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.3.6'");
|
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.3.6'");
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (CURRENT_DATABASE_VERSION == '1.3.6') {
|
if (CURRENT_DATABASE_VERSION == '1.3.6') {
|
||||||
// // Insert queries here required to update to DB version 1.3.7
|
mysqli_query($mysqli, "ALTER TABLE `clients` ADD `client_abbreviation` VARCHAR(10) DEFAULT NULL AFTER `client_tax_id_number`");
|
||||||
|
|
||||||
|
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.3.7'");
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (CURRENT_DATABASE_VERSION == '1.3.7') {
|
||||||
|
// // Insert queries here required to update to DB version 1.3.8
|
||||||
// // Then, update the database to the next sequential version
|
// // Then, update the database to the next sequential version
|
||||||
// mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.3.7'");
|
// mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.3.8'");
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Up-to-date
|
// Up-to-date
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,4 +5,4 @@
|
|||||||
* It is used in conjunction with database_updates.php
|
* It is used in conjunction with database_updates.php
|
||||||
*/
|
*/
|
||||||
|
|
||||||
DEFINE("LATEST_DATABASE_VERSION", "1.3.6");
|
DEFINE("LATEST_DATABASE_VERSION", "1.3.7");
|
||||||
|
|||||||
3
db.sql
3
db.sql
@@ -274,6 +274,7 @@ CREATE TABLE `clients` (
|
|||||||
`client_currency_code` varchar(200) NOT NULL,
|
`client_currency_code` varchar(200) NOT NULL,
|
||||||
`client_net_terms` int(10) NOT NULL,
|
`client_net_terms` int(10) NOT NULL,
|
||||||
`client_tax_id_number` varchar(255) DEFAULT NULL,
|
`client_tax_id_number` varchar(255) DEFAULT NULL,
|
||||||
|
`client_abbreviation` varchar(10) DEFAULT NULL,
|
||||||
`client_notes` text DEFAULT NULL,
|
`client_notes` text DEFAULT NULL,
|
||||||
`client_created_at` datetime NOT NULL DEFAULT current_timestamp(),
|
`client_created_at` datetime NOT NULL DEFAULT current_timestamp(),
|
||||||
`client_updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp(),
|
`client_updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp(),
|
||||||
@@ -1966,4 +1967,4 @@ CREATE TABLE `vendors` (
|
|||||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||||
|
|
||||||
-- Dump completed on 2024-06-01 14:25:19
|
-- Dump completed on 2024-06-07 18:18:21
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ if (isset($_GET['client_id'])) {
|
|||||||
$client_net_terms = $config_default_net_terms;
|
$client_net_terms = $config_default_net_terms;
|
||||||
}
|
}
|
||||||
$client_tax_id_number = nullable_htmlentities($row['client_tax_id_number']);
|
$client_tax_id_number = nullable_htmlentities($row['client_tax_id_number']);
|
||||||
|
$client_abbreviation = nullable_htmlentities($row['client_abbreviation']);
|
||||||
$client_rate = floatval($row['client_rate']);
|
$client_rate = floatval($row['client_rate']);
|
||||||
$client_notes = nullable_htmlentities($row['client_notes']);
|
$client_notes = nullable_htmlentities($row['client_notes']);
|
||||||
$client_created_at = nullable_htmlentities($row['client_created_at']);
|
$client_created_at = nullable_htmlentities($row['client_created_at']);
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ if (isset($_POST['add_client'])) {
|
|||||||
$extended_log_description = '';
|
$extended_log_description = '';
|
||||||
|
|
||||||
// Create client
|
// 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()");
|
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_abbreviation = '$abbreviation', client_notes = '$notes', client_accessed_at = NOW()");
|
||||||
|
|
||||||
$client_id = mysqli_insert_id($mysqli);
|
$client_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
@@ -123,7 +123,7 @@ if (isset($_POST['edit_client'])) {
|
|||||||
|
|
||||||
$client_id = intval($_POST['client_id']);
|
$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");
|
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_abbreviation = '$abbreviation', client_notes = '$notes' WHERE client_id = $client_id");
|
||||||
|
|
||||||
// Create Referral if it doesn't exist
|
// 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'");
|
$sql = mysqli_query($mysqli, "SELECT category_name FROM categories WHERE category_type = 'Referral' AND category_archived_at IS NULL AND category_name = '$referral'");
|
||||||
|
|||||||
@@ -7,5 +7,6 @@ $rate = floatval($_POST['rate']);
|
|||||||
$currency_code = sanitizeInput($_POST['currency_code']);
|
$currency_code = sanitizeInput($_POST['currency_code']);
|
||||||
$net_terms = intval($_POST['net_terms']);
|
$net_terms = intval($_POST['net_terms']);
|
||||||
$tax_id_number = sanitizeInput($_POST['tax_id_number']);
|
$tax_id_number = sanitizeInput($_POST['tax_id_number']);
|
||||||
|
$abbreviation = sanitizeInput($_POST['abbreviation']);
|
||||||
$notes = sanitizeInput($_POST['notes']);
|
$notes = sanitizeInput($_POST['notes']);
|
||||||
$lead = intval($_POST['lead']);
|
$lead = intval($_POST['lead']);
|
||||||
|
|||||||
Reference in New Issue
Block a user