/// <summary> /// Gets the TSDK pol from journal entry. /// </summary> /// <param name="tSdkPoliza">The t SDK poliza.</param> /// <param name="tSdkMovPoliza">The t SDK mov poliza.</param> /// <param name="je">The je.</param> private void GetTsdkPolFromJournalEntry(ITSdkPoliza tSdkPoliza, TSdkMovimientoPoliza tSdkMovPoliza, JournalEntry je) { tSdkPoliza.iniciarInfo(); ESISTORIGEN sourceSystem = GetSourceSystem(je); ETIPOPOLIZA tipo = GetJournalEntryType(je); tSdkPoliza.Tipo = tipo; tSdkPoliza.Clase = je.Affect ? ECLASEPOLIZA.CLASE_AFECTAR : ECLASEPOLIZA.CLASE_SINAFECTAR; tSdkPoliza.Impresa = je.Printed ? 1 : 0; tSdkPoliza.Fecha = je.Date; tSdkPoliza.Diario = je.Daily; tSdkPoliza.SistOrigen = sourceSystem; tSdkPoliza.Ajuste = je.Adjust ? 1 : 0; tSdkPoliza.Concepto = je.Concept; tSdkPoliza.Guid = je.Guid.ToString(); if (je.JournalEntryMovement != null) { je.JournalEntryMovement.ForEach(movement => { tSdkMovPoliza.iniciarInfo(); ETIPOIMPORTEMOVPOLIZA movType = GetJournalEntryMovementType(movement); tSdkMovPoliza.NumMovto = movement.Number; tSdkMovPoliza.CodigoCuenta = movement.Account; tSdkMovPoliza.TipoMovto = movType; tSdkMovPoliza.Importe = movement.Amount; tSdkMovPoliza.ImporteME = movement.AmountFC; tSdkMovPoliza.Diario = movement.JournalEntryMovementDaily; tSdkMovPoliza.SegmentoNegocio = "0"; tSdkMovPoliza.Concepto = movement.Concept; tSdkMovPoliza.Guid = movement.Guid.ToString(); tSdkPoliza.agregaMovimiento(tSdkMovPoliza); }); } }
/// <summary> /// Gets the type of the journal entry movement. /// </summary> /// <param name="movement">The movement.</param> /// <returns></returns> private static ETIPOIMPORTEMOVPOLIZA GetJournalEntryMovementType(JournalEntryMovement movement) { ETIPOIMPORTEMOVPOLIZA movType = ETIPOIMPORTEMOVPOLIZA.MOVPOLIZA_ABONO; if (movement.JournalEntryMovementType == JournalEntryMovementType.DEBITS) { movType = ETIPOIMPORTEMOVPOLIZA.MOVPOLIZA_CARGO; } return(movType); }