public Modul_Pembayaran()
 {
     InitializeComponent();
     allfunc = new AllFunc();
     dbo = new DbObject();
     kas = new Kas();
     obj = new JurnalUmum();
     subObj = new SubJurnalUmum();
     piutang = new Piutang();
     stock = new Stock();
     stockGudang = new StockGudang();
     noBon = new NoBon();
     jual = new Jual();
     subjual = new SubJual();
     returJual = new RetJual();
     returSubJual = new RetSubJual();
     racikan = new Racikan();
     jasa = new Jasa();
     label15.Visible = false;
 }
        private void cetakBtn_Click(object sender, EventArgs e)
        {
            if (jumlahKasTxt.Text.CompareTo("") == 0)
                {
                    double total = Convert.ToDouble(totalOmsetTxt.Text) + Convert.ToDouble(allfunc.remove_separated(kasAwalTxt.Text));
                    jumlahKasTxt.Text = allfunc.digit_separated(Convert.ToString(total));
                }
                DbObject dbo = new DbObject();
                double penjualanTunai = 0.0;
                Jual jual = new Jual();
                try
                {
                    SqlDataReader sdr = jual.getJualTunai(DateTime.Today, login.username);
                    while (sdr.Read())
                    {
                        penjualanTunai = (double)sdr["nominal"];
                    }
                }
                catch (InvalidCastException ice_e)
                {
                    penjualanTunai = 0.0;
                }

                StrukPrint print = new StrukPrint();
                print.printLaporanGantiOperatorDirectPrint("", login.username, jamMulaiDateTimePicker.Value, jamSelesaiDateTimePicker.Value, kelompokOmsetDataGridView, piutangDataGridView, Convert.ToDouble(allfunc.remove_separated(totalOmsetTxt.Text)), Convert.ToDouble(allfunc.remove_separated(kasAwalTxt.Text)), penjualanTunai);
            //print.printLaporanGantiOperator("",login.username,jamMulaiDateTimePicker.Value,jamSelesaiDateTimePicker.Value,kelompokOmsetDataGridView,piutangDataGridView,Convert.ToDouble(allfunc.remove_separated(totalOmsetTxt.Text)),Convert.ToDouble(allfunc.remove_separated(kasAwalTxt.Text)),penjualanTunai);
                login.logout();
                this.Visible = false;
                if (pos != null)
                {
                    pos.Close();
                }
                else if (resep != null)
                {
                    resep.Close();
                }
        }
        public Modul_Pembayaran(Modul_POS modulPos,Login login)
        {
            InitializeComponent();
            this.modulPos = modulPos;
            allfunc = new AllFunc();
            string[] custDataArr = modulPos.getCustomer();
            if (custDataArr[0].CompareTo("") == 0)
            {
                kodePelangganTxt.Text = "TUNAI";
                namaKodePelangganTxt.Text = "TUNAI";
                namaPasienTxt.Text = "TUNAI";
                alamatPasienTxt.Text = "";
                alamatTxt.Text = "";
            }
            else
            {
                kodePelangganTxt.Text = custDataArr[0];
                namaKodePelangganTxt.Text = custDataArr[1];
                namaPasienTxt.Text = custDataArr[1];
                alamatPasienTxt.Text = custDataArr[2];
                alamatTxt.Text = custDataArr[2];
            }
            this.jumlahPenjualan = modulPos.jumlahPenjualan;
            this.jumlahDiskon = modulPos.jumlahDiskon;
            this.jumlahPenjualanBruto = modulPos.jumlahPenjualanBruto;
            nettoTxt.Text = allfunc.digit_separated(Convert.ToString(this.jumlahPenjualan));
            discountRPTxt.Text = allfunc.digit_separated(Convert.ToString(modulPos.jumlahDiskon));

            dbo = new DbObject();
            kas = new Kas();
            obj = new JurnalUmum();
            subObj = new SubJurnalUmum();
            piutang = new Piutang();
            stock = new Stock();
            stockGudang = new StockGudang();
            noBon = new NoBon();
            jual = new Jual();
            subjual = new SubJual();
            returJual = new RetJual();
            returSubJual = new RetSubJual();
            racikan = new Racikan();
            jasa = new Jasa();
            this.login = login;
            label15.Visible = false;
            kasir = login.username;
        }