Index: llyStocked/src/main/java/com/bazi/fullystocked/Controller/HomeController.java
===================================================================
--- FullyStocked/src/main/java/com/bazi/fullystocked/Controller/HomeController.java	(revision e278ff894cd227f8877b2c3c6ab48a7cef81450c)
+++ 	(revision )
@@ -1,18 +1,0 @@
-package com.bazi.fullystocked.Controller;
-
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-@Controller
-@RequestMapping(value = {"/","/home"})
-public class HomeController {
-    @GetMapping
-    public String getHomePage()
-    {
-        return "home";
-    }
-
-
-}
Index: llyStocked/src/main/java/com/bazi/fullystocked/Controller/LogOutController.java
===================================================================
--- FullyStocked/src/main/java/com/bazi/fullystocked/Controller/LogOutController.java	(revision e278ff894cd227f8877b2c3c6ab48a7cef81450c)
+++ 	(revision )
@@ -1,18 +1,0 @@
-package com.bazi.fullystocked.Controller;
-
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import javax.servlet.http.HttpServletRequest;
-
-@Controller
-@RequestMapping("/logout")
-public class LogOutController {
-    @GetMapping
-    public String loguot(HttpServletRequest request)
-    {
-        request.getSession().invalidate();
-        return "redirect:/login";
-    }
-}
Index: llyStocked/src/main/java/com/bazi/fullystocked/Controller/LoginController.java
===================================================================
--- FullyStocked/src/main/java/com/bazi/fullystocked/Controller/LoginController.java	(revision e278ff894cd227f8877b2c3c6ab48a7cef81450c)
+++ 	(revision )
@@ -1,69 +1,0 @@
-package com.bazi.fullystocked.Controller;
-
-import com.bazi.fullystocked.Models.Exceptions.InvalidUserCredentialsException;
-import com.bazi.fullystocked.Models.Managers;
-import com.bazi.fullystocked.Models.Suppliers;
-import com.bazi.fullystocked.Models.User;
-import com.bazi.fullystocked.Models.Workers;
-import com.bazi.fullystocked.Services.AuthService;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import javax.servlet.http.HttpServletRequest;
-
-@Controller
-@RequestMapping("/login")
-public class LoginController {
-
-
-    private final AuthService authService;
-
-    public LoginController(AuthService authService) {
-        this.authService = authService;
-    }
-
-    @GetMapping
-    public String getLoginPage(Model m) {
-        m.addAttribute("bodycontent","login");
-
-        return "/login";
-    }
-
-    @PostMapping
-    public String login(HttpServletRequest request, Model model) {
-        User user = null;
-        try {
-            user = this.authService.login(request.getParameter("username"),
-                    request.getParameter("password"));
-            if (user instanceof Workers) {
-                Workers w= (Workers) user;
-                request.getSession().setAttribute("user", w);
-                request.getSession().setAttribute("location",w.getLocation().getLocationname()+" "+w.getLocation().getCity());
-                return "redirect:/worker";
-            } else if (user instanceof Managers) {
-                Managers m= (Managers) user;
-                request.getSession().setAttribute("user", m);
-                return "redirect:/manager";
-            }
-            else if(user instanceof Suppliers)
-            {
-                Suppliers s= (Suppliers) user;
-                request.getSession().setAttribute("user", s);
-                request.getSession().setAttribute("info",s.getSupplierinfo());
-                request.getSession().setAttribute("number",s.getPhone());
-                request.getSession().setAttribute("location",s.getStreet()+" бр."+ s.getStreetnumber()+", "+s.getCity());
-                return "redirect:/supplier";
-            }
-            return "redirect:/home";
-        }
-        catch (InvalidUserCredentialsException exception) {
-            model.addAttribute("hasError", true);
-            model.addAttribute("error", exception.getMessage());
-
-            return "login";
-        }
-    }
-}
Index: llyStocked/src/main/java/com/bazi/fullystocked/Controller/ManagerController.java
===================================================================
--- FullyStocked/src/main/java/com/bazi/fullystocked/Controller/ManagerController.java	(revision e278ff894cd227f8877b2c3c6ab48a7cef81450c)
+++ 	(revision )
@@ -1,16 +1,0 @@
-package com.bazi.fullystocked.Controller;
-
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-@Controller
-@RequestMapping(value ="/manager")
-public class ManagerController {
-    @GetMapping
-    public String getManagerPage()
-    {
-
-        return "homeManager";
-    }
-}
Index: llyStocked/src/main/java/com/bazi/fullystocked/Controller/RegisterController.java
===================================================================
--- FullyStocked/src/main/java/com/bazi/fullystocked/Controller/RegisterController.java	(revision e278ff894cd227f8877b2c3c6ab48a7cef81450c)
+++ 	(revision )
@@ -1,76 +1,0 @@
-package com.bazi.fullystocked.Controller;
-
-import com.bazi.fullystocked.Models.Exceptions.InvalidArgumentsException;
-import com.bazi.fullystocked.Models.Exceptions.UsernameAlreadyExistsException;
-import com.bazi.fullystocked.Models.User;
-import com.bazi.fullystocked.Services.AuthService;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-
-import javax.servlet.http.HttpServletRequest;
-
-@Controller
-@RequestMapping("/register")
-public class RegisterController {
-    private final AuthService authService;
-
-    public RegisterController( AuthService authService) {
-        this.authService = authService;
-    }
-    @GetMapping
-    public String getRegisterPage(@RequestParam(required = false) String error, Model model)
-    {
-        return "register";
-    }
-    @PostMapping
-    public String register(@RequestParam String ime,
-                           @RequestParam String prezime,
-                           @RequestParam String username,
-                           @RequestParam String email
-            , @RequestParam String password
-            , @RequestParam String role, HttpServletRequest request) {
-        try {
-            if (role.equals("menadzer")) {
-                authService.registerManager(ime, prezime, username, email, password);
-            } else if (role.equals("magacioner")) {
-                authService.registerWorker(ime, prezime, username, email, password);
-            } else if (role.equals("dobavuvac")) {
-                User u = new User(ime, prezime, username, email, password);
-                request.getSession().setAttribute("user", u);
-                return "redirect:/register/registerSupplier";
-            }
-            return "redirect:/login";
-        }
-        catch (UsernameAlreadyExistsException | InvalidArgumentsException exception)
-        {
-            return "redirect:/register?error="+exception.getMessage();
-        }
-    }
-    @GetMapping("/registerSupplier")
-    public String getRegisterSupplier(@RequestParam(required = false) String error, Model model)
-    {
-        return "registerSupplier";
-    }
-    @PostMapping("/registerSupplier")
-    public String registerSupplier(@RequestParam String sinfo,
-                                   @RequestParam String phone,
-                                   @RequestParam String street,
-                                   @RequestParam String broj,
-                                   @RequestParam String grad,HttpServletRequest request)
-    {
-        try {
-            User u = (User) request.getSession().getAttribute("user");
-            authService.registerSupplier(u.getFirstname(), u.getLastname(), u.getUsername(), u.getEmail(), u.getUserpassword(), sinfo, phone, street, Integer.parseInt(broj), grad);
-            request.getSession().invalidate();
-            return "redirect:/login";
-        }
-        catch (UsernameAlreadyExistsException | InvalidArgumentsException exception)
-        {
-            return "redirect:/register?error="+exception.getMessage();
-        }
-    }
-}
Index: llyStocked/src/main/java/com/bazi/fullystocked/Controller/SupplierController.java
===================================================================
--- FullyStocked/src/main/java/com/bazi/fullystocked/Controller/SupplierController.java	(revision e278ff894cd227f8877b2c3c6ab48a7cef81450c)
+++ 	(revision )
@@ -1,16 +1,0 @@
-package com.bazi.fullystocked.Controller;
-
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-@Controller
-@RequestMapping(value ="/supplier")
-public class SupplierController {
-    @GetMapping
-    public String getSupplierPage()
-    {
-
-        return "homeSupplier";
-    }
-}
Index: llyStocked/src/main/java/com/bazi/fullystocked/Controller/WorkerController.java
===================================================================
--- FullyStocked/src/main/java/com/bazi/fullystocked/Controller/WorkerController.java	(revision e278ff894cd227f8877b2c3c6ab48a7cef81450c)
+++ 	(revision )
@@ -1,52 +1,0 @@
-package com.bazi.fullystocked.Controller;
-
-import com.bazi.fullystocked.Models.SqlViews.ArticlesReport;
-import com.bazi.fullystocked.Models.StoredArticles;
-import com.bazi.fullystocked.Models.User;
-import com.bazi.fullystocked.Models.Workers;
-import com.bazi.fullystocked.Services.StoredArticlesService;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import javax.servlet.http.HttpServletRequest;
-import java.util.List;
-import java.util.Optional;
-
-@Controller
-@RequestMapping(value ="/worker")
-public class WorkerController {
-   private final StoredArticlesService storedArticlesService;
-
-    public WorkerController(StoredArticlesService storedArticlesService) {
-        this.storedArticlesService = storedArticlesService;
-    }
-
-    @GetMapping
-    public String getWorkerPage()
-    {
-
-        return "homeWorker";
-    }
-    @GetMapping("/articles")
-    public String getArticles(HttpServletRequest request, Model model)
-    {
-        Workers u= (Workers) request.getSession().getAttribute("user");
-        List<ArticlesReport> articlesReport=storedArticlesService.findByLocation(u.getLocation().getLocationid());
-        model.addAttribute("articles",articlesReport);
-        return "articles";
-    }
-    @GetMapping("/articles/details/{id}")
-    public String getDetails(@PathVariable Integer id,Model model)
-    {
-        if(this.storedArticlesService.findById(id).isPresent())
-        {
-            ArticlesReport articlesReport=this.storedArticlesService.findById(id).get();
-            model.addAttribute("article",articlesReport);
-            return "detailsArticle";
-        }
-        return "redirect:/articles?error=ArticleNotFound";
-    }
-}
Index: FullyStocked/src/main/java/com/bazi/fullystocked/Services/Implementations/InvoicesServiceImpl.java
===================================================================
--- FullyStocked/src/main/java/com/bazi/fullystocked/Services/Implementations/InvoicesServiceImpl.java	(revision e278ff894cd227f8877b2c3c6ab48a7cef81450c)
+++ FullyStocked/src/main/java/com/bazi/fullystocked/Services/Implementations/InvoicesServiceImpl.java	(revision 497d1291ce2544d5bd75549d5adaa45c875c717c)
@@ -58,4 +58,5 @@
             throw new ArticleNotAvailableException();
         }
+        storedArticle.setQuantity(storedArticle.getQuantity()-quantity);
         InvoicedArticles invoicedArticles=new InvoicedArticles(price, quantity, invoice, article);
         invoicedArticlesRepository.save(invoicedArticles);
@@ -63,3 +64,8 @@
         return Optional.of(invoicesRepository.save(invoice));
     }
+
+    @Override
+    public Optional<Invoices> findById(Integer id) {
+        return invoicesRepository.findById(id);
+    }
 }
Index: FullyStocked/src/main/java/com/bazi/fullystocked/Services/InvoicesService.java
===================================================================
--- FullyStocked/src/main/java/com/bazi/fullystocked/Services/InvoicesService.java	(revision e278ff894cd227f8877b2c3c6ab48a7cef81450c)
+++ FullyStocked/src/main/java/com/bazi/fullystocked/Services/InvoicesService.java	(revision 497d1291ce2544d5bd75549d5adaa45c875c717c)
@@ -9,3 +9,4 @@
     Optional<Invoices> create(Integer workerId);
     Optional<Invoices> addArticleToInvoice(Integer invoiceId, Integer articleId, int price, int quantity);
+    Optional<Invoices> findById(Integer id);
 }
Index: FullyStocked/src/main/java/com/bazi/fullystocked/Web/Controller/HomeController.java
===================================================================
--- FullyStocked/src/main/java/com/bazi/fullystocked/Web/Controller/HomeController.java	(revision 497d1291ce2544d5bd75549d5adaa45c875c717c)
+++ FullyStocked/src/main/java/com/bazi/fullystocked/Web/Controller/HomeController.java	(revision 497d1291ce2544d5bd75549d5adaa45c875c717c)
@@ -0,0 +1,18 @@
+package com.bazi.fullystocked.Web.Controller;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+@Controller
+@RequestMapping(value = {"/","/home"})
+public class HomeController {
+    @GetMapping
+    public String getHomePage()
+    {
+        return "home";
+    }
+
+
+}
Index: FullyStocked/src/main/java/com/bazi/fullystocked/Web/Controller/InvoiceController.java
===================================================================
--- FullyStocked/src/main/java/com/bazi/fullystocked/Web/Controller/InvoiceController.java	(revision 497d1291ce2544d5bd75549d5adaa45c875c717c)
+++ FullyStocked/src/main/java/com/bazi/fullystocked/Web/Controller/InvoiceController.java	(revision 497d1291ce2544d5bd75549d5adaa45c875c717c)
@@ -0,0 +1,126 @@
+package com.bazi.fullystocked.Web.Controller;
+
+import com.bazi.fullystocked.Models.Exceptions.InvalidArgumentsException;
+import com.bazi.fullystocked.Models.Invoices;
+import com.bazi.fullystocked.Models.SqlViews.ArticlesReport;
+import com.bazi.fullystocked.Models.Workers;
+import com.bazi.fullystocked.Services.InvoicesService;
+import com.bazi.fullystocked.Services.StoredArticlesService;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+
+@Controller
+@RequestMapping(value ="/invoices")
+public class InvoiceController {
+    private final InvoicesService invoicesService;
+    private final StoredArticlesService storedArticlesService;
+
+    public InvoiceController(InvoicesService invoicesService, StoredArticlesService storedArticlesService) {
+        this.invoicesService = invoicesService;
+        this.storedArticlesService = storedArticlesService;
+    }
+
+    @GetMapping("/create")
+    public String createInvoice()
+    {
+        return "createInv";
+    }
+    @PostMapping("/create")
+    public String createInvoice(@RequestParam(required = false) String cname,
+                                @RequestParam(required = false) String phone,
+                                @RequestParam(required = false) String city,
+                                @RequestParam(required = false) String street,
+                                @RequestParam(required = false) int num, HttpServletRequest request, Model model)
+    {
+        Invoices inv=null;
+        Workers u=null;
+        try
+        {
+            u= (Workers) request.getSession().getAttribute("user");
+            if(cname==null || cname.isEmpty())
+            {
+                inv=invoicesService.create(u.getUserid()).orElseThrow();
+            }
+            else
+            {
+                inv = invoicesService.create(cname, phone, street, num, city, u.getUserid()).orElseThrow();
+            }
+        }
+        catch (Exception e)
+        {
+            return "redirect:/invoices/create?error="+e.getMessage();
+        }
+        model.addAttribute("invId", inv.getInvoiceid());
+        model.addAttribute("articles", storedArticlesService.findByLocation(u.getLocation().getLocationid()));
+        return "selectInvArticle";
+    }
+
+    @PostMapping("/articles/select")
+    public String getDetails(@RequestParam int invoiceId, @RequestParam int articleId, Model model)
+    {
+        if(invoicesService.findById(invoiceId).isEmpty())
+        {
+            return "redirect:/create";
+        }
+        try{
+            model.addAttribute("invId", invoiceId);
+            ArticlesReport articlesReport=this.storedArticlesService.findById(articleId).orElseThrow(InvalidArgumentsException::new);
+            model.addAttribute("article",articlesReport);
+            return "addInvoiceArticle";
+        }
+        catch(Exception e)
+        {
+            return "redirect:/invoices/backToList/"+invoiceId+"?"+e.getMessage();
+        }
+    }
+    @PostMapping("/articles/add")
+    public String getDetails(@RequestParam int invoiceId, @RequestParam int articleId, @RequestParam int quantity, @RequestParam int price, HttpServletRequest request, Model model)
+    {
+        if(invoicesService.findById(invoiceId).isEmpty())
+        {
+            return "redirect:/invoices/create";
+        }
+        try
+        {
+            Workers u= (Workers) request.getSession().getAttribute("user");
+            invoicesService.addArticleToInvoice(invoiceId, articleId, price, quantity);
+            model.addAttribute("invId", invoiceId);
+            model.addAttribute("articles", storedArticlesService.findByLocation(u.getLocation().getLocationid()));
+            return "selectInvArticle";
+        }
+        catch(Exception e)
+        {
+            return "redirect:/invoices/backToList/"+invoiceId+"?"+e.getMessage();
+        }
+    }
+
+    @GetMapping("/backToList/{invoiceId}")
+    public String backToList(@PathVariable int invoiceId, HttpServletRequest request, Model model, @RequestParam(required = false) String error)
+    {
+        Workers u=null;
+        try
+        {
+            u=(Workers) request.getSession().getAttribute("user");
+        }
+        catch (Exception e)
+        {
+            return "redirect:/login";
+        }
+        if(invoicesService.findById(invoiceId).isEmpty())
+        {
+            return "redirect:/invoices/create";
+        }
+        Invoices inv=invoicesService.findById(invoiceId).get();
+        if(!inv.getWorker().getUserid().equals(u.getUserid()))
+        {
+            return "redirect:/login";
+
+        }
+        model.addAttribute("invId", invoiceId);
+        model.addAttribute("articles", storedArticlesService.findByLocation(u.getLocation().getLocationid()));
+        return "selectInvArticle";
+    }
+}
Index: FullyStocked/src/main/java/com/bazi/fullystocked/Web/Controller/LogOutController.java
===================================================================
--- FullyStocked/src/main/java/com/bazi/fullystocked/Web/Controller/LogOutController.java	(revision 497d1291ce2544d5bd75549d5adaa45c875c717c)
+++ FullyStocked/src/main/java/com/bazi/fullystocked/Web/Controller/LogOutController.java	(revision 497d1291ce2544d5bd75549d5adaa45c875c717c)
@@ -0,0 +1,18 @@
+package com.bazi.fullystocked.Web.Controller;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import javax.servlet.http.HttpServletRequest;
+
+@Controller
+@RequestMapping("/logout")
+public class LogOutController {
+    @GetMapping
+    public String loguot(HttpServletRequest request)
+    {
+        request.getSession().invalidate();
+        return "redirect:/login";
+    }
+}
Index: FullyStocked/src/main/java/com/bazi/fullystocked/Web/Controller/LoginController.java
===================================================================
--- FullyStocked/src/main/java/com/bazi/fullystocked/Web/Controller/LoginController.java	(revision 497d1291ce2544d5bd75549d5adaa45c875c717c)
+++ FullyStocked/src/main/java/com/bazi/fullystocked/Web/Controller/LoginController.java	(revision 497d1291ce2544d5bd75549d5adaa45c875c717c)
@@ -0,0 +1,69 @@
+package com.bazi.fullystocked.Web.Controller;
+
+import com.bazi.fullystocked.Models.Exceptions.InvalidUserCredentialsException;
+import com.bazi.fullystocked.Models.Managers;
+import com.bazi.fullystocked.Models.Suppliers;
+import com.bazi.fullystocked.Models.User;
+import com.bazi.fullystocked.Models.Workers;
+import com.bazi.fullystocked.Services.AuthService;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import javax.servlet.http.HttpServletRequest;
+
+@Controller
+@RequestMapping("/login")
+public class LoginController {
+
+
+    private final AuthService authService;
+
+    public LoginController(AuthService authService) {
+        this.authService = authService;
+    }
+
+    @GetMapping
+    public String getLoginPage(Model m) {
+        m.addAttribute("bodycontent","login");
+
+        return "/login";
+    }
+
+    @PostMapping
+    public String login(HttpServletRequest request, Model model) {
+        User user = null;
+        try {
+            user = this.authService.login(request.getParameter("username"),
+                    request.getParameter("password"));
+            if (user instanceof Workers) {
+                Workers w= (Workers) user;
+                request.getSession().setAttribute("user", w);
+                request.getSession().setAttribute("location",w.getLocation().getLocationname()+" "+w.getLocation().getCity());
+                return "redirect:/worker";
+            } else if (user instanceof Managers) {
+                Managers m= (Managers) user;
+                request.getSession().setAttribute("user", m);
+                return "redirect:/manager";
+            }
+            else if(user instanceof Suppliers)
+            {
+                Suppliers s= (Suppliers) user;
+                request.getSession().setAttribute("user", s);
+                request.getSession().setAttribute("info",s.getSupplierinfo());
+                request.getSession().setAttribute("number",s.getPhone());
+                request.getSession().setAttribute("location",s.getStreet()+" бр."+ s.getStreetnumber()+", "+s.getCity());
+                return "redirect:/supplier";
+            }
+            return "redirect:/home";
+        }
+        catch (Exception exception) {
+            model.addAttribute("hasError", true);
+            model.addAttribute("error", exception.getMessage());
+
+            return "login";
+        }
+    }
+}
Index: FullyStocked/src/main/java/com/bazi/fullystocked/Web/Controller/ManagerController.java
===================================================================
--- FullyStocked/src/main/java/com/bazi/fullystocked/Web/Controller/ManagerController.java	(revision 497d1291ce2544d5bd75549d5adaa45c875c717c)
+++ FullyStocked/src/main/java/com/bazi/fullystocked/Web/Controller/ManagerController.java	(revision 497d1291ce2544d5bd75549d5adaa45c875c717c)
@@ -0,0 +1,16 @@
+package com.bazi.fullystocked.Web.Controller;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+@Controller
+@RequestMapping(value ="/manager")
+public class ManagerController {
+    @GetMapping
+    public String getManagerPage()
+    {
+
+        return "homeManager";
+    }
+}
Index: FullyStocked/src/main/java/com/bazi/fullystocked/Web/Controller/RegisterController.java
===================================================================
--- FullyStocked/src/main/java/com/bazi/fullystocked/Web/Controller/RegisterController.java	(revision 497d1291ce2544d5bd75549d5adaa45c875c717c)
+++ FullyStocked/src/main/java/com/bazi/fullystocked/Web/Controller/RegisterController.java	(revision 497d1291ce2544d5bd75549d5adaa45c875c717c)
@@ -0,0 +1,76 @@
+package com.bazi.fullystocked.Web.Controller;
+
+import com.bazi.fullystocked.Models.Exceptions.InvalidArgumentsException;
+import com.bazi.fullystocked.Models.Exceptions.UsernameAlreadyExistsException;
+import com.bazi.fullystocked.Models.User;
+import com.bazi.fullystocked.Services.AuthService;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import javax.servlet.http.HttpServletRequest;
+
+@Controller
+@RequestMapping("/register")
+public class RegisterController {
+    private final AuthService authService;
+
+    public RegisterController( AuthService authService) {
+        this.authService = authService;
+    }
+    @GetMapping
+    public String getRegisterPage(@RequestParam(required = false) String error, Model model)
+    {
+        return "register";
+    }
+    @PostMapping
+    public String register(@RequestParam String ime,
+                           @RequestParam String prezime,
+                           @RequestParam String username,
+                           @RequestParam String email
+            , @RequestParam String password
+            , @RequestParam String role, HttpServletRequest request) {
+        try {
+            if (role.equals("menadzer")) {
+                authService.registerManager(ime, prezime, username, email, password);
+            } else if (role.equals("magacioner")) {
+                authService.registerWorker(ime, prezime, username, email, password);
+            } else if (role.equals("dobavuvac")) {
+                User u = new User(ime, prezime, username, email, password);
+                request.getSession().setAttribute("user", u);
+                return "redirect:/register/registerSupplier";
+            }
+            return "redirect:/login";
+        }
+        catch (UsernameAlreadyExistsException | InvalidArgumentsException exception)
+        {
+            return "redirect:/register?error="+exception.getMessage();
+        }
+    }
+    @GetMapping("/registerSupplier")
+    public String getRegisterSupplier(@RequestParam(required = false) String error, Model model)
+    {
+        return "registerSupplier";
+    }
+    @PostMapping("/registerSupplier")
+    public String registerSupplier(@RequestParam String sinfo,
+                                   @RequestParam String phone,
+                                   @RequestParam String street,
+                                   @RequestParam String broj,
+                                   @RequestParam String grad,HttpServletRequest request)
+    {
+        try {
+            User u = (User) request.getSession().getAttribute("user");
+            authService.registerSupplier(u.getFirstname(), u.getLastname(), u.getUsername(), u.getEmail(), u.getUserpassword(), sinfo, phone, street, Integer.parseInt(broj), grad);
+            request.getSession().invalidate();
+            return "redirect:/login";
+        }
+        catch (UsernameAlreadyExistsException | InvalidArgumentsException exception)
+        {
+            return "redirect:/register?error="+exception.getMessage();
+        }
+    }
+}
Index: FullyStocked/src/main/java/com/bazi/fullystocked/Web/Controller/SupplierController.java
===================================================================
--- FullyStocked/src/main/java/com/bazi/fullystocked/Web/Controller/SupplierController.java	(revision 497d1291ce2544d5bd75549d5adaa45c875c717c)
+++ FullyStocked/src/main/java/com/bazi/fullystocked/Web/Controller/SupplierController.java	(revision 497d1291ce2544d5bd75549d5adaa45c875c717c)
@@ -0,0 +1,16 @@
+package com.bazi.fullystocked.Web.Controller;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+@Controller
+@RequestMapping(value ="/supplier")
+public class SupplierController {
+    @GetMapping
+    public String getSupplierPage()
+    {
+
+        return "homeSupplier";
+    }
+}
Index: FullyStocked/src/main/java/com/bazi/fullystocked/Web/Controller/WorkerController.java
===================================================================
--- FullyStocked/src/main/java/com/bazi/fullystocked/Web/Controller/WorkerController.java	(revision 497d1291ce2544d5bd75549d5adaa45c875c717c)
+++ FullyStocked/src/main/java/com/bazi/fullystocked/Web/Controller/WorkerController.java	(revision 497d1291ce2544d5bd75549d5adaa45c875c717c)
@@ -0,0 +1,52 @@
+package com.bazi.fullystocked.Web.Controller;
+
+import com.bazi.fullystocked.Models.SqlViews.ArticlesReport;
+import com.bazi.fullystocked.Models.StoredArticles;
+import com.bazi.fullystocked.Models.User;
+import com.bazi.fullystocked.Models.Workers;
+import com.bazi.fullystocked.Services.StoredArticlesService;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.List;
+import java.util.Optional;
+
+@Controller
+@RequestMapping(value ="/worker")
+public class WorkerController {
+   private final StoredArticlesService storedArticlesService;
+
+    public WorkerController(StoredArticlesService storedArticlesService) {
+        this.storedArticlesService = storedArticlesService;
+    }
+
+    @GetMapping
+    public String getWorkerPage()
+    {
+
+        return "homeWorker";
+    }
+    @GetMapping("/articles")
+    public String getArticles(HttpServletRequest request, Model model)
+    {
+        Workers u= (Workers) request.getSession().getAttribute("user");
+        List<ArticlesReport> articlesReport=storedArticlesService.findByLocation(u.getLocation().getLocationid());
+        model.addAttribute("articles",articlesReport);
+        return "articles";
+    }
+    @GetMapping("/articles/details/{id}")
+    public String getDetails(@PathVariable Integer id,Model model)
+    {
+        if(this.storedArticlesService.findById(id).isPresent())
+        {
+            ArticlesReport articlesReport=this.storedArticlesService.findById(id).get();
+            model.addAttribute("article",articlesReport);
+            return "detailsArticle";
+        }
+        return "redirect:/worker/articles?error=ArticleNotFound";
+    }
+}
Index: FullyStocked/src/main/resources/templates/addInvoiceArticle.html
===================================================================
--- FullyStocked/src/main/resources/templates/addInvoiceArticle.html	(revision 497d1291ce2544d5bd75549d5adaa45c875c717c)
+++ FullyStocked/src/main/resources/templates/addInvoiceArticle.html	(revision 497d1291ce2544d5bd75549d5adaa45c875c717c)
@@ -0,0 +1,96 @@
+<!DOCTYPE html>
+<html lang="en">
+<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
+
+<head>
+    <meta charset="UTF-8">
+    <title>Details</title>
+</head>
+<body>
+<nav class="navbar navbar-expand-md navbar-dark bg-dark">
+    <div class="container">
+        <a class="navbar-brand" href="/homeWorker">FULLYSTOCKED</a>
+        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault"
+                aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
+            <span class="navbar-toggler-icon"></span>
+        </button>
+
+        <div class="collapse navbar-collapse justify-content-end" id="navbarsExampleDefault">
+            <ul class="navbar-nav m-auto">
+                <li class="nav-item m-auto">
+                    <a class="nav-link active" href="#">Преглед на магацинот</a>
+                </li>
+                <li class="nav-item m-auto">
+                    <a class="nav-link active" href="#">Постави прашање</a>
+                </li>
+                <li class="nav-item m-auto">
+                    <a class="nav-link active" href="#">Погледни одговори</a>
+                </li>
+                <li class="nav-item m-auto">
+                    <a class="nav-link active" href="#">Креирај фактура</a>
+                </li>
+            </ul>
+
+            <ul class="nav navbar-nav navbar-right">
+
+                <li class="nav-item">
+                    <a class="btn btn-light btn-sm ml-3" href="/logout">
+                        <i class="fa fa-shopping-cart"></i> Logout
+                    </a>
+                </li>
+            </ul>
+        </div>
+    </div>
+</nav>
+<div class="container mt-2">
+    <div class="row">
+        <div class="col-md-5">
+            <div class="project-info-box mt-0">
+                <h5 th:text="${article.getArticlename()}"></h5>
+                <p class="mb-0" th:text="${article.getDescription()}"></p>
+                <hr>
+            </div><!-- / project-info-box -->
+
+            <div class="project-info-box">
+                <p><b>Локација: </b><span th:text="${article.getLocationname()}"></span></p>
+                <p><b>Количина: </b><span th:text="${article.getQuantity()}"></span></p>
+            </div><!-- / project-info-box -->
+
+            <div class="project-info-box mt-0 mb-0">
+                <p class="mb-0">
+                <form action="/invoices/articles/add" method="POST">
+                    <div class="input-group input-group-sm mb-3">
+                        <div class="input-group-prepend">
+                            <span class="input-group-text inputGroup-sizing-sm">Количина</span>
+                        </div>
+                        <input type="text" name="quantity" class="form-control" aria-label="Small" aria-describedby="inputGroup-sizing-sm">
+                    </div>
+                    <div class="input-group input-group-sm mb-3">
+                        <div class="input-group-prepend">
+                            <span class="input-group-text inputGroup-sizing-sm">Цена</span>
+                        </div>
+                        <input type="text" name="price" class="form-control" aria-label="Small" aria-describedby="inputGroup-sizing-sm">
+                    </div>
+                    <input type="hidden" name="invoiceId" th:value="${invId}">
+                    <input type="hidden" name="articleId" th:value="${article.getArticleid()}">
+                    <button class="btn btn-primary" >Додади</button>
+                </form>
+                </p>
+            </div>
+
+            <div class="project-info-box mt-0 mb-0">
+                <p class="mb-0">
+                    <form th:action="@{'/invoices/backToList/{invoiceId}' (invoiceId=${invId})}" method="GET">
+                        <button class="btn btn-primary" >Назад</button>
+                    </form>
+                </p>
+            </div><!-- / project-info-box -->
+        </div><!-- / column -->
+
+        <div class="col-md-7 mt-3">
+            <img th:src="${article.getImageurl()}" alt="project-image" class="rounded img-fluid">
+        </div>
+    </div>
+</div>
+</body>
+</html>
Index: FullyStocked/src/main/resources/templates/createInv.html
===================================================================
--- FullyStocked/src/main/resources/templates/createInv.html	(revision 497d1291ce2544d5bd75549d5adaa45c875c717c)
+++ FullyStocked/src/main/resources/templates/createInv.html	(revision 497d1291ce2544d5bd75549d5adaa45c875c717c)
@@ -0,0 +1,96 @@
+<!DOCTYPE html>
+<html lang="en" xmlns:sec="http://www.w3.org/1999/xhtml">
+<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
+
+<head>
+    <meta charset="UTF-8">
+    <title>Title</title>
+</head>
+<body>
+<nav class="navbar navbar-expand-md navbar-dark bg-dark">
+    <div class="container">
+        <a class="navbar-brand" href="/homeWorker">FULLYSTOCKED</a>
+        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault"
+                aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
+            <span class="navbar-toggler-icon"></span>
+        </button>
+
+        <div class="collapse navbar-collapse justify-content-end" id="navbarsExampleDefault">
+            <ul class="navbar-nav m-auto">
+                <li class="nav-item m-auto">
+                    <a class="nav-link active" href="#">Преглед на магацинот</a>
+                </li>
+                <li class="nav-item m-auto">
+                    <a class="nav-link active" href="#">Постави прашање</a>
+                </li>
+                <li class="nav-item m-auto">
+                    <a class="nav-link active" href="#">Погледни одговори</a>
+                </li>
+                <li class="nav-item m-auto">
+                    <a class="nav-link active" href="#">Креирај фактура</a>
+                </li>
+            </ul>
+
+            <ul class="nav navbar-nav navbar-right">
+
+                <li class="nav-item">
+                    <a class="btn btn-light btn-sm ml-3" href="/logout">
+                        <i class="fa fa-shopping-cart"></i> Logout
+                    </a>
+                </li>
+            </ul>
+        </div>
+    </div>
+</nav>
+<div class="text-center">
+    <h2 class="m-2">Креирај фактура</h2>
+    <h3 class="m-2">Инфо за клиент</h3>
+</div>
+<form method="POST" action="/invoices/create">
+    <div class="mt-4">
+        <div class="form-group row">
+            <div class="col-md-3"></div>
+            <label for="cname" class="col-form-label col-md-2 font-weight-bold text-left">Име</label>
+            <div class="col-md-4">
+                <input type="text" name="cname" id="cname" class="form-control">
+            </div>
+        </div>
+        <div class="form-group row">
+            <div class="col-md-3"></div>
+            <label for="phone" class="col-form-label col-md-2 font-weight-bold text-left">Телефонски број</label>
+            <div class="col-md-4">
+                <input type="text" name="phone" id="phone" class="form-control">
+            </div>
+        </div>
+        <div class="form-group row">
+            <div class="col-md-3"></div>
+            <label for="city" class="col-form-label col-md-2 font-weight-bold text-left">Град</label>
+            <div class="col-md-4">
+                <input type="text" name="city" id="city" class="form-control">
+            </div>
+        </div>
+        <div class="form-group row">
+            <div class="col-md-3"></div>
+            <label for="street" class="col-form-label col-md-2 font-weight-bold text-left">Улица</label>
+            <div class="col-md-4">
+                <input type="text" name="street" id="street" class="form-control">
+            </div>
+        </div>
+        <div class="form-group row">
+            <div class="col-md-3"></div>
+            <label for="num" class="col-form-label col-md-2 font-weight-bold text-left">Број</label>
+            <div class="col-md-4">
+                <input type="number" name="num" id="num" class="form-control">
+            </div>
+        </div>
+        <div class="row mt-4">
+            <div class="col-md-3">
+            </div>
+            <div class="col-md-6">
+                <input type="submit" value="Креирај" class="btn btn-default w-100" />
+            </div>
+        </div>
+    </div>
+</form>
+</body>
+</html>
Index: FullyStocked/src/main/resources/templates/selectInvArticle.html
===================================================================
--- FullyStocked/src/main/resources/templates/selectInvArticle.html	(revision 497d1291ce2544d5bd75549d5adaa45c875c717c)
+++ FullyStocked/src/main/resources/templates/selectInvArticle.html	(revision 497d1291ce2544d5bd75549d5adaa45c875c717c)
@@ -0,0 +1,104 @@
+<!DOCTYPE html>
+<html lang="en" xmlns:sec="http://www.w3.org/1999/xhtml">
+<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
+
+<head>
+    <meta charset="UTF-8">
+    <title>Title</title>
+</head>
+<body>
+<nav class="navbar navbar-expand-md navbar-dark bg-dark">
+    <div class="container">
+        <a class="navbar-brand" href="/homeWorker">FULLYSTOCKED</a>
+        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault"
+                aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
+            <span class="navbar-toggler-icon"></span>
+        </button>
+
+        <div class="collapse navbar-collapse justify-content-end" id="navbarsExampleDefault">
+            <ul class="navbar-nav m-auto">
+                <li class="nav-item m-auto">
+                    <a class="nav-link active" href="#">Преглед на магацинот</a>
+                </li>
+                <li class="nav-item m-auto">
+                    <a class="nav-link active" href="#">Постави прашање</a>
+                </li>
+                <li class="nav-item m-auto">
+                    <a class="nav-link active" href="#">Погледни одговори</a>
+                </li>
+                <li class="nav-item m-auto">
+                    <a class="nav-link active" href="#">Креирај фактура</a>
+                </li>
+            </ul>
+
+            <ul class="nav navbar-nav navbar-right">
+
+                <li class="nav-item">
+                    <a class="btn btn-light btn-sm ml-3" href="/logout">
+                        <i class="fa fa-shopping-cart"></i> Logout
+                    </a>
+                </li>
+            </ul>
+        </div>
+    </div>
+</nav>
+<div class="d-flex justify-content-center">
+    <h2 class="m-2">Избери артикл</h2>
+</div>
+<table class="table">
+    <thead>
+    <tr>
+        <th>
+            Слика
+        </th>
+        <th>
+            Име
+        </th>
+        <th>
+            Достапна количина
+        </th>
+        <th>
+
+        </th>
+    </tr>
+    </thead>
+    <tbody>
+    <tr th:each="article : ${articles}">
+
+        <td>
+            <img style="width:300px; max-height:200px " th:src="${article.getImageurl()}">
+        </td>
+        <td th:text="${article.getArticlename()}" class="link">
+        </td>
+        <td th:text="${article.getQuantity()}" class="link1">
+        </td>
+
+        <td>
+            <form  action="/invoices/articles/select" method="POST">
+                <input type="hidden" name="invoiceId" th:value="${invId}">
+                <input type="hidden" name="articleId" th:value="${article.getSarticleid()}">
+                <input type="submit" class="btn btn-primary" value="Додади во фактура">
+            </form>
+
+        </td>
+
+    </tr>
+    </tbody>
+
+</table>
+<style>
+    .link {
+        font-size: 20px;
+    }
+
+    .link1 {
+        font-size: 18px;
+    }
+
+    th {
+        font-size: 16px;
+    }
+
+</style>
+</body>
+</html>
