Exemplo n.º 1
0
        public static void cetakBukti(DataTable dtBKM, string MK)
        {
            int    i = 0;
            double total = 0, jumlah;
            string _Terima, _NoBukti, _Tanggal, _Kasir, _mengetahui, _pembukuan, _judul, _h2 = "", _penerima;

            Guid _RowID = (Guid)dtBKM.Rows[0]["RowID"];

            _Terima  = dtBKM.Rows[0]["Kepada"].ToString().Trim();
            _NoBukti = dtBKM.Rows[0]["NoBukti"].ToString().Trim();

            _Tanggal    = String.Format("{0:dd-MMM-yyyy}", dtBKM.Rows[0]["TglBukti"]);
            _Kasir      = dtBKM.Rows[0]["kasir"].ToString().Trim();
            _mengetahui = "";
            _pembukuan  = dtBKM.Rows[0]["pembukuan"].ToString().Trim();

            if (MK == "M")
            {
                _judul    = "[BUKTI KAS MASUK]";
                _h2       = "Di Terima Dari : ";
                _penerima = "Penyetor";
            }
            else
            {
                _judul    = "[BUKTI KAS KELUAR]";
                _h2       = "Kepada : ";
                _penerima = "Penerima";
            }

            BuildString lap = new BuildString();

            lap.Initialize();

            lap.PageLLine(33);
            lap.LeftMargin(1);
            lap.FontCPI(12);
            lap.LineSpacing("1/6");
            lap.DoubleWidth(true);
            lap.PROW(true, 1, _judul);
            lap.DoubleWidth(false);

            lap.PROW(true, 1, lap.PrintTopLeftCorner() + lap.PrintHorizontalLine(41) + lap.PrintTTOp()
                     + lap.PrintHorizontalLine(41) + lap.PrintTopRightCorner());
            lap.PROW(true, 1, lap.PrintVerticalLine() + _h2.PadRight(41) +
                     lap.PrintVerticalLine() + ("Nomor   : " + _NoBukti).PadRight(41) + lap.PrintVerticalLine());
            lap.PROW(true, 1, lap.PrintVerticalLine() + _Terima.PadRight(41) + lap.PrintVerticalLine() + ("Tanggal : " +
                                                                                                          _Tanggal).PadRight(30) + ("Hal : 1 / 1").PadRight(11) + lap.PrintVerticalLine());
            lap.PROW(true, 1, lap.PrintTLeft() + lap.PrintHorizontalLine(41) + lap.PrintTBottom()
                     + lap.PrintHorizontalLine(41) + lap.PrintTRight());
            lap.PROW(true, 1, lap.PrintVerticalLine() + "No. Prk".PadRight(10) + lap.PadCenter(58, "URAIAN") + lap.SPACE(15) + lap.PrintVerticalLine());
            lap.PROW(true, 1, lap.PrintTLeft() + lap.PrintHorizontalLine(83) + lap.PrintTRight());

            if (dtBKM.Rows[0]["Jumlah"].ToString() != "")
            {
                foreach (DataRow dr in dtBKM.Rows)
                {
                    jumlah = Convert.ToDouble(dr["Jumlah"].ToString());
                    lap.PROW(true, 1, lap.PrintVerticalLine() + "".PadRight(10) + dr["Uraian"].ToString().ToUpper().PadRight(58).Substring(0, 58) + jumlah.ToString("#,###").PadLeft(15) + lap.PrintVerticalLine());
                    total += Convert.ToDouble(dr["Jumlah"].ToString());
                    i++;
                }
            }
            if (i < 10)
            {
                for (int j = 0; j < 10 - i; j++)
                {
                    lap.PROW(true, 1, lap.PrintVerticalLine() + lap.SPACE(83) + lap.PrintVerticalLine());
                }
            }
            lap.PROW(true, 1, lap.PrintTLeft() + lap.PrintHorizontalLine(83) + lap.PrintTRight());
            lap.PROW(true, 1, lap.PrintVerticalLine() + "Terbilang".PadRight(58) + "Jumlah Rp.".PadRight(10) +
                     total.ToString("#,###").PadLeft(15) + lap.PrintVerticalLine());
            lap.PROW(true, 1, lap.PrintTLeft() + lap.PrintHorizontalLine(83) + lap.PrintTRight());
            lap.PROW(true, 1, lap.PrintVerticalLine() + ISA.Common.Tools.Terbilang(total).PadRight(83) + lap.PrintVerticalLine());
            lap.PROW(true, 1, lap.PrintTLeft() + lap.PrintHorizontalLine(20) + lap.PrintTTOp() + lap.PrintHorizontalLine(20) + lap.PrintTTOp()
                     + lap.PrintHorizontalLine(20) + lap.PrintTTOp() + lap.PrintHorizontalLine(20) + lap.PrintTRight());
            lap.PROW(true, 1, lap.PrintVerticalLine() + lap.PadCenter(20, "Pembukuan") + lap.PrintVerticalLine() + lap.PadCenter(20, "Mengetahui")
                     + lap.PrintVerticalLine() + lap.PadCenter(20, "Kasir") + lap.PrintVerticalLine() + lap.PadCenter(20, _penerima) + lap.PrintVerticalLine());
            lap.PROW(true, 1, lap.PrintVerticalLine() + lap.PadCenter(20, "") + lap.PrintVerticalLine() + lap.PadCenter(20, "")
                     + lap.PrintVerticalLine() + lap.PadCenter(20, "") + lap.PrintVerticalLine() + lap.PadCenter(20, "") + lap.PrintVerticalLine());
            lap.PROW(true, 1, lap.PrintVerticalLine() + lap.PadCenter(20, "") + lap.PrintVerticalLine() + lap.PadCenter(20, "")
                     + lap.PrintVerticalLine() + lap.PadCenter(20, "") + lap.PrintVerticalLine() + lap.PadCenter(20, "") + lap.PrintVerticalLine());
            lap.PROW(true, 1, lap.PrintVerticalLine() + lap.PadCenter(20, "") + lap.PrintVerticalLine() + lap.PadCenter(20, "")
                     + lap.PrintVerticalLine() + lap.PadCenter(20, "") + lap.PrintVerticalLine() + lap.PadCenter(20, "") + lap.PrintVerticalLine());
            lap.PROW(true, 1, lap.PrintVerticalLine() + "(" + lap.PadCenter(18, "") + ")" + lap.PrintVerticalLine() + "(" + lap.PadCenter(18, "")
                     + ")" + lap.PrintVerticalLine() + "(" + lap.PadCenter(18, _Kasir.Trim()) + ")" + lap.PrintVerticalLine() + "(" + lap.PadCenter(18, _Terima.Trim()) + ")" +
                     lap.PrintVerticalLine());
            lap.PROW(true, 1, lap.PrintBottomLeftCorner() + lap.PrintHorizontalLine(20) + lap.PrintTBottom() + lap.PrintHorizontalLine(20) + lap.PrintTBottom()
                     + lap.PrintHorizontalLine(20) + lap.PrintTBottom() + lap.PrintHorizontalLine(20) + lap.PrintBottomRightCorner());
            lap.PROW(true, 1, String.Format("{0:yyyyMMddhhmmss}", DateTime.Now) + " " + SecurityManager.UserName);
            lap.Eject();

            using (Database db = new Database(GlobalVar.DBName))
            {
                db.Commands.Add(db.CreateCommand("rsp_CetakBukti"));
                db.Commands[0].Parameters.Add(new Parameter("@rowID", SqlDbType.UniqueIdentifier, _RowID));
                db.Commands[0].ExecuteNonQuery();
            }
            lap.SendToPrinter("laporan.txt");
        }
