Exemple #1
0
        void ResetHeaderJournal(object sender, EventArgs e)
        {
            simpanToolStripButton.Enabled    = true;
            journalDateDateTimePicker.Value  = DateTime.Today;
            voucherNoTextBox.Text            = AppCode.GetVoucherNo();
            balanceJumlahNumericUpDown.Value = decimal.Zero;

            tJournalDataGridView.Rows.Clear();
            ResetJournalDetail(sender, e);
        }
 private void ResetPiHutangHeader(object sender, EventArgs e)
 {
     simpanToolStripButton.Enabled      = true;
     voucherNoTextBox.Text              = AppCode.GetVoucherNo();
     journalDateDateTimePicker.Value    = DateTime.Today;
     piHutangPicComboBox.SelectedIndex  = -1;
     subAccountIdComboBox.SelectedIndex = -1;
     journalDescTextBox.ResetText();
     journalJumlahNumericUpDown.Value = 0;
     tPiHutangDataGridView.Rows.Clear();
 }
Exemple #3
0
        void ResetHeaderJournal(object sender, EventArgs e)
        {
            simpanToolStripButton.Enabled      = true;
            kasAccountIdComboBox.SelectedIndex = -1;
            journalDateDateTimePicker.Value    = DateTime.Today;
            voucherNoTextBox.Text = AppCode.GetVoucherNo();
            kasDescTextBox.ResetText();
            kasJumlahNumericUpDown.Value = decimal.Zero;

            tJournalDataGridView.Rows.Clear();
            ResetJournalDetail(sender, e);
        }
