Skip to content

Commit

Permalink
Bump github.com/shopspring/decimal from 1.3.1 to 1.4.0 (#292)
Browse files Browse the repository at this point in the history
* Bump github.com/shopspring/decimal from 1.3.1 to 1.4.0

Bumps [github.com/shopspring/decimal](https://github.com/shopspring/decimal) from 1.3.1 to 1.4.0.
- [Release notes](https://github.com/shopspring/decimal/releases)
- [Changelog](https://github.com/shopspring/decimal/blob/master/CHANGELOG.md)
- [Commits](shopspring/decimal@v1.3.1...v1.4.0)

---
updated-dependencies:
- dependency-name: github.com/shopspring/decimal
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* replace `decimal.Equals` with `decimal.Equal`

fixes #295

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: konstantin <[email protected]>
  • Loading branch information
dependabot[bot] and hf-kklein authored May 2, 2024
1 parent b4ab156 commit 768d819
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions bo/rechnung.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func RechnungStructLevelValidationGesamtNetto(sl validator.StructLevel) {
}
expectedGesamtNetto.Wert = expectedGesamtNetto.Wert.Add(rp.TeilsummeNetto.Wert)
}
if expectedGesamtNetto.Waehrung != rechnung.GesamtNetto.Waehrung || !expectedGesamtNetto.Wert.Equals(rechnung.GesamtNetto.Wert) {
if expectedGesamtNetto.Waehrung != rechnung.GesamtNetto.Waehrung || !expectedGesamtNetto.Wert.Equal(rechnung.GesamtNetto.Wert) {
sl.ReportError(rechnung.GesamtNetto, "Wert", "GesamtNetto", "GesamtNetto==sum(TeilsummeNetto)", "")
}
}
Expand All @@ -98,7 +98,7 @@ func RechnungStructLevelValidationZuZahlen(sl validator.StructLevel) {
}
expectedZuZahlen.Wert = expectedZuZahlen.Wert.Sub(rechnung.RabattBrutto.Wert)
}
if expectedZuZahlen.Waehrung != rechnung.Zuzahlen.Waehrung || !expectedZuZahlen.Wert.Equals(rechnung.Zuzahlen.Wert) {
if expectedZuZahlen.Waehrung != rechnung.Zuzahlen.Waehrung || !expectedZuZahlen.Wert.Equal(rechnung.Zuzahlen.Wert) {
sl.ReportError(rechnung.Zuzahlen, "Wert", "Zuzahlen", "Zuzahlen==GesamtBrutto-Rechnung.Vorausgezahlt-Rechnung.RabattBrutto", "")
}
}
Expand All @@ -122,7 +122,7 @@ func RechnungStructLevelValidationGesamtBrutto(sl validator.StructLevel) {
}
expectedGesamtBrutto.Wert = expectedGesamtBrutto.Wert.Add(rp.TeilsummeSteuer.Basiswert).Add(rp.TeilsummeSteuer.Steuerwert)
}
if expectedGesamtBrutto.Waehrung != rechnung.GesamtBrutto.Waehrung || !expectedGesamtBrutto.Wert.Equals(rechnung.GesamtBrutto.Wert) {
if expectedGesamtBrutto.Waehrung != rechnung.GesamtBrutto.Waehrung || !expectedGesamtBrutto.Wert.Equal(rechnung.GesamtBrutto.Wert) {
sl.ReportError(rechnung.GesamtBrutto, "Wert", "GesamtBrutto", "GesamtBrutto==sum(TeilsummeSteuer)", "")
}
}
Expand All @@ -148,7 +148,7 @@ func RechnungStructLevelValidationGesamtSteuer(sl validator.StructLevel) {
}
expectedGesamtSteuer.Wert = expectedGesamtSteuer.Wert.Add(sb.Steuerwert)
}
if expectedGesamtSteuer.Waehrung != rechnung.GesamtSteuer.Waehrung || !expectedGesamtSteuer.Wert.Equals(rechnung.GesamtSteuer.Wert) {
if expectedGesamtSteuer.Waehrung != rechnung.GesamtSteuer.Waehrung || !expectedGesamtSteuer.Wert.Equal(rechnung.GesamtSteuer.Wert) {
sl.ReportError(rechnung.GesamtSteuer, "Wert", "GesamtSteuer", "GesamtSteuer==sum(Steuerbetraege)", "")
}
}
Expand Down
2 changes: 1 addition & 1 deletion com/rechnungsposition.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func RechnungspositionStructLevelValidation(sl validator.StructLevel) {
// todo: write a bo4e modification proposal: https://github.com/Hochfrequenz/bo4e-modification-proposals/issues/7
return
}
if !expectedTeilsummeNetto.Wert.Equals(rp.TeilsummeNetto.Wert) {
if !expectedTeilsummeNetto.Wert.Equal(rp.TeilsummeNetto.Wert) {
sl.ReportError(rp.TeilsummeNetto.Wert, "Wert", "TeilsummeNetto", "TeilsummeNetto.Wert==Einzelpreis*Positionsmenge", "")
}
}
2 changes: 1 addition & 1 deletion com/steuerbetrag.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func SteuerbetragStructLevelValidation(sl validator.StructLevel) {
err := fmt.Errorf("Validation of Steuerkennzeichen %v is not implemented", steuerbetrag.Steuerkennzeichen)
panic(err)
}
if !expectedSteuerwert.Equals(steuerbetrag.Steuerwert) {
if !expectedSteuerwert.Equal(steuerbetrag.Steuerwert) {
sl.ReportError(steuerbetrag.Steuerwert, "Steuerwert", "Steuerwert", "Steuerwert=Basiswert*Steuerkennzeichen", "")
}
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.20
require (
github.com/corbym/gocrest v1.1.1
github.com/go-playground/validator/v10 v10.20.0
github.com/shopspring/decimal v1.3.1
github.com/shopspring/decimal v1.4.0
)

require (
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ github.com/go-playground/validator/v10 v10.20.0/go.mod h1:dbuPbCMFw/DrkbEynArYaC
github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8=
github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k=
github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA=
golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
Expand Down

0 comments on commit 768d819

Please sign in to comment.