Beispiel #1
0
        private void Valid(string Username)
        {
            Session["SalahPass"] = null;

            //Logfile otorisasi
            DataTable rs = Db.Rs("SELECT "
                                 + " CONVERT(varchar, TglMEMO, 106) AS [Tanggal]"
                                 + ",Tipe"
                                 + ",Ref AS [Ref.]"
                                 + ",Unit"
                                 + ",Customer"
                                 + ",CaraBayar AS [Cara Bayar]"
                                 + ",Ket AS [Keterangan]"
                                 + ",Total"
                                 + ",NoBG AS [No. BG]"
                                 + ",CONVERT(varchar, TglBG, 106) AS [Tanggal BG]"
                                 + ",NoMEMO AS [No. MEMO]"
                                 + ",CONVERT(varchar, TglMEMO, 106) AS [Tanggal MEMO]"
                                 + " FROM MS_MEMO WHERE NoMEMO = " + NoMEMO);

            Db.Execute("EXEC spLogMEMO"
                       + " 'R-MEMO'"
                       + ",'" + Username + "'"
                       + ",'" + Act.IP + "'"
                       + ",'" + Cf.LogCapture(rs) + "'"
                       + ",'" + NoMEMO.ToString().PadLeft(7, '0') + "'"
                       );

            decimal LogID   = Db.SingleDecimal("SELECT TOP 1 LogID FROM MS_MEMO_LOG ORDER BY LogID DESC");
            string  Project = Db.SingleString("SELECT Project FROM MS_MEMO WHERE NoMEMO = '" + NoMEMO + "'");

            Db.Execute("UPDATE MS_MEMO_LOG SET Project = '" + Project + "' WHERE LogID  = " + LogID);

            Tampil();
            string file  = Param.PathFilePDFFinanceAR + NoMEMO + Project + "_MEMO.pdf";
            bool   exist = System.IO.File.Exists(file);

            if (exist)
            {
                System.IO.File.Delete(file);
            }
            ConvertPdf();
            Response.Redirect(Param.PathLinkFilePDFFinanceAR + NoMEMO + Project + "_MEMO.pdf");
        }
Beispiel #2
0
        private void Tampil()
        {
            list.Visible    = true;
            reprint.Visible = false;
            Js.AutoPrint(this);

            //increment
            Db.Execute("UPDATE MS_MEMO SET PrintMEMO = PrintMEMO + 1 WHERE NoMEMO = " + NoMEMO);

            //Logfile
            DataTable rs = Db.Rs("SELECT "
                                 + " CONVERT(varchar, TglMEMO, 106) AS [Tanggal]"
                                 + ",Tipe"
                                 + ",Ref AS [Ref.]"
                                 + ",Unit"
                                 + ",Customer"
                                 + ",CaraBayar AS [Cara Bayar]"
                                 + ",Ket AS [Keterangan]"
                                 + ",Total"
                                 + ",NoBG AS [No. BG]"
                                 + ",CONVERT(varchar, TglBG, 106) AS [Tanggal BG]"
                                 + ",NoMEMO AS [No. MEMO Sistem]"
                                 + ",NoMEMO2 AS [No. MEMO]"
                                 + ",CONVERT(varchar, TglMEMO, 106) AS [Tanggal MEMO]"
                                 + " FROM MS_MEMO WHERE NoMEMO = " + NoMEMO);

            Db.Execute("EXEC spLogMEMO"
                       + " 'P-MEMO'"
                       + ",'" + Act.UserID + "'"
                       + ",'" + Act.IP + "'"
                       + ",'" + Cf.LogCapture(rs) + "'"
                       + ",'" + NoMEMO.ToString().PadLeft(7, '0') + "'"
                       );

            decimal LogID   = Db.SingleDecimal("SELECT TOP 1 LogID FROM MS_MEMO_LOG ORDER BY LogID DESC");
            string  Project = Db.SingleString("SELECT Project FROM MS_MEMO WHERE NoMEMO = '" + NoMEMO + "'");

            Db.Execute("UPDATE MS_MEMO_LOG SET Project = '" + Project + "' WHERE LogID  = " + LogID);
        }
Beispiel #3
0
        private void Fill()
        {
            btnlog.Attributes["onclick"]  = "location.href='LogPk.aspx?Tb=MS_MEMO_LOG&Pk=" + NoMEMO.PadLeft(7, '0') + "'";
            btnvoid.Attributes["onclick"] = "if(confirm('"
                                            + "Apakah anda ingin membatalkan MEMO nomor : " + NoMEMO + " ?\\n"
                                            + "Perhatian bahwa proses ini TIDAK bisa dibalik."
                                            + "'))"
                                            + "{location.href='MEMOVoid.aspx?NoMEMO=" + NoMEMO + "'}";
            string Project = Db.SingleString("SELECT Project FROM MS_MEMO WHERE NoMemo = '" + NoMEMO + "'");

            printMEMO.HRef = "PrintMEMO.aspx?NoMEMO=" + NoMEMO + "&project=" + Project;

            string strSql = "SELECT * "
                            + ",CASE CaraBayar"
                            + "		WHEN 'TN' THEN 'TUNAI'"
                            + "		WHEN 'KK' THEN 'KARTU KREDIT'"
                            + "		WHEN 'KD' THEN 'KARTU DEBIT'"
                            + "		WHEN 'TR' THEN 'TRANSFER BANK'"
                            + "		WHEN 'BG' THEN 'CEK GIRO'"//jangan diganti!!!!!!! bisa merubah flow program dibawah
                            + "		WHEN 'UJ' THEN 'UANG JAMINAN'"
                            + "		WHEN 'DN' THEN 'DISKON'"
                            + "		WHEN 'MB' THEN 'MERCHANT BANKING'"
                            + "     WHEN 'PP' THEN 'PENGHAPUSAN PIUTANG'"
                            + "     WHEN 'TG' THEN 'TUKAR GULING'"
                            + "     WHEN 'AL' THEN 'ALOKASI LEBIH BAYAR'"
                            + " END AS CaraBayar2"
                            + " FROM MS_MEMO WHERE NoMEMO = " + NoMEMO;
            DataTable rs = Db.Rs(strSql);

            if (rs.Rows.Count == 0)
            {
                Response.Redirect("/CustomError/Deleted.html");
            }
            else
            {
                System.Configuration.AppSettingsReader s = new System.Configuration.AppSettingsReader();
                string JenisPPN    = Db.SingleString("SELECT JenisPPN FROM " + Mi.DbPrefix + "MARKETINGJUAL..MS_KONTRAK WHERE NoKontrak = '" + Cf.Pk(rs.Rows[0]["Ref"]) + "'");
                string HeaderPajak = "";
                if (JenisPPN == "PEMERINTAH")
                {
                    HeaderPajak = (string)s.GetValue("NoFPSPemerintah", typeof(string));
                }
                else if (JenisPPN == "KONSUMEN")
                {
                    HeaderPajak = (string)s.GetValue("NoFPSKonsumen", typeof(string));
                }

                tglmemo.Text  = Cf.Day(rs.Rows[0]["TglMEMO"]);
                ket.Text      = rs.Rows[0]["Ket"].ToString();
                tipememo.Text = rs.Rows[0]["CaraBayar2"].ToString();

                unit.Text     = rs.Rows[0]["Unit"].ToString();
                customer.Text = rs.Rows[0]["Customer"].ToString();

                printMEMO.InnerHtml = printMEMO.InnerHtml + " (" + rs.Rows[0]["PrintMEMO"] + ")";

                kasir.Text    = rs.Rows[0]["UserID"].ToString();
                ip.Text       = rs.Rows[0]["IP"].ToString();
                tglInput.Text = Cf.Date(rs.Rows[0]["TglInput"]);
                nilai.Text    = Cf.Num(rs.Rows[0]["Total"]);
                pph.Checked   = (bool)rs.Rows[0]["Pph"];
                memoinfo.Text = rs.Rows[0]["NoMEMO2"].ToString();
                string stat = rs.Rows[0]["Status"].ToString();
                status.Text = stat;

                if (stat == "VOID")
                {
                    status.ForeColor = Color.Red;
                    btnvoid.Disabled = true;
                }
                else if (stat == "POST")
                {
                    status.ForeColor = Color.Blue;
                }

                FillTb(rs.Rows[0]["Tipe"].ToString());

                if (rs.Rows[0]["Tipe"].ToString() != "TENANT")
                {
                    alokasi.InnerHtml = "<a href='CustomerLunas.aspx?Tipe=" + rs.Rows[0]["Tipe"] + "&Ref=" + rs.Rows[0]["Ref"] + "'>"
                                        + "<b>Alokasi Pelunasan</b></a>";
                }
            }
        }