Exemple #4
0
        private void CalculateItemValue()
        {
            //IList listGudang = DataMaster.GetAll(typeof(MGudang));
            //MGudang gud;

            //IList listItemStok;
            //ItemGudangStok stok;
            //MItem item;

            //decimal itemvalue = 0;

            //for (int i = 0; i < listGudang.Count; i++)
            //{
            //    gud = (MGudang)listGudang[i];
            //    listItemStok = DataMaster.GetListEq(typeof(ItemGudangStok), ItemGudangStok.ColumnNames.GudangId, gud.GudangId);
            //    for (int j = 0; j < listItemStok.Count; j++)
            //    {
            //        stok = (ItemGudangStok)listItemStok[j];
            //        item = (MItem)DataMaster.GetObjectByProperty(typeof(MItem), MItem.ColumnNames.ItemId, stok.ItemId);
            //        if (item != null)
            //        {
            //            itemvalue += stok.ItemStok * item.ItemPricePurchaseAvg;
            //        }
            //    }
            //}

            //IList listTrans = DataMaster.GetListBetweenValue(typeof(TTransaction), TTransaction.ColumnNames.TransactionDate, from, to);
            //IList listDet;
            //TTransaction trans;
            //TTransactionDetail det;

            //decimal salesTot = 0;
            //decimal retSalesTot = 0;
            //decimal hppSalesTot = 0;
            //decimal hppRetSalesTot = 0;
            ////decimal purTot = 0;
            ////decimal retPurTot = 0;

            //for (int i = 0; i < listTrans.Count; i++)
            //{
            //    trans = (TTransaction)listTrans[i];

            //    if (trans.TransactionStatus == ListOfTransaction.Sales.ToString() || trans.TransactionStatus == ListOfTransaction.ReturSales.ToString())
            //    {
            //        listDet = DataMaster.GetListEq(typeof(TTransactionDetail), TTransactionDetail.ColumnNames.TransactionId, trans.TransactionId);
            //        for (int j = 0; j < listDet.Count; j++)
            //        {
            //            det = (TTransactionDetail)listDet[j];
            //            if (trans.TransactionStatus == ListOfTransaction.Sales.ToString())
            //                hppSalesTot += det.CostPrice;
            //            else if (trans.TransactionStatus == ListOfTransaction.ReturSales.ToString())
            //                hppRetSalesTot += det.CostPrice;
            //        }

            //    }
            //}

            //decimal hppNet = hppSalesTot - hppRetSalesTot;

            //string voucherno = AppCode.GetVoucherNo();

            //TJournal jur = new TJournal();
            //jur.JournalDate = DateTime.Today;
            //jur.JournalDesc = "Harga Pokok Penjualan bulan " + comboBox_Month.Text + " " + numericUpDown_Year.Value.ToString();
            //jur.JournalJumlah = hppNet;
            //jur.JournalPic = string.Empty;
            //jur.JournalStatus = ListOfJournalStatus.Debet.ToString();
            //jur.SubAccountId = AppCode.GetHPPAccountNo();
            //jur.VoucherNo = voucherno;
            //jur.ModifiedBy = lbl_UserName.Text;
            //jur.ModifiedDate = DateTime.Now;
            //AppCode.SaveTJournal(jur);

            //jur = new TJournal();
            //jur.JournalDate = DateTime.Today;
            //jur.JournalDesc = "Ikhtiar Rugi Laba bulan " + comboBox_Month.Text + " " + numericUpDown_Year.Value.ToString();
            //jur.JournalJumlah = hppNet;
            //jur.JournalPic = string.Empty;
            //jur.JournalStatus = ListOfJournalStatus.Kredit.ToString();
            //jur.SubAccountId = AppCode.GetIkhtiarRLAccountNo();
            //jur.VoucherNo = voucherno;
            //jur.ModifiedBy = lbl_UserName.Text;
            //jur.ModifiedDate = DateTime.Now;
            //AppCode.SaveTJournal(jur);

            IList       listSubAcc = DataMaster.GetAll(typeof(MSubAccount));
            MSubAccount sub;
            MAccount    acc;
            decimal     rl = 0;

            for (int i = 0; i < listSubAcc.Count; i++)
            {
                sub = (MSubAccount)listSubAcc[i];
                SaveRekap(sub.AccountId, sub.SubAccountId, sub.SubAccountName, sub.SubAccountSaldo);
                acc = (MAccount)DataMaster.GetObjectByProperty(typeof(MAccount), MAccount.ColumnNames.AccountId, sub.AccountId);
                if (acc != null)
                {
                    if (acc.AccountPosition == ListOfAccountPosition.RugiLaba.ToString())
                    {
                        rl += sub.SubAccountSaldo;
                    }
                }
            }

            string voucherno = AppCode.GetVoucherNo();

            if (comboBox_Month.SelectedValue.ToString() == "12")
            {
                TJournal jur;
                IList    listAcc = DataMaster.GetListEq(typeof(MAccount), MAccount.ColumnNames.AccountPosition, ListOfAccountPosition.RugiLaba.ToString());
                for (int i = 0; i < listAcc.Count; i++)
                {
                    acc        = (MAccount)listAcc[i];
                    listSubAcc = DataMaster.GetListEq(typeof(MSubAccount), MSubAccount.ColumnNames.AccountId, acc.AccountId);
                    for (int j = 0; j < listSubAcc.Count; j++)
                    {
                        sub               = (MSubAccount)listSubAcc[j];
                        jur               = new TJournal();
                        jur.JournalDate   = DateTime.Today;
                        jur.JournalDesc   = "Jurnal Pembalik periode " + numericUpDown_Year.Value.ToString();
                        jur.JournalJumlah = sub.SubAccountSaldo;
                        jur.JournalPic    = lbl_UserName.Text;
                        jur.JournalStatus = ListOfJournalStatus.Debet.ToString();

                        jur.SubAccountId = sub.SubAccountId;
                        jur.VoucherNo    = voucherno;
                        jur.ModifiedBy   = lbl_UserName.Text;
                        jur.ModifiedDate = DateTime.Now;
                        AppCode.SaveTJournal(jur);
                    }
                }

                sub = (MSubAccount)DataMaster.GetObjectByProperty(typeof(MSubAccount), MSubAccount.ColumnNames.SubAccountId, AppCode.GetLabaDitahanAccountNo());

                jur               = new TJournal();
                jur.JournalDate   = DateTime.Today;
                jur.JournalDesc   = "Laba Tahun " + numericUpDown_Year.Value.ToString();
                jur.JournalJumlah = rl;
                jur.JournalPic    = lbl_UserName.Text;
                jur.JournalStatus = ListOfJournalStatus.Kredit.ToString();
                jur.SubAccountId  = sub.SubAccountId;
                jur.VoucherNo     = voucherno;
                jur.ModifiedBy    = lbl_UserName.Text;
                jur.ModifiedDate  = DateTime.Now;
                AppCode.SaveTJournal(jur);

                SaveRekap(sub.AccountId, sub.SubAccountId, sub.SubAccountName, rl);
            }
            else
            {
                SaveRekap("", "", "Laba/Rugi Periode Berjalan", rl);
            }
        }