Beispiel #1
0
        public void cetakLaporan(string _NoBukti, string uraian, string total, string _Tanggal, string MK)
        {
            string _judul = "", _h2 = "", _penerima = "";

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

            _Kepada = lookupPegawai1.Nama.Trim();
            _Kasir  = SecurityManager.UserName;
            uraian  = uraian.Trim();
            try
            {
                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() + _Kepada.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());

                lap.PROW(true, 1, lap.PrintVerticalLine() + "".ToString().Trim().PadRight(10) + uraian.ToString().ToUpper().PadRight(58).Substring(0, 58) + total.PadLeft(15) + lap.PrintVerticalLine());



                for (int j = 0; j < 9; 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.PadLeft(15) + lap.PrintVerticalLine());
                lap.PROW(true, 1, lap.PrintTLeft() + lap.PrintHorizontalLine(83) + lap.PrintTRight());
                lap.PROW(true, 1, lap.PrintVerticalLine() + Tools.Terbilang(Convert.ToDouble(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, _Kepada.Trim()).Substring(0, 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("ISADBDepoFinance"))
                {
                    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");
            }
            catch (Exception ex)
            {
                Error.LogError(ex);
            }
        }
Beispiel #2
0
        public void cetakLaporan()
        {
            if ((int.Parse(dgDetailBank.SelectedCells[0].OwningRow.Cells["NPrint"].Value.ToString()) > 0) && (!SecurityManager.IsManager()))
            {
                if (!SecurityManager.AskPasswordManager())
                {
                    return;
                }
            }



            string Keterangan, NoBBK, TglBank, NoBGCH, NamaBank, TglRK, Nilai, Kasir, jnsTran, Tanggal;
            string txtJudul, txtKeterangan, txtNamaBank, txtPenerima;

            Guid _rowID = (Guid)dgDetailBank.SelectedCells[0].OwningRow.Cells["RowID"].Value;

            Keterangan = dgDetailBank.SelectedCells[0].OwningRow.Cells["Keterangan"].Value.ToString().Trim();
            NamaBank   = dgHeaderBank.SelectedCells[0].OwningRow.Cells["NamaBank"].Value.ToString().Trim();
            Tanggal    = String.Format("{0:dd-MMM-yyyy}", (DateTime)dgDetailBank.SelectedCells[0].OwningRow.Cells["TglBank"].Value);
            TglBank    = String.Format("{0:dd-MMM-yyyy}", (DateTime)dgDetailBank.SelectedCells[0].OwningRow.Cells["TglBank"].Value);
            NoBBK      = dgDetailBank.SelectedCells[0].OwningRow.Cells["NoBBKD"].Value.ToString().Trim();
            NoBGCH     = dgDetailBank.SelectedCells[0].OwningRow.Cells["NoBGCH"].Value.ToString().Trim();
            TglRK      = String.Format("{0:dd-MMM-yyyy}", (DateTime)dgDetailBank.SelectedCells[0].OwningRow.Cells["TglRK"].Value);
            jnsTran    = dgDetailBank.SelectedCells[0].OwningRow.Cells["JnsTran"].Value.ToString().Trim();
            Kasir      = SecurityManager.UserID;

            if (jnsTran == "BBM")
            {
                txtJudul      = "BUKTI BANK MASUK";
                txtKeterangan = "Diterima dari : ";
                txtNamaBank   = "Asal Transfer";
                txtPenerima   = "Penyetor";
                Nilai         = String.Format("{0:0,0}", Convert.ToDouble(dgDetailBank.SelectedCells[0].OwningRow.Cells["Debet"].Value));
            }
            else
            {
                txtJudul      = "BUKTI BANK KELUAR";
                txtKeterangan = "Dibayar kepada : ";
                txtNamaBank   = "Transfer Ke";
                txtPenerima   = "Penerima";
                Nilai         = String.Format("{0:0,0}", Convert.ToDouble(dgDetailBank.SelectedCells[0].OwningRow.Cells["Kredit"].Value));
            }

            try
            {
                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, txtJudul);
                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() + txtKeterangan.PadRight(41) +
                         lap.PrintVerticalLine() + ("Nomor   : " + NoBBK).PadRight(41) + lap.PrintVerticalLine());
                lap.PROW(true, 1, lap.PrintVerticalLine() + Keterangan.PadRight(41).Substring(0, 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(15, "Nomor") + lap.PadCenter(16, txtNamaBank) + lap.SPACE(1) + lap.PadCenter(10, "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());

                lap.PROW(true, 1, lap.PrintVerticalLine() + NoBGCH.PadRight(15) + NamaBank.ToString().ToUpper().PadRight(16).Substring(0, 16) + lap.SPACE(1) + "".PadRight(10) +
                         lap.PadCenter(13, TglBank) + lap.PadCenter(13, TglRK)
                         + Nilai.PadLeft(15) + lap.PrintVerticalLine());


                for (int j = 0; j < 9; 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." +
                         Nilai.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(Convert.ToDouble(Nilai)).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, txtPenerima) + 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) + ")" + lap.PrintVerticalLine() + "(" + lap.SPACE(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:yyyyMMddhh:mm:ss}", DateTime.Now) + " " + SecurityManager.UserName);
                lap.Eject();

                using (Database db = new Database(GlobalVar.DBName))
                {
                    db.Commands.Add(db.CreateCommand("rsp_CetakBankDetail"));
                    db.Commands[0].Parameters.Add(new Parameter("@rowID", SqlDbType.UniqueIdentifier, _rowID));
                    db.Commands[0].ExecuteNonQuery();
                }
                //DetailRefresh(_rowID);
                DetailRefresh();
                DetailFindRow("RowID", _rowID.ToString());
                lap.SendToPrinter("laporanPS.txt");
            }
            catch (Exception ex)
            {
                Error.LogError(ex);
            }
        }
Beispiel #3
0
        public void cetakLaporan()
        {
            if ((int.Parse(dgHeaderBKM.SelectedCells[0].OwningRow.Cells["NPrint"].Value.ToString()) > 0) && (!SecurityManager.IsManager()))
            {
                if (!SecurityManager.AskPasswordManager())
                {
                    return;
                }
            }
            int    i = 0;
            double total = 0, jumlah;
            string _Terima, _NoBukti, _Tanggal, _Lampiran, _Kasir;
            Guid   _rowID = (Guid)dgHeaderBKM.SelectedCells[0].OwningRow.Cells["RowID"].Value;

            _Terima   = dgHeaderBKM.SelectedCells[0].OwningRow.Cells["dari"].Value.ToString();
            _NoBukti  = dgHeaderBKM.SelectedCells[0].OwningRow.Cells["noBukti"].Value.ToString();
            _Lampiran = dgHeaderBKM.SelectedCells[0].OwningRow.Cells["Lampiran"].Value.ToString();
            _Tanggal  = String.Format("{0:dd-MMM-yyyy}", dgHeaderBKM.SelectedCells[0].OwningRow.Cells["tglBukti"].Value);
            _Kasir    = dgHeaderBKM.SelectedCells[0].OwningRow.Cells["Kasir"].Value.ToString();
            int rowNo = 0;
            int no    = 0;

            int ttlData = dtBKMDetail.Rows.Count;
            int hal     = 1;
            int ttlHal  = 0;
            int prevHal = hal;

            if (ttlData % 10 > 0)
            {
                ttlHal = (ttlData / 10) + 1;
            }
            else
            {
                ttlHal = ttlData / 10;
            }

            try
            {
                BuildString lap = new BuildString();


                bool cetak = true;

                foreach (DataRow dr in dtBKMDetail.Rows)
                {
                    #region header

                    if (cetak)
                    {
                        lap.Initialize();

                        lap.PageLLine(33);
                        lap.LeftMargin(1);
                        lap.FontCPI(12);
                        lap.LineSpacing("1/6");
                        lap.DoubleWidth(true);
                        lap.PROW(true, 1, "[BUKTI KAS MASUK]");
                        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() + "Di Terima Dari : ".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 : " + hal.ToString() + "/" + ttlHal.ToString()).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());
                    }

                    #endregion


                    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++;

                    no++;
                    rowNo++;
                    cetak = false;

                    if (hal == ttlHal && 10 - no > 0 && rowNo == ttlData)
                    {
                        for (int j = 0; j < 10 - no; j++)
                        {
                            lap.PROW(true, 1, lap.PrintVerticalLine() + lap.SPACE(83) + lap.PrintVerticalLine());
                        }
                    }

                    #region footer
                    if (ttlData == rowNo || no == 10)
                    {
                        prevHal = hal;
                        hal++;
                        no    = 0;
                        cetak = true;

                        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();
                    }


                    #endregion
                }


                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();
                }
                HeaderRowRefresh(_rowID);
                lap.SendToPrinter("laporanPS.txt");
                //lap.SendToFile("laporanPS.txt");
            }
            catch (Exception ex)
            {
                Error.LogError(ex);
            }
        }
Beispiel #4
0
        private void PrintLaporan(DataTable dt)
        {
            BuildString lap          = new BuildString();
            Guid        _RowID       = (Guid)dt.Rows[0]["RowID"];
            string      typePrinter  = lap.GetPrinterName();
            string      NamaBank     = Tools.isNull(dt.Rows[0]["NamaBank"], "").ToString().Trim();
            string      NoBBM        = Tools.isNull(dt.Rows[0]["NoBBM"], "").ToString().Trim();
            string      TglBBM       = ((DateTime)dt.Rows[0]["TglBBM"]).ToString("dd-MM-yyyy").Trim();
            string      Pembukuan    = Tools.isNull(dt.Rows[0]["Dibukukan"], "").ToString().Trim();
            string      Mengetahui   = Tools.isNull(dt.Rows[0]["Diketahui"], "").ToString().Trim();
            string      Kasir        = Tools.isNull(dt.Rows[0]["Kasir"], "").ToString().Trim();
            string      Penyetor     = Tools.isNull(dt.Rows[0]["Penyetor"], "").ToString().Trim();
            string      Nomor        = string.Empty;
            string      AsalTransfer = string.Empty;
            string      Bank         = string.Empty;
            string      TglBank      = string.Empty;
            string      TglTransfer  = string.Empty;
            double      Jumlah       = 0;
            double      sumJumlah    = 0;
            string      tempJumlah   = string.Empty;
            int         i            = 0;
            int         rowNo        = 0;
            int         no           = 0;

            int ttlData = dt.Rows.Count;
            int hal     = 1;
            int ttlHal  = 0;
            int prevHal = hal;

            if (ttlData % 10 > 0)
            {
                ttlHal = (ttlData / 10) + 1;
            }
            else
            {
                ttlHal = ttlData / 10;
            }

            //lap.PROW(true, 1, lap.PrintTopLeftCorner() + lap.PrintHorizontalLine(128) + lap.PrintTopRightCorner());
            //lap.PROW(false, 63, lap.PrintTTOp());

            //lap.PROW(true, 1, lap.PrintVerticalLine() + "Diterima Dari: ".PadRight(61) + lap.PrintVerticalLine());
            //lap.PROW(false, 65, "Nomor  : " + NoBBM.PadRight(57) + lap.PrintVerticalLine());

            //lap.PROW(true, 1, lap.PrintVerticalLine() + NamaBank.PadRight(61) + lap.PrintVerticalLine());
            //lap.PROW(false, 65, "Tanggal: " + TglBBM.PadLeft(10) + lap.SPACE(3) + "Hal : " + hal.ToString() + "/" + ttlHal.ToString().PadRight(36)  + lap.PrintVerticalLine());

            //lap.PROW(true, 1, lap.PrintTLeft() + lap.PrintHorizontalLine(128) + lap.PrintTRight());
            //lap.PROW(false, 63, lap.PrintTBottom());
            //lap.PROW(true, 1, lap.PrintVerticalLine() + "Nomor" + lap.SPACE(16) + "Asal Transfer" + lap.SPACE(16) + "Bank" + lap.SPACE(16) + "Tgl.Bank" + lap.SPACE(16) + "Tgl.Trf" + lap.SPACE(15) + "Nilai Tranfer" + lap.PrintVerticalLine());
            //lap.PROW(true, 1, lap.PrintTLeft() + lap.PrintHorizontalLine(129) + lap.PrintTRight());

            bool cetak = true;

            foreach (DataRow dr in dt.Rows)
            {
                #region header
                if (cetak)
                {
                    lap.Initialize();

                    lap.PageLLine(33);
                    lap.LeftMargin(1);
                    lap.FontCPI(12);
                    lap.LineSpacing("1/6");
                    lap.DoubleWidth(true);
                    lap.PROW(true, 1, "[Bukti Bank Keluar]");
                    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() + "Kepada : ".PadRight(41) +
                             lap.PrintVerticalLine() + ("Nomor   : " + NoBBM).PadRight(41) + lap.PrintVerticalLine());
                    lap.PROW(true, 1, lap.PrintVerticalLine() + NamaBank.PadRight(41) + lap.PrintVerticalLine() + ("Tanggal : " +
                                                                                                                   TglBBM).PadRight(30) + ("Hal : " + hal.ToString() + "/" + ttlHal.ToString()).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());
                }
                #endregion

                Nomor        = dr["Nomor"].ToString().Trim();
                AsalTransfer = dr["AsalTransfer"].ToString().Trim();
                Bank         = dr["Bank"].ToString().Trim();
                TglBank      = ((DateTime)dr["TglBank"]).ToString("dd-MMM-yyyy").Trim();
                TglTransfer  = ((DateTime)dr["TglTransfer"]).ToString("dd-MMM-yyyy").Trim();

                Jumlah    = double.Parse(dr["Nominal"].ToString());
                sumJumlah = sumJumlah + Jumlah;
                //tempJumlah = Jumlah.ToString("#,##0");

                lap.PROW(true, 1, lap.PrintVerticalLine() + dr["Nomor"].ToString().Trim().PadRight(10) + dr["AsalTransfer"].ToString().ToUpper().PadRight(20).Substring(0, 20) + lap.SPACE(1)
                         + dr["NamaBank"].ToString().PadRight(11).Substring(0, 11) + 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());
                i++;

                no++;
                rowNo++;
                cetak = false;

                if (hal == ttlHal && 10 - no > 0 && rowNo == ttlData)
                {
                    for (int j = 0; j < 10 - no; j++)
                    {
                        lap.PROW(true, 1, lap.PrintVerticalLine() + lap.SPACE(83) + lap.PrintVerticalLine());
                    }
                }

                #region footer

                if (ttlData == rowNo || no == 10)
                {
                    prevHal = hal;
                    hal++;
                    no    = 0;
                    cetak = true;
                    lap.PROW(true, 1, lap.PrintTLeft() + lap.PrintHorizontalLine(83) + lap.PrintTRight());
                    lap.PROW(true, 1, lap.PrintVerticalLine() + "Terbilang".PadRight(58) + "Jumlah Rp." +
                             sumJumlah.ToString("#,###").PadLeft(15) + lap.PrintVerticalLine());
                    lap.PROW(true, 1, lap.PrintTLeft() + lap.PrintHorizontalLine(83) + lap.PrintTRight());
                    lap.PROW(true, 1, lap.PrintVerticalLine() + Tools.Terbilang(sumJumlah).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) + ")" + lap.PrintVerticalLine() + "(" + lap.PadCenter(18, Mengetahui)
                             + ")" + lap.PrintVerticalLine() + "(" + lap.PadCenter(18, Kasir) + ")" + lap.PrintVerticalLine() + "(" + lap.PadCenter(18, Penyetor) + ")" +
                             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:yyyyMMddhh:mm:ss}", DateTime.Now) + " " + SecurityManager.UserName);
                    lap.Eject();
                }



                #endregion
            }

            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)dt.Rows[0]["NPrint"] + 1));
                db.Commands[0].Parameters.Add(new Parameter("@LastUpdatedBy", SqlDbType.VarChar, SecurityManager.UserName));
                db.Commands[0].ExecuteNonQuery();
            }
            lap.SendToPrinter("BBK.txt", lap.GenerateString());
            //lap.SendToPrinter("BBK.txt");
        }
