private void PrintRawSPPB2(DataTable dt)
        {
            BuildString sppb = new BuildString();


            string _NamaStok = string.Empty;
            string _Pcs      = string.Empty;
            string _Lok      = string.Empty;
            int    No        = 0;
            int    n         = dt.Rows.Count;
            int    i         = 0;
            int    p         = 0;
            int    s         = 0;

            p = n / 13;
            s = n % 13;

            #region "First Header"
            //sppb.Initialize();
            //sppb.LeftMargin(1);
            //sppb.BottomMargin(1);
            //sppb.PROW(true, 1, string.Empty);
            sppb.AddCR();
            sppb.PROW(false, 1, "KODE RAK :                                                                                  				     TANGGAL :");
            sppb.Append(PrintHeader(No, n));
            #endregion

            #region "Detail"
            foreach (DataRow dr in dt.Rows)
            {
                No++;
                i++;
                _NamaStok = dr["NamaStok"].ToString();
                _Pcs      = dr["SatJual"].ToString();
                _Lok      = dr["Lokasi"].ToString();

                sppb.PROW(true, 1, sppb.PrintVerticalLine() + No.ToString().PadLeft(4, ' ') + sppb.PrintVerticalLine() + _NamaStok.PadRight(73, '.') + sppb.SPACE(4) + sppb.PrintVerticalLine() + _Pcs.PadLeft(3, ' ') + sppb.PrintVerticalLine() + "              " + sppb.PrintVerticalLine() + "              " + sppb.PrintVerticalLine() + "              " + sppb.PrintVerticalLine() + _Lok.PadLeft(7, ' ') + sppb.PrintVerticalLine());
                if (i == 28 || No == n)
                {
                    sppb.PROW(true, 1, sppb.PrintBottomLeftCorner() + sppb.PrintHorizontalLine(4) + sppb.PrintTBottom() + sppb.PrintHorizontalLine(77) + sppb.PrintTBottom() + sppb.PrintHorizontalLine(3) + sppb.PrintTBottom() + sppb.PrintHorizontalLine(14) + sppb.PrintTBottom() + sppb.PrintHorizontalLine(14) + sppb.PrintTBottom() + sppb.PrintHorizontalLine(14) + sppb.PrintTBottom() + sppb.PrintHorizontalLine(7) + sppb.PrintRightBottomCorner());
                    sppb.Eject();
                    i = 0;

                    if (i == 0 && No != n)
                    {
                        sppb.Append(PrintHeader(No, n));
                    }
                }
                else
                {
                    sppb.PROW(true, 1, sppb.PrintTLeft() + sppb.PrintHorizontalLine(4) + sppb.PrintTMidlle() + sppb.PrintHorizontalLine(77) + sppb.PrintTMidlle() + sppb.PrintHorizontalLine(3) + sppb.PrintTMidlle() + sppb.PrintHorizontalLine(14) + sppb.PrintTMidlle() + sppb.PrintHorizontalLine(14) + sppb.PrintTMidlle() + sppb.PrintHorizontalLine(14) + sppb.PrintTMidlle() + sppb.PrintHorizontalLine(7) + sppb.PrintTRight());
                }
            }
            #endregion

            sppb.SendToPrinter("sppb.txt", sppb.GenerateString());
        }
Beispiel #2
0
        private void PrintRawRincianBiaya(DataTable dt)
        {
            BuildString printESC = new BuildString();

            DateTime tglKirim      = DateTime.Parse(dt.Rows[0]["TglKirim"].ToString());
            string   sopir         = dt.Rows[0]["Sopir"].ToString();
            string   tujuan        = dt.Rows[0]["Tujuan"].ToString();
            string   kernet        = dt.Rows[0]["Kernet"].ToString();
            string   noPolisi      = dt.Rows[0]["NoPolisi"].ToString();
            double   total         = double.Parse(dt.Rows[0]["Total"].ToString());
            double   bbmRp         = double.Parse(dt.Rows[0]["BBMRp"].ToString());;
            double   parkir        = double.Parse(dt.Rows[0]["Parkir"].ToString());;
            double   uangMakan     = double.Parse(dt.Rows[0]["UangMakan"].ToString());;
            double   tol           = double.Parse(dt.Rows[0]["Tol"].ToString());;
            double   izinMasuk     = double.Parse(dt.Rows[0]["IzinMasuk"].ToString());;
            double   timbangan     = double.Parse(dt.Rows[0]["Timbangan"].ToString());;
            double   insTepatWaktu = double.Parse(dt.Rows[0]["InTepatWaktu"].ToString());;
            double   insPengiriman = double.Parse(dt.Rows[0]["InPengiriman"].ToString());;
            double   lain          = double.Parse(dt.Rows[0]["Lain"].ToString());;
            double   kuli          = double.Parse(dt.Rows[0]["Kuli"].ToString());;
            double   kasbon        = double.Parse(dt.Rows[0]["Kasbon"].ToString());

            printESC.Initialize();
            printESC.Append(printESC.SPACE(20) + Convert.ToString((char)27) + Convert.ToString((char)33) + Convert.ToString((char)24));
            printESC.PROW(true, 1, "PERINCIAN BIAYA EKSPEDISI");
            printESC.PROW(true, 1, "");
            printESC.PROW(true, 1, Convert.ToString((char)27) + Convert.ToString((char)33) + Convert.ToString((char)1) + "Periode  : " + tglKirim.ToString("dd-MMM-yyyy") + printESC.SPACE(15) + "Nama Sopir  : " + sopir);
            printESC.PROW(true, 1, "Jalur    : " + tujuan.PadRight(20) + printESC.SPACE(6) + "Nama Helper : " + kernet);
            printESC.PROW(true, 1, printESC.SPACE(37) + "No. Polisi  : " + noPolisi);
            printESC.PROW(true, 1, "");
            printESC.PROW(true, 1, printESC.Replicate("-", 60));
            printESC.PROW(true, 1, "");
            printESC.PROW(true, 1, "Biaya Bahan Bakar                 : Rp. " + bbmRp.ToString("#,##0").PadLeft(9));
            printESC.PROW(true, 1, "Biaya Retribusi Parkir            : Rp. " + parkir.ToString("#,##0").PadLeft(9));
            printESC.PROW(true, 1, "Biaya Makan                       : Rp. " + uangMakan.ToString("#,##0").PadLeft(9));
            printESC.PROW(true, 1, "Biaya Tol                         : Rp. " + tol.ToString("#,##0").PadLeft(9));
            printESC.PROW(true, 1, "Biaya Izin Masuk kota             : Rp. " + izinMasuk.ToString("#,##0").PadLeft(9));
            printESC.PROW(true, 1, "Biaya Timbangan                   : Rp. " + timbangan.ToString("#,##0").PadLeft(9));
            printESC.PROW(true, 1, "Insentif tepat waktu              : Rp. " + insTepatWaktu.ToString("#,##0").PadLeft(9));
            printESC.PROW(true, 1, "Insentif pengiriman               : Rp. " + insPengiriman.ToString("#,##0").PadLeft(9));
            printESC.PROW(true, 1, "Lain-lain                         : Rp. " + lain.ToString("#,##0").PadLeft(9));
            printESC.PROW(true, 1, "Biaya Kuli                        : Rp. " + kuli.ToString("#,##0").PadLeft(9));
            printESC.PROW(true, 1, printESC.SPACE(32) + "-----------------");
            printESC.PROW(true, 1, "");
            printESC.PROW(true, 1, "Jumlah Biaya                      : Rp. " + total.ToString("#,##0").PadLeft(9));
            printESC.PROW(true, 1, "Uang Saku                         : Rp. " + kasbon.ToString("#,##0").PadLeft(9));
            printESC.PROW(true, 1, printESC.SPACE(32) + "-----------------");
            printESC.PROW(true, 1, "Sisa uang saku                    : Rp. " + (kasbon - total).ToString("#,##0").PadLeft(9));
            printESC.PROW(true, 1, "");
            printESC.PROW(true, 1, "");
            printESC.PROW(true, 1, "Keterangan     : ");
            printESC.PROW(true, 1, "");
            printESC.PROW(true, 1, "");
            printESC.PROW(true, 1, "");
            printESC.PROW(true, 1, "");
            printESC.PROW(true, 1, " Bag. Ekspedisi,                                    Kasir, ");
            printESC.Eject();

            printESC.SendToPrinter("RincianBiaya.txt");
        }
