Exemple #1
0
 public void AllocateRestOverRCTLines(IList <POReceiptLineAdjustment> aLines, decimal rest)
 {
     if (rest != Decimal.Zero)
     {
         if (aLines.Count == 0)
         {
             aLines.Add(new POReceiptLineAdjustment(new POReceiptLine(), rest, null));
         }
         else
         {
             aLines[0] = new POReceiptLineAdjustment(aLines[0].Item1, aLines[0].Item2 + rest, aLines[0].BranchID);
         }
     }
 }
        public virtual POReceiptLineAdjustment CreateReceiptLineAdjustment(AllocationItem allocationItem, POReceiptLine receiptLine,
                                                                           decimal qtyToAssign, int?branchID)
        {
            if ((allocationItem == null || allocationItem.ReceiptLine == null) && receiptLine == null)
            {
                var emptyReceiptLine = new POReceiptLine();

                return(new POReceiptLineAdjustment(emptyReceiptLine, qtyToAssign, branchID));
            }

            var result = new POReceiptLineAdjustment(receiptLine ?? allocationItem.ReceiptLine, qtyToAssign, branchID);

            return(result);
        }