private void CetakPackingListAmplop(DataTable dt) { BuildString data = new BuildString(); string sAlamat = dt.Rows[0]["Alamat"].ToString().Trim(); string sJmlKoli = dt.Compute("SUM(JmlKoli)", string.Empty).ToString(); data.Initialize(); data.LetterQuality(true); data.FontCPI(10); 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.PROW(true, 1, data.SPACE(2) + "JUMLAH KOLI : " + sJmlKoli + " (" + Tools.Terbilang(int.Parse(sJmlKoli)).ToUpper() + ")"); data.PROW(true, 1, ""); data.PROW(true, 1, ""); data.PROW(true, 1, ""); data.PROW(true, 1, ""); data.PROW(true, 1, ""); data.PROW(true, 1, dt.Rows[0]["NamaToko"].ToString().PadLeft(83)); data.PROW(true, 1, data.SPACE(10) + dt.Rows[0]["Catatan3"].ToString().Trim()); data.PROW(true, 1, sAlamat.PadLeft(83)); data.PROW(true, 1, ""); data.PROW(true, 1, dt.Rows[0]["Daerah"].ToString().PadLeft(83)); data.PROW(true, 1, dt.Rows[0]["Kota"].ToString().PadLeft(83)); data.Eject(); data.SendToPrinter("amplop.txt", data.GenerateString()); }
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"); }
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()); }
private void cetakKasbon() { 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, "[ PERTANGGUNGAN UANG MUKA PEGAWAI ]"); lap.DoubleWidth(false); lap.PROW(true, 1, lap.SPACE(85)); lap.PROW(true, 1, "NOMOR".PadRight(12) + lap.PadCenter(3, ":") + TBNoKasbon.Text.PadRight(70)); lap.PROW(true, 1, "TANGGAL".PadRight(12) + lap.PadCenter(3, ":") + String.Format("{0:dd-MMM-yyyy}", tbTanggal.DateValue).PadRight(70)); lap.PROW(true, 1, "NAMA PEGAWAI".PadRight(12) + lap.PadCenter(3, ":") + tbNamaPegawai.Text.PadRight(70)); lap.PROW(true, 1, "NIP/DIVISI".PadRight(12) + lap.PadCenter(3, ":") + tbDivisi.Text.PadRight(70)); lap.PROW(true, 1, "KEPERLUAN".PadRight(12) + lap.PadCenter(3, ":") + tbKeperluan.Text.PadRight(70)); lap.PROW(true, 1, lap.SPACE(85)); lap.PROW(true, 1, lap.SPACE(85)); lap.PROW(true, 1, lap.PrintMinusSymbol(85)); lap.PROW(true, 1, "I. PENGAMBILAN".PadRight(20) + "1.BKK No : " + txtNoBkk.Text + lap.SPACE(5) + txtRpBkk.Text.Trim().PadLeft(15)); lap.PROW(true, 1, lap.SPACE(70) + txtRpTotal.Text.Trim().PadLeft(15)); lap.PROW(true, 1, lap.SPACE(85)); lap.PROW(true, 1, "II. PENGELUARAN".PadRight(85)); lap.PROW(true, 1, lap.SPACE(4) + "- Biaya".PadRight(8) + txtJv.Text.PadRight(33) + lap.SPACE(5) + txtRpBkk.Text.Trim().PadLeft(15)); lap.PROW(true, 1, lap.SPACE(70) + txtRpJv.Text.Trim().PadLeft(15)); lap.PROW(true, 1, lap.SPACE(70) + lap.PrintMinusSymbol(15)); lap.PROW(true, 1, lap.SPACE(55) + "KURANG/LEBIH".PadRight(15) + txtRpLbhKrng.Text.PadLeft(15)); lap.PROW(true, 1, lap.SPACE(85)); lap.PROW(true, 1, "III. PENYELESAIAN".PadRight(85)); lap.PROW(true, 1, lap.SPACE(5) + "KURANG".PadRight(15) + "1.BKK No : " + txtBkk3.Text + lap.SPACE(5) + txtRpBkk3.Text.Trim().PadLeft(15)); lap.PROW(true, 1, lap.SPACE(20) + "2.TRK No : " + txtTrk3.Text + lap.SPACE(5) + txtRpTrk3.Text.Trim().PadLeft(15)); lap.PROW(true, 1, lap.SPACE(70) + string.Format("{0:#,##0}", (Convert.ToDouble(txtRpTrk3.Text) + Convert.ToDouble(txtRpBkk3.Text))).PadLeft(15)); lap.PROW(true, 1, lap.SPACE(85)); lap.PROW(true, 1, lap.SPACE(5) + "LEBIH".PadRight(15) + "1.BKM No : " + txtBkm3.Text + lap.SPACE(5) + txtRpBkm3.Text.Trim().PadLeft(15)); lap.PROW(true, 1, lap.SPACE(20) + "2.TRN No : " + txtTrm3.Text + lap.SPACE(5) + txtRpTrm3.Text.Trim().PadLeft(15)); lap.PROW(true, 1, lap.SPACE(70) + string.Format("{0:#,##0}", (Convert.ToDouble(txtRpTrm3.Text) + Convert.ToDouble(txtRpBkm3.Text))).PadLeft(15)); lap.PROW(true, 1, lap.SPACE(85)); lap.PROW(true, 1, lap.PrintMinusSymbol(85)); lap.PROW(true, 1, "JUMLAH UANG MUKA : Rp." + txtRpTotal.Text.PadLeft(15)); lap.PROW(true, 1, "(" + Tools.Terbilang(Convert.ToDouble(txtRpTotal.Text)) + ")"); lap.PROW(true, 1, lap.SPACE(85)); lap.PROW(true, 1, lap.SPACE(85)); lap.PROW(true, 1, lap.PadCenter(15, "Dibuat") + lap.SPACE(8) + lap.PadCenter(15, "Disetujui") + lap.SPACE(8) + lap.PadCenter(15, "Diketahui") + lap.SPACE(8) + lap.PadCenter(15, "Penerima")); lap.PROW(true, 1, lap.SPACE(85)); lap.PROW(true, 1, lap.SPACE(85)); lap.PROW(true, 1, lap.SPACE(85)); lap.PROW(true, 1, "(" + lap.SPACE(13) + ")" + lap.SPACE(8) + "(" + lap.SPACE(13) + ")" + lap.SPACE(8) + "(" + lap.SPACE(13) + ")" + lap.SPACE(8) + "(" + lap.SPACE(13) + ")"); lap.Eject(); //lap.SendToPrinter("laporanPS.txt"); lap.SendToFile("laporanPS.txt"); }
private void DspReport5(DataTable dt) { //List<ReportParameter> rptParams = new List<ReportParameter>(); //rptParams.Add(new ReportParameter("UserID", SecurityManager.UserID)); //rptParams.Add(new ReportParameter("GroupLokasi", txtKodeRak.Text)); ////call report viewer //frmReportViewer ifrmReport = new frmReportViewer("Persediaan.rptFrmDetailPerKodeRak5.rdlc", rptParams, dt, "dsOpname_Data"); //ifrmReport.Show(); { int i = 0; int No = 0; int n = dt.Rows.Count; BuildString detail = new BuildString(); detail.FontCondensed(true); detail.LeftMargin(0); detail.PageLLine(33); foreach (DataRowView dr in dt.DefaultView) { i++; No++; if (i == 1) { detail.PROW(true, 1, "FORM OPNAME 2014 NOMOR :"); detail.PROW(true, 1, " "); detail.PROW(true, 1, "Tanggal : Hitungan ke :"); detail.PROW(true, 1, "-------------------------------------------------------------------------------------------------------------------------------------------------------"); detail.PROW(true, 1, "|No. | Nama Barang | Sat. | Kode Rak | Baik | Cacat | Rusak |"); detail.PROW(true, 1, "-------------------------------------------------------------------------------------------------------------------------------------------------------"); // |12345|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx| xxxxx| xxxxxxx | | | | } detail.PROW(true, 1, "|" + i.ToString().PadLeft(5, ' ') + "|" + dr["NamaStok"].ToString().PadRight(100) + "| " + detail.PadCenter(5, dr["SatJual"].ToString()) + "| " + dr["Lokasi"].ToString() + " | | | |"); detail.PROW(true, 1, "| | | | | | | |"); detail.PROW(true, 1, "-------------------------------------------------------------------------------------------------------------------------------------------------------"); if ((No == n) || (i == 5 && No != n)) // eof() { i = 0; detail.PROW(true, 1, " Penghitung Pencatat Ka. Area"); detail.PROW(true, 1, " "); detail.PROW(true, 1, " "); detail.PROW(true, 1, " (...............) (..............) (................)"); detail.Eject(); } } detail.SendToPrinter("detailPerKodeRak.txt"); } }
private void DisplayReport2(DataTable dtA) { ////construct parameter //// periode = String.Format("{0} s/d {1}", ((DateTime)rgbTglDO.FromDate.Value).ToString("dd/MM/yyyy"), ((DateTime)rgbTglDO.ToDate.Value).ToString("dd/MM/yyyy")); //List<ReportParameter> rptParams = new List<ReportParameter>(); //// rptParams.Add(new ReportParameter("Periode", periode)); //rptParams.Add(new ReportParameter("UserID", SecurityManager.UserID)); ////call report viewer //frmReportViewer ifrmReport = new frmReportViewer("ArusStock.rptAntarGudangNota.rdlc", rptParams, dtA, "dsAntarGudang_Data"); //ifrmReport.Show(); int i = 0; BuildString ag = new BuildString(); ag.FontCondensed(true); ag.LeftMargin(3); ag.PROW(true, 1, "BPB-AG"); ag.PROW(true, 1, "Gud. Tujuan : " + dtA.Rows[0]["KeGudang"].ToString() + ag.SPACE(50) + "No : " + dtA.Rows[0]["NoAG"].ToString()); ag.PROW(true, 1, "Gud. Pengirim : " + dtA.Rows[0]["DrGudang"].ToString() + ag.SPACE(50) + "Tanggal : " + dtA.Rows[0]["TglKirim"].ToString()); ag.PROW(true, 1, ag.PrintTopLeftCorner() + ag.PrintHorizontalLine(128) + ag.PrintTopRightCorner()); ag.PROW(true, 1, ag.PrintVerticalLine() + ag.PadCenter(5, "NO") + ag.PrintVerticalLine() + ag.PadCenter(110, "NAMA BARANG") + ag.PrintVerticalLine() + ag.PadCenter(5, "SAT") + ag.PrintVerticalLine() + ag.PadCenter(5, "QTY") + ag.PrintVerticalLine()); ag.PROW(true, 1, ag.PrintVerticalLine() + ag.PrintHorizontalLine(128) + ag.PrintVerticalLine()); foreach (DataRowView dr in dtA.DefaultView) { i++; ag.PROW(true, 1, ag.PrintVerticalLine() + ag.PadCenter(5, i.ToString()) + ag.PrintVerticalLine() + dr["NamaStok"].ToString().PadRight(110) + ag.PrintVerticalLine() + ag.PadCenter(5, dr["Satuan"].ToString()) + ag.PrintVerticalLine() + dr["QtyKirim"].ToString().PadLeft(5) + ag.PrintVerticalLine()); } ag.PROW(true, 1, ag.PrintBottomLeftCorner() + ag.PrintHorizontalLine(128) + ag.PrintBottomRightCorner()); ag.PROW(true, 1, ag.PadCenter(30, "Gudang") + ag.SPACE(20) + ag.PadCenter(30, "Checker 1") + ag.SPACE(20) + ag.PadCenter(30, "Checker 2")); ag.PROW(true, 1, ""); ag.PROW(true, 1, ""); ag.PROW(true, 1, ""); ag.PROW(true, 1, "(" + ag.SPACE(28) + ")" + ag.SPACE(20) + "(" + ag.SPACE(28) + ")" + ag.SPACE(20) + "(" + ag.SPACE(28) + ")"); ag.Eject(); ag.SendToPrinter("notaJual.txt"); }
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"); }
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"); }
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 ShowNotepad(DataTable dt) { try { BuildString data = new BuildString(); data.PROW(true, 1, "HASIL DOWNLOAD NO.PERK DARI 11"); data.PROW(true, 1, "==============================================================================================="); data.PROW(true, 1, data.PrintVerticalLine2()); data.PROW(false, 3, "REF"); data.PROW(false, 7, data.PrintVerticalLine2()); data.PROW(false, 10, "No.Perkiraan"); data.PROW(false, 24, data.PrintVerticalLine2()); data.PROW(false, 50, "Nama Perkiraan"); data.PROW(false, 96, data.PrintVerticalLine2()); data.PROW(true, 1, "-----------------------------------------------------------------------------------------------"); foreach (DataRow dr in dt.Rows) { data.PROW(true, 1, data.PrintVerticalLine2()); data.PROW(false, 3, Tools.isNull(dr["ref"], "").ToString().Trim()); data.PROW(false, 7, data.PrintVerticalLine2()); data.PROW(false, 10, Tools.isNull(dr["no_perk"], "").ToString().Trim()); data.PROW(false, 24, data.PrintVerticalLine2()); data.PROW(false, 26, Tools.isNull(dr["uraian"], "").ToString().Trim()); data.PROW(false, 96, data.PrintVerticalLine2()); } data.PROW(true, 1, "==============================================================================================="); data.Eject(); if (File.Exists(Properties.Settings.Default.OutputFile + "\\" + "NoPerk.txt")) { File.Delete(Properties.Settings.Default.OutputFile + "\\" + "NoPerk.txt"); } data.SendToTxt("NoPerk.txt", data.GenerateString()); Process.Start(Properties.Settings.Default.OutputFile + "\\" + "NoPerk.txt"); } catch (Exception ex) { Error.LogError(ex); MessageBox.Show(ex.Message); } }
private void PrintRekapPerBulan(DataTable dt) { try { BuildString data = new BuildString(); data.AddCR(); data.PROW(true, 1, "Kartu Piutang " + lookupToko1.NamaToko.Trim() + " " + lookupToko1.Alamat.Trim() + " " + lookupToko1.Kota.Trim()); data.PROW(true, 1, " " + "Id.Wil: " + lookupToko1.WilID + " Plafon : Rp." + lookupToko1.Plafon.ToString("#,##0")); data.PROW(true, 1, ""); data.PROW(true, 1, " Bulan Penjualan Pembayaran Retur/Tarikan Lain-lain "); data.PROW(true, 1, "============================================================================= "); string bulan = string.Empty; foreach (DataRow dr in dt.Rows) { data.PROW(true, 1, Tools.Left(dr["TglTransaksi"].ToString(), 10) + " " + Tools.Left(dr["Combine"].ToString(), 4) + " " + double.Parse(dr["RpJual"].ToString()).ToString("#,##0") + " " + double.Parse(dr["Rpbayar"].ToString()).ToString("#,##0") + " " + double.Parse(dr["RpRetur"].ToString()).ToString("#,##0") + " " + double.Parse(dr["RpLain"].ToString()).ToString("#,##0") + " " ); } data.PROW(true, 1, "============================================================================= "); data.PROW(true, 1, " " + double.Parse(dt.Compute("SUM(RpJual)", string.Empty).ToString()).ToString("#,##0") + " " + double.Parse(dt.Compute("SUM(Rpbayar)", string.Empty).ToString()).ToString("#,##0") + " " + double.Parse(dt.Compute("SUM(RpRetur)", string.Empty).ToString()).ToString("#,##0") + " " + double.Parse(dt.Compute("SUM(RpLain)", string.Empty).ToString()).ToString("#,##0") + " " ); data.Eject(); data.SendToPrinter("show.txt", data.GenerateString()); Process.Start(Properties.Settings.Default.OutputFile + "\\" + "show.txt"); } catch (System.Exception ex) { Error.LogError(ex); MessageBox.Show(ex.Message); } }
public void cetakLaporan() { int i = 0; double total = 0, jumlah; string _Terima, _NoBukti, _Tanggal, _Lampiran, _Kasir; _Terima = asalGiro; _NoBukti = noBKM; _Lampiran = " "; _Tanggal = tglCair.ToString("dd-MMM-yyyy"); _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 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 : 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 dtBKMDetail.Rows) { jumlah = Convert.ToDouble(dr["Jumlah"].ToString()); lap.PROW(true, 1, lap.PrintVerticalLine() + "".ToString().Trim().PadRight(10) + dr["Uraian"].ToString().ToUpper().PadRight(58).Substring(0, 58) + jumlah.ToString("#,###").PadLeft(15) + lap.PrintVerticalLine()); total += Convert.ToDouble(dr["Jumlah"].ToString()); i++; } if (i < 10) { for (int j = 0; j < 10 - i; j++) { lap.PROW(true, 1, lap.PrintVerticalLine() + lap.SPACE(83) + lap.PrintVerticalLine()); } } lap.PROW(true, 1, lap.PrintTLeft() + lap.PrintHorizontalLine(83) + lap.PrintTRight()); lap.PROW(true, 1, lap.PrintVerticalLine() + "Terbilang".PadRight(58) + "Jumlah Rp.".PadRight(10) + total.ToString("#,###").PadLeft(15) + lap.PrintVerticalLine()); lap.PROW(true, 1, lap.PrintTLeft() + lap.PrintHorizontalLine(83) + lap.PrintTRight()); lap.PROW(true, 1, lap.PrintVerticalLine() + ISA.Common.Tools.Terbilang(total).PadRight(83) + lap.PrintVerticalLine()); lap.PROW(true, 1, lap.PrintTLeft() + lap.PrintHorizontalLine(20) + lap.PrintTTOp() + lap.PrintHorizontalLine(20) + lap.PrintTTOp() + lap.PrintHorizontalLine(20) + lap.PrintTTOp() + lap.PrintHorizontalLine(20) + lap.PrintTRight()); lap.PROW(true, 1, lap.PrintVerticalLine() + lap.PadCenter(20, "Pembukuan") + lap.PrintVerticalLine() + lap.PadCenter(20, "Mengetahui") + lap.PrintVerticalLine() + lap.PadCenter(20, "Kasir") + lap.PrintVerticalLine() + lap.PadCenter(20, "Penerima") + lap.PrintVerticalLine()); lap.PROW(true, 1, lap.PrintVerticalLine() + lap.PadCenter(20, "") + lap.PrintVerticalLine() + lap.PadCenter(20, "") + lap.PrintVerticalLine() + lap.PadCenter(20, "") + lap.PrintVerticalLine() + lap.PadCenter(20, "") + lap.PrintVerticalLine()); lap.PROW(true, 1, lap.PrintVerticalLine() + lap.PadCenter(20, "") + lap.PrintVerticalLine() + lap.PadCenter(20, "") + lap.PrintVerticalLine() + lap.PadCenter(20, "") + lap.PrintVerticalLine() + lap.PadCenter(20, "") + lap.PrintVerticalLine()); lap.PROW(true, 1, lap.PrintVerticalLine() + lap.PadCenter(20, "") + lap.PrintVerticalLine() + lap.PadCenter(20, "") + lap.PrintVerticalLine() + lap.PadCenter(20, "") + lap.PrintVerticalLine() + lap.PadCenter(20, "") + lap.PrintVerticalLine()); lap.PROW(true, 1, lap.PrintVerticalLine() + "(" + lap.PadCenter(18, "") + ")" + lap.PrintVerticalLine() + "(" + lap.PadCenter(18, "") + ")" + lap.PrintVerticalLine() + "(" + lap.PadCenter(18, _Kasir.Trim()) + ")" + lap.PrintVerticalLine() + "(" + lap.PadCenter(18, _Terima.Trim()) + ")" + lap.PrintVerticalLine()); lap.PROW(true, 1, lap.PrintBottomLeftCorner() + lap.PrintHorizontalLine(20) + lap.PrintTBottom() + lap.PrintHorizontalLine(20) + lap.PrintTBottom() + lap.PrintHorizontalLine(20) + lap.PrintTBottom() + lap.PrintHorizontalLine(20) + lap.PrintBottomRightCorner()); lap.PROW(true, 1, String.Format("{0:yyyyMMddhhmmss}", DateTime.Now) + " " + SecurityManager.UserName); lap.Eject(); using (Database db = new Database(GlobalVar.DBName)) { db.Commands.Add(db.CreateCommand("rsp_CetakBukti")); db.Commands[0].Parameters.Add(new Parameter("@rowID", SqlDbType.UniqueIdentifier, _titipID)); db.Commands[0].ExecuteNonQuery(); } lap.SendToPrinter("laporan.txt"); } catch (Exception ex) { Error.LogError(ex); } }
public void PrintOutMinus() { int i = 0; BuildString detail = new BuildString(); detail.FontCondensed(true); detail.LeftMargin(3); foreach (ListBarang dr in _ListBarang) { i++; detail.PROW(true, 1, detail.PrintTopLeftCorner() + detail.PrintHorizontalLine(42) + detail.PrintTTOp() + detail.PrintHorizontalLine(42) + detail.PrintTTOp() + detail.PrintHorizontalLine(42) + detail.PrintTopRightCorner()); detail.PROW(true, 1, detail.PrintVerticalLine() + "Tanggal :".PadRight(42) + detail.PrintVerticalLine() + "No. Form :".PadRight(42) + detail.PrintVerticalLine() + detail.PadCenter(42, "KODE RAK :" + dr.KodeRak) + detail.PrintVerticalLine()); detail.PROW(true, 1, detail.PrintTLeft() + detail.PrintHorizontalLine(5) + detail.PrintTTOp() + detail.PrintHorizontalLine(36) + detail.PrintTBottom() + detail.PrintHorizontalLine(42) + detail.PrintTBottom() + detail.PrintHorizontalLine(20) + detail.PrintTTOp() + detail.PrintHorizontalLine(5) + detail.PrintTTOp() + detail.PrintHorizontalLine(15) + detail.PrintTRight()); detail.PROW(true, 1, detail.PrintVerticalLine() + detail.PadCenter(5, "NO.") + detail.PrintVerticalLine() + detail.PadCenter(100, "NAMA BARANG") + detail.PrintVerticalLine() + detail.PadCenter(5, "SAT") + detail.PrintVerticalLine() + detail.PadCenter(15, "PENGHITUNG") + detail.PrintVerticalLine()); detail.PROW(true, 1, detail.PrintTLeft() + detail.PrintHorizontalLine(5) + detail.PrintTMidlle() + detail.PrintHorizontalLine(100) + detail.PrintTMidlle() + detail.PrintHorizontalLine(5) + detail.PrintTMidlle() + detail.PrintHorizontalLine(15) + detail.PrintTRight()); //detail.PROW(true, 1, detail.PrintVerticalLine() + detail.PadCenter(5, "") + detail.PrintVerticalLine() + detail.PadCenter(100, "") // + detail.PrintVerticalLine() + detail.PadCenter(5, "") + detail.PrintVerticalLine() + detail.PadCenter(15, "") + detail.PrintVerticalLine()); detail.PROW(true, 1, detail.PrintVerticalLine() + i.ToString().PadLeft(5) + detail.PrintVerticalLine() + dr.NamaStok.PadRight(100) + detail.PrintVerticalLine() + detail.PadCenter(5, dr.SatJual) + detail.PrintVerticalLine() + detail.PadCenter(15, "") + detail.PrintVerticalLine()); //detail.PROW(true, 1, detail.PrintVerticalLine() + detail.PadCenter(5, "") + detail.PrintVerticalLine() + detail.PadCenter(100, "") // + detail.PrintVerticalLine() + detail.PadCenter(5, "") + detail.PrintVerticalLine() + detail.PadCenter(15, "") + detail.PrintVerticalLine()); detail.PROW(true, 1, detail.PrintTLeft() + detail.PrintHorizontalLine(5) + detail.PrintTBottom() + detail.PrintHorizontalLine(22) + detail.PrintTTOp() + detail.PrintHorizontalLine(28) + detail.PrintTTOp() + detail.PrintHorizontalLine(28) + detail.PrintTTOp() + detail.PrintHorizontalLine(19) + detail.PrintTBottom() + detail.PrintHorizontalLine(5) + detail.PrintTBottom() + detail.PrintHorizontalLine(15) + detail.PrintTRight()); detail.PROW(true, 1, detail.PrintVerticalLine() + detail.PadCenter(28, "BAIK") + detail.PrintVerticalLine() + detail.PadCenter(28, "CACAT") + detail.PrintVerticalLine() + detail.PadCenter(28, "RUSAK") + detail.PrintVerticalLine() + "Dicatat Oleh,".PadLeft(41) + detail.PrintVerticalLine()); detail.PROW(true, 1, detail.PrintVerticalLine() + detail.PadCenter(28, "") + detail.PrintVerticalLine() + detail.PadCenter(28, "") + detail.PrintVerticalLine() + detail.PadCenter(28, "") + detail.PrintVerticalLine() + "".PadLeft(41) + detail.PrintVerticalLine()); detail.PROW(true, 1, detail.PrintVerticalLine() + detail.PadCenter(28, "") + detail.PrintVerticalLine() + detail.PadCenter(28, "") + detail.PrintVerticalLine() + detail.PadCenter(28, "") + detail.PrintVerticalLine() + "".PadLeft(41) + detail.PrintVerticalLine()); detail.PROW(true, 1, detail.PrintVerticalLine() + detail.PadCenter(28, "") + detail.PrintVerticalLine() + detail.PadCenter(28, "") + detail.PrintVerticalLine() + detail.PadCenter(28, "") + detail.PrintVerticalLine() + "Bag. Adm. Persediaan".PadLeft(41) + detail.PrintVerticalLine()); detail.PROW(true, 1, detail.PrintBottomLeftCorner() + detail.PrintHorizontalLine(28) + detail.PrintTBottom() + detail.PrintHorizontalLine(28) + detail.PrintTBottom() + detail.PrintHorizontalLine(28) + detail.PrintTBottom() + detail.PrintHorizontalLine(41) + detail.PrintBottomRightCorner()); if ((i % 2 == 0) && (i % 4 != 0)) { for (int j = 0; j < 10; j++) { detail.PROW(true, 1, ""); } } else if (i % 4 == 0) { detail.Eject(); } } if (i % 2 != 0) { detail.Eject(); } detail.SendToPrinter("notaJual.txt"); }
private void DisplayReport(DataTable dt) { ////construct parameter //List<ReportParameter> rptParams=new List<ReportParameter>(); //rptParams.Add(new ReportParameter("UserID", SecurityManager.UserID)); ////call report viewer //frmReportViewer ifrmReport=new frmReportViewer("Persediaan.rptDetailPerKodeRak.rdlc", rptParams, dt, "dsOpname_Data"); //ifrmReport.Show(); int i = 0; BuildString detail = new BuildString(); detail.FontCondensed(true); detail.LeftMargin(3); foreach (DataRowView dr in dt.DefaultView) { i++; detail.PROW(true, 1, detail.PrintTopLeftCorner() + detail.PrintHorizontalLine(42) + detail.PrintTTOp() + detail.PrintHorizontalLine(42) + detail.PrintTTOp() + detail.PrintHorizontalLine(42) + detail.PrintTopRightCorner()); detail.PROW(true, 1, detail.PrintVerticalLine() + "Tanggal :".PadRight(42) + detail.PrintVerticalLine() + "No. Form :".PadRight(42) + detail.PrintVerticalLine() + detail.PadCenter(42, "KODE RAK :" + dr["Lokasi"].ToString()) + detail.PrintVerticalLine()); detail.PROW(true, 1, detail.PrintTLeft() + detail.PrintHorizontalLine(5) + detail.PrintTTOp() + detail.PrintHorizontalLine(36) + detail.PrintTBottom() + detail.PrintHorizontalLine(42) + detail.PrintTBottom() + detail.PrintHorizontalLine(20) + detail.PrintTTOp() + detail.PrintHorizontalLine(5) + detail.PrintTTOp() + detail.PrintHorizontalLine(15) + detail.PrintTRight()); detail.PROW(true, 1, detail.PrintVerticalLine() + detail.PadCenter(5, "NO.") + detail.PrintVerticalLine() + detail.PadCenter(100, "NAMA BARANG") + detail.PrintVerticalLine() + detail.PadCenter(5, "SAT") + detail.PrintVerticalLine() + detail.PadCenter(15, "PENGHITUNG") + detail.PrintVerticalLine()); detail.PROW(true, 1, detail.PrintTLeft() + detail.PrintHorizontalLine(5) + detail.PrintTMidlle() + detail.PrintHorizontalLine(100) + detail.PrintTMidlle() + detail.PrintHorizontalLine(5) + detail.PrintTMidlle() + detail.PrintHorizontalLine(15) + detail.PrintTRight()); //detail.PROW(true, 1, detail.PrintVerticalLine() + detail.PadCenter(5, "") + detail.PrintVerticalLine() + detail.PadCenter(100, "") // + detail.PrintVerticalLine() + detail.PadCenter(5, "") + detail.PrintVerticalLine() + detail.PadCenter(15, "") + detail.PrintVerticalLine()); detail.PROW(true, 1, detail.PrintVerticalLine() + i.ToString().PadLeft(5) + detail.PrintVerticalLine() + dr["NamaStok"].ToString().PadRight(100) + detail.PrintVerticalLine() + detail.PadCenter(5, dr["SatJual"].ToString()) + detail.PrintVerticalLine() + detail.PadCenter(15, "") + detail.PrintVerticalLine()); //detail.PROW(true, 1, detail.PrintVerticalLine() + detail.PadCenter(5, "") + detail.PrintVerticalLine() + detail.PadCenter(100, "") // + detail.PrintVerticalLine() + detail.PadCenter(5, "") + detail.PrintVerticalLine() + detail.PadCenter(15, "") + detail.PrintVerticalLine()); detail.PROW(true, 1, detail.PrintTLeft() + detail.PrintHorizontalLine(5) + detail.PrintTBottom() + detail.PrintHorizontalLine(22) + detail.PrintTTOp() + detail.PrintHorizontalLine(28) + detail.PrintTTOp() + detail.PrintHorizontalLine(28) + detail.PrintTTOp() + detail.PrintHorizontalLine(19) + detail.PrintTBottom() + detail.PrintHorizontalLine(5) + detail.PrintTBottom() + detail.PrintHorizontalLine(15) + detail.PrintTRight()); detail.PROW(true, 1, detail.PrintVerticalLine() + detail.PadCenter(28, "BAIK") + detail.PrintVerticalLine() + detail.PadCenter(28, "CACAT") + detail.PrintVerticalLine() + detail.PadCenter(28, "RUSAK") + detail.PrintVerticalLine() + "Dicatat Oleh,".PadLeft(41) + detail.PrintVerticalLine()); detail.PROW(true, 1, detail.PrintVerticalLine() + detail.PadCenter(28, "") + detail.PrintVerticalLine() + detail.PadCenter(28, "") + detail.PrintVerticalLine() + detail.PadCenter(28, "") + detail.PrintVerticalLine() + "".PadLeft(41) + detail.PrintVerticalLine()); detail.PROW(true, 1, detail.PrintVerticalLine() + detail.PadCenter(28, "") + detail.PrintVerticalLine() + detail.PadCenter(28, "") + detail.PrintVerticalLine() + detail.PadCenter(28, "") + detail.PrintVerticalLine() + "".PadLeft(41) + detail.PrintVerticalLine()); detail.PROW(true, 1, detail.PrintVerticalLine() + detail.PadCenter(28, "") + detail.PrintVerticalLine() + detail.PadCenter(28, "") + detail.PrintVerticalLine() + detail.PadCenter(28, "") + detail.PrintVerticalLine() + "Bag. Adm. Persediaan".PadLeft(41) + detail.PrintVerticalLine()); detail.PROW(true, 1, detail.PrintBottomLeftCorner() + detail.PrintHorizontalLine(28) + detail.PrintTBottom() + detail.PrintHorizontalLine(28) + detail.PrintTBottom() + detail.PrintHorizontalLine(28) + detail.PrintTBottom() + detail.PrintHorizontalLine(41) + detail.PrintBottomRightCorner()); if ((i % 2 == 0) && (i % 4 != 0)) { for (int j = 0; j < 10; j++) { detail.PROW(true, 1, ""); } } else if (i % 4 == 0) { detail.Eject(); } } if (i % 2 != 0) { detail.Eject(); } detail.SendToPrinter("notaJual.txt"); }
private void Cetak(DataTable dt) { BuildString detail = new BuildString(); string NoDKN = Tools.isNull(dt.Rows[0]["NoDKN"], "").ToString(); string Tanggal = Tools.isNull(dt.Rows[0]["Tanggal"], "").ToString(); string Cabang = Tools.isNull(dt.Rows[0]["Cabang"], "").ToString(); string DK = Tools.isNull(dt.Rows[0]["DK"], "").ToString(); string headerTitle = string.Empty; string deskripsi = string.Empty; int posHeader = 0; if (DK == "K") { headerTitle = "KREDIT NOTA"; deskripsi = "Dengan ini kami menkredit Rekening Saudara untuk transaksi sebagai berikut"; posHeader = 12; } else if (DK == "D") { headerTitle = "DEBET NOTA"; deskripsi = "Dengan ini kami mendebet Rekening Saudara untuk transaksi sebagai berikut"; posHeader = 13; } string Perkiraan = string.Empty; string Uraian = string.Empty; double Jumlah = 0; double sumJumlah = 0; string tempJumlah = string.Empty; string typePrinter = detail.GetPrinterName(); detail.Initialize(); detail.FontCondensed(false); detail.FontCPI(7); detail.PageLLine(33); detail.LeftMargin(5); detail.BottomMargin(1); detail.FontCondensed(true); #region Header if (typePrinter.Contains("LX")) { detail.LetterQuality(false); detail.FontBold(true); detail.FontCondensed(true); detail.DoubleHeight(true); } else { detail.LetterQuality(true); detail.FontBold(true); detail.DoubleHeight(true); detail.DoubleWidth(true); } detail.FontBold(false); detail.DoubleHeight(false); detail.DoubleWidth(false); detail.FontCondensed(false); detail.LineSpacing("1/8"); detail.AddCR(); detail.FontCPI(12); detail.PROW(true, 1, detail.PrintTopLeftCorner() + detail.PrintHorizontalLine(92) + detail.PrintTopRightCorner()); detail.PROW(false, 30, detail.PrintTTOp()); detail.PROW(true, 1, detail.PrintVerticalLine()); //detail.FontBold(true); //detail.FontBold(false); detail.PROW(false, 30, detail.PrintVerticalLine() + " Tanggal : " + ((DateTime)dt.Rows[0]["Tanggal"]).ToString("dd/MM/yyyy").PadRight(51) + detail.PrintVerticalLine()); detail.PROW(true, 1, detail.PrintVerticalLine()); detail.FontCPI(14); detail.FontBold(true); detail.PROW(false, posHeader, headerTitle); detail.FontCPI(12); detail.FontBold(false); detail.PROW(false, 36, detail.PrintTLeft() + detail.PrintHorizontalLine(64) + detail.PrintTRight()); detail.PROW(true, 1, detail.PrintVerticalLine()); detail.PROW(false, 30, detail.PrintVerticalLine() + detail.SPACE(1) + "Kepada : Kepala Administrasi " + Cabang.PadRight(31) + detail.PrintVerticalLine()); detail.PROW(true, 1, detail.PrintVerticalLine()); detail.PROW(false, 8, "[No: " + NoDKN + "]"); detail.PROW(false, 30, detail.PrintTLeft() + detail.PrintHorizontalLine(64) + detail.PrintTRight()); detail.PROW(true, 1, detail.PrintVerticalLine()); detail.PROW(false, 30, detail.PrintVerticalLine() + detail.SPACE(1) + "Lampiran :" + detail.SPACE(10) + "lbr: ".PadRight(42) + detail.PrintVerticalLine()); detail.PROW(true, 1, detail.PrintTLeft() + detail.PrintHorizontalLine(92) + detail.PrintTRight()); detail.PROW(false, 30, detail.PrintTBottom()); detail.PROW(true, 1, detail.PrintVerticalLine() + deskripsi.PadRight(93) + detail.PrintVerticalLine()); detail.PROW(true, 1, detail.PrintTLeft() + detail.PrintHorizontalLine(91) + detail.PrintTRight()); detail.PROW(false, 15, detail.PrintTTOp()); detail.PROW(false, 84, detail.PrintTTOp()); detail.PROW(true, 1, detail.PrintVerticalLine() + " Perkiraan " + detail.PrintVerticalLine() + detail.SPACE(31) + "Uraian" + detail.SPACE(31) + detail.PrintVerticalLine() + " Jumlah " + detail.PrintVerticalLine()); detail.PROW(true, 1, detail.PrintTLeft() + detail.PrintHorizontalLine(91) + detail.PrintTRight()); detail.PROW(false, 15, detail.PrintTLeft()); detail.PROW(false, 84, detail.PrintTRight()); #endregion #region CetakDetail foreach (DataRow dr in dt.Rows) { Perkiraan = dr["NoPerkiraan"].ToString(); Uraian = dr["Uraian"].ToString(); Jumlah = double.Parse(dr["Jumlah"].ToString()); sumJumlah = sumJumlah + Jumlah; tempJumlah = Jumlah.ToString("#,##0"); detail.PROW(true, 1, detail.PrintVerticalLine() + Perkiraan + detail.SPACE(1) + detail.PrintVerticalLine() + Uraian.PadRight(68) + detail.PrintVerticalLine() + tempJumlah.PadLeft(10) + detail.PrintVerticalLine()); detail.PROW(true, 1, detail.PrintTLeft() + detail.PrintHorizontalLine(91) + detail.PrintTRight()); detail.PROW(false, 15, detail.PrintTBottom()); detail.PROW(false, 84, detail.PrintTBottom()); //header.PROW(true, 1, header.PrintVerticalLine() + header.SPACE(2) + "Perkiraan" + header.SPACE(2) + header.PrintVerticalLine() + header.SPACE(22) + "Uraian" + header.SPACE(22) + header.PrintVerticalLine() + header.SPACE(2) + "Jumlah" + header.SPACE(2) + header.PrintVerticalLine()); } detail.PROW(true, 1, detail.PrintVerticalLine() + detail.SPACE(14) + "Total" + detail.SPACE(64) + sumJumlah.ToString("#,##0").PadLeft(10) + detail.PrintVerticalLine()); detail.PROW(true, 1, detail.PrintTLeft() + detail.PrintHorizontalLine(93) + detail.PrintTRight()); detail.PROW(true, 1, detail.PrintVerticalLine() + "Terbilang" + detail.SPACE(5) + ISA.Common.Tools.Terbilang(sumJumlah).PadRight(79) + detail.PrintVerticalLine()); detail.PROW(true, 1, detail.PrintVerticalLine() + detail.SPACE(93) + detail.PrintVerticalLine()); detail.PROW(true, 1, detail.PrintTLeft() + detail.PrintHorizontalLine(91) + detail.PrintTRight()); detail.PROW(false, 32, detail.PrintTTOp()); detail.PROW(false, 61, detail.PrintTTOp()); #endregion #region Footer detail.PROW(true, 1, detail.PrintVerticalLine() + " Dibuat Oleh " + detail.PrintVerticalLine() + " Mengetahui " + detail.PrintVerticalLine() + " Dibukukan Oleh " + detail.PrintVerticalLine()); detail.PROW(true, 1, detail.PrintTLeft() + detail.PrintHorizontalLine(91) + detail.PrintTRight()); detail.PROW(false, 32, detail.PrintTTOp()); detail.PROW(false, 61, detail.PrintTTOp()); detail.PROW(true, 1, detail.PrintVerticalLine() + " " + detail.PrintVerticalLine() + " " + detail.PrintVerticalLine() + " " + detail.PrintVerticalLine()); detail.PROW(true, 1, detail.PrintVerticalLine() + " " + detail.PrintVerticalLine() + " " + detail.PrintVerticalLine() + " " + detail.PrintVerticalLine()); detail.PROW(true, 1, detail.PrintVerticalLine() + " " + detail.PrintVerticalLine() + " " + detail.PrintVerticalLine() + " " + detail.PrintVerticalLine()); detail.PROW(true, 1, detail.PrintVerticalLine() + " " + detail.PrintVerticalLine() + " " + detail.PrintVerticalLine() + " " + detail.PrintVerticalLine()); detail.PROW(true, 1, detail.PrintVerticalLine() + " " + detail.PrintVerticalLine() + " " + detail.PrintVerticalLine() + " " + detail.PrintVerticalLine()); detail.PROW(true, 1, detail.PrintVerticalLine() + " MNG " + detail.PrintVerticalLine() + " " + detail.PrintVerticalLine() + " " + detail.PrintVerticalLine()); detail.PROW(true, 1, detail.PrintBottomLeftCorner() + detail.PrintHorizontalLine(91) + detail.PrintRightBottomCorner2()); detail.PROW(false, 32, detail.PrintTBottom()); detail.PROW(false, 61, detail.PrintTBottom()); #endregion detail.Eject(); detail.SendToPrinter("DebetKreditNota.txt", detail.GenerateString()); }
private void PrintLaporan(DataTable dt) { BuildString lap = new BuildString(); string typePrinter = lap.GetPrinterName(); //string NamaBank = Tools.isNull(dt.Rows[0]["Bank"], "").ToString(); string NoBBK = Tools.isNull(dt.Rows[0]["NoBBK"], "").ToString().Trim(); string TglBBK = ((DateTime)dt.Rows[0]["TglBBK"]).ToString("dd-MMM-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 Penerima = Tools.isNull(dt.Rows[0]["Penerima"], "").ToString().Trim(); string Nomor = string.Empty; string NamaBank = string.Empty; string TglGiro = string.Empty; string TglJth = 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.Initialize(); //lap.PageLLine(33); //lap.LeftMargin(3); //lap.FontCPI(10); //lap.DoubleWidth(true); //lap.PROW(true, 1, "[VOUCHER BUKA GIRO]"); //lap.DoubleWidth(false); //lap.FontCondensed(true); //lap.PROW(true, 1, lap.PrintTopLeftCorner() + lap.PrintHorizontalLine(64)+lap.PrintTTOp()+ lap.PrintHorizontalLine(63)+ lap.PrintTopRightCorner()); //lap.PROW(true, 1, lap.PrintVerticalLine() + "Dibayarkan Kepada: ".PadRight(64) + lap.PrintVerticalLine()+ ("Nomor : " + NoBBK).PadRight(63) + lap.PrintVerticalLine()); //lap.PROW(true, 1, lap.PrintVerticalLine() + Penerima.PadRight(64) + lap.PrintVerticalLine()+ "Tanggal: " + TglBBK.PadRight(20) + "Hal :" + hal.ToString() + "/" + ttlHal.ToString().PadRight(22) + lap.PrintVerticalLine()); //lap.PROW(true, 1, lap.PrintTLeft() + lap.PrintHorizontalLine(64) + lap.PrintTBottom() + lap.PrintHorizontalLine(63) + lap.PrintTRight()); //lap.PROW(true, 1, lap.PrintVerticalLine() + lap.PadCenter(15,"Nomor") + lap.PadCenter(51,"Bank") + lap.PadCenter(21,"Tgl.Giro") + lap.PadCenter(21,"Tgl.JT") + lap.PadCenter(20,"Nilai Tranfer")+ lap.PrintVerticalLine()); //lap.PROW(true, 1, lap.PrintTLeft() + lap.PrintHorizontalLine(128) + 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, "[VOUCHER BUKA 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() + "Dibayarkan Kepada: ".PadRight(41) + lap.PrintVerticalLine() + ("Nomor : " + NoBBK).PadRight(41) + lap.PrintVerticalLine()); lap.PROW(true, 1, lap.PrintVerticalLine() + Penerima.PadRight(41) + lap.PrintVerticalLine() + ("Tanggal: " + TglBBK).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(15, "Nomor") + lap.PadCenter(27, "Nama Bank") + lap.PadCenter(13, "Tgl.Giro") + lap.PadCenter(13, "Tgl.JT") + lap.PadCenter(15, "Nilai Tranfer") + lap.PrintVerticalLine()); lap.PROW(true, 1, lap.PrintTLeft() + lap.PrintHorizontalLine(83) + lap.PrintTRight()); } #endregion Nomor = dr["Nomor"].ToString().Trim(); NamaBank = dr["Bank"].ToString().Trim(); TglGiro = ((DateTime)dr["TglGiro"]).ToString("dd-MMM-yyyy").Trim(); TglJth = ((DateTime)dr["TglJth"]).ToString("dd-MMM-yyyy").Trim(); Jumlah = double.Parse(dr["Nominal"].ToString()); sumJumlah = sumJumlah + Jumlah; tempJumlah = Jumlah.ToString("#,##0"); lap.PROW(true, 1, lap.PrintVerticalLine() + Nomor.PadRight(15) + NamaBank.PadRight(27) + lap.PadCenter(13, TglGiro) + lap.PadCenter(13, TglJth) + tempJumlah.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) { lap.PROW(true, 1, lap.PrintTLeft() + lap.PrintHorizontalLine(83) + lap.PrintTRight()); lap.PROW(true, 1, lap.PrintVerticalLine() + "Terbilang".PadRight(58) + "Jumlah Rp." + sumJumlah.ToString("#,##0").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, "Penerima") + lap.PrintVerticalLine()); lap.PROW(true, 1, lap.PrintVerticalLine() + lap.SPACE(20) + lap.PrintVerticalLine() + lap.SPACE(20) + lap.PrintVerticalLine() + lap.SPACE(20) + lap.PrintVerticalLine() + lap.SPACE(20) + lap.PrintVerticalLine()); lap.PROW(true, 1, lap.PrintVerticalLine() + lap.SPACE(20) + lap.PrintVerticalLine() + lap.SPACE(20) + lap.PrintVerticalLine() + lap.SPACE(20) + lap.PrintVerticalLine() + lap.SPACE(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, Penerima) + ")" + 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.PrintRightBottomCorner2()); lap.PROW(true, 1, String.Format("{0:yyyyMMddhh:mm:ss}", DateTime.Now) + " " + SecurityManager.UserName); lap.Eject(); } #endregion } lap.SendToPrinter("BBK.txt", lap.GenerateString()); }
public void cetakLaporan() { int nprint = int.Parse(gridHeader.SelectedCells[0].OwningRow.Cells["hdrNPrint"].Value.ToString()); if ((nprint > 0) && (!SecurityManager.IsManager())) { if (!SecurityManager.AskPasswordManager()) { return; } } double total = 0, jumlah; string _Kepada, _NoBukti, _Tanggal, _Kasir; Guid _rowID = (Guid)gridHeader.SelectedCells[0].OwningRow.Cells["hdrRowID"].Value; string _uraian = gridHeader.SelectedCells[0].OwningRow.Cells["hdrUraian"].Value.ToString().Trim(); string _dari = gridHeader.SelectedCells[0].OwningRow.Cells["hdrUraian2"].Value.ToString().Split('|').GetValue(0).ToString().Trim(); _Kepada = gridHeader.SelectedCells[0].OwningRow.Cells["KetBon"].Value.ToString().Trim(); _Kasir = gridHeader.SelectedCells[0].OwningRow.Cells["hdrDibuat"].Value.ToString(); _NoBukti = gridHeader.SelectedCells[0].OwningRow.Cells["hdrNoVoucher"].Value.ToString(); _Tanggal = Convert.ToDateTime(gridHeader.SelectedCells[0].OwningRow.Cells["hdrTglVoucher"].Value).ToString("dd/MM/yyyy"); int rowNo = 0; int no = 0; int ttlData = dtDetail.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(); //lap.Initialize(); //lap.PageLLine(33); //lap.LeftMargin(3); //lap.FontCPI(10); //lap.DoubleWidth(true); //lap.PROW(true, 1, "[BUKTI KAS KELUAR]"); //lap.DoubleWidth(false); //lap.FontCondensed(true); //lap.PROW(true, 1, lap.PrintTopLeftCorner() + lap.PrintHorizontalLine(63) + lap.PrintTTOp() // + lap.PrintHorizontalLine(64) + lap.PrintTopRightCorner()); //lap.PROW(true, 1, lap.PrintVerticalLine() + "Kepada : ".PadRight(63) + // lap.PrintVerticalLine() + "Nomor : " + _NoBukti.PadRight(54) + lap.PrintVerticalLine()); //lap.PROW(true, 1, lap.PrintVerticalLine() + _Kepada.PadRight(63) + lap.PrintVerticalLine() + "Tanggal : " + // _Tanggal.PadRight(30) + "Hal : " + hal.ToString() + "/" + ttlHal.ToString().PadRight(12) + lap.PrintVerticalLine()); //lap.PROW(true, 1, lap.PrintTLeft() + lap.PrintHorizontalLine(63) + lap.PrintTBottom() // + lap.PrintHorizontalLine(64) + lap.PrintTRight()); //lap.PROW(true, 1, lap.PrintVerticalLine() + "No. Prk".PadRight(15) + lap.PadCenter(98, "URAIAN") + lap.SPACE(15) + lap.PrintVerticalLine()); //lap.PROW(true, 1, lap.PrintTLeft() + lap.PrintHorizontalLine(128) + lap.PrintTRight()); bool cetak = true; foreach (DataRow dr in dtDetail.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 KELUAR]"); lap.DoubleWidth(false); //lap.FontCondensed(true); lap.PROW(true, 1, lap.PrintTopLeftCorner() + lap.PrintHorizontalLine(41) + lap.PrintTTOp() + lap.PrintHorizontalLine(41) + lap.PrintTopRightCorner()); lap.PROW(true, 1, lap.PrintVerticalLine() + ("Kepada : " + _dari.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 : " + 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["Debet"].ToString()); lap.PROW(true, 1, lap.PrintVerticalLine() + "".PadRight(10) + dr["Keterangan"].ToString().ToUpper().PadRight(58).Substring(0, 58) + jumlah.ToString("#,###").PadLeft(15) + lap.PrintVerticalLine()); total += Convert.ToDouble(dr["Debet"].ToString()); 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() + 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, "") + ")" + 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 } //UPDATE NPRINT using (Database db = new Database(GlobalVar.DBName)) { VoucherJournal.UpdateNPrint(db, _rowID, nprint + 1); } //REFRESH ROW HEADER RefreshRowHeader(_rowID); lap.SendToPrinter("laporanPS.txt"); //lap.SendToFile("laporanPS.txt"); } catch (Exception ex) { Error.LogError(ex); } }
private void printOpname(string namaStok, string satJual, string kodeBarang) { BuildString op = new BuildString(); double saldoAwal = 0; using (Database db = new Database()) { DataTable dt = new DataTable(); db.Commands.Add(db.CreateCommand("usp_getSaldoAwal")); db.Commands[0].Parameters.Add(new Parameter("@TglOpname", SqlDbType.DateTime, DateTime.Now)); db.Commands[0].Parameters.Add(new Parameter("@KodeBarang", SqlDbType.VarChar, kodeBarang)); db.Commands[0].Parameters.Add(new Parameter("@KodeGudang", SqlDbType.VarChar, GlobalVar.Gudang)); dt = db.Commands[0].ExecuteDataTable(); saldoAwal = Convert.ToDouble(Tools.isNull(dt.Rows[0][0], "0").ToString()); } op.LeftMargin(3); op.FontBold(true); op.FontCPI(20); op.PROW(true, 0, "FORM OPNAME HARIAN 0000"); op.PROW(true, 1, ""); op.FontCondensed(true); op.FontBold(false); op.PROW(true, 1, "Tgl. Opname " + String.Format("{0:dd-MMM-yyyy}", DateTime.Now) + op.SPACE(5) + "(Saldo Awal : " + saldoAwal.ToString() + ")"); op.PROW(true, 1, ""); op.PROW(true, 1, ""); op.PROW(true, 1, op.PrintTopLeftCorner() + op.PrintHorizontalLine(128) + op.PrintTopRightCorner()); op.PROW(true, 1, op.PrintVerticalLine() + op.PadCenter(15, "Nama barang") + op.PrintVerticalLine() + namaStok.PadRight(112) + op.PrintVerticalLine()); op.PROW(true, 1, op.PrintVerticalLine() + op.PrintHorizontalLine(128) + op.PrintVerticalLine()); op.PROW(true, 1, op.PrintVerticalLine() + op.SPACE(15) + op.PrintVerticalLine() + op.SPACE(112) + op.PrintVerticalLine()); op.PROW(true, 1, op.PrintVerticalLine() + "QTY".PadLeft(15) + op.PrintVerticalLine() + op.SPACE(20) + satJual.PadRight(92) + op.PrintVerticalLine()); op.PROW(true, 1, op.PrintVerticalLine() + op.SPACE(15) + op.PrintVerticalLine() + op.SPACE(112) + op.PrintVerticalLine()); op.PROW(true, 1, op.PrintBottomLeftCorner() + op.PrintHorizontalLine(128) + op.PrintBottomRightCorner()); op.PROW(true, 1, ""); op.PROW(true, 1, op.PrintTopLeftCorner() + op.PrintHorizontalLine(128) + op.PrintTopRightCorner()); op.PROW(true, 1, op.PrintVerticalLine() + op.PadCenter(42, "Penghitung") + op.PrintVerticalLine() + op.PadCenter(42, "Ka. gudang") + op.PrintVerticalLine() + op.PadCenter(42, "Accounting") + op.PrintVerticalLine()); op.PROW(true, 1, op.PrintVerticalLine() + op.PadCenter(42, "Mengajukan") + op.PrintVerticalLine() + op.PadCenter(42, "Menyetujui") + op.PrintVerticalLine() + op.PadCenter(42, "Mengetahui") + op.PrintVerticalLine()); op.PROW(true, 1, op.PrintVerticalLine() + op.PrintHorizontalLine(128) + op.PrintVerticalLine()); op.PROW(true, 1, op.PrintVerticalLine() + op.SPACE(42) + op.PrintVerticalLine() + op.SPACE(42) + op.PrintVerticalLine() + op.SPACE(42) + op.PrintVerticalLine()); op.PROW(true, 1, op.PrintVerticalLine() + op.SPACE(42) + op.PrintVerticalLine() + op.SPACE(42) + op.PrintVerticalLine() + op.SPACE(42) + op.PrintVerticalLine()); op.PROW(true, 1, op.PrintVerticalLine() + op.SPACE(42) + op.PrintVerticalLine() + op.SPACE(42) + op.PrintVerticalLine() + op.SPACE(42) + op.PrintVerticalLine()); op.PROW(true, 1, op.PrintVerticalLine() + op.SPACE(42) + op.PrintVerticalLine() + op.SPACE(42) + op.PrintVerticalLine() + op.SPACE(42) + op.PrintVerticalLine()); op.PROW(true, 1, op.PrintVerticalLine() + op.PrintHorizontalLine(128) + op.PrintVerticalLine()); op.PROW(true, 1, op.PrintVerticalLine() + " (" + op.SPACE(36) + ") " + op.PrintVerticalLine() + " (" + op.SPACE(36) + ") " + op.PrintVerticalLine() + " (" + op.SPACE(36) + ") " + op.PrintVerticalLine()); op.PROW(true, 1, op.PrintBottomLeftCorner() + op.PrintHorizontalLine(128) + op.PrintBottomRightCorner()); op.PROW(true, 1, String.Format("{0:dd-MMM-yyy-hh-mm-ss}", DateTime.Now) + ", " + SecurityManager.UserName); op.Eject(); op.SendToPrinter("notaJual.txt"); }
private void PrintRawSPPB(DataTable dt) { BuildString sppb = new BuildString(); int No = 1; int n = dt.Rows.Count; int i = 0; int p = 0; int s = 0; p = n / 13; s = n % 13; bool _repeat = true; #region "Header" sppb.Initialize(); sppb.LeftMargin(1); sppb.BottomMargin(1); sppb.PROW(true, 1, "KODE RAK : TANGGAL :"); #endregion string _NamaStok = string.Empty; string _Pcs = string.Empty; string _Lok = string.Empty; string _Header1 = sppb.PrintTopLeftCorner() + sppb.PrintDoubleLine(4) + sppb.PrintTTOp() + sppb.PrintDoubleLine(77) + sppb.PrintTTOp() + sppb.PrintDoubleLine(3) + sppb.PrintTTOp() + sppb.PrintDoubleLine(15) + sppb.PrintTTOp() + sppb.PrintDoubleLine(15) + sppb.PrintTTOp() + sppb.PrintDoubleLine(15) + sppb.PrintTTOp() + sppb.PrintDoubleLine(7) + sppb.PrintTopRightCorner(); string _Header2 = sppb.PrintVerticalLine() + "No. " + sppb.PrintVerticalLine() + " N A M A B A R A N G " + sppb.PrintVerticalLine() + "SAT" + sppb.PrintVerticalLine() + " 1 " + sppb.PrintVerticalLine() + " 2 " + sppb.PrintVerticalLine() + " 3 " + sppb.PrintVerticalLine() + " OK. " + sppb.PrintVerticalLine(); string _Header3 = sppb.PrintTLeft() + sppb.PrintDoubleLine(4) + sppb.PrintTMidlle() + sppb.PrintDoubleLine(77) + sppb.PrintTMidlle() + sppb.PrintDoubleLine(3) + sppb.PrintTMidlle() + sppb.PrintDoubleLine(15) + sppb.PrintTMidlle() + sppb.PrintDoubleLine(15) + sppb.PrintTMidlle() + sppb.PrintDoubleLine(15) + sppb.PrintTMidlle() + sppb.PrintDoubleLine(7) + sppb.PrintTRight(); string _Footer1 = sppb.PrintTLeft() + sppb.PrintHorizontalLine(4) + sppb.PrintTMidlle() + sppb.PrintHorizontalLine(77) + sppb.PrintTMidlle() + sppb.PrintHorizontalLine(3) + sppb.PrintTMidlle() + sppb.PrintHorizontalLine(15) + sppb.PrintTMidlle() + sppb.PrintHorizontalLine(15) + sppb.PrintTMidlle() + sppb.PrintHorizontalLine(15) + sppb.PrintTMidlle() + sppb.PrintHorizontalLine(7) + sppb.PrintTRight(); string _Footer2 = sppb.PrintBottomLeftCorner() + sppb.PrintHorizontalLine(4) + sppb.PrintTBottom() + sppb.PrintHorizontalLine(77) + sppb.PrintTBottom() + sppb.PrintHorizontalLine(3) + sppb.PrintTBottom() + sppb.PrintHorizontalLine(15) + sppb.PrintTBottom() + sppb.PrintHorizontalLine(15) + sppb.PrintTBottom() + sppb.PrintHorizontalLine(15) + sppb.PrintTBottom() + sppb.PrintHorizontalLine(7) + sppb.PrintBottomRightCorner(); string _temp = sppb.PrintVerticalLine() + " " + sppb.PrintVerticalLine() + " " + sppb.PrintVerticalLine() + " " + sppb.PrintVerticalLine(); foreach (DataRow dr in dt.Rows) { #region "Header" if (i == 0 && _repeat) { sppb.PROW(true, 1, _Header1); sppb.PROW(true, 1, _Header2); sppb.PROW(true, 1, _Header3); } #endregion if (i <= 13) { _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, ' ') + _temp + _Lok.PadLeft(7, ' ') + sppb.PrintVerticalLine()); sppb.PROW(true, 1, (No == n || i == 12) ? _Footer2 : _Footer1); _repeat = false; if (i == 12 || No == n) { sppb.PROW(true, 1, " "); _repeat = true; i = -1; sppb.Eject(); } } i++; No++; } sppb.SendToPrinter("sppb.txt", sppb.ToString()); }
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"); }
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"); }
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"); }
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-MMM-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.Initialize(); //lap.PageLLine(33); //lap.LeftMargin(3); //lap.FontCPI(10); //lap.DoubleWidth(true); //lap.PROW(true, 1, "[Bukti Bank Masuk]"); //lap.DoubleWidth(false); //lap.FontCondensed(true); //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 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() + "Diterima Dari: ".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; lap.PROW(true, 1, lap.PrintVerticalLine() + Nomor.PadRight(10) + AsalTransfer.ToUpper().PadRight(20).Substring(0, 20) + lap.SPACE(1) + dr["NamaBank"].ToString().PadRight(11).Substring(0, 11) + lap.PadCenter(13, TglBank) + lap.PadCenter(13, 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("BBM.txt", lap.GenerateString()); //lap.SendToFile("BBM.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"); }
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); } }
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() + 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.DBFinance)) { db.Commands.Add(db.CreateCommand("rsp_CetakBankDetail")); db.Commands[0].Parameters.Add(new Parameter("@rowID", SqlDbType.UniqueIdentifier, _rowID)); db.Commands[0].ExecuteNonQuery(); } DetailRefresh(_rowID); DetailFindRow("RowID", _rowID.ToString()); lap.SendToPrinter("laporanPS.txt"); } catch (Exception ex) { Error.LogError(ex); } }
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"); }
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.DBFinance)) { 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 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.SendToPrinter("packingList.txt"); }
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"); }