Beispiel #1
0
 private void cmdAdd_Click(object sender, EventArgs e)
 {
     if (_isFromPiutang == true)
     {
         try
         {
             DataTable dtPerkiraan = Perkiraan.GetPerkiraanKoneksiDetail("");
             //tbUraian.NamaPerkiraan = dtPerkiraan.Rows[0]["uraian"].ToString();
             //tbUraian.NoPerkiraan = dtPerkiraan.Rows[0]["NoPerkiraan"].ToString();
         }
         catch (Exception ex)
         {
             Error.LogError(ex);
         }
     }
     else
     {
         tbUraian.NamaPerkiraan = "";
         tbUraian.NoPerkiraan   = "?";
     }
     tbJumlah.Text             = _rpsisa.ToString(); // "0";
     tbAcc.Text                = "";
     gbBKKUpdate.Enabled       = true;
     gbUpdateDetailBKK.Visible = true;
     gbUpdateDetailBKK.Top     = 100;
     gbUpdateDetailBKK.Left    = 200;
     detailMode                = enumDetailMode.New;
     txtUraian.Text            = "";
     tbUraian.Focus();
 }
Beispiel #2
0
        private void GetDialogResult(frmLookupTransaksiBank dialogForm)
        {
            this.kdTransaksi = dialogForm.KdTransaksi;
            this.nmTransaksi = dialogForm.NmTransaksi;
            this.dk = dialogForm.dk;
            this.noPerkiraan = dialogForm.noPerkiraan;

            if (this.SelectData != null)
            {
                this.SelectData(this, new EventArgs());
            }

            if (noPerkiraan == "")
            {
                using (Database db = new Database(GlobalVar.DBName))
                {
                    noPerkiraan = Perkiraan.GetPerkiraanKoneksiDetail("HI11").Rows[0]["NoPerkiraan"].ToString();
                }
            }

            if (kdTransaksi == "BM1")
            {
                LookupBankDialog();
            }
            
        }
Beispiel #3
0
        private void tbTglCair_Leave(object sender, EventArgs e)
        {
            //cair slip
            try
            {
                string _noGiro = gridDetail.SelectedCells[0].OwningRow.Cells["Nomor"].Value.ToString();
                if (MessageBox.Show("Proses Cair Slip " + _noGiro + " ??", "", MessageBoxButtons.OKCancel) == DialogResult.OK)
                {
                    DataTable dtCekBukti = new DataTable();
                    dtCekBukti = Inden.CekRelasiInden("Bukti", "RowID", _titipID.ToString(), "", "");
                    string RecordIDBKM = _titipRecID.Substring(0, 22) + "S";
                    Guid   _GiroID     = (Guid)gridDetail.SelectedCells[0].OwningRow.Cells["GiroID"].Value;
                    string _GiroRecID  = gridDetail.SelectedCells[0].OwningRow.Cells["GiroRecID"].Value.ToString();
                    string noPerk      = Perkiraan.GetPerkiraanKoneksiDetail("BGTRM").Rows[0]["NoPerkiraan"].ToString();
                    string uraian      = "SLIP #" + _noGiro + " (" + _noVoucher + ")";
                    string jumlah      = gridDetail.SelectedCells[0].OwningRow.Cells["Nominal"].Value.ToString();
                    tglCair = (DateTime)tbTglCair.DateValue;
                    using (Database db = new Database(GlobalVar.DBName))
                    {
                        db.BeginTransaction();
                        if (dtCekBukti.Rows.Count == 0)
                        {
                            noBKM    = Numerator.BookNumerator("BKM");
                            asalGiro = gridDetail.SelectedCells[0].OwningRow.Cells["_asalgiro"].Value.ToString();
                            BKM.AddHeader(db, _titipID, _titipID, RecordIDBKM, noBKM, "K", "SLP", tglCair, asalGiro, "", "", SecurityManager.UserName, "");
                        }
                        else
                        {
                            dtBKMHeader = new DataTable();
                            dtBKMHeader = BKM.ListHeaderperRow(_titipID);
                            asalGiro    = dtBKMHeader.Rows[0]["Kepada"].ToString();
                            noBKM       = dtBKMHeader.Rows[0]["NoBukti"].ToString();
                            tglCair     = (DateTime)dtBKMHeader.Rows[0]["TglBukti"];
                        }
                        BKM.AddDetail(db, _GiroID, _titipID, _GiroRecID, RecordIDBKM, "", "", "", "", noPerk, uraian, jumlah);
                        db.CommitTransaction();
                        dtBKMDetail = new DataTable();
                        dtBKMDetail = BKM.ListDetail(db, _titipID);
                    }

                    titipGiro();
                }
                else
                {
                    jnsSlip           = "";
                    cmdTitip.Enabled  = true;
                    gbTglCair.Enabled = false;
                    gbSlip.Visible    = false;
                    gbLookup.Enabled  = true;
                    return;
                }
            }
            catch (Exception ex)
            {
                Error.LogError(ex);
            }
        }
Beispiel #4
0
        private void Link2BKM()
        {
            string _noPerk = Perkiraan.GetPerkiraanKoneksiDetail("IND").Rows[0]["NoPerkiraan"].ToString();
            string noBKM   = Numerator.BookNumerator("BKM");

            String HRecordID = BKM.GetRecordIDBukti(_RecordIDInden, "IND");

            using (Database db = new Database(GlobalVar.DBName))
                //BKM.AddHeader(db, _RowIDInden, _RowIDInden, BKM.GetRecordIDBukti(_RecordIDInden, "IND"), noBKM, "K", "IND", GlobalVar.DateOfServer, _NamaCollector, "", "", SecurityManager.UserName, "");
                BKM.AddHeader(db, _RowIDInden, _RowIDInden, HRecordID, noBKM, "K", "IND", GlobalVar.DateOfServer, _NamaCollector, "", "", SecurityManager.UserName, "");
            //BKM.AddHeader(db, _RowIDInden, _RowIDInden, HRecordID, noBKM, "K", "IND", _TglTerima, _NamaCollector, "", "", SecurityManager.UserName, "");

            using (Database db = new Database(GlobalVar.DBName))
                //    BKM.AddDetail(db, _RowIDIndenDetail, _RowIDInden, _RecordIDInden, BKM.GetRecordIDBukti(_RecordIDIndenDetail, "IND"), "", "", "", "", _noPerk, "PENERIMAAN BELUM IDENTIFIKASI (" + _NoBukti + ")", _Nominal);
                BKM.AddDetail(db, _RowIDIndenDetail, _RowIDInden, _RecordIDInden, HRecordID, "", "", "", "", _noPerk, "PENERIMAAN BELUM IDENTIFIKASI (" + _NoBukti + ")", _Nominal);
        }
Beispiel #5
0
        private void cmdAdd_Click(object sender, EventArgs e)
        {
            if (_isFromPiutang == true)
            {
                try
                {
                    DataTable dtPerkiraan = Perkiraan.GetPerkiraanKoneksiDetail("PK");
                    tbUraian.Text = dtPerkiraan.Rows[0]["uraian"].ToString();
                }
                catch (Exception ex)
                {
                    Error.LogError(ex);
                }
            }
            else
            {
                tbUraian.Text = "";
            }

            if (linkPembelian)
            {
                if (dgDetailBKK.Rows.Count > 0)
                {
                    MessageBox.Show("BKK dr Nota Pembelian tidah bisa mempunyai 2 detail");
                    return;
                }
                tbUraian.Text    = _uraian;
                tbJumlah.Text    = _nominal;
                tbAcc.Text       = "";
                tbJumlah.Enabled = false;
            }
            else
            {
                tbJumlah.Text = "0";
                tbAcc.Text    = "";
            }
            gbBKKUpdate.Enabled       = true;
            gbUpdateDetailBKK.Visible = true;
            gbUpdateDetailBKK.Top     = 100;
            gbUpdateDetailBKK.Left    = 200;
            detailMode = enumDetailMode.New;
            tbUraian.Focus();
        }
Beispiel #6
0
        private void frmBuktiTransferMasukDetailUpdate_Load(object sender, EventArgs e)
        {
            switch (formMode)
            {
            case enumFormMode.New:

                DataTable dt1 = new DataTable();

                using (Database db = new Database(GlobalVar.DBName))
                {
                    db.Commands.Add(db.CreateCommand("usp_TransferBank_LIST"));

                    db.Commands[0].Parameters.Add(new Parameter("@RowID", SqlDbType.UniqueIdentifier, _RowIDTransferBank));
                    dt1 = db.Commands[0].ExecuteDataTable();
                }
                txtNoPerkiraan.Text   = (Perkiraan.GetPerkiraanKoneksiDetail("PK")).Rows[0]["NoPerkiraan"].ToString();
                dbTglBank.Text        = ((DateTime)dt1.Rows[0]["TglBBM"]).ToString("dd-MM-yyyy");
                dbTglTransfer.Text    = DateTime.Now.Date.ToString("dd/MM/yyyy");
                _RecordIDTransferBank = Tools.isNull(dt1.Rows[0]["RecordID"], "").ToString();
                _rowIDBank            = (Guid)Tools.isNull(dt1.Rows[0]["RowIDBank"], "");
                _NoBBK           = Tools.isNull(dt1.Rows[0]["NoBBM"], "").ToString();
                ntbTransfer.Text = _kredit.ToString();
                break;

            case enumFormMode.Update:

                DataTable dt = new DataTable();
                using (Database db = new Database(GlobalVar.DBName))
                {
                    db.Commands.Add(db.CreateCommand("usp_TransferBankDetail_LIST"));

                    db.Commands[0].Parameters.Add(new Parameter("@RowID", SqlDbType.UniqueIdentifier, _rowIDTransferBankDetail));
                    dt                    = db.Commands[0].ExecuteDataTable();
                    dbTglBank.Text        = ((DateTime)dt.Rows[0]["TglBank"]).ToString("dd/MM/yyyy");
                    txtNamaBank.Text      = dt.Rows[0]["KeBank"].ToString().Trim();
                    txtNomorTransfer.Text = dt.Rows[0]["Nomor"].ToString();
                    dbTglTransfer.Text    = ((DateTime)dt.Rows[0]["TglTransfer"]).ToString("dd/MM/yyyy");
                    ntbTransfer.Text      = dt.Rows[0]["Nominal"].ToString().Trim();
                }

                break;
            }
        }
Beispiel #7
0
        private void cmdUtkPembayaran_Validated(object sender, EventArgs e)
        {
            if (cmdUtkPembayaran.Text.Trim() != string.Empty)
            {
                if (_isFromPiutang == true)
                {
                    try
                    {
                        DataTable dtPerkiraan = Perkiraan.GetPerkiraanKoneksiDetail("");
                        lblKeterangan.Text = dtPerkiraan.Rows[0]["uraian"].ToString();
                        cmdNoPerk.Text     = dtPerkiraan.Rows[0]["NoPerkiraan"].ToString();
                    }
                    catch (Exception ex)
                    {
                        Error.LogError(ex);
                    }
                }
                else
                {
                    try
                    {
                        DataTable dtPerkiraan = Perkiraan.GetPerkiraanKoneksiDetail("HI11");
                        lblKeterangan.Text = dtPerkiraan.Rows[0]["uraian"].ToString();
                        cmdNoPerk.Text     = dtPerkiraan.Rows[0]["NoPerkiraan"].ToString();
                    }
                    catch (Exception ex)
                    {
                        Error.LogError(ex);
                    }
                }

                lblKeterangan.Visible = true;
            }
            else
            {
                cmdNoPerk.Text        = string.Empty;
                lblKeterangan.Text    = string.Empty;
                lblKeterangan.Visible = false;
            }
        }
Beispiel #8
0
 private void cmdAdd_Click(object sender, EventArgs e)
 {
     if (_isFromPiutang == true)
     {
         DataTable dtPerkiraan = Perkiraan.GetPerkiraanKoneksiDetail("");
         //tbUraian.NamaPerkiraan = dtPerkiraan.Rows[0]["uraian"].ToString();
         //tbUraian.NoPerkiraan = dtPerkiraan.Rows[0]["NoPerkiraan"].ToString();
     }
     else
     {
         tbUraian.NamaPerkiraan = "";
         tbUraian.NoPerkiraan   = "?";
     }
     tbJumlah.Text             = _kredit.ToString();
     txtUraian.Text            = _uraianPK.ToString();
     gbBKMUpdate.Enabled       = false;
     gbUpdateDetailBKM.Visible = true;
     gbUpdateDetailBKM.Top     = 100;
     gbUpdateDetailBKM.Left    = 200;
     detailMode = enumDetailMode.New;
     tbUraian.Focus();
 }
Beispiel #9
0
        private string GetNoPerkiraan()
        {
            string noPerkiraan = "";

            try
            {
                this.Cursor = Cursors.WaitCursor;

                string kodeTrn = "COL" + dt.Rows[0]["WilID"].ToString().Substring(0, 1);
                noPerkiraan = Perkiraan.GetPerkiraanKoneksiDetail(kodeTrn).Rows[0]["NoPerkiraan"].ToString();

                //this.Cursor = Cursors.WaitCursor;
                //DataTable dtGL = new DataTable();
                //using (Database db = new Database())
                //{
                //    db.Commands.Add(db.CreateCommand("usp_GetNoPerkiraan"));
                //    db.Commands[0].Parameters.Add(new Parameter("@kode", SqlDbType.VarChar, "PJT"));
                //    dtGL = db.Commands[0].ExecuteDataTable();
                //}
                //if (dtGL.Rows.Count > 0)
                //{
                //    noPerkiraan = dtGL.Rows[0]["NoPerkiraan"].ToString();
                //}
                //else
                //{
                //    MessageBox.Show("Kode PJT untuk cabang " + GlobalVar.CabangID + " belum ada di tabel, hubungi manager Anda", "Perhatian");
                //}
            }
            catch (Exception ex)
            {
                Error.LogError(ex);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
            return(noPerkiraan);
        }
Beispiel #10
0
        private void cmdHI_Click(object sender, EventArgs e)
        {
            string noPerkiraan = gridDetail.SelectedCells[0].OwningRow.Cells["dtlNoPerkiraan"].Value.ToString();
            Guid   _rowIDH     = (Guid)gridHeader.SelectedCells[0].OwningRow.Cells["hdrRowID"].Value;
            string tipe        = gridHeader.SelectedCells[0].OwningRow.Cells["hdrTipe"].Value.ToString();
            Guid   _rowIDD     = (Guid)gridDetail.SelectedCells[0].OwningRow.Cells["dtlRowID"].Value;
            Double jumlah      = Convert.ToDouble(gridDetail.SelectedCells[0].OwningRow.Cells["dtlDebet"].Value.ToString());
            Double jumlahLink  = 0;
            Double jumlahSisa  = 0;
            string _recordIDH  = gridHeader.SelectedCells[0].OwningRow.Cells["hdrRecordID"].Value.ToString();
            string _recordIDD  = gridDetail.SelectedCells[0].OwningRow.Cells["dtlRecordID"].Value.ToString();
            string namaSP      = "usp_VoucherJournalDetail_Update";
            string _noPerk;

            if (tipe.Trim() != "UM")
            {
                return;
            }

            try
            {
                //CEK PERNAH LINK?
                string _kode = gridDetail.SelectedCells[0].OwningRow.Cells["dtlLKode"].Value.ToString().Trim();
                if (_kode != "") //PERNAH LINK
                {
                    //AMBIL DATA LINK, CEK JUMLAH YG PERNAH D LINK
                    DataTable dtCek = new DataTable();
                    dtCek      = DKN.CekLinkDKNDetail(_rowIDD);
                    jumlahLink = Convert.ToDouble(dtCek.Compute("Sum(Jumlah)", ""));
                    // JIKA JUMLAH SUDAH FULL, UNLINK?
                    if (jumlahLink >= jumlah)
                    {
                        if (MessageBox.Show("Sudah di Link Full. \nHapus Link?", "Hapus Link DKN", MessageBoxButtons.OKCancel) == DialogResult.OK)
                        {
                            //UNLINK DKN
                            using (Database db = new Database(GlobalVar.DBName))
                            {
                                db.BeginTransaction();
                                DKN.UnlinkDKN(db, _rowIDD);
                                DKN.UpdateKodeLink(db, _rowIDD, "", namaSP, "?");
                                db.CommitTransaction();
                            }
                            MessageBox.Show("Unlink DKN Berhasil.");
                            return;
                        }
                        else
                        {
                            return;
                        }
                    }
                }

                _noPerk = Perkiraan.GetPerkiraanKoneksiDetail("HI11").Rows[0]["NoPerkiraan"].ToString();

                if (noPerkiraan != _noPerk)
                {
                    if (MessageBox.Show("No Perkiraan Bukan No Perkiraan HI.\nUbah No Perkiraan Menjadi No Perkiraan HI?\n" + _noPerk, "", MessageBoxButtons.OKCancel) == DialogResult.OK)
                    {
                        using (Database db = new Database(GlobalVar.DBName))
                        {
                            db.Commands.Add(db.CreateCommand("usp_VoucherJournalDetail_Update"));
                            db.Commands[0].Parameters.Add(new Parameter("@NoPerkiraan", SqlDbType.VarChar, _noPerk));
                            db.Commands[0].Parameters.Add(new Parameter("@rowID", SqlDbType.UniqueIdentifier, _rowIDD));
                            db.Commands[0].Parameters.Add(new Parameter("@LastUpdatedBy", SqlDbType.VarChar, SecurityManager.UserID));
                            db.Commands[0].ExecuteNonQuery();
                        }

                        RefreshDetail();
                        FindRowDetail("dtlRowID", _rowIDD.ToString());
                        noPerkiraan = _noPerk;
                    }
                    else
                    {
                        return;
                    }
                }

                DateTime tglBukti = (DateTime)gridHeader.SelectedCells[0].OwningRow.Cells["hdrTglVoucher"].Value;
                string   noBukti  = gridHeader.SelectedCells[0].OwningRow.Cells["hdrNoVoucher"].Value.ToString();
                string   uraian   = gridDetail.SelectedCells[0].OwningRow.Cells["dtlKeterangan"].Value.ToString();
                jumlahSisa = jumlah - jumlahLink;
                frmBuktiHILink frm = new frmBuktiHILink(this, "D", "VJU", "E", "IND", tglBukti, noBukti, _rowIDH, noPerkiraan, uraian, jumlahSisa, _rowIDD, "usp_VoucherJournalDetail_Update", _recordIDH, _recordIDD);
                frm.ShowDialog();
            }
            catch (SqlException ex)
            {
                Error.LogError(ex);
            }
            catch (Exception ex)
            {
                Error.LogError(ex);
            }
        }
Beispiel #11
0
        private void addIndenDetail(
            Database db
            )
        {
            DataTable dtCekRelasi = new DataTable();

            db.Commands.Clear();


            db.Commands.Add(db.CreateCommand("usp_IndenDetail_INSERT"));
            db.Commands[0].Parameters.Add(new Parameter("@RowID", SqlDbType.UniqueIdentifier, RowID));
            db.Commands[0].Parameters.Add(new Parameter("@HeaderID", SqlDbType.UniqueIdentifier, HeaderID));
            db.Commands[0].Parameters.Add(new Parameter("@RecordID", SqlDbType.VarChar, RecordID));
            db.Commands[0].Parameters.Add(new Parameter("@HRecordID", SqlDbType.VarChar, HRecordID));
            db.Commands[0].Parameters.Add(new Parameter("@TglTrf", SqlDbType.DateTime, tglRK));
            db.Commands[0].Parameters.Add(new Parameter("@BankID", SqlDbType.VarChar, bankID));
            db.Commands[0].Parameters.Add(new Parameter("@NamaBank", SqlDbType.VarChar, NamaBank));
            db.Commands[0].Parameters.Add(new Parameter("@Lokasi", SqlDbType.VarChar, Lokasi));
            db.Commands[0].Parameters.Add(new Parameter("@CHBG", SqlDbType.VarChar, cara));
            db.Commands[0].Parameters.Add(new Parameter("@Nomor", SqlDbType.VarChar, noBGC));
            db.Commands[0].Parameters.Add(new Parameter("@TglGiro", SqlDbType.DateTime, tglGiro));
            db.Commands[0].Parameters.Add(new Parameter("@TglJt", SqlDbType.DateTime, tglJTempo));
            db.Commands[0].Parameters.Add(new Parameter("@Ket", SqlDbType.VarChar, ket));
            db.Commands[0].Parameters.Add(new Parameter("@NoAcc", SqlDbType.VarChar, noAcc));
            db.Commands[0].Parameters.Add(new Parameter("@RpCash", SqlDbType.Money, RpCash));
            db.Commands[0].Parameters.Add(new Parameter("@RpGiro", SqlDbType.Money, RpGiro));
            db.Commands[0].Parameters.Add(new Parameter("@RpTrf", SqlDbType.Money, RpTrn));
            db.Commands[0].Parameters.Add(new Parameter("@RpCrd", SqlDbType.Money, RpCrd));
            db.Commands[0].Parameters.Add(new Parameter("@RpDbt", SqlDbType.Money, RpDbt));
            db.Commands[0].Parameters.Add(new Parameter("@LastUpdatedBy", SqlDbType.VarChar, SecurityManager.UserID));
            if (RowIDOrderPenjualan != Guid.Empty)
            {
                db.Commands[0].Parameters.Add(new Parameter("@RowIDOrderPenjualan", SqlDbType.UniqueIdentifier, RowIDOrderPenjualan));
            }

            db.Commands[0].ExecuteNonQuery();


            if (cara == "")
            {
                string _noPerk;
                _noPerk     = Perkiraan.GetPerkiraanKoneksiDetail("IND").Rows[0]["NoPerkiraan"].ToString();
                dtCekRelasi = Inden.CekRelasiInden("Bukti", "SrcID", HeaderID.ToString(), "", "").Copy();
                Guid _RowID = new Guid();
                if (dtCekRelasi.Rows.Count == 0)
                {
                    _RowID = HeaderID;
                    string noBKM = Numerator.BookNumerator("BKM");
                    BKM.AddHeader(db, _RowID, HeaderID, BKM.GetRecordIDBukti(HRecordID, "IND"), noBKM, "K", "IND", tglInden, namaCollector, "", noAcc, SecurityManager.UserName, "");
                }
                else
                {
                    _RowID = (Guid)dtCekRelasi.Rows[0][0];
                }
                BKM.AddDetail(db, RowID, _RowID, RecordID, BKM.GetRecordIDBukti(HRecordID, "IND"), "", "", "", noAcc, _noPerk, "PENERIMAAN BELUM IDENTIFIKASI (" + noBukti + ")", RpCash);
            }
            else if (cara == "T")
            {
                string recordIDTB = HRecordID + "I";
                string noBBK      = "";
                string _noPerk    = Perkiraan.GetPerkiraanKoneksiDetail("IND").Rows[0]["NoPerkiraan"].ToString();
                Guid   _RowID     = new Guid();



                dtCekRelasi = Inden.CekRelasiInden("TransferBank", "SrcID", HeaderID.ToString(), "", "").Copy();

                if (dtCekRelasi.Rows.Count == 0)
                {
                    _RowID = HeaderID;
                    noBBK  = Numerator.BookNumerator("BBM");
                    TransferBank.addHeader(db, _RowID, HeaderID, recordIDTB, tglInden, noBBK, "M", "", "IND. No " + noBukti, "", "", SecurityManager.UserName, "");
                }
                else
                {
                    _RowID = (Guid)dtCekRelasi.Rows[0][0];
                    noBBK  = dtCekRelasi.Rows[0][1].ToString();
                }
                TransferBank.addDetail(db, RowID, _RowID, RecordID, recordIDTB, collectorID, namaCollector, NamaBank, Lokasi, noAcc, (DateTime)tglRK, RpTrn, "", "", "", "", bankID, _noPerk, "");
                Bank.AddBankDetail(db, RowID, Guid.Empty, noBBK, noAcc, rowIDBankTujuan, "", tglInden, "BBM", "TRANSFER DARI : " + namaCollector + " (BANK TRANSFER)", "IDR", RpTrn, "0", DateTime.Today, (DateTime)tglRK, "", "", "", "", _noPerk, bankID, RecordID);
            }
            else if (cara == "G" || cara == "C" || cara == "S")
            {
                string recordIDVJ = "";
                Guid   _VJRowID   = new Guid();


                string noVoucher = Numerator.BookNumerator("VPG");
                string _noPerk   = Perkiraan.GetPerkiraanKoneksiDetail("IND").Rows[0]["NoPerkiraan"].ToString();
                dtCekRelasi = new DataTable();
                dtCekRelasi = Inden.CekRelasiInden("VoucherJournal", "RefRowID", HeaderID.ToString(), "PG", "").Copy();


                if (dtCekRelasi.Rows.Count == 0)
                {
                    recordIDVJ = HRecordID + "I";
                    _VJRowID   = Guid.NewGuid();

                    VoucherJournal.AddHeader(db, _VJRowID, HeaderID, recordIDVJ, "PG", tglInden, noVoucher,
                                             "PENERIMAAN GIRO IND. NO " + noBukti, "", "", "", "", "", "", "", 0, true);
                }
                else
                {
                    recordIDVJ = dtCekRelasi.Rows[0][1].ToString();
                    _VJRowID   = (Guid)dtCekRelasi.Rows[0][0];
                }
                //VoucherJournal.AddDetail(db, RowID, _VJRowID, RecordID, recordIDVJ, "", "", "", noBGC, _noPerk, namaCollector,
                //    Convert.ToDouble(RpGiro), 0, true);

                Giro.Add(db, RowID, _VJRowID, Guid.Empty, Guid.Empty, recordIDVJ, "", "", RecordID, "", NamaBank, Lokasi,
                         cara, noBGC, (DateTime)tglGiro, (DateTime)tglJTempo, Convert.ToDouble(RpGiro), "", SqlDateTime.Null,
                         "", "", "", "", "", "", _noPerk, SqlDateTime.Null, true, noAcc, "");
            }
            else if (cara == "R")
            {
                string recordIDVPG = "", noVoucherPG = "", noVoucherTT = "";
                string recordIDVTT = "";

                Guid _VJRowIDPG = new Guid();
                Guid _VJRowIDTT = new Guid();



                string _noPerk = Perkiraan.GetPerkiraanKoneksiDetail("IND").Rows[0]["NoPerkiraan"].ToString();

                //VOUCHER PENERIMAAN CRD
                dtCekRelasi = Inden.CekRelasiInden("VoucherJournal", "RefRowID", HeaderID.ToString(), "CRD", "").Copy();


                if (dtCekRelasi.Rows.Count == 0)
                {
                    recordIDVPG = HRecordID + "R";
                    _VJRowIDPG  = Guid.NewGuid();
                    noVoucherPG = Numerator.BookNumerator("VPG");
                    VoucherJournal.AddHeader(db, _VJRowIDPG, HeaderID, recordIDVPG, "CC", tglInden, noVoucherPG,
                                             "PENERIMAAN CREDIT CARD IND. NO " + noBukti, "", "", "", "", "", "", "", 0, true);
                }
                else
                {
                    recordIDVPG = dtCekRelasi.Rows[0][1].ToString();
                    _VJRowIDPG  = (Guid)dtCekRelasi.Rows[0][0];
                }
                //VoucherJournal.AddDetail(db, RowID, _VJRowID, RecordID, recordIDVJ, "", "", "", noBGC, _noPerk, namaCollector,
                //    Convert.ToDouble(RpGiro), 0, true);



                //VOUCHER TITIP CRD
                dtCekRelasi = new DataTable();

                dtCekRelasi = Inden.CekRelasiInden("VoucherJournal", "RefRowID", HeaderID.ToString(), "TT", bankID).Copy();


                if (dtCekRelasi.Rows.Count == 0)
                {
                    recordIDVTT = Tools.CreateFingerPrint(GlobalVar.PerusahaanID, SecurityManager.UserInitial).TrimEnd() + "R";
                    _VJRowIDTT  = Guid.NewGuid();
                    noVoucherTT = Numerator.BookNumerator("VTG");

                    VoucherJournal.AddHeader(db, _VJRowIDTT, HeaderID, recordIDVTT, "TT", tglInden, noVoucherTT,
                                             "OTOMATIS TITIP DR CRD", "", "", "", "", "", bankID, namaBanki, 0, true);
                }
                else
                {
                    recordIDVTT = dtCekRelasi.Rows[0][1].ToString();
                    _VJRowIDTT  = (Guid)dtCekRelasi.Rows[0][0];
                }

                //INSERT TABLE GIRO
                Giro.Add(db, RowID, _VJRowIDPG, Guid.Empty, _VJRowIDTT, recordIDVPG, "", recordIDVTT, RecordID, "", NamaBank, Lokasi,
                         cara, noBGC, (DateTime)tglGiro, (DateTime)tglJTempo, Convert.ToDouble(RpCrd), "", (DateTime)SqlDateTime.Null,
                         "", "", "", "", bankID, namaBanki, _noPerk, tglInden, true, noAcc, "");
            }
            else if (cara == "D")
            {
                string recordIDVPG = "", noVoucherPG = "", noVoucherTT = "";
                string recordIDVTT = "";

                Guid _VJRowIDPG = new Guid();
                Guid _VJRowIDTT = new Guid();



                string _noPerk = Perkiraan.GetPerkiraanKoneksiDetail("IND").Rows[0]["NoPerkiraan"].ToString();

                //VOUCHER PENERIMAAN CRD
                dtCekRelasi = Inden.CekRelasiInden("VoucherJournal", "RefRowID", HeaderID.ToString(), "DBT", "").Copy();


                if (dtCekRelasi.Rows.Count == 0)
                {
                    recordIDVPG = HRecordID + "D";
                    _VJRowIDPG  = Guid.NewGuid();
                    noVoucherPG = Numerator.BookNumerator("VPG");
                    VoucherJournal.AddHeader(db, _VJRowIDPG, HeaderID, recordIDVPG, "DB", tglInden, noVoucherPG,
                                             "PENERIMAAN DEBIT CARD IND. NO " + noBukti, "", "", "", "", "", "", "", 0, true);
                }
                else
                {
                    recordIDVPG = dtCekRelasi.Rows[0][1].ToString();
                    _VJRowIDPG  = (Guid)dtCekRelasi.Rows[0][0];
                }
                //VoucherJournal.AddDetail(db, RowID, _VJRowID, RecordID, recordIDVJ, "", "", "", noBGC, _noPerk, namaCollector,
                //    Convert.ToDouble(RpGiro), 0, true);



                //VOUCHER TITIP CRD
                dtCekRelasi = new DataTable();

                dtCekRelasi = Inden.CekRelasiInden("VoucherJournal", "RefRowID", HeaderID.ToString(), "TT", bankID).Copy();


                if (dtCekRelasi.Rows.Count == 0)
                {
                    recordIDVTT = Tools.CreateFingerPrint(GlobalVar.PerusahaanID, SecurityManager.UserInitial).TrimEnd() + "D";
                    _VJRowIDTT  = Guid.NewGuid();
                    noVoucherTT = Numerator.BookNumerator("VTG");

                    VoucherJournal.AddHeader(db, _VJRowIDTT, HeaderID, recordIDVTT, "TT", tglInden, noVoucherTT,
                                             "OTOMATIS TITIP DR DBT", "", "", "", "", "", bankID, namaBanki, 0, true);
                }
                else
                {
                    recordIDVTT = dtCekRelasi.Rows[0][1].ToString();
                    _VJRowIDTT  = (Guid)dtCekRelasi.Rows[0][0];
                }

                //INSERT TABLE GIRO
                Giro.Add(db, RowID, _VJRowIDPG, Guid.Empty, _VJRowIDTT, recordIDVPG, "", recordIDVTT, RecordID, "", NamaBank, Lokasi,
                         cara, noBGC, (DateTime)tglGiro, (DateTime)tglJTempo, Convert.ToDouble(RpDbt), "", (DateTime)SqlDateTime.Null,
                         "", "", "", "", bankID, namaBanki, _noPerk, tglInden, true, noAcc, "");
            }
        }
Beispiel #12
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (dataGridView1.SelectedCells.Count > 0 && dataGridView2.SelectedCells.Count > 0)
            {
                if (Convert.ToBoolean(dataGridView2.SelectedCells[0].OwningRow.Cells["upd"].Value) == false && dataGridView2.SelectedCells[0].OwningRow.Cells["IdWilBaru"].Value.ToString() != "")
                {
                    string kodeToko = dataGridView1.SelectedCells[0].OwningRow.Cells["KodeToko"].Value.ToString();
                    string namaToko = dataGridView1.SelectedCells[0].OwningRow.Cells["NamaToko"].Value.ToString();

                    string idWilBaru  = dataGridView2.SelectedCells[0].OwningRow.Cells["IdWilBaru"].Value.ToString();
                    string idWilLama  = dataGridView2.SelectedCells[0].OwningRow.Cells["IdWilLama"].Value.ToString();
                    Guid   rowID      = (Guid)dataGridView1.SelectedCells[0].OwningRow.Cells["RowID"].Value;
                    Guid   reWilRowID = (Guid)dataGridView2.SelectedCells[0].OwningRow.Cells["Row"].Value;

                    DataTable dtVwil = new DataTable();

                    using (Database db = new Database(GlobalVar.DBName))
                    {
                        db.Commands.Add(db.CreateCommand("psp_VWIL_GetData"));
                        db.Commands[0].Parameters.Add(new Parameter("@kodetoko", SqlDbType.VarChar, kodeToko));
                        dtVwil = db.Commands[0].ExecuteDataTable();
                        //RefreshData();


                        //DataTable dt = new DataTable();
                        //db.Commands.Add(db.CreateCommand("usp_Toko_UPDATE"));
                        //db.Commands[0].Parameters.Add(new Parameter("@rowID", SqlDbType.UniqueIdentifier, rowID));
                        //db.Commands[0].Parameters.Add(new Parameter("@wilID", SqlDbType.VarChar, wilID));
                        //db.Commands[0].Parameters.Add(new Parameter("@reWilRowID", SqlDbType.UniqueIdentifier, reWilRowID));
                        //db.Commands[0].Parameters.Add(new Parameter("@lastUpdatedBy", SqlDbType.VarChar, SecurityManager.UserID));
                        //db.Commands[0].ExecuteNonQuery();
                        //RefreshData();
                    }

                    DataTemplates.dsJurnal.JournalDataTable       dtHeader = new ISA.Finance.DataTemplates.dsJurnal.JournalDataTable();
                    DataTemplates.dsJurnal.JournalDetailDataTable dtDetail = new ISA.Finance.DataTemplates.dsJurnal.JournalDetailDataTable();
                    double rpSisa = 0;

                    if (dtVwil.Rows.Count == 1)
                    {
                        Guid     jRowID   = Guid.NewGuid();
                        string   jRecID   = Tools.CreateFingerPrint(GlobalVar.PerusahaanID, SecurityManager.UserInitial);
                        DateTime jTanggal = DateTime.Now.Date;
                        string   jReff    = Numerator.BookNumerator("ADJ");
                        string   jUraian  = "PINDAH WILAYAH TOKO " + namaToko + " DARI " + idWilLama + " KE " + idWilBaru;
                        rpSisa = Convert.ToDouble(dtVwil.Rows[0]["RpSisa"]);

                        string dNoPerk = "";
                        string kNoPerk = "";

                        string NoPerkBaru = Perkiraan.GetPerkiraanKoneksiDetail("COL" + idWilBaru.Substring(0, 1)).Rows[0]["NoPerkiraan"].ToString();
                        string NoPerkLama = Perkiraan.GetPerkiraanKoneksiDetail("COL" + idWilLama.Substring(0, 1)).Rows[0]["NoPerkiraan"].ToString();


                        if (rpSisa >= 0)
                        {
                            dNoPerk = NoPerkBaru;
                            kNoPerk = NoPerkLama;
                        }
                        else
                        {
                            dNoPerk = NoPerkLama;
                            kNoPerk = NoPerkBaru;
                        }
                        if (rpSisa > 0)
                        {
                            dtJurnalH.Rows.Clear();
                            dtJurnalD.Rows.Clear();

                            InsertJournalHeader(jRowID, rowID, jRecID, jTanggal, jReff, jUraian, "WIL", GlobalVar.Gudang, false, rpSisa, rpSisa);
                            InsertJournalDetail(Guid.NewGuid(), rowID, jRowID, Tools.CreateFingerPrint(GlobalVar.PerusahaanID, SecurityManager.UserInitial), jRecID, dNoPerk, jUraian, rpSisa, 0, "D");
                            InsertJournalDetail(Guid.NewGuid(), rowID, jRowID, Tools.CreateFingerPrint(GlobalVar.PerusahaanID, SecurityManager.UserInitial), jRecID, kNoPerk, jUraian, 0, rpSisa, "K");
                        }
                    }
                    VWil.frmProsesIDWilExecute ifrmChild = new VWil.frmProsesIDWilExecute(kodeToko, reWilRowID, dtJurnalH, dtJurnalD);
                    ifrmChild.Caller = this;
                    ifrmChild.ShowDialog();
                    //MessageBox.Show("Refresh data transaksi telah selesai");
                }
                else
                {
                    MessageBox.Show("Record ini sudah diupload");
                }
            }
            else
            {
                MessageBox.Show(Messages.Error.RowNotSelected);
            }
        }
