Home Free Projects Inventory Management System using Spring boot

Inventory Management System using Spring boot

14 min read
0
0
6,897

The Icecream shop pos system is developed using Spring boot. The project is built to manage sales and transactions. To make a new transaction, fields such as: Ice cream type and Drink type, qty needs to be selected. If you like to learn point of sales systems step by step, this is the right place to learn from the beginning. In this tutorial useful for making a point of sales system for a small shops.

The system shall be able to select the relevant Ice cream type and Drink type.

First Step Create the Spring boot you have to go the website start.spring.io  

above the image shown how to add the dependencies and create project.

after created the project you have to import in to the eclipse.

First step have to create the view page. go to the src/main/resources Folder
expand it you wil have a folder named templates  inside the folder you will have to create the index.html.
after created the page you have to paste the code inside the page.  you can download images folder and component folder  here  files

<html>
<head>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>

</head>
<body>

<nav class="navbar navbar-dark bg-dark">

    <span class="navbar-brand mb-0 h1">ICECREAM SHOP POS</span>


</nav>

<div class="row">

    <div class="col-sm-3">

        <div class="container">
            <div class="list-group-item list-group-item-action active">Item</div>


        <div class="panel-body bg-dark" style="color: white">
            
            <form id="frm-project">
                <div class="form-group">

                    <div>
                        <img src="images/chocolate-ice.jpg" id="Chocolate" class="photo" width="100" height="100" data-toggle="modal" data-target="#exampleModal">
                            <b>Chocolate</b>
                    </div>


                    <div>
                        <img src="images/mango.jpg" id="Mango" class="photo" width="100" height="100" data-toggle="modal" data-target="#exampleModal">
                        <b>Mango</b>
                    </div>

                    <div>
                        <img src="images/venila.jpg" id="Venila" class="photo" width="100" height="100" data-toggle="modal" data-target="#exampleModal">
                        <b>Venila</b>
                    </div>

                    <div>
                        <img src="images/sww.jpg" id="Strawberry" class="photo" width="100" height="100" data-toggle="modal" data-target="#exampleModal">
                        <b>Strawberry</b>
                    </div>

                    <div>
                        <img src="images/mixfruit.jpg" id="MixFruit" class="photo" width="100" height="100" data-toggle="modal" data-target="#exampleModal">
                        <b>MixFruit</b>
                    </div>
                </div>
            </form>
        </div>
        </div>
    </div>

    <div class="col-sm-6">
        <div class="container">
            <div class="list-group-item list-group-item-action active">AddProducts</div>
            <table id="tbl-item" class="table table-dark table-bordered" cellpadding="0" cellspacing="0" width="100%" align="center">
                <thead>

                <tr>
                    <th>Delete</th>
                    <th>Item</th>
                    <th>Price</th>
                    <th>Qty</th>
                    <th>Total</th>
                </tr>

                <tbody>

                </tbody>

            </table>
        </div>
    </div>

    <div class="col-sm-3">
        <div class="list-group-item list-group-item-action active">Bill</div>
        <div>
            <label>Total</label>
            <input type="text" style="color: yellow; background: black; font-size: 30px;" id="total" name="total" placeholder="Total" required>
        </div>
        </br>

        <div>
            <input type="button" class="btn btn-warning" value="reset" name="reset" id="reset">
        </div>

    </div>

</div>


<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="exampleModalLabel">Qty</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <div>
                    <input type="number" style="color: yellow; background: black; font-size: 30px;" id="qty" name="qty" placeholder="Qty" required>
                </div>
            </div>




            <div class="modal-footer">
                <input type="button" class="btn btn-info" value="Add" name="add" id="add" onclick="add()">


            </div>
        </div>
    </div>
</div>

<script src="component/jquery/jquery.js"></script>
<script src="component/jquery/jquery.min.js"></script>

<script type="text/javascript">

    var total = 0;
    var tot = 0;

    var item = null;
    var price = 0;


    var a = "";

    $("img").on("click",function()
        {

            a = $(this).prop('id')

        });


    function add()
    {
        if(a == "Chocolate")
        {

            item = "Chocolate";
            price = 32;


        }
        else if(a == "Mango")
        {
            item = "Mango";
            price = 35;

        }
        else if(a == "Venila")
        {
            item = "Venila";
            price = 40;

        }
        else if(a == "Strawberry")
        {
            item = "Strawberry";
            price = 45;

        }

        else if(a == "MixFruit")
        {
            item = "Strawberry";
            price = 35;

        }

        var qty = $('#qty').val();
        tot = qty * price;

        var table1 =

            "<tr>" +
            "<td><button type='button' name='record' class='btn btn-warning' onclick='deleterow(this)'>Delete</td>" +
            "<td>" + item    +  "</td>" +
            "<td>" + price    +  "</td>" +

            "<td>" + qty    +  "</td>" +

            "<td>" + tot    +  "</td>" +

            "</tr>" ;


        total += Number(tot);
        $('#total').val(total);


        $("table tbody").append(table1);
        $("exampleModal").modal('toggle');
        $('#qty').val("1");




    }

    function deleterow(e)
    {
        total_cost = parseInt($(e).parent().parent().find('td:last').text(),10);
        total -= total_cost;
        $('#total').val(total);
        $(e).parent().parent().remove();



    }



    $('#reset').click(function()
    {
        location.reload();
    });

</script>

</body>

</html>

After done the view part let moving to Controller part.

Controller

lets select the project folder and right click new->package->com.example.IceCreamInventory. IceController and type package name like this. after created the package inside the package have create controller IceController.java

Inside the page you have add it

@Controller
public class IceInventory 
{	
	@RequestMapping(value = "/index", method = RequestMethod.GET)
	   public String index() 
           {
	      return "index";
	   }
}

above code shown when you run the page it will be calling the  index action method.

After go to the src/main/resources Folder  expand it  you will have file application.properties
paste the below code

spring.jpa.hibernate.ddl-auto=none
spring.datasource.driver-class-name=com.mysql.jdbc.Driver

server.port=9070

above code shown only set the port of Spring boot Application.

After go to main page of  Spring boot Application above @SpringBootApplication Annotation paste the @EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})

@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})
@SpringBootApplication
public class IceCreamInventoryApplication {

	public static void main(String[] args) {
		SpringApplication.run(IceCreamInventoryApplication.class, args);
	}

i have attached the video link below. which will do this tutorials step by step.

 

 

 

 

 

 

 

 

 

 

Load More Related Articles
Load More By admin
Load More In Free Projects

Leave a Reply

Your email address will not be published. Required fields are marked *

Check Also

Build Crud App with Laravel 11 and Vue.js

In this tutorial will teach Vue Laravel 10 CRUD using Vite step by step. Laravel  10 CRUD …