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 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); } }
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 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 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 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 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 PrintRawSPPB(DataTable dt) { BuildString sppb = new BuildString(); int No = 0; #region Header string noMemo = dt.Rows[0]["NoMPR"].ToString(); string tglMemo = DateTime.Parse(dt.Rows[0]["TglMPR"].ToString()).ToString("dd-MMM-yyyy"); string namaToko = dt.Rows[0]["NamaToko"].ToString().PadRight(31); string alamatKirim = dt.Rows[0]["Alamat"].ToString().PadRight(60); string kota = dt.Rows[0]["Kota"].ToString(); string idWil = dt.Rows[0]["WilID"].ToString(); string bagianPenjualan = dt.Rows[0]["BagPenjualan"].ToString(); sppb.Initialize(); sppb.FontCondensed(false); sppb.FontCPI(10); sppb.PageLLine(33); sppb.LeftMargin(3); sppb.FontBold(true); sppb.PROW(true, 1, "No." + noMemo + sppb.SPACE(50) + " Tgl." + tglMemo); sppb.FontCPI(12); sppb.PROW(true, 1, sppb.SPACE(30) + "SURAT PERINTAH PENGAMBILAN BARANG"); sppb.FontBold(false); sppb.LetterQuality(true); sppb.LineSpacing("1/8"); sppb.PROW(true, 1, " "); sppb.PROW(true, 1, sppb.SPACE(10) + sppb.PrintTopLeftCorner() + sppb.PrintHorizontalLine(1) + " Nama Toko : " + sppb.PrintHorizontalLine(26) + sppb.PrintTopRightCorner()); sppb.PROW(true, 1, sppb.SPACE(10) + sppb.PrintVerticalLine() + sppb.SPACE(40) + sppb.PrintVerticalLine()); sppb.FontBold(true); sppb.AddCR(); sppb.PROW(false, 13, namaToko); sppb.FontBold(false); sppb.PROW(true, 1, sppb.SPACE(10) + sppb.PrintVerticalLine() + sppb.SPACE(40) + sppb.PrintVerticalLine()); sppb.FontCondensed(true); sppb.FontItalic(true); sppb.AddCR(); sppb.PROW(false, 22, alamatKirim); sppb.FontItalic(false); sppb.FontCondensed(false); sppb.PROW(true, 1, sppb.SPACE(10) + sppb.PrintVerticalLine() + sppb.SPACE(40) + sppb.PrintVerticalLine()); sppb.FontItalic(true); sppb.AddCR(); sppb.PROW(false, 13, kota + " (" + idWil + ")"); sppb.FontItalic(false); sppb.PROW(true, 1, sppb.SPACE(10) + sppb.PrintBottomLeftCorner() + sppb.PrintHorizontalLine(40) + sppb.PrintBottomRightCorner()); sppb.LetterQuality(false); sppb.FontCondensed(true); sppb.PROW(true, 1, ""); sppb.PROW(true, 1, sppb.PrintDoubleLine(154)); sppb.PROW(true, 1, "No. N a m a B a r a n g" + sppb.SPACE(45) + "Asal Nota" + sppb.SPACE(5) + "Qty" + sppb.SPACE(13) + "Sales" + sppb.SPACE(14) + "Alasan Retur" + sppb.SPACE(12)); sppb.PROW(true, 1, sppb.PrintHorizontalLine(154)); #endregion #region Detail string temp = string.Empty; string sales = string.Empty; string namaStok = string.Empty; string asalNota = string.Empty; string satuan = string.Empty; string catatan = string.Empty; int qtyTarik = 0; foreach (DataRow dr in dt.Rows) { No++; temp = string.Empty; sales = dr["NamaSales"].ToString(); namaStok = dr["NamaBarang"].ToString(); asalNota = dr["NotaAsal"].ToString().PadRight(7); satuan = dr["Satuan"].ToString(); catatan = dr["Catatan1"].ToString(); qtyTarik = int.Parse(dr["QtyTarik"].ToString()); temp += No.ToString().PadLeft(2, '0') + ". "; temp += namaStok.PadRight(73, '.') + sppb.SPACE(4); temp += asalNota + sppb.SPACE(4); temp += qtyTarik.ToString().PadLeft(6) + " " + satuan.PadLeft(3) + sppb.SPACE(4); temp += sppb.PadCenter(15, sales); temp += sppb.PadCenter(30, 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(154)); sppb.PROW(true, 1, ""); sppb.PROW(true, 1, sppb.SPACE(20) + "Bag.Penjualan" + sppb.SPACE(90) + "Salesman"); sppb.PROW(true, 1, ""); sppb.PROW(true, 1, ""); sppb.PROW(true, 1, ""); sppb.PROW(true, 1, sppb.SPACE(16) + "(" + sppb.PadCenter(19, bagianPenjualan) + ")" + sppb.SPACE(79) + "(.....................)"); sppb.Eject(); #endregion sppb.SendToPrinter("sppb.txt"); }