Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VAT calculation and rounding #1992

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ publish/

# NuGet Packages Directory
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
#packages/
packages/

# Windows Azure Build Output
csx
Expand Down
1,431 changes: 722 additions & 709 deletions src/Libraries/Nop.Core/Domain/Catalog/Product.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,14 @@ public class ProductEditorSettings : ISettings
/// </summary>
public bool IsGiftCard { get; set; }

/// <summary>
/// Gets or sets a value indicating whether 'reward points' section is shown
/// </summary>
public bool IsRewardPoints { get; set; }
/// <summary>
/// Gets or sets a value indicating whether 'Downloadable product' field is shown
/// </summary>

public bool DownloadableProduct { get; set; }

/// <summary>
Expand Down
129 changes: 73 additions & 56 deletions src/Libraries/Nop.Core/Domain/Customers/RewardPointsHistory.cs
Original file line number Diff line number Diff line change
@@ -1,56 +1,73 @@
using System;
using Nop.Core.Domain.Orders;

namespace Nop.Core.Domain.Customers
{
/// <summary>
/// Represents a reward point history entry
/// </summary>
public partial class RewardPointsHistory : BaseEntity
{
/// <summary>
/// Gets or sets the customer identifier
/// </summary>
public int CustomerId { get; set; }

/// <summary>
/// Gets or sets the store identifier in which these reward points were awarded or redeemed
/// </summary>
public int StoreId { get; set; }

/// <summary>
/// Gets or sets the points redeemed/added
/// </summary>
public int Points { get; set; }

/// <summary>
/// Gets or sets the points balance
/// </summary>
public int? PointsBalance { get; set; }

/// <summary>
/// Gets or sets the used amount
/// </summary>
public decimal UsedAmount { get; set; }

/// <summary>
/// Gets or sets the message
/// </summary>
public string Message { get; set; }

/// <summary>
/// Gets or sets the date and time of instance creation
/// </summary>
public DateTime CreatedOnUtc { get; set; }

/// <summary>
/// Gets or sets the order for which points were redeemed as a payment (spent by a customer when placing this order)
/// </summary>
public virtual Order UsedWithOrder { get; set; }

/// <summary>
/// Gets or sets the customer
/// </summary>
public virtual Customer Customer { get; set; }
}
}
using System;
using Nop.Core.Domain.Orders;

namespace Nop.Core.Domain.Customers
{
/// <summary>
/// Represents a reward point history entry
/// </summary>
public partial class RewardPointsHistory : BaseEntity
{
/// <summary>
/// Gets or sets the customer identifier
/// </summary>
public int CustomerId { get; set; }

/// <summary>
/// Gets or sets the store identifier in which these reward points were awarded or redeemed
/// </summary>
public int StoreId { get; set; }

/// <summary>
/// Gets or sets the points redeemed/added
/// </summary>
public int Points { get; set; }
/// <summary>
/// Gets or sets the purchased points redeemed/added
/// </summary>
public int PointsPurchased { get; set; }
/// <summary>
/// Gets or sets the points balance
/// </summary>
public int? PointsBalance { get; set; }
/// <summary>
/// Gets or sets the purchased points balance
/// </summary>
public int? PointsBalancePurchased { get; set; }
/// <summary>
/// Gets or sets the used amount. Opposite sign as respective points!
/// </summary>
public decimal UsedAmount { get; set; }
/// <summary>
/// Gets or sets the used purchased amount. Opposite sign as respective points!
/// </summary>
public decimal UsedAmountPurchased { get; set; }
/// <summary>
/// Gets or sets the message
/// </summary>
public string Message { get; set; }

/// <summary>
/// Gets or sets the date and time of instance creation
/// </summary>
public DateTime CreatedOnUtc { get; set; }

/// <summary>
/// Gets or sets the order for which points were redeemed as a payment (spent by a customer when placing this order)
/// </summary>
public virtual Order UsedWithOrder { get; set; }

/// <summary>
/// Gets or sets the customer
/// </summary>
public virtual Customer Customer { get; set; }
/// <summary>
/// Gets or sets the associated order item identifier
/// </summary>
public int? PurchasedWithOrderItemId { get; set; }
/// <summary>
/// Gets or sets the associated order item
/// </summary>
public virtual OrderItem PurchasedWithOrderItem { get; set; }
}
}
148 changes: 87 additions & 61 deletions src/Libraries/Nop.Core/Domain/Customers/RewardPointsSettings.cs
Original file line number Diff line number Diff line change
@@ -1,62 +1,88 @@
using Nop.Core.Configuration;

