From 2e5763dc8dac6117401bb7f9b9fae6a400deb1cf Mon Sep 17 00:00:00 2001 From: "johnny@pittpc.com" Date: Wed, 21 Aug 2019 00:59:27 -0400 Subject: [PATCH] Refinements to ticketting system, Added force recurring option created company_id chile directories for clients, settings, expenses, added dir checks to add client and add contact and much more. --- add_contact_modal.php | 2 +- add_payment_modal.php | 2 +- add_product_modal.php | 2 +- add_trip_copy_modal.php | 7 +- add_trip_modal.php | 4 +- api.php | 2 +- check_login.php | 3 + clients.php | 6 +- edit_calendar_event_modal.php | 1 + edit_product_modal.php | 2 +- edit_trip_modal.php | 4 +- footer.php | 11 + get_settings.php | 6 +- header.php | 12 +- invoice.php | 6 +- noclients.php | 17 ++ post.php | 237 +++++++++++++++++---- print_profit_loss.php | 377 ++++++++++++++++++++++++++++++++++ quote.php | 4 +- recurring.php | 1 + report_income_summary_2.php | 140 +++++++++++++ settings-nav.php | 8 + settings-ticket.php | 39 ++++ setup.php | 14 +- ticket.php | 166 +++++++++++++++ tickets.php | 2 +- 26 files changed, 1005 insertions(+), 70 deletions(-) create mode 100644 noclients.php create mode 100644 print_profit_loss.php create mode 100644 report_income_summary_2.php create mode 100644 settings-ticket.php create mode 100644 ticket.php diff --git a/add_contact_modal.php b/add_contact_modal.php index 5a4d01cf..5e717d00 100644 --- a/add_contact_modal.php +++ b/add_contact_modal.php @@ -2,7 +2,7 @@
- +
@@ -72,6 +72,11 @@ + +
+ + +
diff --git a/add_trip_modal.php b/add_trip_modal.php index 3144dc4c..25c93dc3 100644 --- a/add_trip_modal.php +++ b/add_trip_modal.php @@ -41,7 +41,7 @@
- + @@ -68,7 +68,7 @@
- +
diff --git a/api.php b/api.php index 96803390..f1f44739 100644 --- a/api.php +++ b/api.php @@ -20,7 +20,7 @@ if(isset($_GET['api_key'])){ $row = mysqli_fetch_array($sql); $name = $row['name']; - echo $name; + echo "$name - $cid"; } diff --git a/check_login.php b/check_login.php index 418920b0..815f7504 100644 --- a/check_login.php +++ b/check_login.php @@ -26,6 +26,9 @@ include("get_settings.php"); + $_SESSION['alert_message'] = ''; + $_SESSION['alert_type'] = "warning"; + //Detects if using an apple device and uses apple maps instead of google $iPod = stripos($_SERVER['HTTP_USER_AGENT'],"iPod"); $iPhone = stripos($_SERVER['HTTP_USER_AGENT'],"iPhone"); diff --git a/clients.php b/clients.php index 5f8f1a95..ef6ab6ec 100644 --- a/clients.php +++ b/clients.php @@ -66,9 +66,9 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); - - - + + + diff --git a/edit_calendar_event_modal.php b/edit_calendar_event_modal.php index ee9ec517..1036463e 100644 --- a/edit_calendar_event_modal.php +++ b/edit_calendar_event_modal.php @@ -65,6 +65,7 @@ diff --git a/edit_product_modal.php b/edit_product_modal.php index e4c063fe..a4d86407 100644 --- a/edit_product_modal.php +++ b/edit_product_modal.php @@ -20,7 +20,7 @@
- +
@@ -76,7 +76,7 @@
class="custom-control-input" id="customControlAutosizing" name="roundtrip" value="1" > - +
diff --git a/footer.php b/footer.php index 43cff6a8..1f94e724 100644 --- a/footer.php +++ b/footer.php @@ -47,3 +47,14 @@ + + \ No newline at end of file diff --git a/get_settings.php b/get_settings.php index 9293c7ec..13667f09 100644 --- a/get_settings.php +++ b/get_settings.php @@ -40,6 +40,9 @@ $config_invoice_overdue_reminders = $row['config_invoice_overdue_reminders']; $config_invoice_next_number = $row['config_invoice_next_number']; $config_invoice_prefix = $row['config_invoice_prefix']; +$config_ticket_next_number = $row['config_ticket_next_number']; +$config_ticket_prefix = $row['config_ticket_prefix']; + //Defaults $config_default_expense_account = $row['config_default_expense_account']; $config_default_payment_account = $row['config_default_payment_account']; @@ -56,9 +59,6 @@ $config_enable_cron = $row['config_enable_cron']; $config_base_url = $row['config_base_url']; -$_SESSION['alert_message'] = ''; -$_SESSION['alert_type'] = "warning"; - $client_types_array = array( 'Residential', 'Law', diff --git a/header.php b/header.php index 4ab2f175..2f6efff2 100644 --- a/header.php +++ b/header.php @@ -1,5 +1,13 @@ + + - <?php echo $config_company_name; ?> + <?php echo $config_app_name; ?> diff --git a/invoice.php b/invoice.php index 00826864..96acd031 100644 --- a/invoice.php +++ b/invoice.php @@ -157,7 +157,7 @@ if(isset($_GET['invoice_id'])){
@@ -225,8 +225,8 @@ if(isset($_GET['invoice_id'])){
- - + + - - + + - +
Name ">Type EmailName ">Type Email Phone Balance Action + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 AND YEAR(revenue_date) = $year AND MONTH(revenue_date) = $month AND revenues.company_id = $session_company_id"); + $row = mysqli_fetch_array($sql_revenues); + $revenue_total_amount_for_month = $row['revenue_total_amount_for_month']; + + $payment_total_amount_for_month = $payment_total_amount_for_month + $revenue_total_amount_for_month; + + $payment_total_amount_for_quarter_one = $payment_total_amount_for_quarter_one + $payment_total_amount_for_month; + } + + ?> + + + + 0 AND YEAR(revenue_date) = $year AND MONTH(revenue_date) = $month AND revenues.company_id = $session_company_id"); + $row = mysqli_fetch_array($sql_revenues); + $revenue_total_amount_for_month = $row['revenue_total_amount_for_month']; + + $payment_total_amount_for_month = $payment_total_amount_for_month + $revenue_total_amount_for_month; + + $payment_total_amount_for_quarter_two = $payment_total_amount_for_quarter_two + $payment_total_amount_for_month; + } + + ?> + + + + 0 AND YEAR(revenue_date) = $year AND MONTH(revenue_date) = $month AND revenues.company_id = $session_company_id"); + $row = mysqli_fetch_array($sql_revenues); + $revenue_total_amount_for_month = $row['revenue_total_amount_for_month']; + + $payment_total_amount_for_month = $payment_total_amount_for_month + $revenue_total_amount_for_month; + + $payment_total_amount_for_quarter_three = $payment_total_amount_for_quarter_three + $payment_total_amount_for_month; + } + + ?> + + + + 0 AND YEAR(revenue_date) = $year AND MONTH(revenue_date) = $month AND revenues.company_id = $session_company_id"); + $row = mysqli_fetch_array($sql_revenues); + $revenue_total_amount_for_month = $row['revenue_total_amount_for_month']; + + $payment_total_amount_for_month = $payment_total_amount_for_month + $revenue_total_amount_for_month; + + $payment_total_amount_for_quarter_four = $payment_total_amount_for_quarter_four + $payment_total_amount_for_month; + } + + $total_payments_for_all_four_quarters = $payment_total_amount_for_quarter_one + $payment_total_amount_for_quarter_two + $payment_total_amount_for_quarter_three + $payment_total_amount_for_quarter_four; + + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 AND YEAR(expense_date) = $year AND MONTH(expense_date) = $month AND vendor_id > 0 AND company_id = $session_company_id"); + $row = mysqli_fetch_array($sql_expenses); + $expense_total_amount_for_quarter_one = $expense_total_amount_for_quarter_one + $row['expense_total_amount_for_month']; + } + + ?> + + + + 0 AND YEAR(expense_date) = $year AND MONTH(expense_date) = $month AND vendor_id > 0 AND company_id = $session_company_id"); + $row = mysqli_fetch_array($sql_expenses); + $expense_total_amount_for_quarter_two = $expense_total_amount_for_quarter_two + $row['expense_total_amount_for_month']; + } + + ?> + + + + 0 AND YEAR(expense_date) = $year AND MONTH(expense_date) = $month AND vendor_id > 0 AND company_id = $session_company_id"); + $row = mysqli_fetch_array($sql_expenses); + $expense_total_amount_for_quarter_three = $expense_total_amount_for_quarter_three + $row['expense_total_amount_for_month']; + } + + ?> + + + + 0 AND YEAR(expense_date) = $year AND MONTH(expense_date) = $month AND vendor_id > 0 AND company_id = $session_company_id"); + $row = mysqli_fetch_array($sql_expenses); + $expense_total_amount_for_quarter_four = $expense_total_amount_for_quarter_four + $row['expense_total_amount_for_month']; + } + + $total_expenses_for_all_four_quarters = $expense_total_amount_for_quarter_one + $expense_total_amount_for_quarter_two + $expense_total_amount_for_quarter_three + $expense_total_amount_for_quarter_four; + + ?> + + + + + + + + + + + + + + + + +
Jan-MarApr-JunJul-SepOct-DecTotal


Income
$$$$$
Gross Profit$$$$$


Expenses
$$$$$
Total Expenses


$$$$$
Net Profit$$$$$
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 AND YEAR(revenue_date) = $year AND MONTH(revenue_date) = $month AND revenues.company_id = $session_company_id"); + $row = mysqli_fetch_array($sql_revenues); + $revenues_total_amount_for_month = $row['revenue_amount_for_month']; + + $payment_total_amount_for_month = $payment_total_amount_for_month + $revenues_total_amount_for_month; + + + $total_payment_for_all_months = $payment_total_amount_for_month + $total_payment_for_all_months; + + ?> + + + + + + + +
CategoryJanuaryFebruaryMarchAprilMayJuneJulyAugustSeptemberOctoberNovemberDecemberTotal
$$
Total$$
+
+ + + + + +