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 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 string CetakHeaderBO(DataTable dt, int nUrut, int nMaxHal, out int nHlm) { BuildString header = new BuildString(); const int RowsPerPage = 16; int nHal = (int)Math.Round((nUrut / RowsPerPage) + 0.4, 0) + 1; nHlm = nHal; string cat1 = dt.Rows[0]["Catatan1"].ToString(); string cat2 = dt.Rows[0]["Catatan2"].ToString(); string sales = GetSales(); string namaToko = dt.Rows[0]["NamaToko"].ToString(); string cClass = dt.Rows[0]["StsToko"].ToString(); string TglDO = header.GetDayName(DateTime.Now.DayOfWeek.ToString()) + ", " + DateTime.Now.ToString("dd-MMM-yyyy"); string DO = dt.Rows[0]["NoDO"].ToString() + " " + header.GetDayName(Convert.ToDateTime(dt.Rows[0]["TglDO"].ToString()).DayOfWeek.ToString()) + ", " + Convert.ToDateTime(dt.Rows[0]["TglDO"].ToString()).ToString("dd-MMM-yyyy"); string noRq = dt.Rows[0]["NoRequest"].ToString() + " " + header.GetDayName(Convert.ToDateTime(dt.Rows[0]["TglRequest"].ToString()).DayOfWeek.ToString()) + ", " + Convert.ToDateTime(dt.Rows[0]["TglRequest"].ToString()).ToString("dd-MMM-yyyy"); string alamatKirim = header.Alamat(dt.Rows[0]["Alamat"].ToString()); string nSpace = namaToko.Trim() + header.SPACE(namaToko.Trim().Length + (15 - namaToko.Trim().Length) - 7) + cClass; string waktu = dt.Rows[0]["HariKredit"].ToString() + " Hari / "; string wilID = dt.Rows[0]["WilID"].ToString().Trim(); string daerah = header.Daerah(dt.Rows[0]["Daerah"].ToString()) + "(Wil: " + wilID + ") "; string kota = header.Kota(dt.Rows[0]["Kota"].ToString()); string expedisi = dt.Rows[0]["Expedisi"].ToString(); string namaExpedisi = dt.Rows[0]["NamaExpedisi"].ToString(); double plafon = double.Parse(dt.Rows[0]["Plafon"].ToString()); string grade = dt.Rows[0]["Grade"].ToString(); #region Cetak Header header.Initialize(); header.FontCondensed(false); header.FontCPI(12); header.PageLLine(33); header.LeftMargin(1); header.BottomMargin(1); header.DoubleHeight(true); header.DoubleWidth(true); header.PROW(true, 1, "DELIVERY ORDER (BO)"); header.DoubleHeight(false); header.DoubleWidth(false); header.LetterQuality(true); header.FontCPI(12); header.FontBold(true); header.PROW(true, 1, header.Sales(sales)); header.FontBold(false); header.FontItalic(false); header.LineSpacing("1/6"); header.FontItalic(true); header.AddCR(); header.Append(" "); header.FontItalic(false); header.FontCondensed(true); header.PROW(false, 53, header.PrintTopLeftCorner() + header.PrintHorizontalLine(2) + " Pengiriman kepada Toko " + header.PrintHorizontalLine(14) + header.PrintTopRightCorner()); header.PROW(true, 1, cat1.PadRight(47, ' ')); header.PROW(false, 51, header.PrintVerticalLine() + header.SPACE(40) + header.PrintVerticalLine()); header.FontBold(true); header.AddCR(); header.PROW(false, 55, nSpace); header.FontBold(false); header.FontBold(true); header.PROW(true, 1, "TGL.DOBO : "); header.FontBold(false); header.FontItalic(true); header.AddCR(); header.PROW(false, 13, TglDO); header.FontItalic(false); header.PROW(false, 53, header.PrintVerticalLine() + header.SPACE(40) + header.PrintVerticalLine()); //header.FontCondensed(true); header.FontItalic(true); header.AddCR(); header.PROW(false, 92, alamatKirim); header.FontItalic(false); //header.FontCondensed(false); header.FontBold(true); header.PROW(true, 1, "ASAL D.O : "); header.FontBold(false); header.FontItalic(true); header.AddCR(); header.PROW(false, 13, DO); header.FontItalic(false); header.PROW(false, 53, header.PrintVerticalLine() + header.SPACE(40) + header.PrintVerticalLine()); header.FontItalic(true); header.AddCR(); header.PROW(false, 55, daerah); header.FontItalic(false); header.FontBold(true); header.PROW(true, 1, "JK.WAKTU : "); header.FontBold(false); header.FontItalic(true); header.AddCR(); header.PROW(false, 13, waktu + cat2.PadRight(20, ' ')); header.FontItalic(false); header.PROW(false, 53, header.PrintVerticalLine() + header.SPACE(40) + header.PrintVerticalLine()); header.FontItalic(true); header.AddCR(); header.PROW(false, 55, kota); header.FontItalic(false); header.FontBold(true); header.PROW(true, 1, "NOMOR RQ. : "); header.FontBold(false); header.FontItalic(true); header.AddCR(); header.PROW(false, 13, noRq); header.FontItalic(false); header.PROW(false, 53, header.PrintVerticalLine() + header.SPACE(31) + "Grade: " + header.PrintVerticalLine()); header.FontItalic(true); header.AddCR(); header.PROW(false, 55, "PLAFON :" + plafon.ToString("#,###").PadLeft(14, ' ')); header.FontItalic(false); header.PROW(false, 91, header.STR(2, grade)); header.FontItalic(false); header.FontBold(true); header.PROW(true, 1, "EXPEDISI : "); header.FontBold(false); header.FontItalic(true); header.AddCR(); header.PROW(false, 13, expedisi + " (" + namaExpedisi + ")"); header.FontItalic(false); header.PROW(false, 53, header.PrintBottomLeftCorner() + header.PrintHorizontalLine(40) + header.PrintBottomRightCorner()); header.LetterQuality(false); //header.FontCondensed(true); header.LineSpacing("1/6"); header.PROW(true, 1, "No. N a m a B a r a n g RAK Dipesan Dikirim H.Sat. Disc./Pot. Jml.Net Stok"); header.PROW(true, 1, header.PrintDoubleLine(151)); #endregion return(header.GenerateString()); }
private void 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 PrintOutDotMatrix() { BuildString data = new BuildString(); data.Initialize(); data.PageLLine(33); data.LeftMargin(1); data.BottomMargin(1); data.LetterQuality(false); data.FontBold(true); data.FontCondensed(true); data.DoubleHeight(true); data.PROW(true, 1, ""); data.DoubleWidth(true); data.DoubleHeight(true); data.FontCPI(12); data.LineSpacing("1/8"); //data.PROW(false, 2, Convert.ToString((char)27) + Convert.ToString((char)33) + Convert.ToString((char)12)); data.PROW(true, 1, "Register Tagihan"); data.DoubleWidth(false); data.DoubleHeight(false); /* 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890*/ /* 1 2 3 4 5 6 7 8 9 10 11 12 13 14*/ data.FontCondensed(true); data.PROW(true, 1, " Customer Part Number Q t y Harga Sat Disc(%) Pot Jumlah Harga"); data.PROW(true, 1, data.PrintDoubleLine(134)); //foreach (DataRow dr in dt.Rows) //{ string _customer1 = "YATIK", _customer2 = "RAYZA LUTHFI", _customer3 = "RAFA ANADA RADITIYA AHMAD"; int panjanghuruf = _customer1.Length; if (panjanghuruf >= 25) { _customer1 = _customer1.Substring(0, 30); } int panjanghuruf2 = _customer1.Length; if (panjanghuruf2 >= 25) { _customer2 = _customer2.Substring(0, 30); } string sTemp = ""; sTemp = sTemp + _customer1.PadRight(25, ' ') + " | "; data.PROW(true, 1, sTemp); sTemp = ""; sTemp = sTemp + _customer2.PadRight(25, ' ') + " | "; data.PROW(true, 1, sTemp); sTemp = ""; sTemp = sTemp + _customer3.PadRight(25, ' ') + " | "; data.PROW(true, 1, sTemp); //} data.Eject(); data.SendToPrinter("Register_Tagihan.txt"); //data.SendToTxt("Register_Tagihan.txt", data.GenerateString()); //detail.SendToPrinter("Register_Tagihan.txt"); //, detail.GenerateString()); MessageBox.Show("Proses Cetak Selesai.."); }
private void PrintRawNotaRetur(DataTable dt) { BuildString retur = new BuildString(); string NoMPR = dt.Rows[0]["NoMPR"].ToString(); string NoRetur = dt.Rows[0]["NoNotaRetur"].ToString(); string TglMPR = Convert.ToDateTime(dt.Rows[0]["TglMPR"].ToString()).ToString("dd-MMM-yyyy"); string TglNota = (Tools.isNull(dt.Rows[0]["TglNotaRetur"], "").ToString() == "")? string.Empty:Convert.ToDateTime(dt.Rows[0]["TglNotaRetur"].ToString()).ToString("dd-MMM-yyyy"); string NamaToko = dt.Rows[0]["NamaToko"].ToString().PadRight(31); string Alamat = dt.Rows[0]["Alamat"].ToString().PadRight(60); string Daerah = dt.Rows[0]["Daerah"].ToString().PadRight(25); string IdWil = dt.Rows[0]["WilID"].ToString(); string Kota = dt.Rows[0]["Kota"].ToString(); string Penerima = dt.Rows[0]["Penerima"].ToString(); int No = 0; string ketCetak = ""; if (_nCetak > 1) { ketCetak = "(COPY)"; } if (_nCetak == 9) { ketCetak = "(REVISI)"; } #region Header retur.FontCondensed(false); retur.FontCPI(12); retur.DoubleHeight(true); retur.DoubleWidth(true); retur.PROW(true, 1, retur.SPACE(15) + "NOTA RETUR " + ketCetak); retur.DoubleWidth(false); retur.DoubleHeight(false); retur.FontBold(false); retur.FontCPI(10); retur.PageLLine(33); retur.LeftMargin(0); retur.FontBold(true); retur.PROW(true, 1, "MPR : " + NoMPR.PadRight(7, ' ') + retur.SPACE(47) + "NOTA : " + NoRetur); retur.PROW(true, 1, "Tgl.: " + TglMPR + retur.SPACE(43) + "Tgl. : " + TglNota); //retur.PROW(true, 1, ""); retur.FontCPI(12); retur.FontBold(false); retur.LineSpacing("1/8"); retur.PROW(true, 1, retur.SPACE(53) + retur.PrintTopLeftCorner() + retur.PrintHorizontalLine(1) + " Nama Toko : " + retur.PrintHorizontalLine(26) + retur.PrintTopRightCorner()); retur.PROW(true, 1, retur.SPACE(53) + retur.PrintVerticalLine() + retur.SPACE(40) + retur.PrintVerticalLine()); retur.FontBold(true); retur.AddCR(); retur.PROW(false, 56, NamaToko); retur.FontBold(false); retur.PROW(true, 1, retur.SPACE(53) + retur.PrintVerticalLine() + retur.SPACE(40) + retur.PrintVerticalLine()); retur.FontCondensed(true); retur.FontItalic(true); retur.AddCR(); retur.PROW(false, 95, Alamat); retur.FontItalic(false); retur.FontCondensed(false); retur.PROW(true, 1, retur.SPACE(53) + retur.PrintVerticalLine() + retur.SPACE(40) + retur.PrintVerticalLine()); retur.FontCondensed(true); retur.FontItalic(true); retur.AddCR(); retur.PROW(false, 95, Daerah); retur.FontItalic(false); retur.FontCondensed(false); retur.PROW(true, 1, retur.SPACE(53) + retur.PrintVerticalLine() + retur.SPACE(40) + retur.PrintVerticalLine()); retur.FontItalic(true); retur.AddCR(); retur.PROW(false, 56, Kota + " (" + IdWil + ")"); retur.FontItalic(false); retur.PROW(true, 1, retur.SPACE(53) + retur.PrintBottomLeftCorner() + retur.PrintHorizontalLine(40) + retur.PrintBottomRightCorner()); retur.LetterQuality(false); retur.FontCondensed(true); retur.PROW(true, 1, retur.PrintDoubleLine(157)); retur.PROW(true, 1, "No. N a m a B a r a n g No.Nota Sales Qty Hrg/Sat Jml.Hrg(Rp) Kategori "); retur.PROW(true, 1, retur.PrintHorizontalLine(157)); #endregion #region Detail string Sales = string.Empty; string Keterangan = string.Empty; string NamaStok = string.Empty; string AsalNota = string.Empty; string Satuan = string.Empty; string temp = string.Empty; string QtyGudang = string.Empty; double HargaJual = 0; double Net = 0; double TotalNet = 0; foreach (DataRow dr in dt.Rows) { No++; temp = string.Empty; Sales = retur.PadCenter(11, dr["NamaSales"].ToString()); QtyGudang = dr["QtyGudang"].ToString(); Net = double.Parse(dr["JmlHrg"].ToString()); HargaJual = double.Parse(dr["HrgJual"].ToString()); TotalNet += Net; NamaStok = dr["NamaBarang"].ToString().PadRight(73, '.'); AsalNota = dr["NotaAsal"].ToString().PadRight(7); Satuan = dr["Satuan"].ToString().PadRight(3); Keterangan = dr["Kategori"].ToString(); temp += No.ToString().PadLeft(2, '0') + ". "; temp += NamaStok + " "; temp += AsalNota + " "; temp += Sales; temp += QtyGudang.PadLeft(4) + " " + Satuan + " "; temp += HargaJual.ToString("#,###").PadLeft(9) + " "; temp += Net.ToString("#,###").PadLeft(10) + " "; temp += retur.PadCenter(25, Keterangan.Trim()); retur.PROW(true, 1, temp); } No++; for (int i = No; i <= 15; i++) { retur.PROW(true, 1, i.ToString().PadLeft(2, '0') + ". "); } #endregion #region Footer retur.PROW(true, 1, retur.PrintDoubleLine(157)); retur.PROW(true, 1, retur.SPACE(104) + "Netto : Rp." + TotalNet.ToString("#,###").PadLeft(10)); retur.LineSpacing("1/6"); retur.FontBold(false); retur.FontCondensed(false); retur.PROW(true, 1, " Mengetahui :"); retur.PROW(true, 1, " Bag. Gudang Bag. ADMIN "); retur.PROW(true, 1, ""); retur.PROW(true, 1, ""); retur.PROW(true, 1, " (" + retur.PadCenter(12, Penerima.Trim()) + ") ( )"); retur.Eject(); #endregion retur.SendToPrinter("NotaRetur.txt"); }
private void CetakSlipBonus() { if (dataGridSales.SelectedCells.Count == 0 || dataGridPerolehanBns.SelectedCells.Count == 0) { MessageBox.Show(Messages.Error.RowNotSelected); return; } if ((int)dataGridPerolehanBns.SelectedCells[0].OwningRow.Cells["nPrint"].Value > 0) { MessageBox.Show("Sudah cetak slip", "Perhatian"); return; } if (dataGridPerolehanBns.SelectedCells[0].OwningRow.Cells["NoACC"].Value.ToString() == "") { MessageBox.Show("Belum di acc !!!", "Perhatian"); return; } string kodeSales = dataGridSales.SelectedCells[0].OwningRow.Cells["KodeSales"].Value.ToString(), namaSales = dataGridSales.SelectedCells[0].OwningRow.Cells["NamaSales"].Value.ToString(), periode = dataGridPerolehanBns.SelectedCells[0].OwningRow.Cells["Periode"].Value.ToString(), noACC = dataGridPerolehanBns.SelectedCells[0].OwningRow.Cells["NoACC"].Value.ToString(); double rpACC = double.Parse(dataGridPerolehanBns.SelectedCells[0].OwningRow.Cells["RpACC"].Value.ToString()); DateTime tanggal = (DateTime)dataGridPerolehanBns.SelectedCells[0].OwningRow.Cells["Tanggal"].Value; if (noACC.Substring(0, 3) == "DIS") { return; } BuildString data = new BuildString(); string typePrinter = data.GetPrinterName(); data.Initialize(); data.PageLLine(33); data.LeftMargin(3); data.LetterQuality(true); data.FontBold(true); data.PROW(true, 1, ""); data.DoubleHeight(true); data.DoubleWidth(true); data.PROW(true, 1, data.SPACE(13) + "SLIP BONUS SALESMAN"); data.DoubleWidth(false); data.DoubleHeight(false); data.FontCPI(12); data.PROW(true, 1, ""); //@ PROW()+1,1 SAY CHR(27)+CHR(33)+CHR(12) data.PROW(true, 1, data.PrintHorizontalLine(77)); data.PROW(true, 1, ""); data.PROW(true, 1, ""); data.PROW(true, 1, " BULAN : " + periode); data.PROW(true, 1, ""); data.PROW(true, 1, " DICETAK TANGGAL : " + tanggal.ToString("dd-MMM-yyyy")); data.PROW(true, 1, ""); data.PROW(true, 1, " SALESMAN : " + kodeSales + " " + namaSales); data.PROW(true, 1, ""); data.PROW(true, 1, " NO. ACC : " + noACC); data.PROW(true, 1, ""); data.PROW(true, 1, " BONUS PENJUALAN BARANG PRODUKSI & MEREK HTS"); data.PROW(true, 1, ""); data.PROW(true, 1, " NOMINAL : Rp." + rpACC.ToString("#,###").PadLeft(9) + ",-"); data.PROW(true, 1, ""); data.PROW(true, 1, ""); data.PROW(true, 1, " Ka.ADM, Penerima,"); data.PROW(true, 1, ""); data.PROW(true, 1, ""); data.PROW(true, 1, ""); data.PROW(true, 1, ""); data.PROW(true, 1, " ( ) ( )"); data.PROW(true, 1, data.PrintHorizontalLine(77)); data.PROW(true, 1, ""); data.Eject(); data.SendToPrinter("slipBonus.txt"); }