Exemplo n.º 2
0
        public static void cetakTransfer(DataTable dtTrn, string MK)
        {
            int    i = 0;
            double total = 0, jumlah;
            string _Terima, _NoBukti, _Tanggal, _Kasir, _mengetahui, _pembukuan, _judul, _h2 = "";

            Guid _RowID = (Guid)dtTrn.Rows[0]["RowID"];

            _Terima     = dtTrn.Rows[0]["Penyetor"].ToString();
            _NoBukti    = dtTrn.Rows[0]["NoBBM"].ToString();
            _Tanggal    = String.Format("{0:dd-MMM-yyyy}", dtTrn.Rows[0]["TglBBM"]);
            _Kasir      = dtTrn.Rows[0]["Kasir"].ToString();
            _mengetahui = dtTrn.Rows[0]["Diketahui"].ToString();
            _pembukuan  = dtTrn.Rows[0]["Dibukukan"].ToString();
            if (MK == "M")
            {
                _judul = "[BUKTI BANK MASUK]";
                _h2    = "Di Terima Dari : ";
            }
            else
            {
                _judul = "[BUKTI BANK KELUAR]";
                _h2    = "Kepada : ";
            }

            BuildString lap = new BuildString();

            lap.Initialize();

            lap.PageLLine(33);
            lap.LeftMargin(1);
            lap.FontCPI(12);
            lap.LineSpacing("1/6");
            lap.DoubleWidth(true);
            lap.PROW(true, 1, _judul);
            lap.DoubleWidth(false);


            lap.PROW(true, 1, lap.PrintTopLeftCorner() + lap.PrintHorizontalLine(41) + lap.PrintTTOp()
                     + lap.PrintHorizontalLine(41) + lap.PrintTopRightCorner());
            lap.PROW(true, 1, lap.PrintVerticalLine() + _h2.PadRight(41) +
                     lap.PrintVerticalLine() + ("Nomor   : " + _NoBukti).PadRight(41) + lap.PrintVerticalLine());
            lap.PROW(true, 1, lap.PrintVerticalLine() + _Terima.PadRight(41) + lap.PrintVerticalLine() + ("Tanggal : " +
                                                                                                          _Tanggal).PadRight(30) + ("Hal : 1/1").PadRight(11) + lap.PrintVerticalLine());
            lap.PROW(true, 1, lap.PrintTLeft() + lap.PrintHorizontalLine(41) + lap.PrintTBottom()
                     + lap.PrintHorizontalLine(41) + lap.PrintTRight());
            lap.PROW(true, 1, lap.PrintVerticalLine() + lap.PadCenter(10, "Nomor") + lap.PadCenter(20, "Asal Transfer") + lap.SPACE(1)
                     + lap.PadCenter(11, "Bank") + lap.PadCenter(13, "Tgl. Bank") + lap.PadCenter(13, "Tgl. Trf")
                     + lap.PadCenter(15, "Nilai Transfer") + lap.PrintVerticalLine());
            lap.PROW(true, 1, lap.PrintTLeft() + lap.PrintHorizontalLine(83) + lap.PrintTRight());

            foreach (DataRow dr in dtTrn.Rows)
            {
                jumlah = Convert.ToDouble(dr["Nominal"].ToString());
                lap.PROW(true, 1, lap.PrintVerticalLine() + dr["NoPerkiraan"].ToString().PadRight(10) + dr["AsalTransfer"].ToString().ToUpper().PadRight(20).Substring(0, 20)
                         + dr["NamaBank"].ToString().PadRight(12).Substring(0, 12) + lap.PadCenter(13, String.Format("{0:dd-MMM-yyyy}", dr["TglBBM"]))
                         + lap.PadCenter(13, String.Format("{0:dd-MMM-yyyy}", dr["TglTransfer"])) + jumlah.ToString("#,###").PadLeft(15) + lap.PrintVerticalLine());
                total += Convert.ToDouble(dr["Nominal"].ToString());
                i++;
            }
            if (i < 10)
            {
                for (int j = 0; j < 10 - i; j++)
                {
                    lap.PROW(true, 1, lap.PrintVerticalLine() + lap.SPACE(83) + lap.PrintVerticalLine());
                }
            }
            lap.PROW(true, 1, lap.PrintTLeft() + lap.PrintHorizontalLine(83) + lap.PrintTRight());
            lap.PROW(true, 1, lap.PrintVerticalLine() + "Terbilang".PadRight(58) + "Jumlah Rp." +
                     total.ToString("#,###").PadLeft(15) + lap.PrintVerticalLine());
            lap.PROW(true, 1, lap.PrintTLeft() + lap.PrintHorizontalLine(83) + lap.PrintTRight());
            lap.PROW(true, 1, lap.PrintVerticalLine() + ISA.Common.Tools.Terbilang(total).PadRight(83) + lap.PrintVerticalLine());
            lap.PROW(true, 1, lap.PrintTLeft() + lap.PrintHorizontalLine(20) + lap.PrintTTOp() + lap.PrintHorizontalLine(20) + lap.PrintTTOp()
                     + lap.PrintHorizontalLine(20) + lap.PrintTTOp() + lap.PrintHorizontalLine(20) + lap.PrintTRight());
            lap.PROW(true, 1, lap.PrintVerticalLine() + lap.PadCenter(20, "Pembukuan") + lap.PrintVerticalLine() + lap.PadCenter(20, "Mengetahui")
                     + lap.PrintVerticalLine() + lap.PadCenter(20, "Kasir") + lap.PrintVerticalLine() + lap.PadCenter(20, "Penyetor") + lap.PrintVerticalLine());
            lap.PROW(true, 1, lap.PrintVerticalLine() + lap.PadCenter(20, "") + lap.PrintVerticalLine() + lap.PadCenter(20, "")
                     + lap.PrintVerticalLine() + lap.PadCenter(20, "") + lap.PrintVerticalLine() + lap.PadCenter(20, "") + lap.PrintVerticalLine());
            lap.PROW(true, 1, lap.PrintVerticalLine() + lap.PadCenter(20, "") + lap.PrintVerticalLine() + lap.PadCenter(20, "")
                     + lap.PrintVerticalLine() + lap.PadCenter(20, "") + lap.PrintVerticalLine() + lap.PadCenter(20, "") + lap.PrintVerticalLine());
            lap.PROW(true, 1, lap.PrintVerticalLine() + lap.PadCenter(20, "") + lap.PrintVerticalLine() + lap.PadCenter(20, "")
                     + lap.PrintVerticalLine() + lap.PadCenter(20, "") + lap.PrintVerticalLine() + lap.PadCenter(20, "") + lap.PrintVerticalLine());
            lap.PROW(true, 1, lap.PrintVerticalLine() + "(" + lap.PadCenter(18, _pembukuan.Trim()) + ")" + lap.PrintVerticalLine() + "(" + lap.PadCenter(18, _mengetahui.Trim())
                     + ")" + lap.PrintVerticalLine() + "(" + lap.PadCenter(18, _Kasir.Trim()) + ")" + lap.PrintVerticalLine() + "(" + lap.PadCenter(18, "") + ")" +
                     lap.PrintVerticalLine());
            lap.PROW(true, 1, lap.PrintBottomLeftCorner() + lap.PrintHorizontalLine(20) + lap.PrintTBottom() + lap.PrintHorizontalLine(20) + lap.PrintTBottom()
                     + lap.PrintHorizontalLine(20) + lap.PrintTBottom() + lap.PrintHorizontalLine(20) + lap.PrintBottomRightCorner());
            lap.PROW(true, 1, String.Format("{0:yyyyMMddhhmmss}", DateTime.Now) + " " + SecurityManager.UserName);
            lap.Eject();

            using (Database db = new Database(GlobalVar.DBName))
            {
                db.Commands.Add(db.CreateCommand("usp_TransferBank_Update"));
                db.Commands[0].Parameters.Add(new Parameter("@rowID", SqlDbType.UniqueIdentifier, _RowID));
                db.Commands[0].Parameters.Add(new Parameter("@NPrint", SqlDbType.Int, (int)dtTrn.Rows[0]["nprint"] + 1));
                db.Commands[0].Parameters.Add(new Parameter("@LastUpdatedBy", SqlDbType.VarChar, SecurityManager.UserName));
                db.Commands[0].ExecuteNonQuery();
            }
            lap.SendToPrinter("laporan.txt");
        }