예제 #1
0
        /// <summary>
        ///     添加发票行
        /// </summary>
        /// <param name="itemName">项名称</param>
        /// <param name="amount">金额</param>
        /// <param name="orderLine">订单行</param>
        /// <param name="note">备注</param>
        /// <returns>发票行</returns>
        public PurchaseInvoiceLine AddInvoiceLine(int itemName, decimal amount, OrderLine orderLine, string note)
        {
            var invoiceLine = new PurchaseInvoiceLine();
            invoiceLine.SetItemName((ItemNameType)itemName);
            invoiceLine.SetAmount(amount);
            invoiceLine.SetNote(note);
            invoiceLine.GenerateNewIdentity();
            invoiceLine.SetOrderLine(orderLine);

            InvoiceLines.Add(invoiceLine);

            return invoiceLine;
        }
예제 #2
0
 /// <summary>
 ///     创建发票行
 /// </summary>
 /// <returns></returns>
 public static PurchaseInvoiceLine CreateInvoiceLine()
 {
     var invoiceLine = new PurchaseInvoiceLine();
     invoiceLine.GenerateNewIdentity();
     return invoiceLine;
 }
예제 #3
0
 /// <summary>
 ///     设置发票行属性
 /// </summary>
 /// <param name="invoiceLine">发票行</param>
 /// <param name="itemName">项名称</param>
 /// <param name="amount">金额</param>
 /// <param name="order">订单</param>
 /// <param name="orderLineId">订单行Id</param>
 /// <param name="note">备注</param>
 public static void SetInvoiceLine(PurchaseInvoiceLine invoiceLine, int itemName, decimal amount, Order order,
     int orderLineId, string note)
 {
     if (order != null)
     {
         var orderLine = order.OrderLines.FirstOrDefault(p => p.Id == orderLineId);
         invoiceLine.SetOrderLine(orderLine);
     }
     invoiceLine.SetItemName((ItemNameType)itemName);
     invoiceLine.SetAmount(amount);
     invoiceLine.SetNote(note);
 }