Beispiel #5
0
        private void PrintOutDotMatrix()
        {
            BuildString data = new BuildString();

            data.Initialize();
            data.PageLLine(33);
            data.LeftMargin(1);
            data.BottomMargin(1);

            data.LetterQuality(false);
            data.FontBold(true);
            data.FontCondensed(true);
            data.DoubleHeight(true);

            data.PROW(true, 1, "");

            data.DoubleWidth(true);
            data.DoubleHeight(true);
            data.FontCPI(12);
            data.LineSpacing("1/8");
            //data.PROW(false, 2, Convert.ToString((char)27) + Convert.ToString((char)33) + Convert.ToString((char)12));
            data.PROW(true, 1, "Register Tagihan");
            data.DoubleWidth(false);
            data.DoubleHeight(false);

            /*                  12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890*/
            /*                           1         2         3         4         5         6         7         8         9         10        11        12        13        14*/
            data.FontCondensed(true);
            data.PROW(true, 1, "    Customer                                    Part Number             Q t y    Harga Sat     Disc(%)   Pot          Jumlah Harga");
            data.PROW(true, 1, data.PrintDoubleLine(134));

            //foreach (DataRow dr in dt.Rows)
            //{
            string _customer1 = "YATIK", _customer2 = "RAYZA LUTHFI", _customer3 = "RAFA ANADA RADITIYA AHMAD";
            int    panjanghuruf = _customer1.Length;

            if (panjanghuruf >= 25)
            {
                _customer1 = _customer1.Substring(0, 30);
            }
            int panjanghuruf2 = _customer1.Length;

            if (panjanghuruf2 >= 25)
            {
                _customer2 = _customer2.Substring(0, 30);
            }
            string sTemp = "";

            sTemp = sTemp + _customer1.PadRight(25, ' ') + " | ";
            data.PROW(true, 1, sTemp);

            sTemp = "";
            sTemp = sTemp + _customer2.PadRight(25, ' ') + " | ";
            data.PROW(true, 1, sTemp);

            sTemp = "";
            sTemp = sTemp + _customer3.PadRight(25, ' ') + " | ";
            data.PROW(true, 1, sTemp);

            //}



            data.Eject();
            data.SendToPrinter("Register_Tagihan.txt");

            //data.SendToTxt("Register_Tagihan.txt", data.GenerateString());
            //detail.SendToPrinter("Register_Tagihan.txt");   //, detail.GenerateString());

            MessageBox.Show("Proses Cetak Selesai..");
        }
