Ejemplo n.º 1
0
        private void gridVoucher_DoubleClick(object sender, EventArgs e)
        {
            //if (gridVoucher.SelectedCells[0].OwningRow.Cells["InfoToko"].Value.ToString() == "")
            //{
            //    MessageBox.Show("Belum iden ke Toko");
            //    return;
            //}

            if (gridVoucher.SelectedCells.Count > 0)
            {
                DataTable dtcg = new DataTable(GlobalVar.DBName);
                _GiroID = new Guid(gridVoucher.SelectedCells[0].OwningRow.Cells["GiroID"].Value.ToString());

                /*tambahan cek pin giro*/
                try
                {
                    this.Cursor = Cursors.WaitCursor;
                    using (Database db = new Database(GlobalVar.DBName))
                    {
                        db.Commands.Add(db.CreateCommand("usp_PinGiro_CEK"));
                        db.Commands[0].Parameters.Add(new Parameter("@GiroID", SqlDbType.UniqueIdentifier, _GiroID));
                        dtcg = db.Commands[0].ExecuteDataTable();
                    }
                }
                catch (System.Exception ex)
                {
                    Error.LogError(ex);
                }
                finally
                {
                    this.Cursor = Cursors.Default;
                }

                if (dtcg.Rows.Count > 0)
                {
                    MessageBox.Show("Untuk Pencairan Giro harus minta Pin ke HO.");

                    string _pinKey = GetKey(_GiroID.ToString(), GlobalVar.Gudang, 31);
                    PengajuanPinGiro(dtcg, _pinKey);

                    pin.frmPinMd5 ifrmpin = new pin.frmPinMd5(this, _GiroID, GlobalVar.Gudang, 31, "Untuk Pencairan Giro harus minta Pin ke HO.");
                    ifrmpin.ShowDialog();
                    if (ifrmpin.DialogResult == DialogResult.OK)
                    {
                        try
                        {
                            this.Cursor = Cursors.WaitCursor;
                            using (Database db = new Database(GlobalVar.DBName))
                            {
                                db.Commands.Add(db.CreateCommand("usp_PinGiro_UPDATE"));
                                db.Commands[0].Parameters.Add(new Parameter("@GiroID", SqlDbType.UniqueIdentifier, _GiroID));
                                db.Commands[0].ExecuteNonQuery();
                            }
                            this.Close();
                        }
                        catch (System.Exception ex)
                        {
                            Error.LogError(ex);
                        }
                        finally
                        {
                            this.Cursor = Cursors.Default;
                            this.Close();
                        }
                    }
                    else
                    {
                        this.DialogResult = DialogResult.No;
                        this.Close();
                        return;
                    }
                }

                /*end tambahan*/


                //if (gridVoucher.SelectedCells[0].OwningRow.Cells["InfoToko"].Value.ToString() == "")
                //{
                //    MessageBox.Show("Belum iden ke Toko");
                //    return;
                //}

                string _BankID = "", _BankIDBBM = "";
                _BankID    = gridVoucher.SelectedCells[0].OwningRow.Cells["BankID"].Value.ToString();
                _BankIDBBM = gridVoucher.SelectedCells[0].OwningRow.Cells["BankIDBBM"].Value.ToString();

                //if (_BankID != _BankIDBBM)
                //{
                //    MessageBox.Show("BankID Giro Tidak Sama Dengan BankID BBM");
                //    gridVoucher.Focus();
                //    return;
                //}

                DateTime _tglJT = (DateTime)gridVoucher.SelectedCells[0].OwningRow.Cells["TglJTempo"].Value;
                this.Close();
                Kasir.frmTransaksiPencairanGiro ifrmChild = new Kasir.frmTransaksiPencairanGiro(this.Caller, _GiroID, _rowIDBBM, _tglJT);
                Program.MainForm.RegisterChild(ifrmChild);
                ifrmChild.ShowDialog();
            }
        }
