Fix for Auto Recurring Duplicate Invoice Numbers

This commit is contained in:
johnny@pittpc.com
2019-10-06 14:56:22 -04:00
parent f3c1df3e17
commit 42918e90ae
3 changed files with 15 additions and 7 deletions

View File

@@ -6,13 +6,13 @@
* Locations * Locations
* Vendors * Vendors
* Assets * Assets
* Application Licenses * Password Manager
* Logins Password Manager * Domain Names
* Domains * Applications
* Apps
* Networks * Networks
* Files * Files
* Documentation * Documentation
* Tickets
* Invoicing * Invoicing
* Automatically Emails Past Due Invoices to clients * Automatically Emails Past Due Invoices to clients
* Auto Email Receipts upon receiving payments * Auto Email Receipts upon receiving payments
@@ -36,7 +36,7 @@
* Software License Expiring * Software License Expiring
* Calendar Integration * Calendar Integration
* Schedule Jobs * Schedule Jobs
* Overview of Invoices Domains * Overview of Invoices Domains that are expiring
* Schedule Events * Schedule Events
* Automatic Email Reminders of upcomming calendar events to customers * Automatic Email Reminders of upcomming calendar events to customers
* Dashboard * Dashboard
@@ -50,6 +50,7 @@
* Multi-Tenant - One Instance Multiple Companies and Users * Multi-Tenant - One Instance Multiple Companies and Users
* Audit Logging - Logs actions of users on the system * Audit Logging - Logs actions of users on the system
* 2 Factor Authentication (TOTP)
@@ -97,3 +98,6 @@ NOTE: [API_KEY] - is auto generated when a company is created and shows up in Ge
* CardDAV to integrate with 3rd party Address books * CardDAV to integrate with 3rd party Address books
* Unifi and UNMS integration * Unifi and UNMS integration
* Stripe Integration for online payments * Stripe Integration for online payments
* Client Portal
* Toast Alerts with recent caller that matches caller ID in database which allows you to click on the toast alerts and bring up the clients account right away.
* Built-in mailing list used for alerts and marketing

View File

@@ -20,7 +20,6 @@ while($row = mysqli_fetch_array($sql_companies)){
$config_enable_cron = $row['config_enable_cron']; $config_enable_cron = $row['config_enable_cron'];
$config_invoice_overdue_reminders = $row['config_invoice_overdue_reminders']; $config_invoice_overdue_reminders = $row['config_invoice_overdue_reminders'];
$config_invoice_prefix = $row['config_invoice_prefix']; $config_invoice_prefix = $row['config_invoice_prefix'];
$config_invoice_next_number = $row['config_invoice_next_number'];
$config_smtp_host = $row['config_smtp_host']; $config_smtp_host = $row['config_smtp_host'];
$config_smtp_username = $row['config_smtp_username']; $config_smtp_username = $row['config_smtp_username'];
$config_smtp_password = $row['config_smtp_password']; $config_smtp_password = $row['config_smtp_password'];
@@ -137,6 +136,10 @@ while($row = mysqli_fetch_array($sql_companies)){
$client_net_terms = $row['client_net_terms']; $client_net_terms = $row['client_net_terms'];
//Get the last Invoice Number and add 1 for the new invoice number //Get the last Invoice Number and add 1 for the new invoice number
$sql_invoice_number = mysqli_query($mysqli,"SELECT * FROM settings WHERE company_id = $company_id");
$row = mysqli_fetch_array($sql_invoice_number)){
$config_invoice_next_number = $row['config_invoice_next_number'];
$new_invoice_number = "$config_invoice_prefix$config_invoice_next_number"; $new_invoice_number = "$config_invoice_prefix$config_invoice_next_number";
$new_config_invoice_next_number = $config_invoice_next_number + 1; $new_config_invoice_next_number = $config_invoice_next_number + 1;
mysqli_query($mysqli,"UPDATE settings SET config_invoice_next_number = $new_config_invoice_next_number WHERE company_id = $company_id"); mysqli_query($mysqli,"UPDATE settings SET config_invoice_next_number = $new_config_invoice_next_number WHERE company_id = $company_id");

View File

@@ -12,6 +12,7 @@ if(isset($_GET['ticket_id'])){
echo "<center><h1 class='text-secondary mt-5'>Nothing to see here</h1><a class='btn btn-lg btn-secondary mt-3' href='tickets.php'><i class='fa fa-fw fa-arrow-left'></i> Go Back</a></center>"; echo "<center><h1 class='text-secondary mt-5'>Nothing to see here</h1><a class='btn btn-lg btn-secondary mt-3' href='tickets.php'><i class='fa fa-fw fa-arrow-left'></i> Go Back</a></center>";
include("footer.php"); include("footer.php");
}else{ }else{
$row = mysqli_fetch_array($sql); $row = mysqli_fetch_array($sql);