mirror of https://github.com/itflow-org/itflow
Cleaned up UI a bit invoice, side_menu, client, started working on bank transfers
This commit is contained in:
parent
83ab654824
commit
0fc29c0271
|
|
@ -1,4 +1,4 @@
|
|||
<div class="modal fade" id="addClientModal" tabindex="-1">
|
||||
<div class="modal" id="addClientModal" tabindex="-1">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-calendar"></i></span>
|
||||
</div>
|
||||
<input type="date" class="form-control" name="date" required>
|
||||
<input type="date" class="form-control" name="date" value="<?php echo date("Y-m-d",time()); ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md">
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-calendar"></i></span>
|
||||
</div>
|
||||
<input type="date" class="form-control" name="date" required>
|
||||
<input type="date" class="form-control" name="date" value="<?php echo date("Y-m-d",time()); ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md">
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-dollar-sign"></i></span>
|
||||
</div>
|
||||
<input type="number" class="form-control" step="0.01" min="0" name="amount" value="<?php echo $invoice_amount; ?>" required>
|
||||
<input type="number" class="form-control" step="0.01" min="0" name="amount" value="<?php echo number_format($balance,2); ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
88
client.php
88
client.php
|
|
@ -44,36 +44,70 @@ if(isset($_GET['client_id'])){
|
|||
$num_notes = $row['num'];
|
||||
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<h2><?php echo $client_name; ?></h2>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="dropdown dropleft text-center">
|
||||
<button class="btn btn-primary btn-sm float-right" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fas fa-ellipsis-h"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addClientContactModal">New Contact</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addClientLocationModal">New Location</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addClientAssetModal">New Asset</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addClientVendorModal">New Vendor</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addClientLoginModal">New Login</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addClientNetworkModal">New Network</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addClientDomainModal">New Domain</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addClientApplicationModal">New Application</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addInvoiceModal">New Invoice</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addQuoteModal">New Quote</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addClientAttachmentModal">New Attachment</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addClientNoteModal">New Note</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="client_print.php?client_id=<?php echo $client_id; ?>">Print</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editClientModal<?php echo $client_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="post.php?delete_client=<?php echo $client_id; ?>">Delete</a>
|
||||
|
||||
<ol class="breadcrumb d-print-none">
|
||||
<li class="breadcrumb-item">
|
||||
<a href="clients.php">Clients</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active"><?php echo $client_name; ?></li>
|
||||
</ol>
|
||||
|
||||
<div class="card mb-3 border-0">
|
||||
<div class="card-body mb-4">
|
||||
<div class="row">
|
||||
<div class="col border-left border-right ">
|
||||
<h2 class="text-secondary"><?php echo $client_name; ?></h2>
|
||||
</div>
|
||||
<div class="col border-right">
|
||||
<h4 class="text-secondary">Address</h4>
|
||||
<a href="//maps.<?php echo $session_map_source; ?>.com/?q=<?php echo "$client_address $client_zip"; ?>" target="_blank">
|
||||
<?php echo $client_address; ?>
|
||||
<br>
|
||||
<?php echo "$client_city $client_state $client_zip"; ?>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col border-right">
|
||||
<h4 class="text-secondary">Contact</h4>
|
||||
<i class="fa fa-envelope mx-1"></i> <a href="mailto:<?php echo $client_email; ?>"><?php echo $client_email; ?></a>
|
||||
<br>
|
||||
<i class="fa fa-phone mx-1"></i> <?php echo $client_phone; ?>
|
||||
<br>
|
||||
<i class="fa fa-globe mx-1"></i> <a target="_blank" href="//<?php echo $client_website; ?>"><?php echo $client_website; ?></a>
|
||||
</div>
|
||||
<div class="col border-right">
|
||||
<h4 class="text-secondary">Standings</h4>
|
||||
<h6>Paid to Date <small class="text-secondary ml-5">$0.00</small>
|
||||
<h6>Balance <small class="text-secondary ml-5">$0.00</small>
|
||||
</div>
|
||||
<div class="col-1">
|
||||
<div class="dropdown dropleft text-center">
|
||||
<button class="btn btn-primary btn-sm float-right" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fas fa-ellipsis-h"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addClientContactModal">New Contact</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addClientLocationModal">New Location</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addClientAssetModal">New Asset</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addClientVendorModal">New Vendor</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addClientLoginModal">New Login</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addClientNetworkModal">New Network</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addClientDomainModal">New Domain</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addClientApplicationModal">New Application</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addInvoiceModal">New Invoice</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addQuoteModal">New Quote</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addClientAttachmentModal">New Attachment</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addClientNoteModal">New Note</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="client_print.php?client_id=<?php echo $client_id; ?>">Print</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editClientModal<?php echo $client_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="post.php?delete_client=<?php echo $client_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="card">
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Title</th>
|
||||
<th>Phone</th>
|
||||
<th>Email</th>
|
||||
<th>Phone</th>
|
||||
<th class="text-center">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
@ -28,8 +28,9 @@
|
|||
<tr>
|
||||
<td><?php echo "$client_contact_name"; ?></td>
|
||||
<td><?php echo "$client_contact_title"; ?></td>
|
||||
<td><?php echo "$client_contact_phone"; ?></td>
|
||||
<td><a href="mailto:<?php echo $client_contact_email; ?>"><?php echo "$client_contact_email"; ?></a></td>
|
||||
<td><?php echo "$client_contact_phone"; ?></td>
|
||||
|
||||
<td>
|
||||
<div class="dropdown dropleft text-center">
|
||||
<button class="btn btn-secondary btn-sm" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
<table class="table">
|
||||
<tr>
|
||||
<td><i class="fa fa-map-marker"></i></td>
|
||||
<td>
|
||||
<a href="//maps.<?php echo $session_map_source; ?>.com/?q=<?php echo "$client_address $client_zip"; ?>" target="_blank">
|
||||
<?php echo $client_address; ?>
|
||||
<br>
|
||||
<?php echo "$client_city $client_state $client_zip"; ?>
|
||||
</a>
|
||||
</td>
|
||||
<tr>
|
||||
<td><i class="fa fa-phone"></i></td>
|
||||
<td><?php echo $client_phone; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i class="fa fa-envelope"></i></td>
|
||||
<td><a href="mailto:<?php echo $client_email; ?>"><?php echo $client_email; ?></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i class="fa fa-globe"></i></td>
|
||||
<td><a href="http://<?php echo $client_website; ?>"><?php echo $client_website; ?></a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
@ -1,27 +1,25 @@
|
|||
<ul class="nav nav-pills">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" href="?client_id=<?php echo $client_id; ?>&tab=details">Details</a>
|
||||
</li>
|
||||
<ul class="nav nav-pills nav-fill">
|
||||
<?php if($num_contacts > 0){ ?>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="?client_id=<?php echo $client_id; ?>&tab=contacts">
|
||||
Contacts
|
||||
<span class="badge badge-pill badge-dark"><?php echo $num_contacts; ?></span>
|
||||
<a class="nav-link active" href="?client_id=<?php echo $client_id; ?>&tab=contacts">
|
||||
Contacts<br>
|
||||
<span class="badge badge-pill badge-light"><?php echo $num_contacts; ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php if($num_locations > 0){ ?>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="?client_id=<?php echo $client_id; ?>&tab=locations">
|
||||
Locations
|
||||
<span class="badge badge-pill badge-dark"><?php echo $num_locations; ?></span>
|
||||
Locations<br>
|
||||
<span class="badge badge-pill badge-fark"><?php echo $num_locations; ?></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php if($num_assets > 0){ ?>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="?client_id=<?php echo $client_id; ?>&tab=assets">
|
||||
Assets
|
||||
Assets<br>
|
||||
<span class="badge badge-pill badge-dark"><?php echo $num_assets; ?></span>
|
||||
</a>
|
||||
</li>
|
||||
|
|
@ -29,15 +27,15 @@
|
|||
<?php if($num_vendors > 0){ ?>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="?client_id=<?php echo $client_id; ?>&tab=vendors">
|
||||
Vendors
|
||||
<span class="badge badge-pill badge-dark"><?php echo $num_vendors; ?></span>
|
||||
Vendors<br>
|
||||
<span class="badge badge-pill badge-secondary"><?php echo $num_vendors; ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php if($num_logins > 0){ ?>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="?client_id=<?php echo $client_id; ?>&tab=logins">
|
||||
Logins
|
||||
Logins<br>
|
||||
<span class="badge badge-pill badge-dark"><?php echo $num_logins; ?></span>
|
||||
</a>
|
||||
</li>
|
||||
|
|
@ -45,7 +43,7 @@
|
|||
<?php if($num_networks > 0){ ?>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="?client_id=<?php echo $client_id; ?>&tab=networks">
|
||||
Networks
|
||||
Networks<br>
|
||||
<span class="badge badge-pill badge-dark"><?php echo $num_networks; ?></span>
|
||||
</a>
|
||||
</li>
|
||||
|
|
@ -53,7 +51,7 @@
|
|||
<?php if($num_domains > 0){ ?>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="?client_id=<?php echo $client_id; ?>&tab=domains">
|
||||
Domains
|
||||
Domains<br>
|
||||
<span class="badge badge-pill badge-dark"><?php echo $num_domains; ?></span>
|
||||
</a>
|
||||
</li>
|
||||
|
|
@ -61,7 +59,7 @@
|
|||
<?php if($num_applications > 0){ ?>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="?client_id=<?php echo $client_id; ?>&tab=applications">
|
||||
Applications
|
||||
Applications<br>
|
||||
<span class="badge badge-pill badge-dark"><?php echo $num_applications; ?></span>
|
||||
</a>
|
||||
</li>
|
||||
|
|
@ -69,7 +67,7 @@
|
|||
<?php if($num_invoices > 0){ ?>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="?client_id=<?php echo $client_id; ?>&tab=invoices">
|
||||
Invoices
|
||||
Invoices<br>
|
||||
<span class="badge badge-pill badge-dark"><?php echo $num_invoices; ?></span>
|
||||
</a>
|
||||
</li>
|
||||
|
|
@ -77,7 +75,7 @@
|
|||
<?php if($num_quotes > 0){ ?>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="?client_id=<?php echo $client_id; ?>&tab=quotes">
|
||||
Quotes
|
||||
Quotes<br>
|
||||
<span class="badge badge-pill badge-dark"><?php echo $num_quotes; ?></span>
|
||||
</a>
|
||||
</li>
|
||||
|
|
@ -85,7 +83,7 @@
|
|||
<?php if($num_attachments > 0){ ?>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="?client_id=<?php echo $client_id; ?>&tab=attachments">
|
||||
Attachments
|
||||
Attachments<br>
|
||||
<span class="badge badge-pill badge-dark"><?php echo $num_attachments; ?></span>
|
||||
</a>
|
||||
</li>
|
||||
|
|
@ -93,7 +91,7 @@
|
|||
<?php if($num_notes > 0){ ?>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="?client_id=<?php echo $client_id; ?>&tab=notes">
|
||||
Notes
|
||||
Notes<br>
|
||||
<span class="badge badge-pill badge-dark"><?php echo $num_notes; ?></span>
|
||||
</a>
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,7 @@
|
|||
<?php
|
||||
|
||||
if(isset($_GET['tab'])){
|
||||
if($_GET['tab'] == "details"){
|
||||
include("client_details.php");
|
||||
}
|
||||
elseif($_GET['tab'] == "contacts"){
|
||||
if($_GET['tab'] == "contacts"){
|
||||
include("client_contacts.php");
|
||||
}
|
||||
elseif($_GET['tab'] == "locations"){
|
||||
|
|
@ -45,7 +42,7 @@ if(isset($_GET['tab'])){
|
|||
}
|
||||
}
|
||||
else{
|
||||
include("client_details.php");
|
||||
include("client_contacts.php");
|
||||
}
|
||||
|
||||
?>
|
||||
16
clients.php
16
clients.php
|
|
@ -11,13 +11,12 @@
|
|||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-borderless table-hover" id="dataTable" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Address</th>
|
||||
<th>Phone</th>
|
||||
<th>Email</th>
|
||||
<th class="text-right">Unpaid</th>
|
||||
<th>Phone</th>
|
||||
<th class="text-right">Balance</th>
|
||||
<th class="text-center">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
@ -42,15 +41,8 @@
|
|||
?>
|
||||
<tr>
|
||||
<td><a href="client.php?client_id=<?php echo $client_id; ?>"><?php echo "$client_name"; ?></a></td>
|
||||
<td>
|
||||
<a href="//maps.<?php echo $session_map_source; ?>.com?q=<?php echo "$client_address $client_zip"; ?>" target="_blank">
|
||||
<?php echo "$client_address"; ?>
|
||||
<br>
|
||||
<?php echo "$client_city $client_state $client_zip"; ?>
|
||||
</a>
|
||||
</td>
|
||||
<td><?php echo "$client_phone"; ?></td>
|
||||
<td><a href="mailto:<?php echo$email; ?>"><?php echo "$client_email"; ?></a></td>
|
||||
<td><?php echo "$client_phone"; ?></td>
|
||||
<td class="text-right text-monospace">$0.00</td>
|
||||
<td>
|
||||
<div class="dropdown dropleft text-center">
|
||||
|
|
|
|||
|
|
@ -1,66 +0,0 @@
|
|||
<div class="modal fade" id="editInvoiceModal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-file"></i> Edit Invoice</h5>
|
||||
<button type="button" class="close" data-dismiss="modal">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="invoice_id" value="<?php echo $invoice_id; ?>">
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="form-group">
|
||||
<label>Invoice Date</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-calendar"></i></span>
|
||||
</div>
|
||||
<input type="date" class="form-control" name="date" value="<?php echo date("Y-m-d",$invoice_date); ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Payment Due</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-calendar"></i></span>
|
||||
</div>
|
||||
<input type="date" class="form-control" name="due" value="<?php echo date("Y-m-d",$invoice_due); ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Income Category</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-tag"></i></span>
|
||||
</div>
|
||||
<select class="form-control" name="category" required>
|
||||
<option value="">- Category -</option>
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Income'");
|
||||
while($row = mysqli_fetch_array($sql)){
|
||||
$category_id = $row['category_id'];
|
||||
$category_name = $row['category_name'];
|
||||
?>
|
||||
<option <?php if($category_id == $invoice_category_id){ ?> selected <?php } ?> value="<?php echo $category_id; ?>"><?php echo $category_name; ?></option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
|
||||
<button type="submit" name="edit_invoice" class="btn btn-primary">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
217
invoice.php
217
invoice.php
|
|
@ -68,14 +68,17 @@ if(isset($_GET['invoice_id'])){
|
|||
|
||||
|
||||
?>
|
||||
<div class="row d-print-none">
|
||||
<div class="col-md-11">
|
||||
<h3>Invoice #
|
||||
<small class="text-muted">INV-<?php echo $invoice_number; ?></small>
|
||||
<span class="badge badge-<?php echo $invoice_badge_color; ?>"><?php echo $invoice_status; ?></span>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
|
||||
<ol class="breadcrumb d-print-none">
|
||||
<li class="breadcrumb-item">
|
||||
<a href="index.html">Invoices</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active">INV-<?php echo $invoice_number; ?></li>
|
||||
<span class="ml-3 p-2 badge badge-<?php echo $invoice_badge_color; ?>"><?php echo $invoice_status; ?></span>
|
||||
</ol>
|
||||
|
||||
<div class="row mb-4 d-print-none">
|
||||
<div class="col-md-12">
|
||||
<div class="dropdown dropleft text-center">
|
||||
<button class="btn btn-primary btn-sm float-right" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fas fa-ellipsis-h"></i>
|
||||
|
|
@ -94,7 +97,7 @@ if(isset($_GET['invoice_id'])){
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="row mb-4">
|
||||
<div class="col-sm">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
|
|
@ -139,127 +142,127 @@ if(isset($_GET['invoice_id'])){
|
|||
|
||||
<?php $sql4 = mysqli_query($mysqli,"SELECT * FROM invoice_items WHERE invoice_id = $invoice_id ORDER BY invoice_item_id ASC"); ?>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="row mb-4">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
Items
|
||||
</div>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="d-print-none"></th>
|
||||
<th>Product</th>
|
||||
<th>Description</th>
|
||||
<th class="text-center">Qty</th>
|
||||
<th class="text-right">Price</th>
|
||||
<th class="text-right">Tax</th>
|
||||
<th class="text-right">Total</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while($row = mysqli_fetch_array($sql4)){
|
||||
$invoice_item_id = $row['invoice_item_id'];
|
||||
$invoice_item_name = $row['invoice_item_name'];
|
||||
$invoice_item_description = $row['invoice_item_description'];
|
||||
$invoice_item_quantity = $row['invoice_item_quantity'];
|
||||
$invoice_item_price = $row['invoice_item_price'];
|
||||
$invoice_item_subtotal = $row['invoice_item_price'];
|
||||
$invoice_item_tax = $row['invoice_item_tax'];
|
||||
$invoice_item_total = $row['invoice_item_total'];
|
||||
$total_tax = $invoice_item_tax + $total_tax;
|
||||
$sub_total = $invoice_item_price * $invoice_item_quantity + $sub_total;
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="d-print-none"></th>
|
||||
<th>Item</th>
|
||||
<th>Description</th>
|
||||
<th class="text-right">Unit Cost</th>
|
||||
<th class="text-center">Quantity</th>
|
||||
<th class="text-right">Tax</th>
|
||||
<th class="text-right">Line Total</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while($row = mysqli_fetch_array($sql4)){
|
||||
$invoice_item_id = $row['invoice_item_id'];
|
||||
$invoice_item_name = $row['invoice_item_name'];
|
||||
$invoice_item_description = $row['invoice_item_description'];
|
||||
$invoice_item_quantity = $row['invoice_item_quantity'];
|
||||
$invoice_item_price = $row['invoice_item_price'];
|
||||
$invoice_item_subtotal = $row['invoice_item_price'];
|
||||
$invoice_item_tax = $row['invoice_item_tax'];
|
||||
$invoice_item_total = $row['invoice_item_total'];
|
||||
$total_tax = $invoice_item_tax + $total_tax;
|
||||
$sub_total = $invoice_item_price * $invoice_item_quantity + $sub_total;
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td class="text-center d-print-none"><a class="btn btn-danger btn-sm" href="post.php?delete_invoice_item=<?php echo $invoice_item_id; ?>"><i class="fa fa-trash"></i></a></td>
|
||||
<td><?php echo $invoice_item_name; ?></td>
|
||||
<td><?php echo $invoice_item_description; ?></td>
|
||||
<td class="text-center"><?php echo $invoice_item_quantity; ?></td>
|
||||
<td class="text-right">$<?php echo number_format($invoice_item_price,2); ?></td>
|
||||
<td class="text-right">$<?php echo number_format($invoice_item_tax,2); ?></td>
|
||||
<td class="text-right">$<?php echo number_format($invoice_item_total,2); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-center d-print-none"><a class="btn btn-danger btn-sm" href="post.php?delete_invoice_item=<?php echo $invoice_item_id; ?>"><i class="fa fa-trash"></i></a></td>
|
||||
<td><?php echo $invoice_item_name; ?></td>
|
||||
<td><?php echo $invoice_item_description; ?></td>
|
||||
<td class="text-right">$<?php echo number_format($invoice_item_price,2); ?></td>
|
||||
<td class="text-center"><?php echo $invoice_item_quantity; ?></td>
|
||||
<td class="text-right">$<?php echo number_format($invoice_item_tax,2); ?></td>
|
||||
<td class="text-right">$<?php echo number_format($invoice_item_total,2); ?></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
<?php
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
<tr class="d-print-none">
|
||||
<form action="post.php" method="post">
|
||||
<td class="text-center"><button type="submit" class="btn btn-primary btn-sm" name="add_invoice_item"><i class="fa fa-check"></i></button></td>
|
||||
<input type="hidden" name="invoice_id" value="<?php echo $invoice_id; ?>">
|
||||
<td><input type="text" class="form-control" name="name"></td>
|
||||
<td><textarea class="form-control" rows="1" name="description"></textarea></td>
|
||||
<td><input type="text" class="form-control" name="qty"></td>
|
||||
<td class="text-right"><input type="text" class="form-control" name="price"></td>
|
||||
<td>
|
||||
<select class="form-control" name="tax">
|
||||
<option value="0.00">None</option>
|
||||
<option value="0.07">State Tax 7%</option>
|
||||
</select>
|
||||
</td>
|
||||
<td></td>
|
||||
</form>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="d-print-none"></td>
|
||||
<td colspan="4"></td>
|
||||
<td><strong>SubTotal</strong></td>
|
||||
<td class="text-right">$<?php echo number_format($sub_total,2); ?></td>
|
||||
</tr>
|
||||
<?php if($discount > 0){ ?>
|
||||
<tr>
|
||||
<td class="d-print-none"></td>
|
||||
<td colspan="4"></td>
|
||||
<td><strong>Discount</strong></td>
|
||||
<td class="text-right">$<?php echo number_format($invoice_discount,2); ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if($total_tax > 0){ ?>
|
||||
<tr>
|
||||
<td class="d-print-none"></td>
|
||||
<td colspan="4"></td>
|
||||
<td><strong>Tax</strong></td>
|
||||
<td class="text-right">$<?php echo number_format($total_tax,2); ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if($amount_paid > 0){ ?>
|
||||
<tr>
|
||||
<td class="d-print-none"></td>
|
||||
<td colspan="4"></td>
|
||||
<td><strong class="text-success">Paid</strong></td>
|
||||
<td class="text-right text-success">-$<?php echo number_format($amount_paid,2); ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<tr>
|
||||
<td class="d-print-none"></td>
|
||||
<td colspan="4"></td>
|
||||
<td><strong>Total</strong></td>
|
||||
<td class="text-right">$<?php echo number_format($balance,2); ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<tr class="d-print-none">
|
||||
<form action="post.php" method="post">
|
||||
<td class="text-center"><button type="submit" class="btn btn-primary btn-sm" name="add_invoice_item"><i class="fa fa-check"></i></button></td>
|
||||
<input type="hidden" name="invoice_id" value="<?php echo $invoice_id; ?>">
|
||||
<td><input type="text" class="form-control" name="name"></td>
|
||||
<td><textarea class="form-control" rows="1" name="description"></textarea></td>
|
||||
<td><input type="text" class="form-control" style="text-align: right;" name="price"></td>
|
||||
<td><input type="text" class="form-control" style="text-align: center;" name="qty"></td>
|
||||
<td>
|
||||
<select dir="rtl" class="form-control" name="tax">
|
||||
<option value="0.00">None</option>
|
||||
<option value="0.07">State Tax 7%</option>
|
||||
</select>
|
||||
</td>
|
||||
<td></td>
|
||||
</form>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-sm">
|
||||
|
||||
<div class="row mb-4">
|
||||
<div class="col-5">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
Notes
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="card-body mb-5">
|
||||
<p><?php echo $invoice_note; ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3 offset-4">
|
||||
<table class="table table-borderless">
|
||||
<tbody>
|
||||
<tr class="border-bottom">
|
||||
<td>Subtotal</td>
|
||||
<td class="text-right">$<?php echo number_format($sub_total,2); ?></td>
|
||||
</tr>
|
||||
<?php if($discount > 0){ ?>
|
||||
<tr class="border-bottom">
|
||||
<td>Discount</td>
|
||||
<td class="text-right">$<?php echo number_format($invoice_discount,2); ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if($total_tax > 0){ ?>
|
||||
<tr class="border-bottom">
|
||||
<td>Tax</td>
|
||||
<td class="text-right">$<?php echo number_format($total_tax,2); ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if($amount_paid > 0){ ?>
|
||||
<tr class="border-bottom">
|
||||
<td><div class="text-success">Paid to Date</div></td>
|
||||
<td class="text-right text-success">$<?php echo number_format($amount_paid,2); ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<tr class="border-bottom">
|
||||
<td><strong>Balance Due</strong></td>
|
||||
<td class="text-right"><strong>$<?php echo number_format($balance,2); ?></strong></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-sm d-print-none">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
|
|
|
|||
|
|
@ -42,9 +42,6 @@
|
|||
$unixtime_invoice_due = strtotime($invoice_due);
|
||||
if($unixtime_invoice_due < time()){
|
||||
$overdue_color = "text-danger";
|
||||
$invoice_status = "Overdue";
|
||||
}else{
|
||||
$overdue_color = "text-success";
|
||||
}
|
||||
|
||||
if($invoice_status == "Sent"){
|
||||
|
|
@ -89,7 +86,7 @@
|
|||
|
||||
<?php
|
||||
|
||||
include("edit_invoice_modal.php");
|
||||
//include("edit_invoice_modal.php");
|
||||
include("add_invoice_copy_modal.php");
|
||||
}
|
||||
|
||||
|
|
|
|||
40
post.php
40
post.php
|
|
@ -338,6 +338,13 @@ if(isset($_POST['add_transfer'])){
|
|||
$account_from = intval($_POST['account_from']);
|
||||
$account_to = intval($_POST['account_to']);
|
||||
|
||||
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO expenses SET expense_date = '$date', expense_amount = '$amount', vendor_id = 0, account_id = $account_from");
|
||||
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO invoice_payments SET invoice_payment_date = '$date', invoice_payment_amount = '$amount', account_id = $account_to, invoice_id = 0");
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO transfers SET transfer_date = '$date', transfer_amount = '$amount', transfer_account_from = $account_from, transfer_account_to = $account_to");
|
||||
|
||||
$_SESSION['alert_message'] = "Transfer added";
|
||||
|
|
@ -515,23 +522,30 @@ if(isset($_POST['add_invoice_payment'])){
|
|||
//Calculate the Invoice balance
|
||||
$invoice_balance = $invoice_amount - $total_payments_amount;
|
||||
|
||||
//Determine if invoice has been paid
|
||||
if($invoice_balance == 0){
|
||||
$invoice_status = "Paid";
|
||||
if($amount > $invoice_balance){
|
||||
$_SESSION['alert_message'] = "Payment is more than the balance";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
|
||||
}else{
|
||||
$invoice_status = "Partial";
|
||||
}
|
||||
|
||||
//Determine if invoice has been paid then set the status accordingly
|
||||
if($invoice_balance == 0){
|
||||
$invoice_status = "Paid";
|
||||
}else{
|
||||
$invoice_status = "Partial";
|
||||
}
|
||||
|
||||
//Update Invoice Status
|
||||
mysqli_query($mysqli,"UPDATE invoices SET invoice_status = '$invoice_status' WHERE invoice_id = $invoice_id");
|
||||
//Update Invoice Status
|
||||
mysqli_query($mysqli,"UPDATE invoices SET invoice_status = '$invoice_status' WHERE invoice_id = $invoice_id");
|
||||
|
||||
//Add Payment to History
|
||||
mysqli_query($mysqli,"INSERT INTO invoice_history SET invoice_history_date = CURDATE(), invoice_history_status = '$invoice_status', invoice_history_description = 'INVOICE payment added', invoice_id = $invoice_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Payment added";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
//Add Payment to History
|
||||
mysqli_query($mysqli,"INSERT INTO invoice_history SET invoice_history_date = CURDATE(), invoice_history_status = '$invoice_status', invoice_history_description = 'INVOICE payment added', invoice_id = $invoice_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Payment added";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['edit_invoice_note'])){
|
||||
|
|
|
|||
24
side_nav.php
24
side_nav.php
|
|
@ -1,61 +1,61 @@
|
|||
<!-- Sidebar -->
|
||||
<ul class="sidebar navbar-nav d-print-none">
|
||||
<li class="nav-item">
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="dashboard.php">
|
||||
<i class="fas fa-fw fa-tachometer-alt"></i>
|
||||
<i class="fas fa-fw fa-tachometer-alt mx-2"></i>
|
||||
<span>Dashboard</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="clients.php">
|
||||
<i class="fas fa-fw fa-users"></i>
|
||||
<i class="fas fa-fw fa-users mx-2"></i>
|
||||
<span>Clients</span></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="vendors.php">
|
||||
<i class="fas fa-fw fa-briefcase"></i>
|
||||
<i class="fas fa-fw fa-briefcase mx-2"></i>
|
||||
<span>Vendors</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="invoices.php">
|
||||
<i class="fas fa-fw fa-file-invoice-dollar"></i>
|
||||
<i class="fas fa-fw fa-file-invoice-dollar mx-2"></i>
|
||||
<span>Invoices</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="quotes.php">
|
||||
<i class="fas fa-fw fa-file-invoice"></i>
|
||||
<i class="fas fa-fw fa-file-invoice mx-2"></i>
|
||||
<span>Quotes</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="expenses.php">
|
||||
<i class="fas fa-fw fa-shopping-cart"></i>
|
||||
<i class="fas fa-fw fa-shopping-cart mx-2"></i>
|
||||
<span>Expenses</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="accounts.php">
|
||||
<i class="fas fa-fw fa-piggy-bank"></i>
|
||||
<i class="fas fa-fw fa-piggy-bank mx-2"></i>
|
||||
<span>Accounts</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="transfers.php">
|
||||
<i class="fas fa-fw fa-exchange-alt"></i>
|
||||
<i class="fas fa-fw fa-exchange-alt mx-2"></i>
|
||||
<span>Transfers</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="mileage.php">
|
||||
<i class="fas fa-fw fa-car"></i>
|
||||
<i class="fas fa-fw fa-car mx-2"></i>
|
||||
<span>Mileage</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="#" id="pagesDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fas fa-fw fa-chart-area"></i>
|
||||
<i class="fas fa-fw fa-chart-area mx-2"></i>
|
||||
<span>Reports</span>
|
||||
</a>
|
||||
<div class="dropdown-menu" aria-labelledby="pagesDropdown">
|
||||
|
|
@ -68,7 +68,7 @@
|
|||
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="#" id="pagesDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fas fa-fw fa-cogs"></i>
|
||||
<i class="fas fa-fw fa-cog mx-2"></i>
|
||||
<span>Settings</span>
|
||||
</a>
|
||||
<div class="dropdown-menu" aria-labelledby="pagesDropdown">
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<nav class="navbar navbar-expand navbar-dark bg-dark static-top">
|
||||
<nav class="navbar navbar-expand navbar-dark bg-primary static-top">
|
||||
|
||||
<a class="navbar-brand mr-1" href="index.html"><?php echo "$config_company_name";?></a>
|
||||
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
<div class="input-group">
|
||||
<input type="text" class="form-control" placeholder="Search for..." aria-label="Search" aria-describedby="basic-addon2">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-primary" type="button">
|
||||
<button class="btn btn-dark" type="button">
|
||||
<i class="fas fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
<ul class="navbar-nav ml-auto ml-md-0">
|
||||
<li class="nav-item dropdown no-arrow">
|
||||
<a class="nav-link dropdown-toggle" href="#" id="userDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<img height="28" width="28" src="<?php echo "$session_avatar"; ?>" class="img-fluid rounded-circle"> <?php echo "$session_name"; ?>
|
||||
<img height="32" width="32" src="<?php echo "$session_avatar"; ?>" class="img-fluid rounded-circle"> <strong><?php echo "$session_name"; ?></strong>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="userDropdown">
|
||||
<a class="dropdown-item" data-toggle="modal" data-target="#changeAvatarModal" href="#">
|
||||
|
|
|
|||
Loading…
Reference in New Issue