Beispiel #3
0
        private void button13_Click(object sender, EventArgs e)
        {
            //string data = " ";
            //textBox3.Text = data.Insert(1, "kangguru");

            BuildString data = new BuildString();

            data.Append(data.PrintDoubleLine(23));

            string temp = "ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ";

            byte[] tes = new byte[temp.Length];

            for (int i = 0; i < temp.Length; i++)
            {
                tes[i] = Convert.ToByte(temp[i]);
            }
            // byte[] tes = { 205, 205, 205, 205 };


            //System.IO.StreamWriter file = new System.IO.StreamWriter("C:\\test.txt", false, Encoding.UTF8);
            //file.WriteLine(Convert.ToBase64String(tes));
            //file.Close();

            File.WriteAllBytes("C:\\test.txt", tes);
            //File.WriteAllBytes("C:\\test.txt", Encoding.UTF8.GetBytes(data.GenerateString()));
            MessageBox.Show("Printed");
        }
        private void PrintRawBarangKeluar(DataTable dt)
        {
            BuildString barangKeluar = new BuildString();

            string sales     = dt.Rows[0]["Sales"].ToString().PadRight(23);
            string tglKeluar = DateTime.Parse(dt.Rows[0]["TglKeluar"].ToString()).ToString("dd-MMM-yyyy");
            string tglBatas  = DateTime.Parse(dt.Rows[0]["TglBatas"].ToString()).ToString("dd-MMM-yyyy");
            string noBukti   = dt.Rows[0]["NoBukti"].ToString();
            string penjamin  = dt.Rows[0]["Penjamin"].ToString().PadRight(10);
            string catatan   = dt.Rows[0]["CatatanH"].ToString();
            int    No        = 0;

            barangKeluar.Initialize();
            barangKeluar.PageLLine(33);
            barangKeluar.FontCPI(12);
            barangKeluar.Append(Convert.ToString((char)27) + Convert.ToString((char)33) + Convert.ToString((char)1));
            barangKeluar.PROW(true, 1, barangKeluar.PadCenter(88, "BUKTI PEMINJAMAN BARANG"));
            barangKeluar.PROW(true, 1, "");
            barangKeluar.PROW(true, 1, "Nama salesman : " + sales + barangKeluar.SPACE(12) + "Tanggal pinjam        : " + tglKeluar);
            barangKeluar.PROW(true, 1, "Nomor pinjam  : " + noBukti.PadRight(10) + barangKeluar.SPACE(25) + "Batas tanggal pinjam  : " + tglBatas);
            barangKeluar.PROW(true, 1, "Penjamin      : " + penjamin);
            barangKeluar.PROW(true, 1, barangKeluar.PrintEqualSymbol(88));
            barangKeluar.PROW(true, 1, "No                                   Nama Barang                                 Qty");
            barangKeluar.PROW(true, 1, barangKeluar.PrintMinusSymbol(88));

            string namaStok        = string.Empty;
            int    qtyKeluarGudang = 0;

            foreach (DataRow dr in dt.Rows)
            {
                No++;
                namaStok        = dr["NamaStok"].ToString().PadRight(73);
                qtyKeluarGudang = int.Parse(dr["QtyKeluarGudang"].ToString());

                barangKeluar.PROW(true, 1, No.ToString().PadLeft(2) + " " + namaStok + barangKeluar.SPACE(5) + qtyKeluarGudang.ToString().PadLeft(3));
            }
            barangKeluar.PROW(true, 1, barangKeluar.PrintEqualSymbol(88));
            barangKeluar.PROW(true, 1, "Catatan : " + catatan);
            barangKeluar.PROW(true, 1, "");
            barangKeluar.PROW(true, 1, "");
            barangKeluar.PROW(true, 1, "                   Penjualan                                Peminjam");
            barangKeluar.Eject();

            barangKeluar.SendToPrinter("BarangKeluar.txt");
        }