namespace Nop.Core.Domain.Customers
{
public class RewardPointsSettings : ISettings
{
/// <summary>
/// Gets or sets a value indicating whether Reward Points Program is enabled
/// </summary>
public bool Enabled { get; set; }

/// <summary>
/// Gets or sets a value of Reward Points exchange rate
/// </summary>
public decimal ExchangeRate { get; set; }

/// <summary>
/// Gets or sets the minimum reward points to use
/// </summary>
public int MinimumRewardPointsToUse { get; set; }

/// <summary>
/// Gets or sets a number of points awarded for registration
/// </summary>
public int PointsForRegistration { get; set; }

/// <summary>
/// Gets or sets a number of points awarded for purchases (amount in primary store currency)
/// </summary>
public decimal PointsForPurchases_Amount { get; set; }

/// <summary>
/// Gets or sets a number of points awarded for purchases
/// </summary>
public int PointsForPurchases_Points { get; set; }

/// <summary>
/// Gets or sets a delay before activation points
/// </summary>
public int ActivationDelay { get; set; }

/// <summary>
/// Gets or sets the period of activation delay
/// </summary>
public int ActivationDelayPeriodId { get; set; }

/// <summary>
/// Gets or sets a value indicating whether "You will earn" message should be displayed
/// </summary>
public bool DisplayHowMuchWillBeEarned { get; set; }

/// <summary>
/// Gets or sets a value indicating whether all reward points are accumulated in one balance for all stores and they can be used in any store. Otherwise, each store has its own rewards points and they can only be used in that store.
/// </summary>
public bool PointsAccumulatedForAllStores { get; set; }

/// <summary>
/// Gets or sets the page size is for history of reward points on my account page
/// </summary>
public int PageSize { get; set; }
}
using Nop.Core.Configuration;

namespace Nop.Core.Domain.Customers
{
public class RewardPointsSettings : ISettings
{
/// <summary>
/// Gets or sets a value indicating whether Reward Points Program is enabled
/// </summary>
public bool Enabled { get; set; }

/// <summary>
/// Gets or sets a value of Reward Points exchange rate
/// </summary>
public decimal ExchangeRate { get; set; }

/// <summary>
/// Gets or sets the minimum reward points to use
/// </summary>
public int MinimumRewardPointsToUse { get; set; }

/// <summary>
/// Gets or sets a number of points awarded for registration
/// </summary>
public int PointsForRegistration { get; set; }

/// <summary>
/// Gets or sets a number of points awarded for purchases (amount in primary store currency)
/// </summary>
public decimal PointsForPurchases_Amount { get; set; }

/// <summary>
/// Gets or sets a number of points awarded for purchases
/// </summary>
public int PointsForPurchases_Points { get; set; }

/// <summary>
/// Gets or sets a delay before activation points
/// </summary>
public int ActivationDelay { get; set; }

/// <summary>
/// Gets or sets the period of activation delay
/// </summary>
public int ActivationDelayPeriodId { get; set; }

/// <summary>
/// Gets or sets a value indicating whether "You will earn" message should be displayed
/// </summary>
public bool DisplayHowMuchWillBeEarned { get; set; }

/// <summary>
/// Gets or sets a value indicating whether all reward points are accumulated in one balance for all stores and they can be used in any store. Otherwise, each store has its own rewards points and they can only be used in that store.
/// </summary>
public bool PointsAccumulatedForAllStores { get; set; }

/// <summary>
/// Gets or sets the page size is for history of reward points on my account page
/// </summary>
public int PageSize { get; set; }

/// <summary>
/// Gets or sets a value indicating whether earned reward points are taxable
/// </summary>
public bool EarnedRewardPointsAreTaxable { get; set; }
/// <summary>
/// Gets or sets a value indicating whether reward points can be earned on shipping
/// </summary>
public bool AwardPointsIncludeShipping { get; set; }
/// <summary>
/// Gets or sets a value indicating whether reward points can be earned on payment fee
/// </summary>
public bool AwardPointsIncludePaymentMethodAdditionalFee { get; set; }
/// <summary>
/// Gets or sets a value indicating whether giftcards applied to payment amount should be excluded for reward points calculation
/// </summary>
public bool AwardPointsExcludeGiftCard { get; set; }
/// <summary>
/// Gets or sets a value indicating whether purchased reward points applied to payment amount should be excluded for reward points calculation
/// </summary>
public bool AwardPointsExcludePurchasedRewardPoints { get; set; }
/// <summary>
/// Gets or sets a value indicating whether reward points can only be earned when using purchased reward points for payment
/// </summary>
public bool EarnRewardPointsOnlyWhenUsingPurchasedRewardPoints { get; set; }

}
}
Loading