Ejemplo n.º 2
0
        private void cboTrans_SelectedValueChanged(object sender, EventArgs e)
        {
            string val_ = Tools.isNull(cboTrans.SelectedValue, "").ToString();

            switch (val_)
            {
            case "":
            {
                ResetData();
            }
            break;

            case "RET":
            {
                GetRetur(_KodeToko);
            }
            break;

            case "KPJ":
            {
                GetKoreksi(_KodeToko, "KPJ");
            }
            break;

            case "KRJ":
            {
                GetKoreksi(_KodeToko, "KRJ");
            }
            break;

            case "MUT":
            {
                GetNota(_KodeToko);
            }
            break;

            case "PLL":
            {
                GetPLL();
            }
            break;

            case "POT":
            {
                GetPOT();
            }
            break;

            case "ADJ":
            {
                txtDebet.Text      = "0";
                txtKredit.Text     = "0";
                txtDebet.ReadOnly  = false;
                txtKredit.ReadOnly = false;
                txtNoACC.ReadOnly  = false;
                txtNoACC.TabStop   = true;
                txtUraian.Clear();

                if (GlobalVar.Gudang != "2803" && GlobalVar.Gudang != "2808")
                {
                    string _pinKey = GetKey(_HeaderID.ToString(), GlobalVar.Gudang, 29);

                    MessageBox.Show("Input Transaksi ADJ harus menggunakan Pin." + "\n" +
                                    "Silahkan Pengajuan PIN ke HO.");
                    PengajuanPinAdj(_HeaderID, _pinKey);

                    pin.frmPinMd5 ifrmpin = new pin.frmPinMd5(this, _HeaderID, GlobalVar.Gudang, 29, "ADJ Piutang.");
                    ifrmpin.ShowDialog();
                    if (ifrmpin.DialogResult != DialogResult.OK)
                    {
                        this.DialogResult = DialogResult.No;
                        this.Close();
                        return;
                    }
                }
            }
            break;

            case "DIL":
            {
                //GetDIL(_KodeToko,_NoTransaksi);
                Guid   RowIDNota;
                Guid   RowIDPotongan;
                double Saldo;
                Piutang.frmPotonganPenjualanBelumIden ifrmChild = new Piutang.frmPotonganPenjualanBelumIden(_KodeToko);
                ifrmChild.WindowState = FormWindowState.Normal;
                ifrmChild.ShowDialog();
                if (ifrmChild.DialogResult == DialogResult.OK)
                {
                    RowIDNota     = ifrmChild.RowIDNota;
                    RowIDPotongan = ifrmChild.RowIDPotongan;
                    Saldo         = ifrmChild.Saldo;
                    Piutang.frmpotonganpenjualanidentifikasi frm = new Piutang.frmpotonganpenjualanidentifikasi(RowIDPotongan, Saldo);
                    frm.WindowState = FormWindowState.Normal;
                    frm.ShowDialog();
                    if (frm.DialogResult == DialogResult.OK)
                    {
                        try
                        {
                            DataTable dtLinkPot = new DataTable();
                            using (Database db = new Database())
                            {
                                db.Commands.Add(db.CreateCommand("[psp_Potongan_LinkToPiutang_ISA]"));
                                db.Commands[0].Parameters.Add(new Parameter("@potID", SqlDbType.UniqueIdentifier, RowIDPotongan));
                                db.Commands[0].Parameters.Add(new Parameter("@notaJualID", SqlDbType.UniqueIdentifier, _HeaderID));
                                db.Commands[0].Parameters.Add(new Parameter("@lastUpdatedBy", SqlDbType.VarChar, SecurityManager.UserID));
                                db.Commands[0].Parameters.Add(new Parameter("@NominalIden", SqlDbType.Money, frm.NomIden));
                                dtLinkPot = db.Commands[0].ExecuteDataTable();
                            }
                            if (dtLinkPot.Rows[0]["cekNota"].ToString() == "0")
                            {
                                MessageBox.Show("Nota tidak ada", "Perhatian");
                            }
                            else
                            {
                                MessageBox.Show("Potongan Berhasil Teridentifikasi", "Sukses");
                            }
                        }
                        catch (Exception ex)
                        {
                            Error.LogError(ex);
                        }
                        finally
                        {
                            if (this.Caller is Piutang.frmKartuPiutangBrowse)
                            {
                                Piutang.frmKartuPiutangBrowse frmkp = new Piutang.frmKartuPiutangBrowse();
                                frmkp = (Piutang.frmKartuPiutangBrowse) this.Caller;
                                frmkp.RefreshKPiutangDetail("", _HeaderID);
                            }
                            //Piutang.frmKartuPiutangBrowse frmkp = new Piutang.frmKartuPiutangBrowse();
                            //frmkp.search_kp(_HeaderID.ToString(),_KodeToko);
                            this.Close();
                        }
                    }
                }
            }
            break;
            }
        }