Beispiel #5
0
        private void PrintRawMemoPeminjaman(DataTable dt)
        {
            BuildString memo = new BuildString();

            string sales     = dt.Rows[0]["Sales"].ToString().PadRight(23);
            string tglKeluar = DateTime.Parse(dt.Rows[0]["TglKeluar"].ToString()).ToString("dd-MMM-yyyy");
            string tglBatas  = DateTime.Parse(dt.Rows[0]["TglBatas"].ToString()).ToString("dd-MMM-yyyy");
            string noBukti   = dt.Rows[0]["NoBukti"].ToString();
            string penjamin  = dt.Rows[0]["Penjamin"].ToString().PadRight(10);
            int    No        = 0;

            memo.Initialize();
            memo.PageLLine(33);
            memo.FontCPI(12);
            memo.Append(Convert.ToString((char)27) + Convert.ToString((char)33) + Convert.ToString((char)1));
            memo.PROW(true, 1, memo.PadCenter(88, "MEMO PEMINJAMAN BARANG"));
            memo.PROW(true, 1, "");
            memo.PROW(true, 1, "Nama salesman : " + sales + memo.SPACE(12) + "Tanggal pinjam        : " + tglKeluar);
            memo.PROW(true, 1, "Nomor pinjam  : " + noBukti.PadRight(10) + memo.SPACE(25) + "Batas tanggal pinjam  : " + tglBatas);
            memo.PROW(true, 1, "Penjamin      : " + penjamin);
            memo.PROW(true, 1, memo.PrintEqualSymbol(88));
            memo.PROW(true, 1, "No                                   Nama Barang                            Pinjam Kirim");
            memo.PROW(true, 1, memo.PrintMinusSymbol(88));

            string namaStok = string.Empty;
            int    qtyMemo  = 0;

            foreach (DataRow dr in dt.Rows)
            {
                No++;
                namaStok = dr["NamaStok"].ToString().PadRight(73);
                qtyMemo  = int.Parse(dr["QtyMemo"].ToString());

                memo.PROW(true, 1, No.ToString().PadLeft(2) + " " + namaStok + "  " + qtyMemo.ToString().PadLeft(3) + "   ...");
            }
            memo.PROW(true, 1, memo.PrintEqualSymbol(88));
            memo.PROW(true, 1, "");
            memo.PROW(true, 1, "");
            memo.PROW(true, 1, "");
            memo.PROW(true, 1, "      Ka.Gudang                Checker 1             Checker 2              Gudang");
            memo.Eject();

            memo.SendToPrinter("MemoPeminjaman.txt");
        }
        private void PrintRawBarangKembali(DataTable dt)
        {
            BuildString barangKembali = new BuildString();

            string sales      = dt.Rows[0]["Sales"].ToString().PadRight(23);
            string tglKembali = DateTime.Parse(dt.Rows[0]["TglKembaliPj"].ToString()).ToString("dd-MMM-yyyy");
            string noKembali  = dt.Rows[0]["NoKembali"].ToString();
            string catatan    = dt.Rows[0]["Catatan"].ToString();
            int    No         = 0;

            barangKembali.Initialize();
            barangKembali.PageLLine(33);
            barangKembali.FontCPI(12);
            barangKembali.Append(Convert.ToString((char)27) + Convert.ToString((char)33) + Convert.ToString((char)1));
            barangKembali.PROW(true, 1, barangKembali.PadCenter(88, "BUKTI PENGEMBALIAN PINJAMAN"));
            barangKembali.PROW(true, 1, "");
            barangKembali.PROW(true, 1, "Nama salesman   : " + sales);
            barangKembali.PROW(true, 1, "No.Pengembalian : " + noKembali + barangKembali.SPACE(28) + "Tgl.Pengembalian : " + tglKembali);
            barangKembali.PROW(true, 1, barangKembali.PrintEqualSymbol(88));
            barangKembali.PROW(true, 1, "No                                   Nama Barang                           No.Pinj   Qty");
            barangKembali.PROW(true, 1, barangKembali.PrintMinusSymbol(88));

            string namaStok   = string.Empty;
            string noPinjam   = string.Empty;
            int    qtyKembali = 0;

            foreach (DataRow dr in dt.Rows)
            {
                No++;
                namaStok   = dr["NamaStok"].ToString().PadRight(70);
                noPinjam   = dr["NoPinjam"].ToString().PadRight(10);
                qtyKembali = int.Parse(dr["QtyKembali"].ToString());

                barangKembali.PROW(true, 1, No.ToString().PadLeft(2) + " " + namaStok + " " + noPinjam + " " + qtyKembali.ToString().PadLeft(3));
            }
            barangKembali.PROW(true, 1, barangKembali.PrintEqualSymbol(88));
            barangKembali.PROW(true, 1, "Catatan : " + catatan);
            barangKembali.PROW(true, 1, "");
            barangKembali.PROW(true, 1, "");
            barangKembali.PROW(true, 1, "      Penjualan                Pengembali            Ka.Gudang              Gudang");
            barangKembali.Eject();

            barangKembali.SendToPrinter("BarangKembali.txt");
        }
Beispiel #7
0
        private void PrintRawPengantarSuratJalan(DataTable dt)
        {
            BuildString printESC = new BuildString();

            printESC.Initialize();
            printESC.LeftMargin(0);
            printESC.FontCPI(15);
            printESC.Append(PrintHeader(dt));

            int    nKoli        = 0;
            int    jKoli        = 0;
            int    ctr          = 0;
            int    no           = 0;
            string namaToko     = string.Empty;
            string noNota       = string.Empty;
            string noSJ         = string.Empty;
            string tunaiKredit  = string.Empty;
            string sales        = string.Empty;
            string ket          = string.Empty;
            string tempAlamat   = string.Empty;
            string alamat1      = string.Empty;
            string alamat2      = string.Empty;
            string lastToko     = string.Empty;
            string lastAlamat1  = string.Empty;
            bool   printAlamat1 = false;
            bool   printAlamat2 = false;
            bool   firstRecord  = true;
            int    recordCount  = 0;
            string kodeToko_    = string.Empty;

            ctr = 12;
            int  row   = 0;
            bool first = true;

            foreach (DataRow dr in dt.Rows)
            {
                recordCount++;
                namaToko    = dr["Toko"].ToString();
                kodeToko_   = dr["KodeToko"].ToString();
                jKoli       = int.Parse(dr["JmlKoli"].ToString());
                noNota      = dr["NoNota"].ToString();
                noSJ        = dr["NoSuratJalan"].ToString();
                tunaiKredit = dr["TK"].ToString();
                sales       = dr["Sales"].ToString();
                ket         = dr["Keterangan"].ToString();
                tempAlamat  = dr["Alamat"].ToString();

                if (tempAlamat.Length > 31)
                {
                    alamat1 = tempAlamat.Substring(0, 31);
                    int pos = alamat1.LastIndexOf(' ');
                    alamat1 = alamat1.Substring(0, pos).PadRight(31);
                    alamat2 = tempAlamat.Substring(pos);
                }
                else
                {
                    alamat1 = tempAlamat.PadRight(31);
                    alamat2 = string.Empty;
                }

                alamat2 = alamat2.TrimStart();

                nKoli += jKoli;

                if (lastToko.Equals(kodeToko_)) //(lastToko.Equals(kodeToko_) && lastAlamat1.Equals(alamat1))
                {
                    if (printAlamat1 == false)
                    {
                        printAlamat1 = true;
                        printESC.PROW(true, 1, "|" + "  |" + alamat1 + "|" + jKoli.ToString().PadLeft(4) +
                                      "|" + noNota + "|" + noSJ + "| " + tunaiKredit + " |" + sales.PadRight(11) + "|" + ket.PadRight(14) + "| " + printESC.SPACE(23) + " |");
                    }
                    else if (printAlamat2 == false)
                    {
                        printAlamat2 = true;
                        printESC.PROW(true, 1, "|" + "  |" + alamat2.PadRight(31) + "|" + jKoli.ToString().PadLeft(4) +
                                      "|" + noNota + "|" + noSJ + "| " + tunaiKredit + " |" + sales.PadRight(11) + "|" + ket.PadRight(14) + "| " + printESC.SPACE(23) + " |");
                    }
                    else
                    {
                        printESC.PROW(true, 1, "|" + "  |" + printESC.SPACE(31) + "|" + jKoli.ToString().PadLeft(4) +
                                      "|" + noNota + "|" + noSJ + "| " + tunaiKredit + " |" + sales.PadRight(11) + "|" + ket.PadRight(14) + "| " + printESC.SPACE(23) + " |");
                    }
                    firstRecord = true;
                    row++;
                    ctr++;
                }
                else if (printAlamat1 == false && printAlamat2 == false && firstRecord == false)
                {
                    printESC.PROW(true, 1, "|  |" + alamat1 + "|    |       |       |   |           |              |                         |");
                    row += 1;
                    ctr  = ctr + 1;
                    if (!string.IsNullOrEmpty(alamat2.Trim()))
                    {
                        printESC.PROW(true, 1, "|  |" + alamat2.PadRight(31) + "|    |       |       |   |           |              |                         |");
                        row += 1;
                        ctr  = ctr + 1;
                    }
                    //row += 2;
                    //ctr = ctr + 2;
                    firstRecord  = true;
                    printAlamat1 = true;
                    printAlamat2 = true;
                }
                else
                {
                    no++;
                    if (row < 5 && first == false)
                    {
                        for (int i = 0; i < 5 - row; i++)
                        {
                            printESC.PROW(true, 1, "|  |                               |    |       |       |   |           |              |                         |");
                        }



                        ctr = ctr + (5 - row);
                    }
                    row = 0;
                    if (no != 1)
                    {
                        printESC.PROW(true, 1, "|  |                               |    |       |       |   |           |              | ....................... |");
                        row += 1;
                        ctr  = ctr + 1;
                    }
                    else
                    {
                        row += 1;
                    }

                    if ((ctr >= 47) && (recordCount != dt.Rows.Count))
                    {
                        ctr = 0;
                        printESC.PROW(true, 1, "|  |                               |    |       |       |   |           |              |                         |");
                        printESC.PROW(true, 1, "==================================================================================================================");
                        printESC.Eject();
                        printESC.Append(PrintHeader(dt));
                        ctr   = 12;
                        first = true;
                    }
                    printESC.PROW(true, 1, "|" + no.ToString().PadLeft(2) + "|" + namaToko.PadRight(31) + "|" + jKoli.ToString().PadLeft(4) +
                                  "|" + noNota + "|" + noSJ + "| " + tunaiKredit + " |" + sales.PadRight(11) + "|" + ket.PadRight(14) + "| " + "                       " + " |");

                    firstRecord  = true;
                    printAlamat1 = false;
                    printAlamat2 = false;
                    first        = false;
                    row         += 1;
                    ctr          = ctr + 1;
                }

                lastToko    = kodeToko_;
                lastAlamat1 = alamat1;
            }
            if (row < 5)
            {
                for (int i = 0; i < 5 - row; i++)
                {
                    printESC.PROW(true, 1, "|  |                               |    |       |       |   |           |              |                         |");
                }
                ctr = ctr + (5 - row);
            }
            printESC.PROW(true, 1, "------------------------------------------------------------------------------------------------------------------");
            printESC.PROW(true, 1, "|            TOTAL KOLI            |" + nKoli.ToString().PadLeft(4) + "|                                                                        |");
            printESC.PROW(true, 1, "==================================================================================================================");
            printESC.Eject();

            printESC.SendToFile("PengantarSuratJalan.txt");
        }
Beispiel #8
0
        private void CetakBORaw(DataTable dt)
        {
            BuildString detail = new BuildString();

            const int RowsPerPage = 16;
            int       nMaxHal     = dt.Rows.Count;
            int       nHal        = 0;
            int       nUrut       = 0;
            double    x           = (nMaxHal / RowsPerPage);

            nMaxHal = nMaxHal % RowsPerPage == 0 ? (int)Math.Round(x, 0) : (int)(nMaxHal / RowsPerPage) + 1;
            detail.Append(CetakHeaderBO(dt, nUrut, nMaxHal, out nHal));

            #region Cetak Detail
            double nJumlah = 0;

            string NamaStok      = string.Empty;
            string KodeRak       = string.Empty;
            string Satuan        = string.Empty;
            string Dikirim       = string.Empty;
            string tempQSisa     = string.Empty;
            string JumlahDo      = string.Empty;
            string HargaJual     = string.Empty;
            string HargaNet      = string.Empty;
            string JumlahDiskon  = string.Empty;
            int    QtyDO         = 0;
            int    QtySuratJalan = 0;

            int    QSisa = 0;
            double Net   = 0;

            detail.FontCondensed(true);
            foreach (DataRow dr in dt.Rows)
            {
                nUrut++;
                NamaStok      = dr["NamaBarang"].ToString().PadRight(65, '.');
                KodeRak       = detail.STR(7, dr["KodeRak"].ToString());
                Satuan        = detail.STR(3, dr["Satuan"].ToString());
                QtyDO         = int.Parse(dr["QtyDO"].ToString());
                QtySuratJalan = int.Parse(Tools.isNull(dr["QtySuratJalan"], "0").ToString());
                Dikirim       = nUrut % 2 == 1 ? detail.STR(3, nUrut.ToString()) + ".[_______]             " : detail.STR(16, nUrut.ToString()) + ".[_______]";
                QSisa         = int.Parse(Tools.isNull(dr["QtySisa"], "0").ToString());
                Net           = double.Parse(Tools.isNull(dr["HrgNet"], "0").ToString());
                JumlahDo      = Convert.ToString((QtyDO - QtySuratJalan));
                nJumlah       = nJumlah + Net;
                tempQSisa     = QSisa == 0 ? "      0" : QSisa.ToString("#,###").PadLeft(7, ' ');
                HargaJual     = double.Parse(dr["HrgJual"].ToString()).ToString("#,###");
                HargaNet      = double.Parse(dr["HrgNet"].ToString()).ToString("#,###");
                JumlahDiskon  = double.Parse(dr["JmlDisc"].ToString()).ToString("#,###");

                JumlahDiskon = string.IsNullOrEmpty(JumlahDiskon) == true ? "0" : JumlahDiskon;

                detail.PROW(true, 1, detail.STR(2, nUrut.ToString()) + ". " + NamaStok + " " + KodeRak + " " + detail.STR(5, JumlahDo) + " " + Satuan + Dikirim + detail.STR(9, HargaJual) + " " + detail.STR(10, JumlahDiskon) + " " + detail.STR(10, HargaNet) + " " + tempQSisa);

                if ((nUrut % RowsPerPage == 0) && (nHal < nMaxHal))
                {
                    detail.PROW(true, 1, detail.PrintDoubleLine(164));
                    detail.PROW(true, 1, "A/R-SAS : " + SecurityManager.UserName + ", Tgl." + DateTime.Now.ToString("dd-MMM-yyy") + " Jam " + DateTime.Now.ToShortTimeString());
                    detail.PROW(true, 1, "");
                    detail.PROW(true, 1, "  (    Bag. Piutang    )          (    Bag. Penjualan    )          (    Bag. Gudang    )        (   Bag. Cheker I   )        (   Bag. Cheker II   )");
                    detail.Eject();
                    detail.Append(CetakHeaderBO(dt, nUrut, nMaxHal, out nHal));
                }
            }
            if (nUrut % RowsPerPage != 0)
            {
                for (int i = nUrut + 1; i <= nUrut + (RowsPerPage - (nUrut % RowsPerPage)); i++)
                {
                    detail.PROW(true, 1, detail.STR(2, i.ToString()) + ". ");
                }
            }
            #endregion

            #region Footer

            detail.PROW(true, 1, detail.PrintDoubleLine(151));
            detail.PROW(true, 1, "A/R-SAS : " + SecurityManager.UserName + ", Tgl." + DateTime.Now.ToString("dd-MMM-yyy") + " Jam " + DateTime.Now.ToShortTimeString());
            detail.DoubleWidth(true);
            detail.FontItalic(true);
            detail.AddCR();
            detail.PROW(false, 43, "Total D.O ");
            detail.PROW(false, 59, "Rp." + nJumlah.ToString("#,###").PadLeft(14, ' '));
            detail.DoubleWidth(false);
            detail.FontItalic(false);
            detail.PROW(true, 1, "  (    Bag. Piutang    )          (    Bag. Penjualan    )          (    Bag. Gudang    )        (   Bag. Cheker I   )        (   Bag. Cheker II   )");
            detail.Eject();
            #endregion

            detail.SendToPrinter("bo.txt");
        }
