/// <summary> /// Load Invoice Line /// </summary> /// <param name="inout">shipment/receipt</param> /// <returns>DocLine Array</returns> private DocLine[] LoadLines(MInOut inout) { List <DocLine> list = new List <DocLine>(); MInOutLine[] lines = inout.GetLines(false); for (int i = 0; i < lines.Length; i++) { MInOutLine line = lines[i]; if (line.IsDescription() || line.GetM_Product_ID() == 0 || Env.Signum(line.GetMovementQty()) == 0) { log.Finer("Ignored: " + line); continue; } // PO Matching if (_MatchRequirementR.Equals(X_M_InOut.MATCHREQUIREMENTR_PurchaseOrder) || _MatchRequirementR.Equals(X_M_InOut.MATCHREQUIREMENTR_PurchaseOrderAndInvoice)) { Decimal poDiff = line.GetMatchPODifference(); if (Env.Signum(poDiff) != 0) { _matchProblem += "; Line=" + line.GetLine() + " PO Match diff=" + poDiff; } else if (!line.IsMatchPOPosted()) { _matchProblem += "; PO Match not posted for Line=" + line.GetLine(); } } // Inv Matching else if (_MatchRequirementR.Equals(X_M_InOut.MATCHREQUIREMENTR_Invoice) || _MatchRequirementR.Equals(X_M_InOut.MATCHREQUIREMENTR_PurchaseOrderAndInvoice)) { Decimal invDiff = line.GetMatchInvDifference(); if (Env.Signum(invDiff) != 0) { _matchProblem += "; Line=" + line.GetLine() + " PO Match diff=" + invDiff; } else if (!line.IsMatchInvPosted()) { _matchProblem += "; Inv Match not posted for Line=" + line.GetLine(); } } DocLine docLine = new DocLine(line, this); Decimal Qty = line.GetMovementQty(); docLine.SetQty(Qty, GetDocumentType().Equals(MDocBaseType.DOCBASETYPE_MATERIALDELIVERY)); // sets Trx and Storage Qty // log.Fine(docLine.ToString()); list.Add(docLine); } // Return Array DocLine[] dls = new DocLine[list.Count]; dls = list.ToArray(); return(dls); }