Beispiel #6
0
        private void cetakGiro(DataTable dtGiro)
        {
            double total = 0, jumlah;
            string _Terima, _NoBukti, _Tanggal, _Kasir, _mengetahui, _pembukuan;

            Guid   _RowID        = (Guid)gridHeader.SelectedCells[0].OwningRow.Cells["hdrRowID"].Value;
            string namaBankTitip = gridHeader.SelectedCells[0].OwningRow.Cells["hdrNamaBank"].Value.ToString().Trim();

            _Terima     = "TITIP GIRO " + namaBankTitip;
            _NoBukti    = gridHeader.SelectedCells[0].OwningRow.Cells["hdrNoVoucher"].Value.ToString();
            _Tanggal    = String.Format("{0:dd-MMM-yyyy}", gridHeader.SelectedCells[0].OwningRow.Cells["hdrTglVoucher"].Value);
            _Kasir      = gridHeader.SelectedCells[0].OwningRow.Cells["hdrDibuat"].Value.ToString();
            _mengetahui = gridHeader.SelectedCells[0].OwningRow.Cells["hdrMengetahui"].Value.ToString();
            _pembukuan  = gridHeader.SelectedCells[0].OwningRow.Cells["hdrDibukukan"].Value.ToString();

            total = Convert.ToDouble(dtGiro.Compute("Sum(Nominal)", ""));

            BuildString lap = new BuildString();


            int i = 0, j = 1;
            int n      = dtGiro.Rows.Count;
            int jmlhal = n / 10;
            int y      = 0;

            if (n % 10 > 0)
            {
                jmlhal += 1;
            }

            while (j <= jmlhal)
            {
                //HEADER

                lap.Initialize();

                lap.PageLLine(33);
                lap.LeftMargin(1);
                lap.FontCPI(12);
                lap.LineSpacing("1/6");
                lap.DoubleWidth(true);
                lap.PROW(true, 1, "[VOUCHER TITIP GIRO]");
                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() + "Di Terima Dari : ".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 : " + j.ToString() + " / " + jmlhal.ToString()).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(3, "") + lap.PadCenter(8, "No. Giro") + lap.PadCenter(20, "Asal Giro") + lap.SPACE(1)
                         + lap.PadCenter(10, "Bank Asal") + lap.PadCenter(13, "Tgl. Giro") + lap.PadCenter(13, "Tgl. J/Tempo")
                         + lap.PadCenter(15, "Nilai Giro Rp") + lap.PrintVerticalLine());
                lap.PROW(true, 1, lap.PrintTLeft() + lap.PrintHorizontalLine(83) + lap.PrintTRight());
                y = 0;
                while (i < n && y < 10)
                {
                    jumlah = Convert.ToDouble(dtGiro.Rows[i]["Nominal"].ToString());
                    lap.PROW(true, 1, lap.PrintVerticalLine() + lap.PadCenter(3, dtGiro.Rows[i]["CHBG"].ToString()) + dtGiro.Rows[i]["Nomor"].ToString().Trim().PadRight(8) + dtGiro.Rows[i]["AsalGiro"].ToString().Trim().ToUpper().PadRight(20).Substring(0, 20)
                             + lap.SPACE(1) + dtGiro.Rows[i]["NamaBank"].ToString().Trim().PadRight(10).Substring(0, 10) + lap.PadCenter(13, String.Format("{0:dd-MMM-yyyy}", dtGiro.Rows[i]["TglGiro"]))
                             + lap.PadCenter(13, String.Format("{0:dd-MMM-yyyy}", dtGiro.Rows[i]["TglJth"])) + jumlah.ToString("#,###").PadLeft(15) + lap.PrintVerticalLine());

                    i++;
                    y++;
                }
                j++;

                if (i == n && i % 10 != 0)
                {
                    int sisaBaris = 10 - (i % 10);
                    for (int x = 0; x < sisaBaris; x++)
                    {
                        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() + 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.DBFinance))
            {
                db.Commands.Add(db.CreateCommand("usp_VoucherJournal_Update"));
                db.Commands[0].Parameters.Add(new Parameter("@rowID", SqlDbType.UniqueIdentifier, _RowID));
                db.Commands[0].Parameters.Add(new Parameter("@NPrint", SqlDbType.Int, (int)gridHeader.SelectedCells[0].OwningRow.Cells["hdrNPrint"].Value + 1));
                db.Commands[0].Parameters.Add(new Parameter("@LastUpdatedBy", SqlDbType.VarChar, SecurityManager.UserName));
                db.Commands[0].ExecuteNonQuery();
            }

            HeaderRowRefresh(_RowID);
            lap.SendToPrinter("laporanPS.txt", lap.GenerateString());
            lap.SendToPrinter("laporanPS.txt");
        }
