decimal price bug solved

This commit is contained in:
hysn99
2024-04-26 15:01:18 +03:00
parent 1f0a844fba
commit 0f51cd2848
2 changed files with 24 additions and 4 deletions

View File

@@ -6,6 +6,7 @@ import (
"bordrobot/lib/run"
"fmt"
"log/slog"
"strings"
"github.com/shopspring/decimal"
"github.com/wailsapp/wails/v3/pkg/application"
@@ -115,9 +116,9 @@ func (s *Srv) Rpa(companyID float64, month float64, year float64, devMode bool)
b.ClosingBrowserFromExternalLink()
return nil
}
if rows[0][0] == "" {
rows = rows[1:]
}
// if rows[0][0] == "" {
// rows = rows[1:]
// }
var lastItem bool = false
// data := make([]*model.Bordro, 0) // []*Bordro türünde bir dilim oluştur
for i := 1; i < len(rows); i++ {
@@ -134,6 +135,13 @@ func (s *Srv) Rpa(companyID float64, month float64, year float64, devMode bool)
key := rows[0][ndx]
brd.Ucretler[key], err = decimal.NewFromString(col)
if err != nil {
if strings.Contains(col, ",") {
col = strings.Replace(col, ",", "", -1)
brd.Ucretler[key], err = decimal.NewFromString(col)
if err != nil {
fmt.Print(err)
}
}
// emitLog(`excel okunurken sorun oluştu`)
fmt.Println(err)
}