Esempio n. 1
0
        /// <summary>
        /// Construye una nueva instancia de un lote.
        /// </summary>
        /// <param name="batchActionKey">Clave de la acción que realiza el lote.</param>
        /// <param name="batchActionPrefix">Prefijo que se le da en el SII a
        /// este tipo de lote.</param>
        /// <param name="batchType">Tipo de lote.</param>
        public Batch(BatchActionKeys batchActionKey,
                     BatchActionPrefixes batchActionPrefix, BatchTypes batchType)
        {
            BatchActionKey    = batchActionKey;
            BatchActionPrefix = batchActionPrefix;
            BatchType         = batchType;

            BatchItems = new List <IBatchItem>();
        }
Esempio n. 2
0
        /// <summary>
        /// Obtiene un objeto RegistroLRFacturasRecibidas, este objeto se utiliza
        /// para la serialización xml.
        /// </summary>
        /// <param name="batchActionKey">Tipo de lote.</param>
        /// <param name="updateInnerSII">Si es true, actualiza el objeto SII subyacente
        /// con el valor calculado.</param>
        /// <param name="skipErrors">Indica si hay que omitir las excepciones.</param>
        /// <returns>Nueva instancia del objeto para serialización
        /// xml RegistroLRFacturasEmitidas.</returns>
        public object ToSIIBatchItem(BatchActionKeys batchActionKey,
                                     bool updateInnerSII = false, bool skipErrors = false)
        {
            switch (batchActionKey)
            {
            case BatchActionKeys.LR:
                return(ToSII(updateInnerSII));
                //case BatchActionKeys.DR:
                //return ToRegistroLRBajaRecibidasSII();
            }

            throw new Exception($"Unknown BatchActionKey: {batchActionKey}");
        }
Esempio n. 3
0
        /// <summary>
        /// Obtiene un objeto RegistroLRFacturasRecibidas, este objeto se utiliza
        /// para la serialización xml.
        /// </summary>
        /// <param name="batchActionKey">Tipo de lote.</param>
        /// <param name="updateInnerSII">Si es true, actualiza el objeto SII subyacente
        /// con el valor calculado.</param>
        /// <param name="skipErrors">Indica si hay que omitir las excepciones.</param>
        /// <returns>Nueva instancia del objeto para serialización
        /// xml RegistroLRFacturasEmitidas.</returns>
        public object ToSIIBatchItem(BatchActionKeys batchActionKey,
                                     bool updateInnerSII = false, bool skipErrors = false)
        {
            switch (batchActionKey)
            {
            case BatchActionKeys.LR:
                return(ToSII());

            case BatchActionKeys.DR:
                return(ToRegistroLRBajaBienesInversionSII());
            }

            throw new Exception($"Unknown BatchActionKey: {batchActionKey}");
        }