public VoidedDocumentsLineType[] getVoidedDocumentsLine() { VoidedDocumentsLineType HILT = new VoidedDocumentsLineType(); VoidedDocumentsLineType[] MILT = new VoidedDocumentsLineType[RAD.Count]; MS.GeneraLog.IngresoBD01("Se añaden a la cola los siguientes documentos, para luego actualiza su estado"); for (int i = 0; i < RAD.Count; ++i) { RAC.DOC_UPD_LIST.Add($"{MS.RucNumber}-{RAD[i].TPO_CPE}-{RAD[i].DOC_SER}-{RAD[i].DOC_NUM.ToString().PadLeft(8, '0')}"); MS.GeneraLog.IngresoBD01($"{MS.RucNumber}-{RAD[i].TPO_CPE}-{RAD[i].DOC_SER}-{RAD[i].DOC_NUM.ToString().PadLeft(8, '0')}"); MILT[i] = new VoidedDocumentsLineType(); LineIDType LIT = new LineIDType(); LIT.Value = (i + 1).ToString(); MILT[i].LineID = LIT; DocumentTypeCodeType DTCT = new DocumentTypeCodeType(); DTCT.Value = RAD[i].TPO_CPE; MILT[i].DocumentTypeCode = DTCT; IdentifierType IT1 = new IdentifierType(); IT1.Value = RAD[i].DOC_SER; MILT[i].DocumentSerialID = IT1; IdentifierType IT2 = new IdentifierType(); IT2.Value = RAD[i].DOC_NUM.ToString().PadLeft(8, '0'); MILT[i].DocumentNumberID = IT2; TextType TT = new TextType(); TT.Value = RAD[i].DOC_DES; MILT[i].VoidReasonDescription = TT; } return(MILT); }
/// <summary> /// Devuelve los Items para el Voided Document /// </summary> /// <param name="voidedDetails">items detail voided</param> /// <returns></returns> public static VoidedDocumentsLineType[] GetVoidedLines(IEnumerable <VoidedDetail> voidedDetails) { var result = new List <VoidedDocumentsLineType>(); int counter = 1; foreach (var item in voidedDetails) { var line = new VoidedDocumentsLineType { LineID = counter.ToString(), DocumentTypeCode = ((int)item.TipoDocumento).ToString("00"), DocumentSerialID = item.SerieDocumento, DocumentNumberID = item.CorrelativoDocumento, VoidReasonDescription = item.Motivo }; result.Add(line); counter++; } return(result.ToArray()); }