mirror of
https://github.com/itflow-org/itflow
synced 2026-03-01 03:14:52 +00:00
Feature: Late Fees can now be assessed to unpaid invoices
This commit is contained in:
@@ -1139,11 +1139,22 @@ if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) {
|
|||||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.6.2'");
|
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.6.2'");
|
||||||
}
|
}
|
||||||
|
|
||||||
//if (CURRENT_DATABASE_VERSION == '0.6.2') {
|
if (CURRENT_DATABASE_VERSION == '0.6.2') {
|
||||||
//Insert queries here required to update to DB version 0.6.2
|
//Insert queries here required to update to DB version 0.6.3
|
||||||
|
|
||||||
|
mysqli_query($mysqli, "ALTER TABLE `settings` ADD `config_invoice_late_fee_enable` TINYINT(1) NOT NULL DEFAULT 0 AFTER `config_invoice_from_email`");
|
||||||
|
|
||||||
|
mysqli_query($mysqli, "ALTER TABLE `settings` ADD `config_invoice_late_fee_percent` DECIMAL(5,2) NOT NULL DEFAULT 0 AFTER `config_invoice_late_fee_enable`");
|
||||||
|
|
||||||
// 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` = '0.6.2'");
|
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.6.3'");
|
||||||
|
}
|
||||||
|
|
||||||
|
//if (CURRENT_DATABASE_VERSION == '0.6.3') {
|
||||||
|
//Insert queries here required to update to DB version 0.6.4
|
||||||
|
|
||||||
|
// Then, update the database to the next sequential version
|
||||||
|
//mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.6.4'");
|
||||||
//}
|
//}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -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", "0.6.2");
|
DEFINE("LATEST_DATABASE_VERSION", "0.6.3");
|
||||||
|
|||||||
4
db.sql
4
db.sql
@@ -1134,6 +1134,8 @@ CREATE TABLE `settings` (
|
|||||||
`config_invoice_footer` text DEFAULT NULL,
|
`config_invoice_footer` text DEFAULT NULL,
|
||||||
`config_invoice_from_name` varchar(200) DEFAULT NULL,
|
`config_invoice_from_name` varchar(200) DEFAULT NULL,
|
||||||
`config_invoice_from_email` varchar(200) DEFAULT NULL,
|
`config_invoice_from_email` varchar(200) DEFAULT NULL,
|
||||||
|
`config_invoice_late_fee_enable` tinyint(1) NOT NULL DEFAULT 0,
|
||||||
|
`config_invoice_late_fee_percent` decimal(5,2) NOT NULL DEFAULT 0.00,
|
||||||
`config_recurring_prefix` varchar(200) DEFAULT NULL,
|
`config_recurring_prefix` varchar(200) DEFAULT NULL,
|
||||||
`config_recurring_next_number` int(11) NOT NULL,
|
`config_recurring_next_number` int(11) NOT NULL,
|
||||||
`config_quote_prefix` varchar(200) DEFAULT NULL,
|
`config_quote_prefix` varchar(200) DEFAULT NULL,
|
||||||
@@ -1618,4 +1620,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 2023-07-03 20:22:39
|
-- Dump completed on 2023-07-11 11:40:09
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ $config_invoice_next_number = intval($row['config_invoice_next_number']);
|
|||||||
$config_invoice_footer = $row['config_invoice_footer'];
|
$config_invoice_footer = $row['config_invoice_footer'];
|
||||||
$config_invoice_from_name = $row['config_invoice_from_name'];
|
$config_invoice_from_name = $row['config_invoice_from_name'];
|
||||||
$config_invoice_from_email = $row['config_invoice_from_email'];
|
$config_invoice_from_email = $row['config_invoice_from_email'];
|
||||||
|
$config_invoice_late_fee_enable = intval($row['config_invoice_late_fee_enable']);
|
||||||
|
$config_invoice_late_fee_percent = floatval($row['config_invoice_late_fee_percent']);
|
||||||
|
|
||||||
// Recurring
|
// Recurring
|
||||||
$config_recurring_prefix = $row['config_recurring_prefix'];
|
$config_recurring_prefix = $row['config_recurring_prefix'];
|
||||||
|
|||||||
@@ -157,10 +157,13 @@ if (isset($_POST['edit_invoice_settings'])) {
|
|||||||
$config_invoice_footer = sanitizeInput($_POST['config_invoice_footer']);
|
$config_invoice_footer = sanitizeInput($_POST['config_invoice_footer']);
|
||||||
$config_invoice_from_email = sanitizeInput($_POST['config_invoice_from_email']);
|
$config_invoice_from_email = sanitizeInput($_POST['config_invoice_from_email']);
|
||||||
$config_invoice_from_name = sanitizeInput($_POST['config_invoice_from_name']);
|
$config_invoice_from_name = sanitizeInput($_POST['config_invoice_from_name']);
|
||||||
|
$config_invoice_late_fee_enable = intval($_POST['config_invoice_late_fee_enable']);
|
||||||
|
$config_invoice_late_fee_percent = floatval($_POST['config_invoice_late_fee_percent']);
|
||||||
$config_recurring_prefix = sanitizeInput($_POST['config_recurring_prefix']);
|
$config_recurring_prefix = sanitizeInput($_POST['config_recurring_prefix']);
|
||||||
$config_recurring_next_number = intval($_POST['config_recurring_next_number']);
|
$config_recurring_next_number = intval($_POST['config_recurring_next_number']);
|
||||||
|
|
||||||
mysqli_query($mysqli,"UPDATE settings SET config_invoice_prefix = '$config_invoice_prefix', config_invoice_next_number = $config_invoice_next_number, config_invoice_footer = '$config_invoice_footer', config_invoice_from_email = '$config_invoice_from_email', config_invoice_from_name = '$config_invoice_from_name', config_recurring_prefix = '$config_recurring_prefix', config_recurring_next_number = $config_recurring_next_number WHERE company_id = 1");
|
|
||||||
|
mysqli_query($mysqli,"UPDATE settings SET config_invoice_prefix = '$config_invoice_prefix', config_invoice_next_number = $config_invoice_next_number, config_invoice_footer = '$config_invoice_footer', config_invoice_from_email = '$config_invoice_from_email', config_invoice_from_name = '$config_invoice_from_name', config_invoice_late_fee_enable = $config_invoice_late_fee_enable, config_invoice_late_fee_percent = $config_invoice_late_fee_percent, config_recurring_prefix = '$config_recurring_prefix', config_recurring_next_number = $config_recurring_next_number WHERE company_id = 1");
|
||||||
|
|
||||||
//Logging
|
//Logging
|
||||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Settings', log_action = 'Modify', log_description = '$session_name modified invoice settings', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_user_id = $session_user_id");
|
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Settings', log_action = 'Modify', log_description = '$session_name modified invoice settings', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_user_id = $session_user_id");
|
||||||
|
|||||||
@@ -57,6 +57,28 @@ require_once("inc_all_settings.php"); ?>
|
|||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
|
<legend>Invoice Late Fees</legend>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="custom-control custom-switch">
|
||||||
|
<input type="checkbox" class="custom-control-input" name="config_invoice_late_fee_enable" <?php if ($config_invoice_late_fee_enable == 1) { echo "checked"; } ?> value="1" id="customSwitch1">
|
||||||
|
<label class="custom-control-label" for="customSwitch1">Enable Late Fee</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Late Fee %</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text"><i class="fa fa-fw fa-percent"></i></span>
|
||||||
|
</div>
|
||||||
|
<input type="number" class="form-control" min="0" max="100" step="0.01" name="config_invoice_late_fee_percent" value="<?php echo $config_invoice_late_fee_percent; ?>">
|
||||||
|
</div>
|
||||||
|
<small class="text-secondary">We recommend updating the invoice footer to include policies on your late charges. This will be applied every 30 days after the invoice Due Date.</small>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
<legend>Recurring Invoice</legend>
|
<legend>Recurring Invoice</legend>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|||||||
Reference in New Issue
Block a user