本文整理汇总了C#中Samba.Domain.Models.Tickets.Order.GetTotal方法的典型用法代码示例。如果您正苦于以下问题:C# Order.GetTotal方法的具体用法?C# Order.GetTotal怎么用?C# Order.GetTotal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Samba.Domain.Models.Tickets.Order
的用法示例。
在下文中一共展示了Order.GetTotal方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CalculateOrderTotal
public static decimal CalculateOrderTotal(Ticket ticket, Order order)
{
var discount = ticket.GetPreTaxServicesTotal();
if (discount != 0)
{
var tsum = ticket.GetPlainSum();
var rate = tsum > 0 ? (discount * 100) / tsum : 100;
var tiTotal = order.GetTotal();
var itemDiscount = (tiTotal * rate) / 100;
return tiTotal + itemDiscount;
}
return order.GetTotal();
}
示例2: GetTaxExcludedSum
public decimal GetTaxExcludedSum(Order order)
{
var plainSum = order.GetTotal();
var services = CalculateServices(Calculations.Where(x => !x.IncludeTax), plainSum);
var tax = TaxIncluded ? order.GetTotalTaxAmount(TaxIncluded, plainSum, services) : 0;
return plainSum - tax;
}
示例3: GetTaxExcludedSum
public decimal GetTaxExcludedSum(Order order)
{
var tax = TaxIncluded ? order.GetTotalTaxAmount(TaxIncluded, GetPlainSum(), GetPreTaxServicesTotal()) : 0;
return order.GetTotal() - tax;
}
示例4: ReplaceLineVars
private static string ReplaceLineVars(string line, Order order)
{
string result = line;
if (order != null)
{
result = FormatData(result, TagNames.Quantity, () => order.Quantity.ToString("#,#0.##"));
result = FormatData(result, TagNames.Name, () => order.MenuItemName + order.GetPortionDesc());
result = FormatData(result, TagNames.Price, () => order.Price.ToString("#,#0.00"));
result = FormatData(result, TagNames.Total, () => order.GetItemPrice().ToString("#,#0.00"));
result = FormatData(result, TagNames.TotalAmount, () => order.GetItemValue().ToString("#,#0.00"));
result = FormatData(result, TagNames.Cents, () => (order.Price * 100).ToString("#,##"));
result = FormatData(result, TagNames.LineAmount, () => order.GetTotal().ToString("#,#0.00"));
result = FormatData(result, TagNames.OrderNo, () => order.OrderNumber.ToString());
result = FormatData(result, TagNames.PriceTag, () => order.PriceTag);
result = _settingReplacer.ReplaceSettingValue("{SETTING:([^}]+)}", result);
if (result.Contains(TagNames.Properties.Substring(0, TagNames.Properties.Length - 1)))
{
string lineFormat = result;
if (order.OrderTagValues.Count > 0)
{
string label = "";
foreach (var property in order.OrderTagValues)
{
var itemProperty = property;
var lineValue = FormatData(lineFormat, TagNames.Properties, () => itemProperty.Name);
lineValue = FormatData(lineValue, TagNames.PropQuantity, () => itemProperty.Quantity.ToString("#.##"));
lineValue = FormatData(lineValue, TagNames.PropPrice, () => itemProperty.AddTagPriceToOrderPrice ? "" : itemProperty.Price.ToString("#,#0.00"));
label += lineValue + "\r\n";
}
result = "\r\n" + label;
}
else result = "";
}
result = result.Replace("<", "\r\n<");
}
return result;
}