Beispiel #4
0
        private bool Save()
        {
            if (valid())
            {
                DateTime TglMEMO  = Convert.ToDateTime(tglmemo.Text);
                string   Ket      = Cf.Str(ket.Text);
                string   Unit     = Cf.Str(unit.Text);
                string   Customer = Cf.Str(customer.Text);

                DataTable rs = Db.Rs("SELECT "
                                     + " NoMEMO AS [No. MEMO]"
                                     + ",Tipe"
                                     + ",Ref AS [Ref.]"
                                     + ",CaraBayar AS [Cara Bayar]"
                                     + ",Total AS [Nilai MEMO]"
                                     + " FROM MS_MEMO"
                                     + " WHERE NoMEMO = " + NoMEMO
                                     );

                DataTable rsBef = Db.Rs("SELECT "
                                        + " CONVERT(varchar, TglMEMO, 106) AS [Tanggal MEMO]"
                                        + ",CONVERT(varchar, TglBKM, 106) AS [Tanggal BKM]"
                                        + ",Ket AS [Keterangan]"
                                        + ",NoBG AS [No. BG]"
                                        + ",CONVERT(varchar, TglBG, 106) AS [Tanggal BG]"
                                        + ",Titip AS [Pengelola BG]"
                                        + ",Unit"
                                        + ",Customer"
                                        + ",Pph AS [PPH]"
                                        + ",ManualMEMO AS [Manual MEMO]"
                                        + ",ManualBKM AS [Manual BKM]"
                                        + ", Acc AS [Rekening Bank]"
                                        + ", NoFPS AS [No. Faktur Pajak]"
                                        + " FROM MS_MEMO"
                                        + " WHERE NoMEMO = " + NoMEMO
                                        );

                Db.Execute("EXEC spMEMOEdit"
                           + " '" + NoMEMO + "'"
                           + ",'" + TglMEMO + "'"
                           + ",'" + Unit + "'"
                           + ",'" + Customer + "'"
                           + ",'" + Ket + "'"
                           );

                Db.Execute("EXEC spSinkronisasiMEMO " + NoMEMO);

                DataTable rsAft = Db.Rs("SELECT "
                                        + " CONVERT(varchar, TglMEMO, 106) AS [Tanggal MEMO]"
                                        + ",CONVERT(varchar, TglBKM, 106) AS [Tanggal BKM]"
                                        + ",Ket AS [Keterangan]"
                                        + ",NoBG AS [No. BG]"
                                        + ",CONVERT(varchar, TglBG, 106) AS [Tanggal BG]"
                                        + ",Titip AS [Pengelola BG]"
                                        + ",Unit"
                                        + ",Customer"
                                        + ",Pph AS [PPH]"
                                        + ",ManualMEMO AS [Manual MEMO]"
                                        + ",ManualBKM AS [Manual BKM]"
                                        + ", Acc AS [Rekening Bank]"
                                        + ", NoFPS AS [No. Faktur Pajak]"
                                        + " FROM MS_MEMO"
                                        + " WHERE NoMEMO = " + NoMEMO
                                        );

                /*Update status Akunting*/
                int Akunting = Db.SingleInteger("SELECT Akunting FROM MS_MEMO WHERE NoMEMO = " + NoMEMO);

                if (Akunting == 1)
                {
                    string NoVoucher = Db.SingleString("SELECT NoVoucher FROM MS_MEMO WHERE NoMEMO = " + NoMEMO);

                    Akun.InsertAnomali("MEMO", NoMEMO, Cf.LogCapture(rsBef), Cf.LogCapture(rsAft), "EDIT MEMO", "", NoVoucher);
                }
                /************************/

                //Logfile
                string ketlog = Cf.LogCapture(rs)
                                + Cf.LogCompare(rsBef, rsAft);

                Db.Execute("EXEC spLogMEMO"
                           + " 'EDIT'"
                           + ",'" + Act.UserID + "'"
                           + ",'" + Act.IP + "'"
                           + ",'" + ketlog + "'"
                           + ",'" + NoMEMO.ToString().PadLeft(7, '0') + "'"
                           );

                decimal LogID   = Db.SingleDecimal("SELECT TOP 1 LogID FROM MS_MEMO_LOG ORDER BY LogID DESC");
                string  Project = Db.SingleString("SELECT Project FROM MS_MEMO WHERE NoMEMO = '" + NoMEMO + "'");
                Db.Execute("UPDATE MS_MEMO_LOG SET Project = '" + Project + "' WHERE LogID  = " + LogID);

                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #5
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            Act.Pass();
            Act.NoCache();

            Act.CekInt("NoMEMO");

            DataTable rs = Db.Rs("SELECT * FROM MS_MEMO WHERE NoMEMO = " + NoMEMO);


            if (rs.Rows.Count == 0)
            {
                Response.Redirect("/CustomError/Deleted.html");
            }
            else
            {
                DataTable rsHeader = Db.Rs("SELECT "
                                           + " CONVERT(varchar, TglMEMO, 106) AS [Tanggal]"
                                           + ",Tipe"
                                           + ",Ref AS [Ref.]"
                                           + ",Unit"
                                           + ",Customer"
                                           + ",CaraBayar AS [Cara Bayar]"
                                           + ",Ket AS [Keterangan]"
                                           + ",NoSlip AS [Slip Setoran]"
                                           + ",NoBG AS [No. BG]"
                                           + ",CONVERT(varchar, TglBG, 106) AS [Tanggal BG]"
                                           + ",Titip AS [Pengelola BG]"
                                           + ",Total"
                                           + " FROM MS_MEMO WHERE NoMEMO = " + NoMEMO);

                string  StatusLama   = rs.Rows[0]["Status"].ToString();
                decimal NilaiKembali = Convert.ToDecimal(rs.Rows[0]["Total"]);

                #region logfile
                string Tipe = Db.SingleString("SELECT Tipe FROM MS_MEMO WHERE NoMEMO = " + NoMEMO);
                string Tb   = Sc.MktTb(Tipe);

                string strSql = "";
                if (Tipe != "TENANT")
                {
                    strSql = "SELECT "
                             + " CASE NoTagihan"
                             + "		WHEN 0 THEN 'UNALLOCATED    ' + CONVERT(varchar,NilaiPelunasan,1)"
                             + "		ELSE (SELECT NamaTagihan FROM "+ Tb + "..MS_TAGIHAN WHERE NoUrut = l.NoTagihan AND NoKontrak = l.NoKontrak)"
                             + "          + '    ' + CONVERT(varchar,NilaiPelunasan,1)"
                             + " END AS NamaTagihan"
                             + " FROM " + Tb + "..MS_PELUNASAN AS l "
                             + " WHERE NoMEMO = " + NoMEMO;
                }
                else
                {
                    strSql = "SELECT "
                             + " NamaTagihan + '    ' + CONVERT(varchar,NilaiTagihan,1) "
                             + " FROM " + Tb + "..MS_TAGIHAN AS l "
                             + " WHERE NoMEMO = " + NoMEMO;
                }
                #endregion
                DataTable rsDetil = Db.Rs(strSql);

                Db.Execute("EXEC spMemoVOID " + NoMEMO);
                Db.Execute("EXEC ISC064_MARKETINGJUAL..spPelunasanVoidMEMO " + NoMEMO);

                Db.Execute("UPDATE MS_TTS SET LebihBayar = 0 WHERE NoTTS = " + rs.Rows[0]["NoTTS"]);

                string StatusBaru = Db.SingleString(
                    "SELECT Status FROM MS_MEMO WHERE NoMEMO = " + NoMEMO);

                if (StatusLama != "VOID")// && StatusBaru=="VOID")
                {
                    string logr = "";
                    if (Request.QueryString["r"] != null)
                    {
                        logr = "REIMBURSE<br>";
                        //Db.Execute("UPDATE MS_MEMO SET NilaiKembali = " + NilaiKembali + " WHERE NoMEMO = " + NoMEMO);
                    }

                    /*Update status Akunting*/
                    int Akunting = Db.SingleInteger("SELECT Akunting FROM MS_MEMO WHERE NoMEMO = " + NoMEMO);

                    if (Akunting == 1)
                    {
                        string NoVoucher = Db.SingleString("SELECT NoVoucher FROM MS_MEMO WHERE NoMEMO = '" + NoMEMO + "'");

                        Akun.InsertAnomali("MEMO", NoMEMO, "", "", "VOID MEMO", "", NoVoucher);
                    }
                    /************************/

                    //Log
                    string KetLog = logr
                                    + Cf.LogCapture(rsHeader)
                                    + Cf.LogList(rsDetil, "ALOKASI PELUNASAN")
                    ;

                    Db.Execute("EXEC spLogMEMO"
                               + " 'VOID'"
                               + ",'" + Act.UserID + "'"
                               + ",'" + Act.IP + "'"
                               + ",'" + KetLog + "'"
                               + ",'" + NoMEMO.ToString().PadLeft(7, '0') + "'"
                               );

                    decimal LogID   = Db.SingleDecimal("SELECT TOP 1 LogID FROM MS_MEMO_LOG ORDER BY LogID DESC");
                    string  Project = Db.SingleString("SELECT Project FROM MS_MEMO WHERE NoMEMO = '" + NoMEMO + "'");
                    Db.Execute("UPDATE MS_MEMO_LOG SET Project = '" + Project + "' WHERE LogID  = " + LogID);

                    Response.Redirect("MEMOEdit.aspx?NoMEMO=" + NoMEMO + "&done=1");
                }
                else
                {
                    //Tidak bisa dihapus
                    nodel.Visible = true;
                }
            }
        }