当前位置: 首页>>代码示例>>C#>>正文


C# Order.GetTotal方法代码示例

本文整理汇总了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();
 }
开发者ID:betology,项目名称:SambaPOS-3,代码行数:13,代码来源:MenuGroupBuilder.cs

示例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;
 }
开发者ID:roniwahyu,项目名称:SambaPOS-3,代码行数:7,代码来源:Ticket.cs

示例3: GetTaxExcludedSum

 public decimal GetTaxExcludedSum(Order order)
 {
     var tax = TaxIncluded ? order.GetTotalTaxAmount(TaxIncluded, GetPlainSum(), GetPreTaxServicesTotal()) : 0;
     return order.GetTotal() - tax;
 }
开发者ID:BOBAHbI4,项目名称:SambaPOS-3,代码行数:5,代码来源:Ticket.cs

示例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;
        }
开发者ID:betology,项目名称:SambaPOS-3,代码行数:39,代码来源:TicketFormatter.cs


注:本文中的Samba.Domain.Models.Tickets.Order.GetTotal方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。