Invoice Type fixes : ps

This commit is contained in:
VE10-Sanjeev 2023-12-11 13:24:44 +05:30
parent 35fc81f123
commit edbdce13c0
4 changed files with 9 additions and 9 deletions

View File

@ -31,7 +31,7 @@ class BooksModel extends Model
{ {
$builder = $this->builder(); $builder = $this->builder();
$builder->select('books.book_id, books.title, books.price, books.duration, books.isactive, books.publisher, books.genre, books.language, books.publication_date, GROUP_CONCAT(category.name SEPARATOR \',\') as name'); $builder->select('books.book_id, books.title, books.price, books.duration, books.isactive, books.publisher, books.genre, books.language, books.publication_date, GROUP_CONCAT(category.name SEPARATOR \',\') as name');
$builder->join('book_categories', 'book_categories.book_id = books.book_id', 'left'); $builder->join('book_categories', 'book_categories.book_id = books.book_id and book_categories.isactive = 1', 'left');
$builder->join('category', 'category.id = book_categories.category_id', 'left'); $builder->join('category', 'category.id = book_categories.category_id', 'left');
$builder->where('books.business_id', $business_id); $builder->where('books.business_id', $business_id);
$builder->where('category.name !=', 'membership'); // Exclude books with the category name "membership" $builder->where('category.name !=', 'membership'); // Exclude books with the category name "membership"

View File

@ -82,7 +82,7 @@
<label for="invoiceDate">Invoice Date<span class="text-danger"> *</span></label> <label for="invoiceDate">Invoice Date<span class="text-danger"> *</span></label>
<input type="date" class="form-control" id="invoiceDate" name="invoice_date" value="<?= isset($invoice_details['invoice_date']) ? $invoice_details['invoice_date'] : '' ?>" required> <input type="date" class="form-control" id="invoiceDate" name="invoice_date" value="<?= isset($invoice_details['invoice_date']) ? $invoice_details['invoice_date'] : '' ?>" required>
</div> </div>
<?php if ($invoice_type === '1') : ?> <?php if ($invoice_type === '2') : ?>
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="fromsubcription">From Subcription<span class="text-danger"> *</span></label> <label for="fromsubcription">From Subcription<span class="text-danger"> *</span></label>
<input type="date" class="form-control" id="fromsubcription" name="from_subscription" value="<?= isset($invoice_item_details[0]['from_subscription']) ? $invoice_item_details[0]['from_subscription'] : '' ?>" required onchange="updateToDateMinDate(this.value)"> <input type="date" class="form-control" id="fromsubcription" name="from_subscription" value="<?= isset($invoice_item_details[0]['from_subscription']) ? $invoice_item_details[0]['from_subscription'] : '' ?>" required onchange="updateToDateMinDate(this.value)">
@ -182,7 +182,7 @@
</tbody> </tbody>
</table> </table>
<div class="form-group text-right m-b-0"> <div class="form-group text-right m-b-0">
<?php if ($invoice_type !== '1') : ?> <?php if ($invoice_type !== '2') : ?>
<!-- Show the "Add More Item" button only if invoice_type is not 1 --> <!-- Show the "Add More Item" button only if invoice_type is not 1 -->
<a class="btn" id="addItem"> <a class="btn" id="addItem">
<h4><i class="fa fa-plus" aria-hidden="true"></i> Add More Item</h4> <h4><i class="fa fa-plus" aria-hidden="true"></i> Add More Item</h4>

View File

@ -65,7 +65,7 @@
</thead> </thead>
<tbody> <tbody>
<?php foreach ($invoice as $row) : <?php foreach ($invoice as $row) :
if ($row['invoice_type'] == 2) : // Check if it's a subscription invoice if ($row['invoice_type'] == 1) : // Check if it's a subscription invoice
$invoice_date = date('d/m/Y', strtotime($row['invoice_date'])); $invoice_date = date('d/m/Y', strtotime($row['invoice_date']));
?> ?>
<tr> <tr>
@ -77,9 +77,9 @@
<td><?= "".$row['total_amount']; ?></td> <td><?= "".$row['total_amount']; ?></td>
<td> <td>
<!-- <a href="<?= base_url() . "approve_invoice/" . $row['invoice_id']; ?>" class="approve-button" title="Approve the Invoice"><i class="ri-checkbox-circle-fill"></i></a>&nbsp; --> <!-- <a href="<?= base_url() . "approve_invoice/" . $row['invoice_id']; ?>" class="approve-button" title="Approve the Invoice"><i class="ri-checkbox-circle-fill"></i></a>&nbsp; -->
<?php if ($row['invoice_type'] == 1) : ?> <?php if ($row['invoice_type'] == 2) : ?>
<a href="<?= base_url() . "new_subscription_invoice/" . $row['invoice_id']; ?>" class="edit-button" title="Edit the Invoice"><i class="ri-pencil-line" title="Edit the Invoice"></i></a>&nbsp; <a href="<?= base_url() . "new_subscription_invoice/" . $row['invoice_id']; ?>" class="edit-button" title="Edit the Invoice"><i class="ri-pencil-line" title="Edit the Invoice"></i></a>&nbsp;
<?php elseif ($row['invoice_type'] == 2) : ?> <?php elseif ($row['invoice_type'] == 1) : ?>
<a href="<?= base_url() . "new_book_invoice/" . $row['invoice_id']; ?>" class="edit-button" title="Edit the Invoice"><i class="ri-pencil-line" title="Edit the Invoice"></i></a>&nbsp; <a href="<?= base_url() . "new_book_invoice/" . $row['invoice_id']; ?>" class="edit-button" title="Edit the Invoice"><i class="ri-pencil-line" title="Edit the Invoice"></i></a>&nbsp;
<?php endif; ?> <?php endif; ?>

View File

@ -28,7 +28,7 @@
<tbody> <tbody>
<?php <?php
foreach ($invoice as $row) : foreach ($invoice as $row) :
if ($row['invoice_type'] == 1) : if ($row['invoice_type'] == 2) :
$invoice_date = date('d/m/Y', strtotime($row['invoice_date'])); $invoice_date = date('d/m/Y', strtotime($row['invoice_date']));
?> ?>
<tr> <tr>
@ -43,9 +43,9 @@
<td><?= "" . $row['total_amount']; ?></td> <td><?= "" . $row['total_amount']; ?></td>
<td> <td>
<!-- <a href="<?= base_url() . "approve_invoice/" . $row['invoice_id']; ?>" class="approve-button" title="Approve the Invoice"><i class="ri-checkbox-circle-fill"></i></a>&nbsp; --> <!-- <a href="<?= base_url() . "approve_invoice/" . $row['invoice_id']; ?>" class="approve-button" title="Approve the Invoice"><i class="ri-checkbox-circle-fill"></i></a>&nbsp; -->
<?php if ($row['invoice_type'] == 1) : ?> <?php if ($row['invoice_type'] == 2) : ?>
<a href="<?= base_url() . "new_subscription_invoice/" . $row['invoice_id']; ?>" class="edit-button" title="Edit the Invoice"><i class="ri-pencil-line" title="Edit the Invoice"></i></a>&nbsp; <a href="<?= base_url() . "new_subscription_invoice/" . $row['invoice_id']; ?>" class="edit-button" title="Edit the Invoice"><i class="ri-pencil-line" title="Edit the Invoice"></i></a>&nbsp;
<?php elseif ($row['invoice_type'] == 2) : ?> <?php elseif ($row['invoice_type'] == 1) : ?>
<a href="<?= base_url() . "new_book_invoice/" . $row['invoice_id']; ?>" class="edit-button" title="Edit the Invoice"><i class="ri-pencil-line" title="Edit the Invoice"></i></a>&nbsp; <a href="<?= base_url() . "new_book_invoice/" . $row['invoice_id']; ?>" class="edit-button" title="Edit the Invoice"><i class="ri-pencil-line" title="Edit the Invoice"></i></a>&nbsp;
<?php endif; ?> <?php endif; ?>