Beispiel #7
0
        private void PrintRawNotaRetur(DataTable dt)
        {
            BuildString retur = new BuildString();

            string NoMPR    = dt.Rows[0]["NoMPR"].ToString();
            string NoRetur  = dt.Rows[0]["NoNotaRetur"].ToString();
            string TglMPR   = Convert.ToDateTime(dt.Rows[0]["TglMPR"].ToString()).ToString("dd-MMM-yyyy");
            string TglNota  = (Tools.isNull(dt.Rows[0]["TglNotaRetur"], "").ToString() == "")? string.Empty:Convert.ToDateTime(dt.Rows[0]["TglNotaRetur"].ToString()).ToString("dd-MMM-yyyy");
            string NamaToko = dt.Rows[0]["NamaToko"].ToString().PadRight(31);
            string Alamat   = dt.Rows[0]["Alamat"].ToString().PadRight(60);
            string Daerah   = dt.Rows[0]["Daerah"].ToString().PadRight(25);
            string IdWil    = dt.Rows[0]["WilID"].ToString();
            string Kota     = dt.Rows[0]["Kota"].ToString();
            string Penerima = dt.Rows[0]["Penerima"].ToString();
            int    No       = 0;

            string ketCetak = "";

            if (_nCetak > 1)
            {
                ketCetak = "(COPY)";
            }
            if (_nCetak == 9)
            {
                ketCetak = "(REVISI)";
            }

            #region Header
            retur.FontCondensed(false);


            retur.FontCPI(12);
            retur.DoubleHeight(true);
            retur.DoubleWidth(true);
            retur.PROW(true, 1, retur.SPACE(15) + "NOTA RETUR " + ketCetak);
            retur.DoubleWidth(false);
            retur.DoubleHeight(false);
            retur.FontBold(false);

            retur.FontCPI(10);
            retur.PageLLine(33);
            retur.LeftMargin(0);
            retur.FontBold(true);
            retur.PROW(true, 1, "MPR : " + NoMPR.PadRight(7, ' ') + retur.SPACE(47) + "NOTA : " + NoRetur);
            retur.PROW(true, 1, "Tgl.: " + TglMPR + retur.SPACE(43) + "Tgl. : " + TglNota);
            //retur.PROW(true, 1, "");
            retur.FontCPI(12);
            retur.FontBold(false);
            retur.LineSpacing("1/8");
            retur.PROW(true, 1, retur.SPACE(53) + retur.PrintTopLeftCorner() + retur.PrintHorizontalLine(1) + " Nama Toko : " + retur.PrintHorizontalLine(26) + retur.PrintTopRightCorner());
            retur.PROW(true, 1, retur.SPACE(53) + retur.PrintVerticalLine() + retur.SPACE(40) + retur.PrintVerticalLine());
            retur.FontBold(true);
            retur.AddCR();
            retur.PROW(false, 56, NamaToko);
            retur.FontBold(false);
            retur.PROW(true, 1, retur.SPACE(53) + retur.PrintVerticalLine() + retur.SPACE(40) + retur.PrintVerticalLine());
            retur.FontCondensed(true);
            retur.FontItalic(true);
            retur.AddCR();
            retur.PROW(false, 95, Alamat);
            retur.FontItalic(false);
            retur.FontCondensed(false);
            retur.PROW(true, 1, retur.SPACE(53) + retur.PrintVerticalLine() + retur.SPACE(40) + retur.PrintVerticalLine());
            retur.FontCondensed(true);
            retur.FontItalic(true);
            retur.AddCR();
            retur.PROW(false, 95, Daerah);
            retur.FontItalic(false);
            retur.FontCondensed(false);
            retur.PROW(true, 1, retur.SPACE(53) + retur.PrintVerticalLine() + retur.SPACE(40) + retur.PrintVerticalLine());
            retur.FontItalic(true);
            retur.AddCR();
            retur.PROW(false, 56, Kota + " (" + IdWil + ")");
            retur.FontItalic(false);
            retur.PROW(true, 1, retur.SPACE(53) + retur.PrintBottomLeftCorner() + retur.PrintHorizontalLine(40) + retur.PrintBottomRightCorner());
            retur.LetterQuality(false);
            retur.FontCondensed(true);
            retur.PROW(true, 1, retur.PrintDoubleLine(157));
            retur.PROW(true, 1, "No. N  a  m  a     B  a  r  a  n  g                                           No.Nota    Sales    Qty      Hrg/Sat  Jml.Hrg(Rp)            Kategori          ");
            retur.PROW(true, 1, retur.PrintHorizontalLine(157));
            #endregion

            #region Detail
            string Sales      = string.Empty;
            string Keterangan = string.Empty;
            string NamaStok   = string.Empty;
            string AsalNota   = string.Empty;
            string Satuan     = string.Empty;
            string temp       = string.Empty;
            string QtyGudang  = string.Empty;
            double HargaJual  = 0;
            double Net        = 0;
            double TotalNet   = 0;

            foreach (DataRow dr in dt.Rows)
            {
                No++;
                temp       = string.Empty;
                Sales      = retur.PadCenter(11, dr["NamaSales"].ToString());
                QtyGudang  = dr["QtyGudang"].ToString();
                Net        = double.Parse(dr["JmlHrg"].ToString());
                HargaJual  = double.Parse(dr["HrgJual"].ToString());
                TotalNet  += Net;
                NamaStok   = dr["NamaBarang"].ToString().PadRight(73, '.');
                AsalNota   = dr["NotaAsal"].ToString().PadRight(7);
                Satuan     = dr["Satuan"].ToString().PadRight(3);
                Keterangan = dr["Kategori"].ToString();

                temp += No.ToString().PadLeft(2, '0') + ".  ";
                temp += NamaStok + " ";
                temp += AsalNota + " ";
                temp += Sales;
                temp += QtyGudang.PadLeft(4) + " " + Satuan + " ";
                temp += HargaJual.ToString("#,###").PadLeft(9) + " ";
                temp += Net.ToString("#,###").PadLeft(10) + "   ";
                temp += retur.PadCenter(25, Keterangan.Trim());
                retur.PROW(true, 1, temp);
            }
            No++;

            for (int i = No; i <= 15; i++)
            {
                retur.PROW(true, 1, i.ToString().PadLeft(2, '0') + ". ");
            }
            #endregion

            #region Footer
            retur.PROW(true, 1, retur.PrintDoubleLine(157));
            retur.PROW(true, 1, retur.SPACE(104) + "Netto : Rp." + TotalNet.ToString("#,###").PadLeft(10));
            retur.LineSpacing("1/6");
            retur.FontBold(false);
            retur.FontCondensed(false);
            retur.PROW(true, 1, "     Mengetahui :");
            retur.PROW(true, 1, "     Bag. Gudang                                                           Bag. ADMIN  ");
            retur.PROW(true, 1, "");
            retur.PROW(true, 1, "");
            retur.PROW(true, 1, "    (" + retur.PadCenter(12, Penerima.Trim()) + ")                                                        (           )");
            retur.Eject();
            #endregion

            retur.SendToPrinter("NotaRetur.txt");
        }
        private void CetakPackingList(DataTable dt)
        {
            BuildString data = new BuildString();

            data.Initialize();

            data.PageLLine(11);
            data.FontCPI(15);
            data.DoubleHeight(true);
            data.DoubleWidth(true);
            data.PROW(true, 1, "");
            data.PROW(true, 1, "PACKING LIST");
            data.PROW(true, 1, "");
            data.DoubleHeight(false);
            data.DoubleWidth(false);
            data.LetterQuality(true);
            data.FontCPI(10);
            data.PROW(true, 1, "Tanggal  : " + ((DateTime)dt.Rows[0]["tglSuratJalan"]).ToString("dd-MMM-yyyy"));
            data.AddCR();
            data.PROW(false, 51, "Dikirim Ke : " + dt.Rows[0]["NamaToko"].ToString().PadRight(31));
            data.PROW(true, 1, "Expedisi : " + dt.Rows[0]["Expedisi"]);
            data.AddCR();
            data.PROW(false, 51, "Alamat     : " + dt.Rows[0]["Kota"].ToString().PadRight(20));
            data.FontCondensed(true);
            data.PROW(true, 1, data.PrintTopLeftCorner() + data.PrintHorizontalLine(139) + data.PrintTopRightCorner());
            data.PROW(true, 1, data.PrintVerticalLine() + "No." + data.PrintVerticalLine() + " NOTA  "
                      + data.PrintVerticalLine() + "                       N A M A   B A R A N G                             "
                      + data.PrintVerticalLine() + "  QUANTITY  " + data.PrintVerticalLine() + "    NOMOR KOLI     "
                      + data.PrintVerticalLine() + "     KETERANGAN     " + data.PrintVerticalLine());
            data.PROW(true, 1, data.PrintBottomLeftCorner() + data.PrintHorizontalLine(139) + data.PrintBottomRightCorner());

            int    nUrut = 0;
            string sNoNota, sNamaBrg, sNokoli, sKet, sSatuan;
            int    nQty, nSumJmlkoli = 0;

            foreach (DataRow dr in dt.Rows)
            {
                sNoNota     = dr["NoSuratJalan"].ToString().Trim();
                sNamaBrg    = dr["NamaBarang"].ToString().Trim();
                sNokoli     = dr["NoKoli"].ToString().Trim();
                sSatuan     = dr["Satuan"].ToString().Trim();
                sKet        = dr["KetKoli"].ToString().Trim();
                nQty        = int.Parse(dr["QtySuratjalan"].ToString());
                nSumJmlkoli = nSumJmlkoli + int.Parse(dr["JmlKoli"].ToString());
                nUrut++;

                if (rdbAuto.Checked)
                {
                    data.PROW(true, 1, data.PrintVerticalLine() + nUrut.ToString().PadLeft(3)
                              + data.PrintVerticalLine() + sNoNota
                              + data.PrintVerticalLine() + sNamaBrg.PadRight(73, '.')
                              + data.PrintVerticalLine() + nQty.ToString().PadLeft(7) + " " + sSatuan.PadRight(4)
                              + data.PrintVerticalLine() + "  " + sNokoli.PadRight(17)
                              + data.PrintVerticalLine() + sKet.PadRight(20) + data.PrintVerticalLine());
                }
                if (rdbManual.Checked)
                {
                    data.PROW(true, 1, data.PrintVerticalLine() + nUrut.ToString().PadLeft(3)
                              + data.PrintVerticalLine() + sNoNota
                              + data.PrintVerticalLine() + sNamaBrg.PadRight(73, '.')
                              + data.PrintVerticalLine() + nQty.ToString().PadLeft(7) + " " + sSatuan.PadRight(4)
                              + data.PrintVerticalLine() + "_______" + "_____" + "_______"
                              + data.PrintVerticalLine() + "____________________" + data.PrintVerticalLine());
                }
            }

            data.PROW(true, 1, data.PrintBottomLeftCorner() + data.PrintHorizontalLine(139) + data.PrintBottomRightCorner());
            data.PROW(true, 1, "Jumlah : "
                      + (rdbAuto.Checked ? nSumJmlkoli.ToString("#,###").PadLeft(10) : "_______")
                      + " Koli");

            if (txtKeterangan.Text.Trim() != "" && rdbAuto.Checked)
            {
                data.PROW(true, 1, "");
                data.PROW(true, 1, "Keterangan :");
                data.PROW(true, 1, txtKeterangan.Text);
            }

            data.PROW(true, 1, "");
            data.PROW(true, 1, "         Dibuat Oleh :                                                                        Diterima Oleh :      ");
            data.PROW(true, 1, "");
            data.PROW(true, 1, "");
            data.PROW(true, 1, "");
            data.PROW(true, 1, data.SPACE(8) + data.PrintHorizontalLine(15) + data.SPACE(71) + data.PrintHorizontalLine(15) + data.SPACE(6));
            data.PROW(true, 1, "            Checker                                                                                                ");
            data.PROW(true, 1, "");
            data.PROW(true, 1, " Barang-barang tersebut di atas telah diperiksa & diterima dalam keadaan baik & lengkap");
            data.PROW(true, 1, " Komplain mengenai barang tersebut di atas diterima paling lambat 1 minggu setelah barang diterima.");
            data.Eject();

            data.SendToFile("packingList.txt");
            //data.SendToPrinter("packingList.txt");
        }
