mirror of https://github.com/itflow-org/itflow
Convert Quote to Invoice to use ajax-modal
This commit is contained in:
parent
99e2487d2b
commit
faa94d888d
|
|
@ -2,7 +2,9 @@
|
|||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header bg-dark">
|
||||
<h5 class="modal-title text-white"><i class="fas fa-fw fa-edit mr-2"></i>Quote Notes</h5>
|
||||
<h5 class="modal-title text-white">
|
||||
<i class="fas fa-fw fa-edit mr-2"></i>Quote Notes
|
||||
</h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
|
|
@ -15,8 +17,12 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" name="quote_note" class="btn btn-primary text-bold"><i class="fas fa-check mr-2"></i>Save</button>
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fas fa-times mr-2"></i>Cancel</button>
|
||||
<button type="submit" name="quote_note" class="btn btn-primary text-bold">
|
||||
<i class="fas fa-check mr-2"></i>Save
|
||||
</button>
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal">
|
||||
<i class="fas fa-times mr-2"></i>Cancel
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,14 +1,30 @@
|
|||
<div class="modal" id="addQuoteToInvoiceModal<?php echo $quote_id; ?>" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header bg-dark">
|
||||
<h5 class="modal-title"><i class="fas fa-fw fa-file mr-2"></i>Quote <?php echo "$quote_prefix$quote_number"; ?> <i class="fas fa-arrow-right mr-2"></i>Invoice</h5>
|
||||
<?php
|
||||
|
||||
require_once '../../../includes/modal_header.php';
|
||||
|
||||
$quote_id = intval($_GET['quote_id']);
|
||||
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM quotes WHERE quote_id = $quote_id LIMIT 1");
|
||||
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$quote_prefix = nullable_htmlentities($row['quote_prefix']);
|
||||
$quote_number = intval($row['quote_number']);
|
||||
|
||||
ob_start();
|
||||
?>
|
||||
|
||||
<div class="modal-header bg-dark">
|
||||
<h5 class="modal-title">
|
||||
<i class="fas fa-fw fa-file mr-2"></i>
|
||||
Quote <?= "$quote_prefix$quote_number" ?>
|
||||
<i class="fas fa-arrow-right mr-2"></i>Invoice
|
||||
</h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="quote_id" value="<?php echo $quote_id; ?>">
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="quote_id" value="<?= $quote_id ?>">
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
|
|
@ -18,16 +34,20 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-calendar"></i></span>
|
||||
</div>
|
||||
<input type="date" class="form-control" name="date" max="2999-12-31" value="<?php echo date("Y-m-d"); ?>" required>
|
||||
<input type="date" class="form-control" name="date" max="2999-12-31" value="<?= date("Y-m-d"); ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" name="add_quote_to_invoice" class="btn btn-primary text-bold"><strong><i class="fas fa-check mr-2"></i>Create Invoice</button>
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal"><i class="fas fa-times mr-2"></i>Cancel</button>
|
||||
<button type="submit" name="add_quote_to_invoice" class="btn btn-primary text-bold">
|
||||
<strong><i class="fas fa-check mr-2"></i>Create Invoice</strong>
|
||||
</button>
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal">
|
||||
<i class="fas fa-times mr-2"></i>Cancel
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
require_once '../../../includes/modal_footer.php';
|
||||
|
|
|
|||
|
|
@ -172,7 +172,8 @@ if (isset($_GET['quote_id'])) {
|
|||
|
||||
<?php if ($quote_status == 'Accepted') { ?>
|
||||
<div class="btn-group fix-quote-dropdown">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addQuoteToInvoiceModal<?php echo $quote_id; ?>">
|
||||
<button type="button" class="btn btn-primary ajax-modal"
|
||||
data-modal-url="modals/quote/quote_to_invoice.php?quote_id=<?= $quote_id ?>">
|
||||
<i class="fas fa-check mr-2"></i>Invoice
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary dropdown-toggle dropdown-icon" data-toggle="dropdown" aria-expanded="false">
|
||||
|
|
@ -571,7 +572,6 @@ if (isset($_GET['quote_id'])) {
|
|||
</div>
|
||||
|
||||
<?php
|
||||
require_once "modals/quote/quote_to_invoice.php";
|
||||
require_once "modals/quote/quote_note.php";
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue