Skip to content

Commit

Permalink
fix: tva on restock
Browse files Browse the repository at this point in the history
  • Loading branch information
yyewolf committed Dec 14, 2023
1 parent 94ab140 commit 3bad69c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions backend/api/restock.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package api

import (
"bar/autogen"
"bar/autogen"https://github.com/CETEN-OpenBar/bar/edit/main/backend/api/restock.go
"bar/internal/models"
"math"
"time"

"github.com/google/uuid"
Expand Down Expand Up @@ -99,7 +100,7 @@ func (s *Server) CreateRestock(c echo.Context) error {

item.AmountLeft += restockItem.AmountOfBundle * restockItem.AmountPerBundle
item.LastTva = &restockItem.Tva
item.Prices.Coutant = uint64((10000.0+float64(restockItem.Tva)) * float64(restockItem.BundleCostHt) / (10000.0 * float64(restockItem.AmountPerBundle)))
item.Prices.Coutant = uint64(math.Ceil((10000.0+float64(restockItem.Tva)) * float64(restockItem.BundleCostHt) / (10000.0 * float64(restockItem.AmountPerBundle))))

err = s.DBackend.UpdateItem(c.Request().Context(), item)
if err != nil {
Expand Down

0 comments on commit 3bad69c

Please sign in to comment.