mirror of https://github.com/itflow-org/itflow
Added new category buttons to certian dropdowns to quickly add a category without going to setting then category also a few fixes here and there
This commit is contained in:
parent
1ede4bc795
commit
d2b37a8940
|
|
@ -42,6 +42,9 @@
|
|||
}
|
||||
?>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#addQuickCalendarModal"><i class="fas fa-fw fa-plus"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -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-user mr-2"></i>New Client</h5>
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-user"></i> New Client</h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
|
|
@ -71,6 +71,9 @@
|
|||
}
|
||||
?>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#addQuickReferralModal"><i class="fas fa-fw fa-plus"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@
|
|||
<span class="input-group-text"><i class="fa fa-fw fa-flag"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="state">
|
||||
<option value="">Select a state...</option>
|
||||
<option value="">- State -</option>
|
||||
<?php foreach($states_array as $state_abbr => $state_name) { ?>
|
||||
<option value="<?php echo $state_abbr; ?>"><?php echo $state_name; ?></option>
|
||||
<?php } ?>
|
||||
|
|
|
|||
|
|
@ -94,6 +94,9 @@
|
|||
}
|
||||
?>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#addQuickVendorModal"><i class="fas fa-fw fa-plus"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -126,7 +129,12 @@
|
|||
}
|
||||
?>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#addQuickCategoryExpenseModal"><i class="fas fa-fw fa-plus"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md">
|
||||
|
|
@ -146,7 +154,7 @@
|
|||
<input type="file" class="form-control-file" name="file">
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addCategoryModal"><i class="fas fa-fw fa-plus"></i></button>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<div class="modal" id="addExpenseRefundModal<?php echo $expense_id; ?>" tabindex="-1">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content bg-dark">
|
||||
<div class="modal-header text-white">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-recycle mr-2"></i>Refund</h5>
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-recycle"></i> Refund</h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span aria-hidden="true">×</span>
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
|
|
@ -12,7 +12,9 @@
|
|||
<input type="hidden" name="account" value="<?php echo $account_id; ?>">
|
||||
<input type="hidden" name="vendor" value="<?php echo $vendor_id; ?>">
|
||||
<input type="hidden" name="category" value="<?php echo $category_id; ?>">
|
||||
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group col-md">
|
||||
<label>Refund Date</label>
|
||||
<div class="input-group">
|
||||
|
|
@ -22,6 +24,7 @@
|
|||
<input type="date" class="form-control" name="date" value="<?php echo date("Y-m-d"); ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md">
|
||||
<label>Refund Amount</label>
|
||||
<div class="input-group">
|
||||
|
|
@ -32,10 +35,12 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Description</label>
|
||||
<textarea class="form-control" rows="4" name="description" required>Refund: <?php echo $expense_description; ?></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Reference</label>
|
||||
<div class="input-group">
|
||||
|
|
@ -45,10 +50,12 @@
|
|||
<input type="text" class="form-control" name="reference" placeholder="Enter a reference" value="<?php echo $expense_reference; ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Receipt</label>
|
||||
<input type="file" class="form-control-file" name="file">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
|
||||
|
|
|
|||
|
|
@ -71,6 +71,9 @@
|
|||
}
|
||||
?>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#addQuickCategoryIncomeModal"><i class="fas fa-fw fa-plus"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<div class="modal" id="addPaymentModal" 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-credit-card mr-2"></i><?php echo $invoice_number; ?>: Add Payment</h5>
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-credit-card"></i> <?php echo $invoice_number; ?>: Add Payment</h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span aria-hidden="true">×</span>
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
|
|
|
|||
|
|
@ -35,6 +35,9 @@
|
|||
}
|
||||
?>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#addQuickCategoryIncomeModal"><i class="fas fa-fw fa-plus"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,96 @@
|
|||
<div class="modal" id="addQuickCategoryExpenseModal" tabindex="-1">
|
||||
<div class="modal-dialog modal-sm">
|
||||
<div class="modal-content bg-light">
|
||||
<div class="modal-body">
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="type" value="Expense">
|
||||
<input type="hidden" name="color" value="#000000">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" name="name" placeholder="Category name" required autofocus>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"><i class="fa fa-fw fa-times"></i></button>
|
||||
<button type="submit" name="add_category" class="btn btn-primary"><i class="fa fa-fw fa-check"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal" id="addQuickCategoryIncomeModal" tabindex="-1">
|
||||
<div class="modal-dialog modal-sm">
|
||||
<div class="modal-content bg-light">
|
||||
<div class="modal-body">
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="type" value="Income">
|
||||
<input type="hidden" name="color" value="#000000">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" name="name" placeholder="Category name" required autofocus>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"><i class="fa fa-fw fa-times"></i></button>
|
||||
<button type="submit" name="add_category" class="btn btn-primary"><i class="fa fa-fw fa-check"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal" id="addQuickVendorModal" tabindex="-1">
|
||||
<div class="modal-dialog modal-sm">
|
||||
<div class="modal-content bg-light">
|
||||
<div class="modal-body">
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" name="name" placeholder="Vendor name" required autofocus>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"><i class="fa fa-fw fa-times"></i></button>
|
||||
<button type="submit" name="add_vendor" class="btn btn-primary"><i class="fa fa-fw fa-check"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal" id="addQuickReferralModal" tabindex="-1">
|
||||
<div class="modal-dialog modal-sm">
|
||||
<div class="modal-content bg-light">
|
||||
<div class="modal-body">
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="type" value="Referral">
|
||||
<input type="hidden" name="color" value="#000000">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" name="name" placeholder="Referral name" required autofocus>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"><i class="fa fa-fw fa-times"></i></button>
|
||||
<button type="submit" name="add_category" class="btn btn-primary"><i class="fa fa-fw fa-check"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal" id="addQuickCalendarModal" tabindex="-1">
|
||||
<div class="modal-dialog modal-sm">
|
||||
<div class="modal-content bg-light">
|
||||
<div class="modal-body">
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="color" value="#000000">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" name="name" placeholder="Calendar name" required autofocus>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"><i class="fa fa-fw fa-times"></i></button>
|
||||
<button type="submit" name="add_calendar" class="btn btn-primary"><i class="fa fa-fw fa-check"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -72,6 +72,9 @@
|
|||
}
|
||||
?>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#addQuickCategoryIncomeModal"><i class="fas fa-fw fa-plus"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<div class="modal" id="addQuoteToInvoiceModal<?php echo $quote_id; ?>" 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-file mr-2"></i><?php echo $quote_number; ?> <i class="fa fa-fw fa-arrow-right"></i> Invoice</h5>
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-file"></i> <?php echo $quote_number; ?> <i class="fa fa-fw fa-arrow-right"></i> Invoice</h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span aria-hidden="true">×</span>
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
|
|
|
|||
|
|
@ -87,6 +87,9 @@
|
|||
}
|
||||
?>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#addQuickCategoryIncomeModal"><i class="fas fa-fw fa-plus"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -91,6 +91,9 @@
|
|||
}
|
||||
?>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#addQuickCategoryIncomeModal"><i class="fas fa-fw fa-plus"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -10,8 +10,13 @@ if(isset($_GET['calendar_id'])){
|
|||
|
||||
<div id='calendar'></div>
|
||||
|
||||
<?php include("add_calendar_event_modal.php"); ?>
|
||||
<?php include("add_calendar_modal.php"); ?>
|
||||
<?php
|
||||
|
||||
include("add_calendar_event_modal.php");
|
||||
include("add_calendar_modal.php");
|
||||
include("add_quick_modal.php");
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
//loop through IDs and create a modal for each
|
||||
|
|
|
|||
12
client.php
12
client.php
|
|
@ -201,16 +201,16 @@ if(isset($_GET['client_id'])){
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<?php include("client_routes.php"); ?>
|
||||
|
||||
<?php include("edit_client_modal.php"); ?>
|
||||
|
||||
<?php
|
||||
|
||||
include("client_routes.php");
|
||||
include("edit_client_modal.php");
|
||||
include("add_quick_modal.php");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
include("footer.php");
|
||||
|
||||
<?php include("footer.php");
|
||||
?>
|
||||
|
|
@ -243,5 +243,6 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||
</div>
|
||||
|
||||
<?php include("add_client_modal.php"); ?>
|
||||
<?php include("add_quick_modal.php"); ?>
|
||||
|
||||
<?php include("footer.php");
|
||||
|
|
@ -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-user mr-2"></i><?php echo $client_name; ?></h5>
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-user"></i> <?php echo $client_name; ?></h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
|
|
@ -72,6 +72,9 @@
|
|||
}
|
||||
?>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#addQuickReferralModal"><i class="fas fa-fw fa-plus"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -96,6 +96,9 @@
|
|||
|
||||
?>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#addQuickVendorModal"><i class="fas fa-fw fa-plus"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -128,6 +131,9 @@
|
|||
|
||||
?>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#addQuickCategoryExpenseModal"><i class="fas fa-fw fa-plus"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -53,6 +53,9 @@
|
|||
}
|
||||
?>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#addQuickCategoryIncomeModal"><i class="fas fa-fw fa-plus"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -35,6 +35,9 @@
|
|||
|
||||
?>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#addQuickCategoryIncomeModal"><i class="fas fa-fw fa-plus"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -53,6 +53,9 @@
|
|||
}
|
||||
?>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#addQuickCategoryIncomeModal"><i class="fas fa-fw fa-plus"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -48,6 +48,9 @@
|
|||
}
|
||||
?>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#addQuickCategoryIncomeModal"><i class="fas fa-fw fa-plus"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -70,6 +70,33 @@
|
|||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Category <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-money-check-alt"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="category" required>
|
||||
<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");
|
||||
while($row = mysqli_fetch_array($sql_category)){
|
||||
$category_id_select = $row['category_id'];
|
||||
$category_name = $row['category_name'];
|
||||
?>
|
||||
<option <?php if($category_id_select == $category_id){ echo "selected"; } ?> value="<?php echo $category_id_select; ?>"><?php echo $category_name; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#addQuickCategoryIncomeModal"><i class="fas fa-fw fa-plus"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Payment Method <strong class="text-danger">*</strong></label>
|
||||
|
|
|
|||
|
|
@ -188,6 +188,6 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||
</div>
|
||||
|
||||
<?php include("add_expense_modal.php"); ?>
|
||||
<?php include("add_category_modal.php"); ?>
|
||||
<?php include("add_quick_modal.php"); ?>
|
||||
|
||||
<?php include("footer.php");
|
||||
19
invoice.php
19
invoice.php
|
|
@ -464,17 +464,20 @@ if(isset($_GET['invoice_id'])){
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<?php include("add_payment_modal.php"); ?>
|
||||
<?php include("add_invoice_copy_modal.php"); ?>
|
||||
<?php include("add_invoice_recurring_modal.php"); ?>
|
||||
<?php include("edit_invoice_modal.php"); ?>
|
||||
<?php include("invoice_note_modal.php"); ?>
|
||||
<?php
|
||||
<?php
|
||||
include("add_payment_modal.php");
|
||||
include("add_invoice_copy_modal.php");
|
||||
include("add_invoice_recurring_modal.php");
|
||||
include("edit_invoice_modal.php");
|
||||
include("invoice_note_modal.php");
|
||||
include("add_quick_modal.php");
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<?php include("footer.php"); ?>
|
||||
include("footer.php");
|
||||
|
||||
?>
|
||||
|
||||
<script>
|
||||
|
||||
|
|
|
|||
|
|
@ -317,6 +317,11 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<?php include("add_invoice_modal.php"); ?>
|
||||
<?php
|
||||
|
||||
include("add_invoice_modal.php");
|
||||
include("add_quick_modal.php");
|
||||
|
||||
<?php include("footer.php");
|
||||
include("footer.php");
|
||||
|
||||
?>
|
||||
|
|
@ -131,6 +131,11 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<?php include("add_product_modal.php"); ?>
|
||||
<?php
|
||||
|
||||
include("add_product_modal.php");
|
||||
include("add_quick_modal.php");
|
||||
|
||||
<?php include("footer.php");
|
||||
include("footer.php");
|
||||
|
||||
?>
|
||||
16
quote.php
16
quote.php
|
|
@ -373,11 +373,15 @@ if(isset($_GET['quote_id'])){
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<?php include("edit_quote_modal.php"); ?>
|
||||
<?php include("add_quote_to_invoice_modal.php"); ?>
|
||||
<?php include("add_quote_copy_modal.php"); ?>
|
||||
<?php include("quote_note_modal.php"); ?>
|
||||
<?php
|
||||
include("edit_quote_modal.php");
|
||||
include("add_quote_to_invoice_modal.php");
|
||||
include("add_quote_copy_modal.php");
|
||||
include("quote_note_modal.php");
|
||||
include("add_quick_modal.php");
|
||||
|
||||
<?php } ?>
|
||||
}
|
||||
|
||||
<?php include("footer.php");
|
||||
include("footer.php");
|
||||
|
||||
?>
|
||||
|
|
@ -198,6 +198,11 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<?php include("add_quote_modal.php"); ?>
|
||||
<?php
|
||||
|
||||
include("add_quote_modal.php");
|
||||
include("add_quick_modal.php");
|
||||
|
||||
include("footer.php");
|
||||
|
||||
<?php include("footer.php");
|
||||
?>
|
||||
|
|
@ -193,6 +193,11 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<?php include("add_recurring_modal.php"); ?>
|
||||
<?php
|
||||
|
||||
include("add_recurring_modal.php");
|
||||
include("add_quick_modal.php");
|
||||
|
||||
<?php include("footer.php");
|
||||
include("footer.php");
|
||||
|
||||
?>
|
||||
|
|
@ -346,9 +346,14 @@ if(isset($_GET['recurring_id'])){
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<?php include("edit_recurring_modal.php"); ?>
|
||||
<?php include("recurring_note_modal.php"); ?>
|
||||
<?php
|
||||
|
||||
include("edit_recurring_modal.php");
|
||||
include("recurring_note_modal.php");
|
||||
include("add_quick_modal.php");
|
||||
|
||||
<?php } ?>
|
||||
}
|
||||
|
||||
<?php include("footer.php");
|
||||
include("footer.php");
|
||||
|
||||
?>
|
||||
|
|
@ -0,0 +1,257 @@
|
|||
<?php include("header.php"); ?>
|
||||
|
||||
<?php
|
||||
|
||||
if(isset($_GET['year'])){
|
||||
$year = intval($_GET['year']);
|
||||
}else{
|
||||
$year = date('Y');
|
||||
}
|
||||
|
||||
//GET unique years from expenses, payments and revenues
|
||||
$sql_all_years = mysqli_query($mysqli,"SELECT YEAR(item_created_at) AS all_years FROM invoice_items WHERE company_id = $session_company_id ORDER BY all_years DESC");
|
||||
|
||||
$sql_tax = mysqli_query($mysqli,"SELECT * FROM taxes WHERE company_id = $session_company_id ORDER BY tax_name ASC");
|
||||
|
||||
?>
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-balance-scale"></i> Tax Summary</h3>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-primary d-print-none" onclick="window.print();"><i class="fas fa-fw fa-print"></i> Print</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body p-0">
|
||||
<form class="p-3">
|
||||
<select onchange="this.form.submit()" class="form-control" name="year">
|
||||
<?php
|
||||
|
||||
while($row = mysqli_fetch_array($sql_all_years)){
|
||||
$all_years = $row['all_years'];
|
||||
?>
|
||||
<option <?php if($year == $all_years){ echo "selected"; } ?> > <?php echo $all_years; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</select>
|
||||
</form>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-sm">
|
||||
<thead class="text-dark">
|
||||
<tr>
|
||||
<th></th>
|
||||
<th class="text-right">Jan-Mar</th>
|
||||
<th class="text-right">Apr-Jun</th>
|
||||
<th class="text-right">Jul-Sep</th>
|
||||
<th class="text-right">Oct-Dec</th>
|
||||
<th class="text-right">Total</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><br><br>Tax</th>
|
||||
<th colspan="5"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
while($row = mysqli_fetch_array($sql_tax)){
|
||||
$tax_id = $row['tax_id'];
|
||||
$tax_name = $row['tax_name'];
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><?php echo $tax_name; ?></td>
|
||||
|
||||
<?php
|
||||
|
||||
$tax_line_quarter_one = 0;
|
||||
|
||||
for($month = 1; $month<=3; $month++) {
|
||||
|
||||
$sql_payments = mysqli_query($mysqli,"SELECT SUM(item_tax) AS tax_line_amount_for_month FROM taxes, invoices, invoice_items
|
||||
WHERE invoice_items.invoice_id = invoices.invoice_id
|
||||
AND invoices.status LIKE 'Paid'
|
||||
AND invoices_items.tax_id = $tax_id
|
||||
AND YEAR(invoice_date) = $year AND MONTH(invoice_date) = $month"
|
||||
);
|
||||
|
||||
$row = mysqli_fetch_array($sql_payments);
|
||||
$payment_amount_for_month = $row['payment_amount_for_month'];
|
||||
|
||||
$sql_revenues = mysqli_query($mysqli,"SELECT SUM(revenue_amount) AS revenue_amount_for_month FROM revenues WHERE revenues.category_id = $category_id AND YEAR(revenue_date) = $year AND MONTH(revenue_date) = $month");
|
||||
$row = mysqli_fetch_array($sql_revenues);
|
||||
$revenue_amount_for_month = $row['revenue_amount_for_month'];
|
||||
|
||||
$payment_amount_for_month = $payment_amount_for_month + $revenue_amount_for_month;
|
||||
|
||||
$payment_amount_for_quarter_one = $payment_amount_for_quarter_one + $payment_amount_for_month;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<td class="text-right">$<?php echo number_format($payment_amount_for_quarter_one,2); ?></td>
|
||||
|
||||
<?php
|
||||
|
||||
$payment_amount_for_quarter_two = 0;
|
||||
|
||||
for($month = 4; $month<=6; $month++) {
|
||||
$sql_payments = mysqli_query($mysqli,"SELECT SUM(payment_amount) AS payment_amount_for_month FROM payments, invoices WHERE payments.invoice_id = invoices.invoice_id AND invoices.category_id = $category_id AND YEAR(payment_date) = $year AND MONTH(payment_date) = $month");
|
||||
$row = mysqli_fetch_array($sql_payments);
|
||||
$payment_amount_for_month = $row['payment_amount_for_month'];
|
||||
|
||||
$sql_revenues = mysqli_query($mysqli,"SELECT SUM(revenue_amount) AS revenue_amount_for_month FROM revenues WHERE revenues.category_id = $category_id AND YEAR(revenue_date) = $year AND MONTH(revenue_date) = $month");
|
||||
$row = mysqli_fetch_array($sql_revenues);
|
||||
$revenue_amount_for_month = $row['revenue_amount_for_month'];
|
||||
|
||||
$payment_amount_for_month = $payment_amount_for_month + $revenue_amount_for_month;
|
||||
|
||||
$payment_amount_for_quarter_two = $payment_amount_for_quarter_two + $payment_amount_for_month;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<td class="text-right">$<?php echo number_format($payment_amount_for_quarter_two,2); ?></td>
|
||||
|
||||
<?php
|
||||
|
||||
$payment_amount_for_quarter_three = 0;
|
||||
|
||||
for($month = 7; $month<=9; $month++) {
|
||||
$sql_payments = mysqli_query($mysqli,"SELECT SUM(payment_amount) AS payment_amount_for_month FROM payments, invoices WHERE payments.invoice_id = invoices.invoice_id AND invoices.category_id = $category_id AND YEAR(payment_date) = $year AND MONTH(payment_date) = $month");
|
||||
$row = mysqli_fetch_array($sql_payments);
|
||||
$payment_amount_for_month = $row['payment_amount_for_month'];
|
||||
|
||||
$sql_revenues = mysqli_query($mysqli,"SELECT SUM(revenue_amount) AS revenue_amount_for_month FROM revenues WHERE revenues.category_id = $category_id AND YEAR(revenue_date) = $year AND MONTH(revenue_date) = $month");
|
||||
$row = mysqli_fetch_array($sql_revenues);
|
||||
$revenue_amount_for_month = $row['revenue_amount_for_month'];
|
||||
|
||||
$payment_amount_for_month = $payment_amount_for_month + $revenue_amount_for_month;
|
||||
$payment_amount_for_quarter_three = $payment_amount_for_quarter_three + $payment_amount_for_month;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<td class="text-right">$<?php echo number_format($payment_amount_for_quarter_three,2); ?></td>
|
||||
|
||||
<?php
|
||||
|
||||
$payment_amount_for_quarter_four = 0;
|
||||
|
||||
for($month = 10; $month<=12; $month++) {
|
||||
$sql_payments = mysqli_query($mysqli,"SELECT SUM(payment_amount) AS payment_amount_for_month FROM payments, invoices WHERE payments.invoice_id = invoices.invoice_id AND invoices.category_id = $category_id AND YEAR(payment_date) = $year AND MONTH(payment_date) = $month");
|
||||
$row = mysqli_fetch_array($sql_payments);
|
||||
$payment_amount_for_month = $row['payment_amount_for_month'];
|
||||
|
||||
$sql_revenues = mysqli_query($mysqli,"SELECT SUM(revenue_amount) AS revenue_amount_for_month FROM revenues WHERE revenues.category_id = $category_id AND YEAR(revenue_date) = $year AND MONTH(revenue_date) = $month");
|
||||
$row = mysqli_fetch_array($sql_revenues);
|
||||
$revenue_amount_for_month = $row['revenue_amount_for_month'];
|
||||
|
||||
$payment_amount_for_month = $payment_amount_for_month + $revenue_amount_for_month;
|
||||
$payment_amount_for_quarter_four = $payment_amount_for_quarter_four + $payment_amount_for_month;
|
||||
}
|
||||
|
||||
$total_payments_for_all_four_quarters = $payment_amount_for_quarter_one + $payment_amount_for_quarter_two + $payment_amount_for_quarter_three + $payment_amount_for_quarter_four;
|
||||
|
||||
?>
|
||||
|
||||
<td class="text-right">$<?php echo number_format($payment_amount_for_quarter_four,2); ?></td>
|
||||
|
||||
<td class="text-right">$<?php echo number_format($total_payments_for_all_four_quarters,2); ?></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
||||
$total_payment_for_all_months = 0;
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<th>Total Taxes<br><br><br></th>
|
||||
<?php
|
||||
|
||||
$expense_total_amount_for_quarter_one = 0;
|
||||
|
||||
for($month = 1; $month<=3; $month++) {
|
||||
$sql_expenses = mysqli_query($mysqli,"SELECT SUM(expense_amount) AS expense_total_amount_for_month FROM expenses WHERE category_id > 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'];
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<th class="text-right">$<?php echo number_format($expense_total_amount_for_quarter_one,2); ?></th>
|
||||
|
||||
<?php
|
||||
|
||||
$expense_total_amount_for_quarter_two = 0;
|
||||
|
||||
for($month = 4; $month<=6; $month++) {
|
||||
$sql_expenses = mysqli_query($mysqli,"SELECT SUM(expense_amount) AS expense_total_amount_for_month FROM expenses WHERE category_id > 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'];
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<th class="text-right">$<?php echo number_format($expense_total_amount_for_quarter_two,2); ?></th>
|
||||
|
||||
<?php
|
||||
|
||||
$expense_total_amount_for_quarter_three = 0;
|
||||
|
||||
for($month = 7; $month<=9; $month++) {
|
||||
$sql_expenses = mysqli_query($mysqli,"SELECT SUM(expense_amount) AS expense_total_amount_for_month FROM expenses WHERE category_id > 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'];
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<th class="text-right">$<?php echo number_format($expense_total_amount_for_quarter_three,2); ?></th>
|
||||
|
||||
<?php
|
||||
|
||||
$expense_total_amount_for_quarter_four = 0;
|
||||
|
||||
for($month = 10; $month<=12; $month++) {
|
||||
$sql_expenses = mysqli_query($mysqli,"SELECT SUM(expense_amount) AS expense_total_amount_for_month FROM expenses WHERE category_id > 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;
|
||||
|
||||
?>
|
||||
|
||||
<th class="text-right">$<?php echo number_format($expense_total_amount_for_quarter_four,2); ?></th>
|
||||
|
||||
<th class="text-right">$<?php echo number_format($total_expenses_for_all_four_quarters,2); ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
$net_profit_quarter_one = $payment_total_amount_for_quarter_one - $expense_total_amount_for_quarter_one;
|
||||
$net_profit_quarter_two = $payment_total_amount_for_quarter_two - $expense_total_amount_for_quarter_two;
|
||||
$net_profit_quarter_three = $payment_total_amount_for_quarter_three - $expense_total_amount_for_quarter_three;
|
||||
$net_profit_quarter_four = $payment_total_amount_for_quarter_four - $expense_total_amount_for_quarter_four;
|
||||
$net_profit_year = $total_payments_for_all_four_quarters - $total_expenses_for_all_four_quarters;
|
||||
?>
|
||||
|
||||
<th>Net Profit</th>
|
||||
<th class="text-right">$<?php echo number_format($net_profit_quarter_one,2); ?></th>
|
||||
<th class="text-right">$<?php echo number_format($net_profit_quarter_two,2); ?></th>
|
||||
<th class="text-right">$<?php echo number_format($net_profit_quarter_three,2); ?></th>
|
||||
<th class="text-right">$<?php echo number_format($net_profit_quarter_four,2); ?></th>
|
||||
<th class="text-right">$<?php echo number_format($net_profit_year,2); ?></th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include("footer.php");
|
||||
|
|
@ -170,6 +170,11 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<?php include("add_revenue_modal.php"); ?>
|
||||
<?php
|
||||
|
||||
<?php include("footer.php");
|
||||
include("add_revenue_modal.php");
|
||||
include("add_quick_modal.php");
|
||||
|
||||
include("footer.php");
|
||||
|
||||
?>
|
||||
|
|
@ -513,7 +513,7 @@ if(isset($_POST['add_company_settings'])){
|
|||
<span class="input-group-text"><i class="fa fa-fw fa-flag"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="state">
|
||||
<option value="">Select a state...</option>
|
||||
<option value="">- State -</option>
|
||||
<?php foreach($states_array as $state_abbr => $state_name) { ?>
|
||||
<option value="<?php echo $state_abbr; ?>"><?php echo $state_name; ?></option>
|
||||
<?php } ?>
|
||||
|
|
|
|||
Loading…
Reference in New Issue