Beispiel #9
0
        private string CetakHeaderBO(DataTable dt, int nUrut, int nMaxHal, out int nHlm)
        {
            BuildString header = new BuildString();

            const int RowsPerPage = 16;

            int nHal = (int)Math.Round((nUrut / RowsPerPage) + 0.4, 0) + 1;

            nHlm = nHal;

            string cat1         = dt.Rows[0]["Catatan1"].ToString();
            string cat2         = dt.Rows[0]["Catatan2"].ToString();
            string sales        = GetSales();
            string namaToko     = dt.Rows[0]["NamaToko"].ToString();
            string cClass       = dt.Rows[0]["StsToko"].ToString();
            string TglDO        = header.GetDayName(DateTime.Now.DayOfWeek.ToString()) + ", " + DateTime.Now.ToString("dd-MMM-yyyy");
            string DO           = dt.Rows[0]["NoDO"].ToString() + " " + header.GetDayName(Convert.ToDateTime(dt.Rows[0]["TglDO"].ToString()).DayOfWeek.ToString()) + ", " + Convert.ToDateTime(dt.Rows[0]["TglDO"].ToString()).ToString("dd-MMM-yyyy");
            string noRq         = dt.Rows[0]["NoRequest"].ToString() + " " + header.GetDayName(Convert.ToDateTime(dt.Rows[0]["TglRequest"].ToString()).DayOfWeek.ToString()) + ", " + Convert.ToDateTime(dt.Rows[0]["TglRequest"].ToString()).ToString("dd-MMM-yyyy");
            string alamatKirim  = header.Alamat(dt.Rows[0]["Alamat"].ToString());
            string nSpace       = namaToko.Trim() + header.SPACE(namaToko.Trim().Length + (15 - namaToko.Trim().Length) - 7) + cClass;
            string waktu        = dt.Rows[0]["HariKredit"].ToString() + " Hari / ";
            string wilID        = dt.Rows[0]["WilID"].ToString().Trim();
            string daerah       = header.Daerah(dt.Rows[0]["Daerah"].ToString()) + "(Wil: " + wilID + ") ";
            string kota         = header.Kota(dt.Rows[0]["Kota"].ToString());
            string expedisi     = dt.Rows[0]["Expedisi"].ToString();
            string namaExpedisi = dt.Rows[0]["NamaExpedisi"].ToString();
            double plafon       = double.Parse(dt.Rows[0]["Plafon"].ToString());
            string grade        = dt.Rows[0]["Grade"].ToString();

            #region Cetak Header
            header.Initialize();
            header.FontCondensed(false);
            header.FontCPI(12);
            header.PageLLine(33);
            header.LeftMargin(1);
            header.BottomMargin(1);
            header.DoubleHeight(true);
            header.DoubleWidth(true);
            header.PROW(true, 1, "DELIVERY ORDER  (BO)");
            header.DoubleHeight(false);
            header.DoubleWidth(false);
            header.LetterQuality(true);
            header.FontCPI(12);
            header.FontBold(true);
            header.PROW(true, 1, header.Sales(sales));
            header.FontBold(false);
            header.FontItalic(false);
            header.LineSpacing("1/6");
            header.FontItalic(true);
            header.AddCR();
            header.Append(" ");
            header.FontItalic(false);
            header.FontCondensed(true);
            header.PROW(false, 53, header.PrintTopLeftCorner() + header.PrintHorizontalLine(2) + " Pengiriman kepada Toko " + header.PrintHorizontalLine(14) + header.PrintTopRightCorner());
            header.PROW(true, 1, cat1.PadRight(47, ' '));
            header.PROW(false, 51, header.PrintVerticalLine() + header.SPACE(40) + header.PrintVerticalLine());
            header.FontBold(true);
            header.AddCR();
            header.PROW(false, 55, nSpace);
            header.FontBold(false);
            header.FontBold(true);
            header.PROW(true, 1, "TGL.DOBO  : ");
            header.FontBold(false);
            header.FontItalic(true);
            header.AddCR();
            header.PROW(false, 13, TglDO);
            header.FontItalic(false);
            header.PROW(false, 53, header.PrintVerticalLine() + header.SPACE(40) + header.PrintVerticalLine());
            //header.FontCondensed(true);
            header.FontItalic(true);
            header.AddCR();
            header.PROW(false, 92, alamatKirim);
            header.FontItalic(false);
            //header.FontCondensed(false);
            header.FontBold(true);
            header.PROW(true, 1, "ASAL D.O  : ");
            header.FontBold(false);
            header.FontItalic(true);
            header.AddCR();
            header.PROW(false, 13, DO);
            header.FontItalic(false);
            header.PROW(false, 53, header.PrintVerticalLine() + header.SPACE(40) + header.PrintVerticalLine());
            header.FontItalic(true);
            header.AddCR();
            header.PROW(false, 55, daerah);
            header.FontItalic(false);
            header.FontBold(true);
            header.PROW(true, 1, "JK.WAKTU  : ");
            header.FontBold(false);
            header.FontItalic(true);
            header.AddCR();
            header.PROW(false, 13, waktu + cat2.PadRight(20, ' '));
            header.FontItalic(false);
            header.PROW(false, 53, header.PrintVerticalLine() + header.SPACE(40) + header.PrintVerticalLine());
            header.FontItalic(true);
            header.AddCR();
            header.PROW(false, 55, kota);
            header.FontItalic(false);
            header.FontBold(true);
            header.PROW(true, 1, "NOMOR RQ. : ");
            header.FontBold(false);
            header.FontItalic(true);
            header.AddCR();
            header.PROW(false, 13, noRq);
            header.FontItalic(false);
            header.PROW(false, 53, header.PrintVerticalLine() + header.SPACE(31) + "Grade:   " + header.PrintVerticalLine());
            header.FontItalic(true);
            header.AddCR();
            header.PROW(false, 55, "PLAFON :" + plafon.ToString("#,###").PadLeft(14, ' '));
            header.FontItalic(false);
            header.PROW(false, 91, header.STR(2, grade));
            header.FontItalic(false);
            header.FontBold(true);
            header.PROW(true, 1, "EXPEDISI  : ");
            header.FontBold(false);
            header.FontItalic(true);
            header.AddCR();
            header.PROW(false, 13, expedisi + " (" + namaExpedisi + ")");
            header.FontItalic(false);
            header.PROW(false, 53, header.PrintBottomLeftCorner() + header.PrintHorizontalLine(40) + header.PrintBottomRightCorner());
            header.LetterQuality(false);
            //header.FontCondensed(true);
            header.LineSpacing("1/6");
            header.PROW(true, 1, "No. N a m a   B a r a n g                                            RAK   Dipesan            Dikirim             H.Sat.   Disc./Pot. Jml.Net    Stok");
            header.PROW(true, 1, header.PrintDoubleLine(151));

            #endregion

            return(header.GenerateString());
        }
        private void PrintRawSuratJalan(DataTable dt)
        {
            BuildString suratJalan = new BuildString();
            int         jumlahkoli = 0;

            #region Header

            string nosj     = dt.Rows[0]["NoSuratJalan"].ToString();
            string namatoko = dt.Rows[0]["NamaToko"].ToString();
            string alamat   = dt.Rows[0]["Alamat"].ToString();
            string tmp      = string.Empty;

            if (alamat.Length > 28)
            {
                tmp = alamat.Substring(0, 28);
            }
            else
            {
                tmp = alamat + " ";
            }

            int    pos          = tmp.LastIndexOf(' ');
            string alamat1      = tmp.Substring(0, pos);
            string alamat3      = dt.Rows[0]["Alamat3"].ToString();
            string alamat2      = alamat.Substring(pos).Trim() + alamat3;
            string kota         = dt.Rows[0]["Kota"].ToString();
            string kodeexpedisi = dt.Rows[0]["KodeExp1"].ToString();

            string[] namaexpedisi = new string[4];
            namaexpedisi[1] = dt.Rows[0]["NamaExpedisi1"].ToString();
            namaexpedisi[2] = dt.Rows[0]["NamaExpedisi2"].ToString();
            namaexpedisi[3] = dt.Rows[0]["NamaExpedisi3"].ToString();

            string   idwil         = dt.Rows[0]["WilID"].ToString();
            string   tlp           = dt.Rows[0]["Telp"].ToString();
            DateTime tglsuratjalan = DateTime.Parse(dt.Rows[0]["TglSuratJalan"].ToString());


            suratJalan.Initialize();
            suratJalan.Append((char)27 + "@" + (char)27 + "C" + (char)33 + (char)27 + "M");
            suratJalan.Append(Convert.ToString((char)27) + Convert.ToString((char)33) + Convert.ToString((char)1));
            suratJalan.PROW(true, 1, "");
            suratJalan.PROW(true, 1, suratJalan.PadCenter(80, "SURAT JALAN"));
            suratJalan.PROW(true, 1, "");
            suratJalan.PROW(true, 1, "NO.         : " + nosj.PadRight(14) + suratJalan.SPACE(20) + "KEPADA YTH :");
            suratJalan.PROW(true, 1, "KENDARAAN   : .............." + suratJalan.SPACE(20) + namatoko);
            suratJalan.PROW(true, 1, "NO. POLISI  : .............." + suratJalan.SPACE(20) + alamat1);

            if (kodeexpedisi == "SAS")
            {
                //kodeexpedisi = suratJalan.SPACE(3);
                suratJalan.PROW(true, 1, "EXPEDISI    : " + kodeexpedisi.PadRight(34) + (string.IsNullOrEmpty(alamat2) == true ? kota : alamat2));
                if (!string.IsNullOrEmpty(alamat2))
                {
                    suratJalan.PROW(true, 1, "TANGGAL     : " + tglsuratjalan.ToString("dd-MMM-yyyy").PadRight(14) + suratJalan.SPACE(20) + kota);
                    suratJalan.PROW(true, 1, suratJalan.SPACE(48) + "WIL : " + idwil + (string.IsNullOrEmpty(tlp) == true ? tlp : ",TELP : " + tlp));
                }
                else
                {
                    suratJalan.PROW(true, 1, "TANGGAL     : " + tglsuratjalan.ToString("dd-MMM-yyyy").PadRight(14) + suratJalan.SPACE(20) + "WIL : " + idwil + (string.IsNullOrEmpty(tlp) == true ? tlp : ",TELP : " + tlp));
                }
            }
            else
            {
                suratJalan.PROW(true, 1, "EXPEDISI    : " + namaexpedisi[1].PadRight(34) + (string.IsNullOrEmpty(alamat2) == false ? alamat2 : kota));
                if (!string.IsNullOrEmpty(namaexpedisi[2]) && !string.IsNullOrEmpty(namaexpedisi[3]))
                {
                    //suratJalan.PROW(true, 1, suratJalan.SPACE(14) + namaexpedisi[2].PadRight(34) + (string.IsNullOrEmpty(alamat2) == false ? kota : "WIL : " + idwil) + (string.IsNullOrEmpty(tlp) == true ? tlp : ", TELP : "+ tlp));
                    //suratJalan.PROW(true, 1, suratJalan.SPACE(14) + namaexpedisi[3].PadRight(34) + (string.IsNullOrEmpty(alamat2) == false ? "WIL : " + idwil : "") + (string.IsNullOrEmpty(tlp) == true ? tlp : ", TELP : "+ tlp));
                    suratJalan.PROW(true, 1, "TANGGAL     : " + tglsuratjalan.ToString("dd-MMM-yyyy").PadRight(14));
                }
                else if (!string.IsNullOrEmpty(namaexpedisi[2]) && string.IsNullOrEmpty(namaexpedisi[3]))
                {
                    //suratJalan.PROW(true, 1, suratJalan.SPACE(14) + namaexpedisi[2].PadRight(34) + (string.IsNullOrEmpty(alamat2) == false ? kota : "WIL : " + idwil) + (string.IsNullOrEmpty(tlp) == true ? tlp : ", TELP : "+ tlp));
                    suratJalan.PROW(true, 1, "TANGGAL     : " + tglsuratjalan.ToString("dd-MMM-yyyy").PadRight(14) + suratJalan.SPACE(20) + (string.IsNullOrEmpty(alamat2) == false ? "WIL : " + idwil : "") + (string.IsNullOrEmpty(tlp) == true ? tlp : ", TELP : " + tlp));
                }
                else if (string.IsNullOrEmpty(namaexpedisi[2]) && string.IsNullOrEmpty(namaexpedisi[3]))
                {
                    suratJalan.PROW(true, 1, "TANGGAL     : " + tglsuratjalan.ToString("dd-MMM-yyyy").PadRight(14) + suratJalan.SPACE(20) + (string.IsNullOrEmpty(alamat2) == false ? kota : "WIL : " + idwil) + (string.IsNullOrEmpty(tlp) == true ? tlp : ", TELP : " + tlp));
                    if (!string.IsNullOrEmpty(alamat2))
                    {
                        suratJalan.PROW(true, 1, suratJalan.SPACE(58) + "WIL : " + idwil + (string.IsNullOrEmpty(tlp) == true ? tlp : ", TELP : " + tlp));
                    }
                }
            }
            suratJalan.PROW(true, 1, suratJalan.PrintEqualSymbol(88));
            suratJalan.PROW(true, 1, "  NO.DO  NO.NOTA    SALES       URAIAN    JUMLAH  SATUAN           KETERANGAN           ");
            suratJalan.PROW(true, 1, suratJalan.Replicate(".", 88));

            #endregion

            #region Detail

            string nonota     = string.Empty;
            string nodo       = string.Empty;
            string sales      = string.Empty;
            string lastNoNota = string.Empty;
            string uraian     = string.Empty;
            string ket        = string.Empty;
            string satuan     = string.Empty;
            int    jumlah     = 0;

            foreach (DataRow dr in dt.Rows)
            {
                nonota = dr["NoNota"].ToString();
                nodo   = dr["NoDO"].ToString();
                sales  = dr["Sales"].ToString();
                uraian = dr["Uraian"].ToString();
                ket    = dr["Keterangan"].ToString();
                satuan = dr["Satuan"].ToString();
                jumlah = int.Parse(dr["Jumlah"].ToString());

                jumlahkoli += jumlah;

                if (lastNoNota.Equals(nonota))
                {
                    sales  = suratJalan.SPACE(11);
                    nodo   = suratJalan.SPACE(7);
                    nonota = suratJalan.SPACE(7);
                }
                else
                {
                    lastNoNota = nonota;
                }

                suratJalan.PROW(true, 1, " " + nodo +
                                " " + nonota +
                                " " + sales +
                                " " + uraian.PadRight(12) +
                                " " + jumlah.ToString("#,###;(#,###);#").PadLeft(7) +
                                " " + suratJalan.PadCenter(6, satuan) +
                                " " + ket.PadRight(30));
            }

            #endregion

            #region Footer
            string namacabang     = dt.Rows[0]["NamaCabang"].ToString();
            string alamatexpedisi = dt.Rows[0]["AlamatExpedisi"].ToString();
            string tlpexpedisi    = dt.Rows[0]["TlpExpedisi"].ToString();

            suratJalan.PROW(true, 1, suratJalan.PrintEqualSymbol(88));

            if (dt.Rows[0]["KodeExp1"].ToString() != "SAS")
            {
                //suratJalan.PROW(true, 1, "KEMBALI KE SAS " + namacabang +" ***"+ suratJalan.SPACE(4) + jumlahkoli.ToString("#,##0").PadLeft(6));
                suratJalan.PROW(true, 1, suratJalan.SPACE(41) + jumlahkoli.ToString("#,##0").PadLeft(6) + suratJalan.SPACE(11) + (char)27 + (char)33 + (char)24 + "FRANGKO" + (char)27 + (char)33 + (char)1);
            }
            else
            {
                suratJalan.PROW(true, 1, suratJalan.SPACE(41) + jumlahkoli.ToString("#,##0").PadLeft(6) + suratJalan.SPACE(11) + (char)27 + (char)33 + (char)24 + "FRANGKO" + (char)27 + (char)33 + (char)1);
            }

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

            if (dt.Rows[0]["KodeExp1"].ToString() != "SAS")
            {
                suratJalan.PROW(true, 1, "ALAMAT Expedisi : " + alamatexpedisi + " " + tlpexpedisi);
                suratJalan.PROW(true, 1, "");
            }

            suratJalan.PROW(true, 1, "           PENERIMA                     PENGIRIMAN                    SOPIR");
            suratJalan.PROW(true, 1, "");
            suratJalan.PROW(true, 1, "");
            suratJalan.PROW(true, 1, "");
            suratJalan.PROW(true, 1, "");
            suratJalan.PROW(true, 1, "         (..........)                  (...........)               (............)");
            suratJalan.PROW(true, 1, SecurityManager.UserName + ", Tgl." + DateTime.Now.ToString("dd-MMM-yyyy") + " Jam " + DateTime.Now.ToShortTimeString());
            suratJalan.Eject();

            #endregion

            suratJalan.SendToFile("RekapKoli.txt");
            //suratJalan.SendToPrinter("RekapKoli.txt");
        }
        private void CetakTagih2(DataTable dtCetak, int nMulai)
        {
            BuildString PrintTagih = new BuildString();

            string NamaToko  = dtCetak.Rows[0]["NamaToko"].ToString();
            string Alamat    = dtCetak.Rows[0]["AlamatKirim"].ToString();
            string Kota      = dtCetak.Rows[0]["Kota"].ToString();
            string Daerah    = dtCetak.Rows[0]["Daerah"].ToString();
            string Propinsi  = dtCetak.Rows[0]["Propinsi"].ToString();
            string WilID     = dtCetak.Rows[0]["WilID"].ToString();
            string InfoTagih = dtCetak.Rows[0]["RefCollector"].ToString();
            string Telp      = dtCetak.Rows[0]["Telp"].ToString();
            int    nn        = nMulai;
            int    nRec      = dtCetak.Rows.Count;

            Alamat += ", " + Kota;
            Daerah  = (string.IsNullOrEmpty(Daerah) == true ? string.Empty : Daerah + ", ") +
                      (string.IsNullOrEmpty(Propinsi) == true ? string.Empty : Propinsi + "  ") +
                      (string.IsNullOrEmpty(WilID) == true ? string.Empty : "(" + WilID + ")");
            NamaToko += string.IsNullOrEmpty(Telp) == true ? string.Empty : "  ==>  TELPON : " + Telp;

            PrintTagih.FontCondensed(true);
            PrintTagih.PageLLine(33);

            for (int i = 1; i <= 9 + (nn - 1); i++)
            {
                PrintTagih.PROW(true, 1, "");
            }

            int      ctr        = 1;
            double   Total      = 0;
            string   NoNota     = string.Empty;
            string   IdTr       = string.Empty;
            string   KodeSales  = string.Empty;
            string   HariKredit = string.Empty;
            DateTime TglTerima;
            DateTime TglJT;
            double   RpNet3 = 0;

            foreach (DataRowView dr in dtCetak.DefaultView)
            {
                NoNota     = dr["NoNota"].ToString();
                IdTr       = dr["TransactionType"].ToString();
                TglTerima  = DateTime.Parse(dr["TglTerima"].ToString());
                KodeSales  = dr["KodeSales"].ToString();
                HariKredit = dr["HariKredit"].ToString();
                TglJT      = DateTime.Parse(dr["TglJT"].ToString());
                RpNet3     = double.Parse(dr["RpNet3"].ToString());

                if (nn >= nMulai)
                {
                    PrintTagih.PROW(true, 1, "  " +
                                    "   " + TglTerima.ToString("dd-MM-yyyy") +
                                    " " + NoNota +
                                    " " + IdTr +
                                    "  " + KodeSales +
                                    "  " + HariKredit.PadLeft(2) +
                                    "  " + TglJT.ToString("dd-MM-yyyy") +
                                    " " + RpNet3.ToString("#,##0").PadLeft(13) +
                                    "                         ");
                }

                if (nn == 12)
                {
                    PrintTagih.Eject();
                    break;
                }
                nn++;
            }

            //int ii = 1;
            ctr   = 1;
            Total = 0;

            if (nRec > 12)
            {
                PrintTagih.Append(CetakHeader(NamaToko, Alamat, Daerah));
                foreach (DataRow dr in dtCetak.Rows)
                {
                    NoNota     = dr["NoNota"].ToString();
                    IdTr       = dr["TransactionType"].ToString();
                    TglTerima  = DateTime.Parse(dr["TglTerima"].ToString());
                    KodeSales  = dr["KodeSales"].ToString();
                    HariKredit = dr["HariKredit"].ToString();
                    TglJT      = DateTime.Parse(dr["TglJT"].ToString());
                    RpNet3     = double.Parse(dr["RpNet3"].ToString());
                    Total     += RpNet3;

                    //if (nn > 12) // <- Logic yg aneh dr sistem yg lama
                    //{
                    PrintTagih.PROW(true, 1, "³" + ctr.ToString().PadLeft(2) +
                                    "³ " + TglTerima.ToString("dd-MM-yyyy") +
                                    "³" + NoNota +
                                    "³" + IdTr +
                                    " ³" + KodeSales +
                                    " ³" + HariKredit.PadLeft(2) +
                                    "³ " + TglJT.ToString("dd-MM-yyyy") +
                                    "³" + RpNet3.ToString("#,##0").PadLeft(13) +
                                    "³           ³           ³");

                    if (ctr == 12)     //<- Original if (ii == 13), logic yg aneh. ??
                    {
                        PrintTagih.PROW(true, 1, "ÔÍÍÏÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÏÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍÍÏÍÍÏÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍ;");
                        PrintTagih.PROW(true, 1, "                                             Jumlah     " + Total.ToString("#,##0").PadLeft(13));
                        PrintTagih.Eject();
                        ctr = 0;
                        //ii = 1;
                        Total = 0;
                        PrintTagih.Append(CetakHeader(NamaToko, Alamat, Daerah));
                    }
                    //}

                    ctr++;
                    //ii++;
                    nn++;
                }

                nn = (12 - ctr);
                for (int j = 1; j <= (nn + 1); j++)
                {
                    PrintTagih.PROW(true, 1, "³" + ctr.ToString().PadLeft(2) + "³" + "           ³       ³   ³            ³  ³           ³             ³           ³           ³");
                    ctr++;
                }
                PrintTagih.PROW(true, 1, "ÔÍÍÏÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÏÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍÍÏÍÍÏÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍ;");
                PrintTagih.PROW(true, 1, "                                             Jumlah     " + Total.ToString("#,##0").PadLeft(13));
            }

            PrintTagih.FontCondensed(false);
            PrintTagih.Eject();
            //PrintTagih.SendToPrinter("RencanaTagihan2.txt");
            PrintTagih.SendToFile("RencanaTagihan2.txt");
        }
        private void CetakTagih1(DataTable dtCetak)
        {
            BuildString PrintTagih = new BuildString();

            string NamaToko  = dtCetak.Rows[0]["NamaToko"].ToString();
            string Alamat    = dtCetak.Rows[0]["AlamatKirim"].ToString();
            string Kota      = dtCetak.Rows[0]["Kota"].ToString();
            string Daerah    = dtCetak.Rows[0]["Daerah"].ToString();
            string Propinsi  = dtCetak.Rows[0]["Propinsi"].ToString();
            string WilID     = dtCetak.Rows[0]["WilID"].ToString();
            string InfoTagih = dtCetak.Rows[0]["RefCollector"].ToString();
            string Telp      = dtCetak.Rows[0]["Telp"].ToString();

            Alamat += ", " + Kota;
            Daerah  = (string.IsNullOrEmpty(Daerah) == true ? string.Empty : Daerah + ", ") +
                      (string.IsNullOrEmpty(Propinsi) == true ? string.Empty : Propinsi + "  ") +
                      (string.IsNullOrEmpty(WilID) == true ? string.Empty : "(" + WilID + ")");
            NamaToko += string.IsNullOrEmpty(Telp) == true ? string.Empty : "  ==>  TELPON : " + Telp;

            PrintTagih.FontCondensed(true);
            PrintTagih.PageLLine(33);
            PrintTagih.Append(CetakHeader(NamaToko, Alamat, Daerah));

            int      ctr        = 1;
            double   Total      = 0;
            string   NoNota     = string.Empty;
            string   IdTr       = string.Empty;
            string   KodeSales  = string.Empty;
            string   HariKredit = string.Empty;
            DateTime TglTerima;
            DateTime TglJT;
            double   RpNet3 = 0;

            foreach (DataRowView dr in dtCetak.DefaultView)
            {
                NoNota     = dr["NoNota"].ToString();
                IdTr       = dr["TransactionType"].ToString();
                TglTerima  = DateTime.Parse(dr["TglTerima"].ToString());
                KodeSales  = dr["KodeSales"].ToString();
                HariKredit = dr["HariKredit"].ToString();
                TglJT      = DateTime.Parse(dr["TglJT"].ToString());
                RpNet3     = double.Parse(dr["RpNet3"].ToString());
                Total     += RpNet3;

                PrintTagih.PROW(true, 1, "³" + ctr.ToString().PadLeft(2) +
                                "³ " + TglTerima.ToString("dd-MM-yyyy") +
                                "³" + NoNota +
                                "³" + IdTr +
                                " ³" + KodeSales.PadRight(11) +
                                " ³" + HariKredit.PadLeft(2) +
                                "³ " + TglJT.ToString("dd-MM-yyyy") +
                                "³" + RpNet3.ToString("#,##0").PadLeft(13) +
                                "³           ³           ³");
                if (ctr == 12)
                {
                    PrintTagih.PROW(true, 1, "ÔÍÍÏÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÏÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍÍÏÍÍÏÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍ;");
                    PrintTagih.PROW(true, 1, "                                             Jumlah     " + Total.ToString("#,##0").PadLeft(13));
                    PrintTagih.Eject();
                    ctr   = 0;
                    Total = 0;
                    PrintTagih.Append(CetakHeader(NamaToko, Alamat, Daerah));
                }
                ctr++;
            }

            int n = 12 - (ctr - 1);

            for (int i = 1; i <= n + 1; i++)
            {
                PrintTagih.PROW(true, 1, "³" + ctr.ToString().PadLeft(2) + "³" + "           ³       ³   ³            ³  ³           ³             ³           ³           ³");
                ctr++;
            }
            PrintTagih.PROW(true, 1, "ÔÍÍÏÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÏÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍÍÏÍÍÏÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍ;");
            PrintTagih.PROW(true, 1, "                                             Jumlah     " + Total.ToString("#,##0").PadLeft(13));
            PrintTagih.PROW(true, 1, "Info Tagih : " + InfoTagih);
            PrintTagih.FontCondensed(false);
            PrintTagih.Eject();

            PrintTagih.SendToPrinter("RencanaTagihan.txt");
            //PrintTagih.SendToFile("RencanaTagihan.txt");
        }