Beispiel #9
0
        private void cetakGiro(DataTable dtGiro, string CT)
        {
            double total = 0, jumlah;
            string _Terima, _NoBukti, _Tanggal, _Kasir, _mengetahui, _pembukuan, _judul, _tgl = "", _h2 = "";

            Guid _RowID = (Guid)gridBBM.SelectedCells[0].OwningRow.Cells["RowID"].Value;

            _Terima     = gridBBM.SelectedCells[0].OwningRow.Cells["NamaBank"].Value.ToString();
            _NoBukti    = gridBBM.SelectedCells[0].OwningRow.Cells["NoBBM"].Value.ToString();
            _Tanggal    = String.Format("{0:dd-MMM-yyyy}", gridBBM.SelectedCells[0].OwningRow.Cells["TglBBM"].Value);
            _Kasir      = gridBBM.SelectedCells[0].OwningRow.Cells["Kasir"].Value.ToString();
            _mengetahui = gridBBM.SelectedCells[0].OwningRow.Cells["Diketahui"].Value.ToString();
            _pembukuan  = gridBBM.SelectedCells[0].OwningRow.Cells["Dibukukan"].Value.ToString();

            BuildString lap = new BuildString();


            if (CT == "C")
            {
                _judul = "[BUKTI BANK MASUK]";
                _tgl   = "Tgl. Cair";
                _h2    = "Diterima Oleh :";
            }
            else if (CT == "T")

            {
                _judul = "[VOUCHER GIRO TOLAK]";
                _tgl   = "Tgl. Tolak";
                _h2    = "Dikeluarkan Oleh :";
            }
            else
            {
                _judul = "[GIRO BATAL TITIP]";
                _tgl   = "Tgl. Batal";
                _h2    = "Dikeluarkan Oleh :";
            }

            int i = 0, j = 1;
            int n      = dtGiro.Rows.Count;
            int jmlhal = n / 10;
            int y      = 0;

            total = Convert.ToDouble(dtGiro.Compute("Sum(Nominal)", ""));

            if (n % 10 > 0)
            {
                jmlhal += 1;
            }

            while (j <= jmlhal)
            {
                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 : " + j.ToString() + " / " + jmlhal.ToString()).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(8, "No. Giro") + lap.PadCenter(20, "Asal Giro") + lap.SPACE(1)
                         + lap.PadCenter(13, "Bank Asal") + lap.PadCenter(13, "Tgl. Giro") + lap.PadCenter(13, "Tgl. J/Tempo")
                         + lap.PadCenter(15, "Nilai Giro Rp") + lap.PrintVerticalLine());
                lap.PROW(true, 1, lap.PrintTLeft() + lap.PrintHorizontalLine(83) + lap.PrintTRight());
                y = 0;
                while (i < n && y < 10)
                {
                    jumlah = Convert.ToDouble(dtGiro.Rows[i]["Nominal"].ToString());

                    lap.PROW(true, 1, lap.PrintVerticalLine() + dtGiro.Rows[i]["Nomor"].ToString().Trim().PadRight(8) + dtGiro.Rows[i]["AsalGiro"].ToString().Trim().ToUpper().PadRight(20).Substring(0, 20)
                             + lap.SPACE(1) + dtGiro.Rows[i]["NamaBankGiro"].ToString().Trim().PadRight(13).Substring(0, 13) + lap.PadCenter(13, String.Format("{0:dd-MMM-yyyy}", dtGiro.Rows[i]["TglGiro"]))
                             + lap.PadCenter(13, String.Format("{0:dd-MMM-yyyy}", dtGiro.Rows[i]["TglCair"])) + jumlah.ToString("#,###").PadLeft(15) + lap.PrintVerticalLine());

                    i++;
                    y++;
                }


                j++;

                if (i == n && i % 10 != 0)
                {
                    int sisaBaris = 10 - (i % 10);
                    for (int x = 0; x < sisaBaris; x++)
                    {
                        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() + 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("rsp_CetakBBM"));
                db.Commands[0].Parameters.Add(new Parameter("@rowID", SqlDbType.UniqueIdentifier, _RowID));
                db.Commands[0].ExecuteNonQuery();
            }
            lap.SendToPrinter("laporan.txt");
        }
        private void CetakSlipBonus()
        {
            if (dataGridSales.SelectedCells.Count == 0 || dataGridPerolehanBns.SelectedCells.Count == 0)
            {
                MessageBox.Show(Messages.Error.RowNotSelected);
                return;
            }

            if ((int)dataGridPerolehanBns.SelectedCells[0].OwningRow.Cells["nPrint"].Value > 0)
            {
                MessageBox.Show("Sudah cetak slip", "Perhatian");
                return;
            }

            if (dataGridPerolehanBns.SelectedCells[0].OwningRow.Cells["NoACC"].Value.ToString() == "")
            {
                MessageBox.Show("Belum di acc !!!", "Perhatian");
                return;
            }
            string
                kodeSales    = dataGridSales.SelectedCells[0].OwningRow.Cells["KodeSales"].Value.ToString(),
                namaSales    = dataGridSales.SelectedCells[0].OwningRow.Cells["NamaSales"].Value.ToString(),
                periode      = dataGridPerolehanBns.SelectedCells[0].OwningRow.Cells["Periode"].Value.ToString(),
                noACC        = dataGridPerolehanBns.SelectedCells[0].OwningRow.Cells["NoACC"].Value.ToString();
            double   rpACC   = double.Parse(dataGridPerolehanBns.SelectedCells[0].OwningRow.Cells["RpACC"].Value.ToString());
            DateTime tanggal = (DateTime)dataGridPerolehanBns.SelectedCells[0].OwningRow.Cells["Tanggal"].Value;

            if (noACC.Substring(0, 3) == "DIS")
            {
                return;
            }

            BuildString data = new BuildString();

            string typePrinter = data.GetPrinterName();

            data.Initialize();
            data.PageLLine(33);
            data.LeftMargin(3);
            data.LetterQuality(true);
            data.FontBold(true);
            data.PROW(true, 1, "");
            data.DoubleHeight(true);
            data.DoubleWidth(true);
            data.PROW(true, 1, data.SPACE(13) + "SLIP BONUS SALESMAN");
            data.DoubleWidth(false);
            data.DoubleHeight(false);
            data.FontCPI(12);
            data.PROW(true, 1, "");
            //@ PROW()+1,1 SAY CHR(27)+CHR(33)+CHR(12)
            data.PROW(true, 1, data.PrintHorizontalLine(77));
            data.PROW(true, 1, "");
            data.PROW(true, 1, "");
            data.PROW(true, 1, "   BULAN            : " + periode);
            data.PROW(true, 1, "");
            data.PROW(true, 1, "   DICETAK TANGGAL  : " + tanggal.ToString("dd-MMM-yyyy"));
            data.PROW(true, 1, "");
            data.PROW(true, 1, "   SALESMAN         : " + kodeSales + "    " + namaSales);
            data.PROW(true, 1, "");
            data.PROW(true, 1, "   NO. ACC          : " + noACC);
            data.PROW(true, 1, "");
            data.PROW(true, 1, "   BONUS PENJUALAN BARANG PRODUKSI & MEREK HTS");
            data.PROW(true, 1, "");
            data.PROW(true, 1, "   NOMINAL          : Rp." + rpACC.ToString("#,###").PadLeft(9) + ",-");
            data.PROW(true, 1, "");
            data.PROW(true, 1, "");
            data.PROW(true, 1, "            Ka.ADM,                                   Penerima,");
            data.PROW(true, 1, "");
            data.PROW(true, 1, "");
            data.PROW(true, 1, "");
            data.PROW(true, 1, "");
            data.PROW(true, 1, "         (          )                               (           )");
            data.PROW(true, 1, data.PrintHorizontalLine(77));
            data.PROW(true, 1, "");
            data.Eject();

            data.SendToPrinter("slipBonus.txt");
        }
