Ejemplo n.º 1
0
    public override void Start()
    {
        DoneFlag = false;
        Report.Init(this, 1, wsReportName);
        Report.PrintBlock(reportLvlStart);

        DataTable dt = new DataTable();
        string    FDT;

        if (string.IsNullOrEmpty(wsFromDate))
        {
            FDT = "01/01/1990";
        }
        else
        {
            FDT = wsFromDate;
        }
        ClsTrailBalance TB = new ClsTrailBalance();

        dt = TB.GetInfo(FDT, wsToDate, "1", wsAll == true ? "Y" : "N", wsCN == true?"C":"N");
        if (dt != null)
        {
            if (dt.Rows.Count != 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    wsPrdName = string.Empty;
                    wsOpBal   = 0;
                    wsDrBal   = 0;
                    wsCrBal   = 0;
                    wsClosBal = 0;
                    wsPrdName = dt.Rows[i]["GLCode"].ToString() + "/" + dt.Rows[i]["SubGlCode"].ToString() + "/" + dt.Rows[i]["GlName"].ToString().Trim();
                    wsOpBal   = Math.Round(Convert.ToDouble(dt.Rows[i]["OPBAL"].ToString()), 2);
                    wsDrBal   = Math.Round(Convert.ToDouble(dt.Rows[i]["DR"].ToString()), 2);
                    wsCrBal   = Math.Round(Convert.ToDouble(dt.Rows[i]["CR"].ToString()), 2);
                    wsClosBal = Math.Round(wsOpBal - wsDrBal + wsCrBal, 2);
                    ++wsRptTotal;
                    wsRptOpBal   += wsOpBal;
                    wsRptDrBal   += wsDrBal;
                    wsRptCrBal   += wsCrBal;
                    wsRptClosBal += Math.Round(wsOpBal - wsDrBal + wsCrBal, 2);
                    Report.PrintBlock(details);
                }
            }
        }
        Report.PrintBlock(reportLvlEnd);
        Report.Finalize();
        DoneFlag = true;
    }