Hide Archived dropdowns when adding adding a new item, except when you are editing an item from before the archived date, Do not allow archiving account until balance is 0.

This commit is contained in:
johnny@pittpc.com 2021-02-07 13:58:42 -05:00
parent 71a183993b
commit 274e1dc9e8
38 changed files with 78 additions and 52 deletions

View File

@ -107,8 +107,10 @@
</button>
<div class="dropdown-menu">
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editAccountModal<?php echo $account_id; ?>">Edit</a>
<?php if($balance == 0){ //Cannot Archive an Account until it reaches 0 Balance ?>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="post.php?archive_account=<?php echo $account_id; ?>">Archive</a>
<?php } ?>
</div>
</div>
</td>

View File

@ -1,10 +1,10 @@
<div class="modal" id="addCalendarModal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content bg-dark">
<div class="modal-header text-white">
<h5 class="modal-title"><i class="fa fa-fw fa-calendar-plus mr-2"></i>New Calendar</h5>
<div class="modal-header">
<h5 class="modal-title"><i class="fa fa-fw fa-calendar-plus"></i> New Calendar</h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
<span>&times;</span>
</button>
</div>
<form action="post.php" method="post" autocomplete="off">

View File

@ -61,7 +61,7 @@
<option value="">N/A</option>
<?php
$referral_sql = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Referral' AND company_id = $session_company_id ORDER BY category_name ASC");
$referral_sql = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Referral' AND category_archived_at IS NULL AND company_id = $session_company_id ORDER BY category_name ASC");
while($row = mysqli_fetch_array($referral_sql)){
$referral = $row['category_name'];
?>

View File

@ -43,7 +43,7 @@
<option value="">- Account -</option>
<?php
$sql = mysqli_query($mysqli,"SELECT * FROM accounts WHERE company_id = $session_company_id ORDER BY account_name ASC");
$sql = mysqli_query($mysqli,"SELECT * FROM accounts WHERE account_archived_at IS NULL AND company_id = $session_company_id ORDER BY account_name ASC");
while($row = mysqli_fetch_array($sql)){
$account_id = $row['account_id'];
$account_name = $row['account_name'];
@ -83,7 +83,7 @@
<option value="">- Vendor -</option>
<?php
$sql = mysqli_query($mysqli,"SELECT * FROM vendors WHERE client_id = 0 AND company_id = $session_company_id ORDER BY vendor_name ASC");
$sql = mysqli_query($mysqli,"SELECT * FROM vendors WHERE client_id = 0 AND vendor_archived_at IS NULL AND company_id = $session_company_id ORDER BY vendor_name ASC");
while($row = mysqli_fetch_array($sql)){
$vendor_id = $row['vendor_id'];
$vendor_name = $row['vendor_name'];
@ -118,7 +118,7 @@
<option value="">- Category -</option>
<?php
$sql = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Expense' AND company_id = $session_company_id ORDER BY category_name ASC");
$sql = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Expense' AND category_archived_at IS NULL AND company_id = $session_company_id ORDER BY category_name ASC");
while($row = mysqli_fetch_array($sql)){
$category_id = $row['category_id'];
$category_name = $row['category_name'];

View File

@ -60,7 +60,7 @@
<option value="">- Category -</option>
<?php
$sql = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Income' AND company_id = $session_company_id ORDER BY category_name ASC");
$sql = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Income' AND category_archived_at IS NULL AND company_id = $session_company_id ORDER BY category_name ASC");
while($row = mysqli_fetch_array($sql)){
$category_id = $row['category_id'];
$category_name = $row['category_name'];

View File

@ -24,7 +24,7 @@
<option value="">- Category -</option>
<?php
$sql = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Income' AND company_id = $session_company_id");
$sql = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Income' AND category_archived_at IS NULL AND company_id = $session_company_id");
while($row = mysqli_fetch_array($sql)){
$category_id = $row['category_id'];
$category_name = $row['category_name'];
@ -61,7 +61,7 @@
<option value="0">None</option>
<?php
$taxes_sql = mysqli_query($mysqli,"SELECT * FROM taxes WHERE company_id = $session_company_id ORDER BY tax_name ASC");
$taxes_sql = mysqli_query($mysqli,"SELECT * FROM taxes WHERE tax_archived_at IS NULL AND company_id = $session_company_id ORDER BY tax_name ASC");
while($row = mysqli_fetch_array($taxes_sql)){
$tax_id = $row['tax_id'];
$tax_name = $row['tax_name'];

View File

@ -61,7 +61,7 @@
<option value="">- Category -</option>
<?php
$sql = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Income' AND company_id = $session_company_id ORDER BY category_name ASC");
$sql = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Income' AND category_archived_at IS NULL AND company_id = $session_company_id ORDER BY category_name ASC");
while($row = mysqli_fetch_array($sql)){
$category_id = $row['category_id'];
$category_name = $row['category_name'];

View File

@ -76,7 +76,7 @@
<option value="">- Category -</option>
<?php
$sql = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Income' AND company_id = $session_company_id ORDER BY category_name ASC");
$sql = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Income' AND category_archived_at IS NULL AND company_id = $session_company_id ORDER BY category_name ASC");
while($row = mysqli_fetch_array($sql)){
$category_id = $row['category_id'];
$category_name = $row['category_name'];

View File

@ -40,7 +40,7 @@
<option value="">- Account -</option>
<?php
$sql = mysqli_query($mysqli,"SELECT * FROM accounts WHERE company_id = $session_company_id ORDER BY account_name ASC");
$sql = mysqli_query($mysqli,"SELECT * FROM accounts WHERE account_archived_at IS NULL AND company_id = $session_company_id ORDER BY account_name ASC");
while($row = mysqli_fetch_array($sql)){
$account_id = $row['account_id'];
$account_name = $row['account_name'];
@ -80,7 +80,7 @@
<option value="">- Category -</option>
<?php
$sql = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Income' AND company_id = $session_company_id ORDER BY category_name ASC");
$sql = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Income' AND category_archived_at IS NULL AND company_id = $session_company_id ORDER BY category_name ASC");
while($row = mysqli_fetch_array($sql)){
$category_id = $row['category_id'];
$category_name = $row['category_name'];
@ -107,7 +107,7 @@
<option value="">- Method of Payment -</option>
<?php
$sql = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Payment Method' AND company_id = $session_company_id ORDER BY category_name ASC");
$sql = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Payment Method' AND category_archived_at IS NULL AND company_id = $session_company_id ORDER BY category_name ASC");
while($row = mysqli_fetch_array($sql)){
$category_name = $row['category_name'];
?>

View File

@ -62,7 +62,7 @@
<option value="">- Account From -</option>
<?php
$sql = mysqli_query($mysqli,"SELECT * FROM accounts WHERE company_id = $session_company_id ORDER BY account_name ASC");
$sql = mysqli_query($mysqli,"SELECT * FROM accounts WHERE account_archived_at IS NULL AND company_id = $session_company_id ORDER BY account_name ASC");
while($row = mysqli_fetch_array($sql)){
$account_id = $row['account_id'];
$account_name = $row['account_name'];
@ -101,7 +101,7 @@
<option value="">- Account To -</option>
<?php
$sql = mysqli_query($mysqli,"SELECT * FROM accounts WHERE company_id = $session_company_id ORDER BY account_name ASC");
$sql = mysqli_query($mysqli,"SELECT * FROM accounts WHERE account_archived_at IS NULL AND company_id = $session_company_id ORDER BY account_name ASC");
while($row = mysqli_fetch_array($sql)){
$account_id = $row['account_id'];
$account_name = $row['account_name'];

View File

@ -93,6 +93,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
$invoice_date = $row['invoice_date'];
$invoice_due = $row['invoice_due'];
$invoice_amount = $row['invoice_amount'];
$invoice_created_at = $row['invoice_created_at'];
$category_id = $row['category_id'];
$category_name = $row['category_name'];
$now = time();

View File

@ -91,6 +91,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
$quote_status = $row['quote_status'];
$quote_date = $row['quote_date'];
$quote_amount = $row['quote_amount'];
$quote_created_at $row['quote_created_at'];
$category_id = $row['category_id'];
$category_name = $row['category_name'];

View File

@ -96,6 +96,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
}
$recurring_next_date = $row['recurring_next_date'];
$recurring_amount = $row['recurring_amount'];
$recurring_created_at = $row['recurring_created_at'];
$category_id = $row['category_id'];
$category_name = $row['category_name'];
if($recurring_status == 1){

View File

@ -147,6 +147,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
$client_net_terms = $row['client_net_terms'];
$client_referral = $row['client_referral'];
$client_notes = $row['client_notes'];
$client_created_at = $row['client_created_at'];
$client_updated_at = $row['client_updated_at'];
//Add up all the payments for the invoice and get the total amount paid to the invoice
$sql_invoice_amounts = mysqli_query($mysqli,"SELECT SUM(invoice_amount) AS invoice_amounts FROM invoices WHERE client_id = $client_id AND invoice_status NOT LIKE 'Draft' AND invoice_status NOT LIKE 'Cancelled' ");

View File

@ -62,7 +62,7 @@
<option value="">N/A</option>
<?php
$referral_sql = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Referral' AND company_id = $session_company_id ORDER BY category_name ASC");
$referral_sql = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Referral' AND (category_archived_at > '$client_created_at' OR category_archived_at IS NULL) AND company_id = $session_company_id ORDER BY category_name ASC");
while($row = mysqli_fetch_array($referral_sql)){
$referral = $row['category_name'];
?>

View File

@ -46,7 +46,7 @@
<select class="form-control select2" name="account" required>
<?php
$sql_accounts = mysqli_query($mysqli,"SELECT * FROM accounts WHERE company_id = $session_company_id ORDER BY account_name ASC");
$sql_accounts = mysqli_query($mysqli,"SELECT * FROM accounts WHERE (account_archived_at > '$expense_created_at' OR account_archived_at IS NULL) AND company_id = $session_company_id ORDER BY account_name ASC");
while($row = mysqli_fetch_array($sql_accounts)){
$account_id_select = $row['account_id'];
$account_name_select = $row['account_name'];
@ -85,7 +85,7 @@
<select class="form-control select2" name="vendor" required>
<?php
$sql_select = mysqli_query($mysqli,"SELECT * FROM vendors WHERE client_id = 0 AND company_id = $session_company_id ORDER BY vendor_name ASC");
$sql_select = mysqli_query($mysqli,"SELECT * FROM vendors WHERE client_id = 0 AND (vendor_archived_at > '$expense_created_at' OR vendor_archived_at IS NULL) AND company_id = $session_company_id ORDER BY vendor_name ASC");
while($row = mysqli_fetch_array($sql_select)){
$vendor_id_select = $row['vendor_id'];
$vendor_name_select = $row['vendor_name'];
@ -120,7 +120,7 @@
<select class="form-control select2" name="category" required>
<?php
$sql_select = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Expense' AND company_id = $session_company_id ORDER BY category_name ASC");
$sql_select = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Expense' AND (category_archived_at > '$expense_created_at' OR category_archived_at IS NULL) AND company_id = $session_company_id ORDER BY category_name ASC");
while($row = mysqli_fetch_array($sql_select)){
$category_id_select = $row['category_id'];
$category_name_select = $row['category_name'];

View File

@ -42,7 +42,7 @@
<option value="">- Category -</option>
<?php
$sql_income_category = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Income' AND company_id = $session_company_id ORDER BY category_name ASC");
$sql_income_category = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Income' AND (category_archived_at > '$income_created_at' OR category_archived_at IS NULL) AND company_id = $session_company_id ORDER BY category_name ASC");
while($row = mysqli_fetch_array($sql_income_category)){
$category_id_select= $row['category_id'];
$category_name_select = $row['category_name'];

View File

@ -24,7 +24,7 @@
<select class="form-control select2" name="category" required>
<?php
$sql_select = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Income' AND company_id = $session_company_id");
$sql_select = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Income' AND (category_archived_at > '$product_created_at' OR category_archived_at IS NULL) AND company_id = $session_company_id");
while($row = mysqli_fetch_array($sql_select)){
$category_id_select = $row['category_id'];
$category_name_select = $row['category_name'];
@ -61,7 +61,7 @@
<option value="0">None</option>
<?php
$taxes_sql = mysqli_query($mysqli,"SELECT * FROM taxes WHERE company_id = $session_company_id ORDER BY tax_name ASC");
$taxes_sql = mysqli_query($mysqli,"SELECT * FROM taxes WHERE (tax_archived_at > '$product_created_at' OR tax_archived_at IS NULL) AND company_id = $session_company_id ORDER BY tax_name ASC");
while($row = mysqli_fetch_array($taxes_sql)){
$tax_id_select = $row['tax_id'];
$tax_name = $row['tax_name'];

View File

@ -42,7 +42,7 @@
<option value="">- Category -</option>
<?php
$sql_income_category = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Income' AND company_id = $session_company_id ORDER BY category_name ASC");
$sql_income_category = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Income' AND (category_archived_at > '$quote_created_at' OR category_archived_at IS NULL) AND company_id = $session_company_id ORDER BY category_name ASC");
while($row = mysqli_fetch_array($sql_income_category)){
$category_id_select = $row['category_id'];
$category_name_select = $row['category_name'];

View File

@ -37,7 +37,7 @@
<option value="">- Category -</option>
<?php
$sql_income_category = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Income' AND company_id = $session_company_id ORDER BY category_name ASC");
$sql_income_category = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Income' AND (category_archived_at > '$recurring_created_at' OR category_archived_at IS NULL) AND company_id = $session_company_id ORDER BY category_name ASC");
while($row = mysqli_fetch_array($sql_income_category)){
$category_id_select= $row['category_id'];
$category_name_select = $row['category_name'];

View File

@ -41,7 +41,7 @@
<option value="">- Account -</option>
<?php
$sql_accounts = mysqli_query($mysqli,"SELECT * FROM accounts WHERE company_id = $session_company_id ORDER BY account_name ASC");
$sql_accounts = mysqli_query($mysqli,"SELECT * FROM accounts WHERE (account_archived_at > '$revenue_created_at' OR account_archived_at IS NULL) AND company_id = $session_company_id ORDER BY account_name ASC");
while($row = mysqli_fetch_array($sql_accounts)){
$account_id_select = $row['account_id'];
$account_name_select = $row['account_name'];
@ -81,7 +81,7 @@
<option value="">- Category -</option>
<?php
$sql_category = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Income' AND company_id = $session_company_id ORDER BY category_name ASC");
$sql_category = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Income' AND (category_archived_at > '$revenue_created_at' OR category_archived_at IS NULL) AND company_id = $session_company_id ORDER BY category_name ASC");
while($row = mysqli_fetch_array($sql_category)){
$category_id_select = $row['category_id'];
$category_name = $row['category_name'];
@ -108,7 +108,7 @@
<option value="">- Method of Payment -</option>
<?php
$sql_categories = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Payment Method' AND company_id = $session_company_id ORDER BY category_name ASC");
$sql_categories = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Payment Method' AND (category_archived_at > '$revenue_created_at' OR category_archived_at IS NULL) AND company_id = $session_company_id ORDER BY category_name ASC");
while($row = mysqli_fetch_array($sql_categories)){
$category_name_select = $row['category_name'];
?>

View File

@ -2,22 +2,26 @@
<div class="modal-dialog">
<div class="modal-content bg-dark">
<div class="modal-header">
<h5 class="modal-title text-white"><i class="fa fa-fw fa-balance-scale mr-2"></i><?php echo $tax_name; ?></h5>
<h5 class="modal-title"><i class="fa fa-fw fa-balance-scale"></i> <?php echo $tax_name; ?></h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
<span>&times;</span>
</button>
</div>
<form action="post.php" method="post" autocomplete="off">
<input type="hidden" name="tax_id" value="<?php echo $tax_id; ?>">
<div class="modal-body bg-white">
<div class="form-group">
<label>Name <strong class="text-danger">*</strong></label>
<input type="text" class="form-control" name="name" value="<?php echo $tax_name; ?>" required>
</div>
<div class="form-group">
<label>Percent <strong class="text-danger">*</strong></label>
<input type="number" min="0" class="form-control col-md-2" name="percent" value="<?php echo $tax_percent; ?>">
</div>
</div>
<div class="modal-footer bg-white">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>

View File

@ -2,9 +2,9 @@
<div class="modal-dialog">
<div class="modal-content bg-dark">
<div class="modal-header">
<h5 class="modal-title text-white"><i class="fa fa-fw fa-exchange-alt mr-2"></i>Modify Transfer</h5>
<h5 class="modal-title"><i class="fa fa-fw fa-exchange-alt"></i> Modify Transfer</h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
<span>&times;</span>
</button>
</div>
<form action="post.php" method="post" autocomplete="off">
@ -13,20 +13,21 @@
<input type="hidden" name="expense_id" value="<?php echo $expense_id; ?>">
<input type="hidden" name="revenue_id" value="<?php echo $revenue_id; ?>">
<ul class="nav nav-pills nav-justified mb-3" id="pills-tab<?php echo $transfer_id; ?>">
<ul class="nav nav-pills nav-justified mb-3">
<li class="nav-item">
<a class="nav-link active" id="pills-details-tab<?php echo $transfer_id; ?>" data-toggle="pill" href="#pills-details<?php echo $transfer_id; ?>">Details</a>
<a class="nav-link active" data-toggle="pill" href="#pills-details<?php echo $transfer_id; ?>">Details</a>
</li>
<li class="nav-item">
<a class="nav-link" id="pills-notes-tab<?php echo $transfer_id; ?>" data-toggle="pill" href="#pills-notes<?php echo $transfer_id; ?>">Notes</a>
<a class="nav-link" data-toggle="pill" href="#pills-notes<?php echo $transfer_id; ?>">Notes</a>
</li>
</ul>
<div class="tab-content" id="pills-tabContent<?php echo $transfer_id; ?>">
<div class="tab-content">
<div class="tab-pane fade show active" id="pills-details<?php echo $transfer_id; ?>">
<div class="form-row">
<div class="form-group col-sm">
<label>Date <strong class="text-danger">*</strong></label>
<div class="input-group">
@ -36,6 +37,7 @@
<input type="date" class="form-control" name="date" value="<?php echo $transfer_date; ?>" required>
</div>
</div>
<div class="form-group col-sm">
<label>Amount <strong class="text-danger">*</strong></label>
<div class="input-group">
@ -45,7 +47,9 @@
<input type="number" class="form-control" step="0.01" min="0" name="amount" placeholder="Amount to transfer" value="<?php echo $transfer_amount; ?>" required>
</div>
</div>
</div>
<div class="form-group">
<label>Transfer <strong class="text-danger">*</strong></label>
<div class="input-group">
@ -55,7 +59,7 @@
<select class="form-control select2" name="account_from" required>
<?php
$sql_accounts = mysqli_query($mysqli,"SELECT * FROM accounts WHERE company_id = $session_company_id ORDER BY account_name ASC");
$sql_accounts = mysqli_query($mysqli,"SELECT * FROM accounts WHERE (account_archived_at > '$transfer_created_at' OR account_archived_at IS NULL) AND company_id = $session_company_id ORDER BY account_name ASC");
while($row = mysqli_fetch_array($sql_accounts)){
$account_id_select = $row['account_id'];
$account_name_select = $row['account_name'];
@ -76,7 +80,7 @@
$balance = $opening_balance + $total_payments + $total_revenues - $total_expenses;
?>
<option <?php if($transfer_account_from == $account_id_select){ ?> selected <?php } ?> value="<?php echo $account_id_select; ?>"><?php echo $account_name_select; ?> [$<?php echo number_format($balance,2); ?>]</option>
<option <?php if($transfer_account_from == $account_id_select){ echo "selected"; } ?> value="<?php echo $account_id_select; ?>"><?php echo $account_name_select; ?> [$<?php echo number_format($balance,2); ?>]</option>
<?php
}
@ -93,7 +97,7 @@
<select class="form-control select2" name="account_to" required>
<?php
$sql2 = mysqli_query($mysqli,"SELECT * FROM accounts WHERE company_id = $session_company_id ORDER BY account_name ASC");
$sql2 = mysqli_query($mysqli,"SELECT * FROM accounts WHERE (account_archived_at > '$transfer_created_at' OR account_archived_at IS NULL) AND company_id = $session_company_id ORDER BY account_name ASC");
while($row = mysqli_fetch_array($sql2)){
$account_id2 = $row['account_id'];
$account_name = $row['account_name'];
@ -114,7 +118,7 @@
$balance = $opening_balance + $total_payments + $total_revenues - $total_expenses;
?>
<option <?php if($transfer_account_to == $account_id2){ ?> selected <?php } ?> value="<?php echo $account_id2; ?>"><?php echo $account_name; ?> [$<?php echo number_format($balance,2); ?>]</option>
<option <?php if($transfer_account_to == $account_id2){ echo "selected"; } ?> value="<?php echo $account_id2; ?>"><?php echo $account_name; ?> [$<?php echo number_format($balance,2); ?>]</option>
<?php
}

View File

@ -2,7 +2,7 @@
<div class="modal-dialog">
<div class="modal-content bg-dark">
<div class="modal-header">
<h5 class="modal-title"><i class="fa fa-fw fa-route mr-2"></i>Edit Trip</h5>
<h5 class="modal-title"><i class="fa fa-fw fa-route"></i> Edit Trip</h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span>&times;</span>
</button>

View File

@ -122,6 +122,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
$expense_description = $row['expense_description'];
$expense_receipt = $row['expense_receipt'];
$expense_reference = $row['expense_reference'];
$expense_created_at = $row['expense_created_at'];
$vendor_id = $row['vendor_id'];
$vendor_name = $row['vendor_name'];
$category_id = $row['category_id'];

View File

@ -1,6 +1,6 @@
<?php include("config.php"); ?>
<?php
<?php
include("config.php");
session_start();

View File

@ -1,7 +1,7 @@
<?php include("guest_header.php"); ?>
<?php
include("guest_header.php");
if(isset($_GET['quote_id'], $_GET['url_key'])){
$url_key = mysqli_real_escape_string($mysqli,$_GET['url_key']);

View File

@ -1,7 +1,7 @@
<?php include("header.php"); ?>
<?php
include("header.php");
if(isset($_GET['invoice_id'])){
$invoice_id = intval($_GET['invoice_id']);
@ -26,6 +26,7 @@ if(isset($_GET['invoice_id'])){
$invoice_amount = $row['invoice_amount'];
$invoice_note = $row['invoice_note'];
$invoice_url_key = $row['invoice_url_key'];
$invoice_created_at = $row['invoice_created_at'];
$category_id = $row['category_id'];
$client_id = $row['client_id'];
$client_name = $row['client_name'];

View File

@ -1,7 +1,7 @@
<?php include("header.php"); ?>
<?php
include("header.php");
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('invoice_id') AS num FROM invoices WHERE invoice_status = 'Sent' AND company_id = $session_company_id"));
$sent_count = $row['num'];
@ -235,6 +235,7 @@
$invoice_date = $row['invoice_date'];
$invoice_due = $row['invoice_due'];
$invoice_amount = $row['invoice_amount'];
$invoice_created_at = $row['invoice_created_at'];
$client_id = $row['client_id'];
$client_name = $row['client_name'];
$category_id = $row['category_id'];

View File

@ -59,7 +59,8 @@ $sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM logs, users
WHERE (log_type LIKE '%$q%' OR log_action LIKE '%$q%' OR log_description LIKE '%$q%')
AND DATE(log_created_at) BETWEEN '$dtf' AND '$dtt'
AND (logs.user_id $extended_query)
ORDER BY $sb $o LIMIT $record_from, $record_to");
ORDER BY $sb $o LIMIT $record_from, $record_to"
);
$num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));

View File

@ -156,4 +156,4 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
</div>
</div>
<?php include("footer.php");
<?php include("footer.php"); ?>

View File

@ -90,6 +90,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
$product_name = $row['product_name'];
$product_description = $row['product_description'];
$product_cost = $row['product_cost'];
$product_created_at = $row['product_created_at'];
$category_id = $row['category_id'];
$category_name = $row['category_name'];
$tax_id = $row['tax_id'];

View File

@ -21,6 +21,7 @@ if(isset($_GET['quote_id'])){
$quote_amount = $row['quote_amount'];
$quote_note = $row['quote_note'];
$quote_url_key = $row['quote_url_key'];
$quote_created_at = $row['quote_created_at'];
$category_id = $row['category_id'];
$client_id = $row['client_id'];
$client_name = $row['client_name'];

View File

@ -125,6 +125,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
$quote_status = $row['quote_status'];
$quote_date = $row['quote_date'];
$quote_amount = $row['quote_amount'];
$quote_created_at = $row['quote_created_at'];
$client_id = $row['client_id'];
$client_name = $row['client_name'];
$category_id = $row['category_id'];

View File

@ -129,6 +129,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
}
$recurring_next_date = $row['recurring_next_date'];
$recurring_amount = $row['recurring_amount'];
$recurring_created_at = $row['recurring_created_at'];
$client_id = $row['client_id'];
$client_name = $row['client_name'];
$category_id = $row['category_id'];

View File

@ -25,6 +25,7 @@ if(isset($_GET['recurring_id'])){
$recurring_next_date = $row['recurring_next_date'];
$recurring_amount = $row['recurring_amount'];
$recurring_note = $row['recurring_note'];
$recurring_created_at = $row['recurring_created_at'];
$category_id = $row['category_id'];
$client_id = $row['client_id'];
$client_name = $row['client_name'];

View File

@ -122,6 +122,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
$revenue_date = $row['revenue_date'];
$revenue_payment_method = $row['revenue_payment_method'];
$revenue_amount = $row['revenue_amount'];
$revenue_created_at = $row['revenue_created_at'];
$account_id = $row['account_id'];
$account_name = $row['account_name'];
$category_id = $row['category_id'];

View File

@ -120,6 +120,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
$transfer_account_to = $row['transfer_account_to'];
$transfer_amount = $row['transfer_amount'];
$transfer_notes = $row['transfer_notes'];
$transfer_created_at = $row['transfer_created_at'];
$expense_id = $row['expense_id'];
$revenue_id = $row['revenue_id'];