Versions in this module Expand all Collapse all v0 v0.0.3 Mar 13, 2024 Changes in this version + const ChargeTypeGiftCard + const ChargeTypeMain + const RoundingModeCeil + const RoundingModeFloor + const RoundingModeHalfDown + const RoundingModeHalfUp + type Charge struct + Price Price + Reference string + Type string + Value Price + func (p Charge) Add(add Charge) (Charge, error) + func (p Charge) GetPayable() Charge + func (p Charge) Mul(qty int) Charge + type ChargeQualifier struct + Reference string + Type string + type Charges struct + func NewCharges(chargesByType map[string]Charge) *Charges + func (c Charges) Add(toadd Charges) Charges + func (c Charges) AddCharge(toadd Charge) Charges + func (c Charges) GetAllByType(ctype string) map[ChargeQualifier]Charge + func (c Charges) GetAllCharges() map[ChargeQualifier]Charge + func (c Charges) GetByChargeQualifier(qualifier ChargeQualifier) (Charge, bool) + func (c Charges) GetByChargeQualifierForced(qualifier ChargeQualifier) Charge + func (c Charges) GetByType(ctype string) (Charge, bool) + func (c Charges) GetByTypeForced(ctype string) Charge + func (c Charges) HasChargeQualifier(qualifier ChargeQualifier) bool + func (c Charges) HasType(ctype string) bool + func (c Charges) Items() []Charge + func (c Charges) Mul(qty int) Charges + type Price struct + func NewFromBigFloat(amount big.Float, currency string) Price + func NewFromFloat(amount float64, currency string) Price + func NewFromInt(amount int64, precision int, currency string) Price + func NewZero(currency string) Price + func SumAll(prices ...Price) (Price, error) + func (p *Price) UnmarshalBinary(data []byte) error + func (p *Price) UnmarshalJSON(data []byte) error + func (p Price) Add(add Price) (Price, error) + func (p Price) Amount() *big.Float + func (p Price) Clone() Price + func (p Price) Currency() string + func (p Price) Discounted(percent float64) Price + func (p Price) Divided(qty int) Price + func (p Price) Equal(cmp Price) bool + func (p Price) FloatAmount() float64 + func (p Price) ForceAdd(add Price) Price + func (p Price) GetPayable() Price + func (p Price) GetPayableByRoundingMode(mode string, precision int) Price + func (p Price) Inverse() Price + func (p Price) IsGreaterThen(cmp Price) bool + func (p Price) IsGreaterThenValue(amount big.Float) bool + func (p Price) IsLessThen(cmp Price) bool + func (p Price) IsLessThenValue(amount big.Float) bool + func (p Price) IsNegative() bool + func (p Price) IsPayable() bool + func (p Price) IsPositive() bool + func (p Price) IsZero() bool + func (p Price) LikelyEqual(cmp Price) bool + func (p Price) MarshalBinary() (data []byte, err error) + func (p Price) MarshalJSON() (data []byte, err error) + func (p Price) Multiply(qty int) Price + func (p Price) SplitInPayables(count int) ([]Price, error) + func (p Price) Sub(sub Price) (Price, error) + func (p Price) TaxFromGross(percent big.Float) Price + func (p Price) TaxFromNet(percent big.Float) Price + func (p Price) Taxed(percent big.Float) Price