Exemple #1
0
        public CashRpt GetDetailReport(CashInfo item,
                                       CashLineList list,
                                       DateTime f_ini,
                                       DateTime f_fin)
        {
            if (item == null)
            {
                return(null);
            }
            if (list.Count == 0)
            {
                return(null);
            }

            CashRpt doc = new CashRpt();

            List <CajaPrint> pList = new List <CajaPrint>();

            int index = item.Lines.IndexOf(list[0]);

            item.DebeAcumulado  = item.GetDebeAcumulado(index);
            item.HaberAcumulado = item.GetHaberAcumulado(index);

            CajaPrint obj = CajaPrint.New(item);

            List <LineaCajaPrint> pLineaCajas = new List <LineaCajaPrint>();

            obj.HaberTotal = obj.HaberAcumulado;
            obj.DebeTotal  = obj.DebeAcumulado;

            foreach (CashLineInfo child in list)
            {
                pLineaCajas.Add(LineaCajaPrint.New(child));
                if (child.EEstado != Common.EEstado.Anulado)
                {
                    obj.HaberTotal += child.Haber;
                    obj.DebeTotal  += child.Debe;
                }
            }

            pList.Add(obj);
            doc.SetDataSource(pList);
            doc.Subreports["SubLineasCaja"].SetDataSource(pLineaCajas);

            FormatHeader(doc);

            return(doc);
        }
        /// <summary>
        /// Actualiza el saldo de cada línea de caja
        /// </summary>
        public virtual void UpdateSaldo(CashLineList lista)
        {
            DebeTotal  = DebeAcumulado;
            HaberTotal = HaberAcumulado;

            if (lista.Count == 0)
            {
                return;
            }

            lista[0].Saldo = SaldoAcumulado + lista[0].Debe - lista[0].Haber;
            DebeTotal     += lista[0].Debe;
            HaberTotal    += lista[0].Haber;

            for (int i = 1; i < lista.Count; i++)
            {
                lista[i].Saldo = lista[i - 1].Saldo + lista[i].Debe - lista[i].Haber;
                DebeTotal     += lista[i].Debe;
                HaberTotal    += lista[i].Haber;
            }
        }
Exemple #3
0
        public CashLineListRpt GetListReport(CashLineList list)
        {
            if (list.Count == 0)
            {
                return(null);
            }

            CashLineListRpt doc = new CashLineListRpt();

            List <LineaCajaPrint> pList = new List <LineaCajaPrint>();

            foreach (CashLineInfo item in list)
            {
                pList.Add(LineaCajaPrint.New(item));
            }
            ;

            doc.SetDataSource(pList);

            FormatHeader(doc);

            return(doc);
        }