Ejemplo n.º 3
0
        private void cmdSAVE_Click(object sender, EventArgs e)
        {
            double nRpBayar = 0;

            if (txtBayar.Text.ToString().Trim() != "" && txtBayar.Text.ToString().Trim() != "0")
            {
                nRpBayar = Convert.ToDouble(txtBayar.Text.ToString());
            }
            if (nRpNota != nRpBayar)
            {
                string _pinKey = GetKey(_rowID.ToString(), GlobalVar.Gudang, 26);

                MessageBox.Show("Nominal Nota beda dengan nominal Pembayaran kasir." + "\n" +
                                "Silahkan Pengajuan PIN ke HO.");
                PengajuanPinPenjualanTunai(_rowID, nRpBayar, _pinKey);

                pin.frmPinMd5 ifrmpin = new pin.frmPinMd5(this, _rowID, GlobalVar.Gudang, 26, "Rp Nota beda dengan Rp Bayar");
                ifrmpin.ShowDialog();
                if (ifrmpin.DialogResult != DialogResult.OK)
                {
                    this.DialogResult = DialogResult.No;
                    this.Close();
                    return;
                }
            }

            string rpNet3 = dt.Rows[0]["RpNet3"].ToString();
            double n      = double.Parse(rpNet3) - double.Parse(txtBayar.Text);

            txtPLL.Text = (0).ToString();
            txtPot.Text = (0).ToString();
            if (n > 0 && n <= 1000)
            {
                txtPot.Text = n.ToString();
            }
            if (n < 0 && n >= -1000)
            {
                txtPLL.Text = Math.Abs(n).ToString();
            }

            try
            {
                this.Cursor = Cursors.WaitCursor;
                using (Database db = new Database())
                {
                    db.Commands.Add(db.CreateCommand("psp_PJT_LinkToKasir_ISA"));
                    db.Commands[0].Parameters.Add(new Parameter("@nilaiBayar", SqlDbType.Money, double.Parse(txtBayar.Text)));
                    db.Commands[0].Parameters.Add(new Parameter("@notaID", SqlDbType.UniqueIdentifier, _rowID));
                    db.Commands[0].Parameters.Add(new Parameter("@noPerkiraan", SqlDbType.VarChar, txtNoPerkiraan.Text));
                    db.Commands[0].Parameters.Add(new Parameter("@uraian", SqlDbType.VarChar, txtUraian.Text));
                    db.Commands[0].Parameters.Add(new Parameter("@nilaiPOT", SqlDbType.Money, double.Parse(txtPot.Text)));
                    db.Commands[0].Parameters.Add(new Parameter("@nilaiPLL", SqlDbType.Money, double.Parse(txtPLL.Text)));
                    db.Commands[0].Parameters.Add(new Parameter("@lastUpdatedBy", SqlDbType.VarChar, SecurityManager.UserID));
                    db.Commands[0].ExecuteNonQuery();
                }
                MessageBox.Show("Data telah disimpan");
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            catch (Exception ex)
            {
                Error.LogError(ex);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }