private ListPembelian() { InitializeComponent(); pembelianService = new PembelianService(); pembelianDetailService = new PembelianDetailService(); dataGridViewDaftarPembelian.DataSource = pembelianService.FindWithSupplierDanPengguna(); dataGridViewDaftarPembelian.Columns[0].Visible = false; comboBoxCari.Items.Add("Kode Transaksi"); comboBoxCari.Items.Add("Supplier"); comboBoxCari.Items.Add("Tanggal"); comboBoxCari.SelectedItem = "Kode Transaksi"; dateTimePickerCari.Format = DateTimePickerFormat.Custom; dateTimePickerCari.CustomFormat = "dd MMMM yyyy"; }
private LaporanKeuangan() { InitializeComponent(); penjualanService = new PenjualanService(); penjualanDetailService = new PenjualanDetailService(); pembelianService = new PembelianService(); pembelianDetailService = new PembelianDetailService(); bukuBesarService = new BukuBesarService(); laporanLabaRugiService = new LaporanLabaRugiService(); dateTimePickerTransaksiPenjualan.Format = DateTimePickerFormat.Custom; dateTimePickerTransaksiPenjualan.CustomFormat = "dd MMMM yyyy"; dateTimePickerTransaksiPenjualanSampai.Format = DateTimePickerFormat.Custom; dateTimePickerTransaksiPenjualanSampai.CustomFormat = "dd MMMM yyyy"; dateTimePickerTransaksiPembelian.Format = DateTimePickerFormat.Custom; dateTimePickerTransaksiPembelian.CustomFormat = "dd MMMM yyyy"; dateTimePickerTransaksiPembelianSampai.Format = DateTimePickerFormat.Custom; dateTimePickerTransaksiPembelianSampai.CustomFormat = "dd MMMM yyyy"; dateTimePickerBukuBesar.Format = DateTimePickerFormat.Custom; dateTimePickerBukuBesar.CustomFormat = "dd MMMM yyyy"; dateTimePickerBukuBesarSampai.Format = DateTimePickerFormat.Custom; dateTimePickerBukuBesarSampai.CustomFormat = "dd MMMM yyyy"; labelTotalSaldo.Text = "Total Saldo : " + bukuBesarService.GetTotalSaldoHariIni(DateTime.Today).ToString("N2", CultureInfo.GetCultureInfo("id-ID")); //labelPemasukkanHariIni.Text="Pemasukkan sementara hari ini : "+bukuBesarService.GetTotalPemasukkanHariIni(DateTime.Today).ToString("N2", CultureInfo.GetCultureInfo("id-ID")); chartLabaRugi.ChartAreas[0].AxisY.Interval = 50000; chartLabaRugi.ChartAreas[0].AxisX.Interval = 1; foreach (var s in chartLabaRugi.Series) { s.Points.Clear(); } chartLabaRugi.Series.Clear(); List <LaporanLabaRugi> data = laporanLabaRugiService.GetLaporan(); Series series = new Series("Laba/Rugi perhari"); series.LabelFormat = "{0:N2}"; series.IsValueShownAsLabel = true; foreach (var d in data) { series.Points.AddXY(d.Tanggal.ToString("dd MM yyyy"), d.Jumlah); } chartLabaRugi.Series.Add(series); //Kas Kecil List <BukuBesar> dataKasKecil = bukuBesarService.GetByTanggal(DateTime.Today, false); ListViewItem item; decimal total = 0; foreach (var kas in dataKasKecil) { item = new ListViewItem(kas.Tanggal.ToString("dd MM yyyy")); item.SubItems.Add(kas.Keterangan); item.SubItems.Add(kas.Debet.ToString("N2", CultureInfo.GetCultureInfo("id-ID"))); item.SubItems.Add(kas.Kredit.ToString("N2", CultureInfo.GetCultureInfo("id-ID"))); total = total + kas.Debet - kas.Kredit; listViewKasKecil.Items.Add(item); } labelTotalKasKecil.Text = total.ToString("N2", CultureInfo.GetCultureInfo("id-ID")); if (!LoginContext.Pengguna.Role.NamaRole.Equals("Administrator")) { tabControl1.TabPages.Remove(tabPageBukuBesar); } }