Beispiel #13
0
        private void cmdSave_Click(object sender, EventArgs e)
        {
            if (lookupNotaPiutang1.KPID == Guid.Empty)
            {
                MessageBox.Show("No Nota Belum Diisi");
                lookupNotaPiutang1.Focus();
                return;
            }
            if (tbRpTagih.GetDoubleValue < tbRpInden.GetDoubleValue)
            {
                MessageBox.Show("Jumlah Rp Inden Tidak Boleh Melebihi Tagihan(" + tbRpTagih.Text + ")");
                tbRpInden.Focus();
                return;
            }
            if (tbRpInden.GetDoubleValue > Convert.ToDouble(RpInden))
            {
                MessageBox.Show("Jumlah Rp Inden Tidak Boleh Melebihi Nilai Identifikasi (" + Convert.ToDouble(RpInden).ToString("#,###") + ")");
                tbRpInden.Focus();
                return;
            }

            if (tbRpInden.GetDoubleValue == 0)
            {
                MessageBox.Show("Jumlah Rp Inden Tidak Boleh 0");
                tbRpInden.Focus();
                return;
            }

            DateTime _Tanggal = (DateTime)tbTglInden.DateValue;

            if (PeriodeClosing.IsPJTClosed(_Tanggal))
            {
                MessageBox.Show("Sudah Closing!");
                return;
            }
            using (Database db = new Database())
            {
                db.Commands.Add(db.CreateCommand("usp_GetTokoIDWil"));
                db.Commands[0].Parameters.Add(new Parameter("@kodetoko", SqlDbType.VarChar, kodeToko));
                dtIDWil = db.Commands[0].ExecuteDataTable();
            }

            //string kodeTrn = "COL" + dtIDWil.Rows[0]["WilID"].ToString().Substring(0, 1);
            string kodeTrn      = "PJT";
            string dNoPerkiraan = Perkiraan.GetPerkiraanKoneksiDetail(kodeTrn).Rows[0]["NoPerkiraan"].ToString();

            RowIDISSD = Guid.NewGuid();
            RecordID  = Tools.CreateFingerPrint(GlobalVar.PerusahaanID, SecurityManager.UserInitial);
            try
            {
                using (Database db = new Database(GlobalVar.DBFinance))
                {
                    db.BeginTransaction();
                    //insert indensuperdetail

                    addIndenSuperDetail(db, RowIDISSD, RowIDISD, RowIDI, RowIDID, RecordID
                                        , HRecordID, lookupNotaPiutang1.TagihDetailID
                                        , lookupNotaPiutang1.TagihDetailRecID, lookupNotaPiutang1.KPID
                                        , lookupNotaPiutang1.KPrecID, lookupNotaPiutang1.Jenis, tglBPP, noReg
                                        , chbg, noBukti, (DateTime)tbTglInden.DateValue
                                        , (DateTime)tbTglJTempo.DateValue, "", "", dNoPerkiraan
                                        , tbRpInden.Text, tbRpNota.Text, tbRpTagih.Text);

                    if (lookupNotaPiutang1.Jenis == "KP")
                    {
                        insertKPiutangDetail(db);
                    }
                    else
                    {
                        insertGtolakDetail(db);
                    }

                    //if (GlobalVar.Gudang != "2803")
                    //{
                    //    updateTagihanDetail(db);
                    //    insertTagihanSubDetail(db);
                    //}
                    db.CommitTransaction();
                }

                //tutup sementara
                frmPenerimaanBelumTeridentifikasiBrowse frm = new frmPenerimaanBelumTeridentifikasiBrowse();
                frm = (frmPenerimaanBelumTeridentifikasiBrowse)Caller;
                frm.IndenRowRefresh(RowIDI);
                frm.IndenDetailRowRefresh(RowIDID);
                frm.IndenSubDetailRowRefresh(RowIDISD);
                frm.IndenSuperDetailRowRefresh(RowIDISSD);
                frm.IndenSuperDetailFindRow("RowIDISSD", RowIDISSD.ToString());
                this.Close();
            }
            catch (Exception ex)
            {
                Error.LogError(ex);
            }
        }
Beispiel #14
0
        private void cmdHI_Click(object sender, EventArgs e)
        {
            try
            {
                string noPerkiraan = dgDetailBKK.SelectedCells[0].OwningRow.Cells["noPerkiraan"].Value.ToString();
                Guid   _rowIDH     = (Guid)dgHeaderBKK.SelectedCells[0].OwningRow.Cells["rowID"].Value;
                Guid   _rowIDD     = (Guid)dgDetailBKK.SelectedCells[0].OwningRow.Cells["rowIDD"].Value;
                string _recordIDH  = dgHeaderBKK.SelectedCells[0].OwningRow.Cells["RecordID"].Value.ToString();
                string _recordIDD  = dgDetailBKK.SelectedCells[0].OwningRow.Cells["RecordIDD"].Value.ToString();
                Double jumlah      = Convert.ToDouble(dgDetailBKK.SelectedCells[0].OwningRow.Cells["Jumlah"].Value);
                Double jumlahLink  = 0;
                Double jumlahSisa  = 0;
                string namaSP      = "usp_BuktiDetail_Update";

                //CEK PERNAH LINK?
                string _kode = dgDetailBKK.SelectedCells[0].OwningRow.Cells["Kode"].Value.ToString().Trim();
                if (_kode != "") //PERNAH LINK
                {
                    //AMBIL DATA LINK, CEK JUMLAH YG PERNAH D LINK
                    DataTable dtCek = new DataTable();
                    dtCek      = DKN.CekLinkDKNDetail(_rowIDD);
                    jumlahLink = Convert.ToDouble(dtCek.Compute("Sum(Jumlah)", ""));
                    // JIKA JUMLAH SUDAH FULL, UNLINK?
                    DialogResult dr = MessageBox.Show("Sudah di Link. \nBatalkan Link?", "Hapus Link DKN", MessageBoxButtons.YesNoCancel);
                    if (dr == DialogResult.Yes)
                    {
                        //UNLINK DKN
                        using (Database db = new Database(GlobalVar.DBFinance))
                        {
                            db.BeginTransaction();
                            DKN.UnlinkDKN(db, _rowIDD);
                            DKN.UpdateKodeLink(db, _rowIDD, "", namaSP, "?");
                            db.CommitTransaction();
                        }
                        MessageBox.Show("Unlink DKN Berhasil.");
                        DetailRowRefresh(_rowIDD);
                        return;
                    }
                    else if (dr == DialogResult.No)
                    {
                        if (jumlahLink >= jumlah)
                        {
                            MessageBox.Show("Sudah Link Full. \nTidak bisa tambah link.");
                            return;
                        }
                    }
                    else
                    {
                        return;
                    }
                }

                string _noPerk;
                _noPerk = Perkiraan.GetPerkiraanKoneksiDetail("HI11").Rows[0]["NoPerkiraan"].ToString();
                if (noPerkiraan != _noPerk)
                {
                    if (MessageBox.Show("No Perkiraan Bukan No Perkiraan HI.\nUbah No Perkiraan Menjadi No Perkiraan HI?\n" + _noPerk, "", MessageBoxButtons.OKCancel) == DialogResult.OK)
                    {
                        using (Database db = new Database(GlobalVar.DBFinance))
                        {
                            db.Commands.Add(db.CreateCommand("usp_BuktiDetail_Update"));
                            db.Commands[0].Parameters.Add(new Parameter("@NoPerkiraan", SqlDbType.VarChar, _noPerk));
                            db.Commands[0].Parameters.Add(new Parameter("@rowID", SqlDbType.UniqueIdentifier, _rowIDD));
                            db.Commands[0].Parameters.Add(new Parameter("@LastUpdatedBy", SqlDbType.VarChar, SecurityManager.UserID));
                            db.Commands[0].ExecuteNonQuery();
                        }

                        DetailRowRefresh(_rowIDD);
                        noPerkiraan = _noPerk;
                    }
                    else
                    {
                        return;
                    }
                }

                DateTime tglBukti = (DateTime)dgHeaderBKK.SelectedCells[0].OwningRow.Cells["tglBukti"].Value;
                string   noBukti  = dgHeaderBKK.SelectedCells[0].OwningRow.Cells["noBukti"].Value.ToString();
                string   uraian   = dgDetailBKK.SelectedCells[0].OwningRow.Cells["Uraian"].Value.ToString();
                jumlahSisa = jumlah - jumlahLink;
                frmBuktiHILink frm = new frmBuktiHILink(this, "D", "BKK", "E", "IND", tglBukti, noBukti, _rowIDH, noPerkiraan, uraian, jumlahSisa, _rowIDD, namaSP, _recordIDH, _recordIDD);
                frm.ShowDialog();

                DetailRowRefresh(_rowIDD);
            }
            catch (SqlException ex)
            {
                Error.LogError(ex);
            }
            catch (Exception ex)
            {
                Error.LogError(ex);
            }
        }