Beispiel #11
0
        private void PrintRawSPPB(DataTable dt)
        {
            BuildString sppb = new BuildString();
            int         No   = 0;

            #region "Header"
            string NoMPR_      = dt.Rows[0]["NoMPR"].ToString();
            string TglKirim_   = DateTime.Parse(dt.Rows[0]["TglKirim"].ToString()).ToString("dd-MMM-yyyy");
            string TglMPR_     = DateTime.Parse(dt.Rows[0]["TglMPR"].ToString()).ToString("dd-MMM-yyyy");
            string KodeGudang_ = dt.Rows[0]["KodeGudang"].ToString();

            sppb.Initialize();
            sppb.FontCondensed(false);
            sppb.FontCPI(12);
            sppb.PageLLine(33);
            sppb.LeftMargin(0);
            sppb.FontBold(true);
            sppb.LetterQuality(true);

            sppb.PROW(true, 1, "No.MPR      : " + NoMPR_ + sppb.SPACE(45) + " Tanggal Kirim : " + TglKirim_);
            sppb.PROW(true, 1, "Tanggal MPR : " + TglMPR_);
            sppb.PROW(true, 1, "");
            sppb.DoubleHeight(true);
            sppb.DoubleWidth(true);

            sppb.FontCPI(12);
            sppb.PROW(true, 1, sppb.SPACE(12) + "MEMO PERMOHONAN RETUR");
            sppb.DoubleHeight(false);
            sppb.DoubleWidth(false);
            sppb.LineSpacing("1/8");
            sppb.PROW(true, 1, " ");
            sppb.PROW(true, 1, "Kepada : 011");
            sppb.PROW(true, 1, "Dari   : " + KodeGudang_);
            sppb.FontCPI(15);

            sppb.PROW(true, 1, sppb.PrintDoubleLine(119));
            sppb.PROW(true, 1, "No. N a m a   B a r a n g                                                     Sat Qty    Harga       Alasan Retur      ");
            sppb.PROW(true, 1, sppb.PrintHorizontalLine(119));

            #endregion

            #region "Detail"
            string temp       = string.Empty;
            string namaStok_  = string.Empty;
            string asalNota_  = string.Empty;
            string satuan_    = string.Empty;
            string catatan_   = string.Empty;
            int    QtyTerima_ = 0;
            double HrgBeli_   = 0;

            foreach (DataRow dr in dt.Rows)
            {
                No++;
                temp       = string.Empty;
                namaStok_  = dr["NamaBarang"].ToString();
                satuan_    = dr["Satuan"].ToString();
                catatan_   = dr["Catatan"].ToString();
                QtyTerima_ = int.Parse(dr["QtyTerima"].ToString());
                HrgBeli_   = Convert.ToDouble(Tools.isNull(dr["HrgBeli"], "0").ToString());

                temp += No.ToString().PadLeft(2, '0') + ".  ";
                temp += namaStok_.PadRight(73, '.') + sppb.SPACE(1);
                temp += satuan_.PadRight(3, ' ') + sppb.SPACE(1);
                temp += QtyTerima_.ToString().PadLeft(3, ' ') + sppb.SPACE(1);
                temp += Tools.GetAntiNumeric(HrgBeli_.ToString("#,##0")).PadLeft(9, ' ')
                        + sppb.SPACE(1);
                temp += catatan_;
                sppb.PROW(true, 1, temp);
            }

            No++;
            for (int i = No; i <= 15; i++)
            {
                sppb.PROW(true, 1, i.ToString().PadLeft(2, '0') + ". ");
            }

            #endregion

            #region "Footer"
            sppb.PROW(true, 1, sppb.PrintDoubleLine(119));
            sppb.PROW(true, 1, "");
            sppb.PROW(true, 1, "   Dibuat oleh              Checker 1              Checker 2           Ka.Operasional            Penerima  ");
            sppb.PROW(true, 1, "");
            sppb.PROW(true, 1, "");
            sppb.PROW(true, 1, "");
            sppb.PROW(true, 1, "  (            )          (           )          (           )          (           )          (           )");
            sppb.Eject();
            #endregion


            sppb.SendToPrinter("sppb.txt");
        }
Beispiel #12
0
        public void cetakLaporanVju(string _NoBukti, string _Tanggal)
        {
            int    i = 0;
            double total = 0, jumlah;
            string _Kepada, _Kasir;

            _Kepada = TBNoKasbon.Text + " Rp." + tbNominal.Text;
            _Kasir  = SecurityManager.UserName;
            try
            {
                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, "[BUKTI KAS KELUAR]");
                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() + ("Di Terima Dari : " + lookupPegawai1.Nama.Trim()).PadRight(41) +
                         lap.PrintVerticalLine() + ("Nomor   : " + _NoBukti).PadRight(41) + lap.PrintVerticalLine());
                lap.PROW(true, 1, lap.PrintVerticalLine() + _Kepada.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());

                foreach (DataRow dr in dtVoucher.Rows)
                {
                    string uraian = dr["Keterangan"].ToString().Trim();
                    if (dr["NoACC"].ToString() != "")
                    {
                        uraian += " ACC " + dr["NoACC"].ToString().Trim();
                    }
                    jumlah = Convert.ToDouble(dr["Debet"].ToString());
                    lap.PROW(true, 1, lap.PrintVerticalLine() + "".ToString().Trim().PadRight(10) + (uraian + " (" + TBNoKasbon.Text + ")").ToUpper().PadRight(58).Substring(0, 58) + jumlah.ToString("#,###").PadLeft(15) + lap.PrintVerticalLine());

                    total += Convert.ToDouble(dr["Debet"].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() + 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, "".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();

                lap.SendToPrinter("laporan.txt");
            }
            catch (Exception ex)
            {
                Error.LogError(ex);
            }
        }