示例#1
0
        protected override void AfterSaveUpdate()
        {
            if (!Find.IsExists <MataUang>("KodeMataUang=" +
                                          FormatSqlValue(MataUangDasar)))
            {
                MataUang mu = new MataUang();
                mu.KodeMataUang = MataUangDasar;
                mu.NamaMataUang = "Rupiah";
                mu.Aktif        = true;
                mu.SaveNew();
            }

            if (GetOriginal <SetingPerusahaan>().MataUangDasar !=
                MataUangDasar)
            {
                Akun.SetMataUangDasar(Dp, MataUangDasar);
            }

            BaseFramework.TransDate.Reload();
            DateTime TmpTgl = BaseFramework.TransDate.StartDate;

            BaseFramework.TransDate.StartDate = _TglMulaiSistemBaru;

            if (!Find.IsExists <SaldoAwalAkun>(string.Empty))
            {
                return;
            }

            if (TmpTgl != _TglMulaiSistemBaru)
            {
                TmpTgl = TmpTgl.AddDays(-1);
                int OldThn = TmpTgl.Year;
                int OldBln = TmpTgl.Month;
                TmpTgl = _TglMulaiSistemBaru.AddDays(-1);
                int NewThn = TmpTgl.Year;
                int NewBln = TmpTgl.Month;

                ExecuteNonQuery(@"UPDATE RingkasanAkun SET Tahun=@NewThn,
                    Bulan=@NewBln WHERE Tahun=@OldThn AND Bulan=@OldBln",
                                new FieldParam("NewThn", NewThn),
                                new FieldParam("NewBln", NewBln),
                                new FieldParam("OldThn", OldThn),
                                new FieldParam("OldBln", OldBln));
            }
        }
示例#2
0
        static void CurrentLogin_onLogon()
        {
            RingkasanAkun = new RingkasanAkun();

            using (EntityTransaction tr = new EntityTransaction(
                       BaseFramework.DefaultDp))
            {
                if (!BaseFramework.DefaultDp.Find
                    .IsExists <MataUang>(string.Empty))
                {
                    MataUang mu = new MataUang();
                    mu.KodeMataUang = "IDR";
                    mu.NamaMataUang = "Rupiah";
                    mu.Aktif        = true;
                    mu.SaveNew();
                }
                if (!BaseFramework.DefaultDp.Find
                    .IsExists <JenisDokSumberJurnal>("Otomatis=@0",
                                                     new FieldParam("0", false)))
                {
                    JenisDokSumberJurnal jds = new JenisDokSumberJurnal();
                    jds.JenisDokSumber = "Umum";
                    jds.Aktif          = true;
                    jds.SaveNew();
                }

                if (!BaseFramework.DefaultDp.Find
                    .IsExists <SetingPerusahaan>(string.Empty))
                {
                    SetingPerusahaan sp = new SetingPerusahaan();
                    sp.SetDefaultValue();
                    sp.TglMulaiSistemBaru = BaseFramework
                                            .TransDate.StartDate;
                    sp.SaveNew();
                }

                tr.CommitTransaction();
            }
            SetingPerusahaan.LoadEntity();
            RegisterAsPostedDocument("Penerimaan Kas Umum");
            RegisterAsPostedDocument("Pengeluaran Kas Umum");
            RegisterAsPostedDocument("Transfer Antar Kas");
        }
示例#3
0
        protected override void AfterSaveNew()
        {
            if (!Find.IsExists <MataUang>("KodeMataUang=" +
                                          FormatSqlValue(MataUangDasar)))
            {
                MataUang mu = new MataUang();
                mu.KodeMataUang = MataUangDasar;
                mu.NamaMataUang = "Rupiah";
                mu.Aktif        = true;
                mu.SaveNew();
            }

            if (GetOriginal <SetingPerusahaan>() == null ||
                GetOriginal <SetingPerusahaan>().MataUangDasar != MataUangDasar)
            {
                Akun.SetMataUangDasar(Dp, MataUangDasar);
            }

            BaseFramework.TransDate.StartDate = _TglMulaiSistemBaru;
        }