public SimplePrice(SimplePrice previous) { _localization = previous._localization; _source = previous._source; _vat = previous._vat; _discount = previous._discount; _ranged = previous._ranged; }
public SimplePrice(IAmountUnit source, ILocalization localization) { if (localization == null) throw new ArgumentNullException("lo"); //_ranged = true; _source = source; _localization = localization; _discount = YesNoDifference.Yes; }
public SimplePrice(IAmountUnit source, ILocalization localization) { if (localization == null) { throw new ArgumentNullException("lo"); } //_ranged = true; _source = source; _localization = localization; _discount = YesNoDifference.Yes; }
internal int Amount(YesNoDifference discount, YesNoDifference vatVal, IAmountUnit source, bool ranged) { if (discount == YesNoDifference.Difference) { var inclVat = vatVal != YesNoDifference.No; return source.GetAmount(inclVat, false, ranged) - _source.GetAmount(inclVat, true, ranged); } var discounted = discount == YesNoDifference.Yes; if (vatVal == YesNoDifference.Difference) { return source.GetAmount(true, discounted, ranged) - _source.GetAmount(false, discounted, ranged); } var vat = vatVal == YesNoDifference.Yes; return source.GetAmount(vat, discounted, ranged); }
internal int Amount(YesNoDifference discount, YesNoDifference vatVal, IAmountUnit source, bool ranged) { if (discount == YesNoDifference.Difference) { var inclVat = vatVal != YesNoDifference.No; return(source.GetAmount(inclVat, false, ranged) - _source.GetAmount(inclVat, true, ranged)); } var discounted = discount == YesNoDifference.Yes; if (vatVal == YesNoDifference.Difference) { return(source.GetAmount(true, discounted, ranged) - _source.GetAmount(false, discounted, ranged)); } var vat = vatVal == YesNoDifference.Yes; return(source.GetAmount(vat, discounted, ranged)); }