Example #1
0
        private void SaveJournal(object sender, EventArgs e)
        {
            if (ValidateJournalHeader())
            {
                simpanToolStripButton.Enabled = false;

                TJournal jur;

                //save journal detail
                for (int i = 0; i < tJournalDataGridView.RowCount; i++)
                {
                    jur               = new TJournal();
                    jur.JournalDate   = journalDateDateTimePicker.Value;
                    jur.JournalDesc   = tJournalDataGridView.Rows[i].Cells[4].Value.ToString();
                    jur.JournalJumlah = Convert.ToDecimal(tJournalDataGridView.Rows[i].Cells[2].Value);
                    jur.JournalPic    = string.Empty;
                    jur.JournalStatus = tJournalDataGridView.Rows[i].Cells[3].Value.ToString();
                    jur.SubAccountId  = tJournalDataGridView.Rows[i].Cells[0].Value.ToString();
                    jur.VoucherNo     = voucherNoTextBox.Text;
                    jur.ModifiedBy    = lbl_UserName.Text;
                    jur.ModifiedDate  = DateTime.Now;
                    AppCode.SaveTJournal(jur);
                }

                MessageBox.Show(this.Text + " berhasil disimpan", AppCode.AssemblyProduct, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Example #2
0
        private void SaveJournalInterface()
        {
            if (isInEdit)
            {
                JurnalPembalik(delId);
            }

            voucherNo = AppCode.GetVoucherNo();
            //save to biaya ekspedisi
            SaveTransactionJournal(AppCode.GetBiayaEkspedisiAccountNo(), ListOfJournalStatus.Debet, deliveryCostNumericUpDown.Value, "Surat Jalan " + deliveryNumberExpedissionTextBox.Text, deliveryExpedissionTextBox.Text);

            if (transactionPaymentComboBox.SelectedItem.ToString() == ListOfPayment.Credit.ToString())
            {
                //save to hutang ekspedisi
                SaveTransactionJournal(AppCode.GetHutangEkspedisiAccountNo(), ListOfJournalStatus.Kredit, deliveryCostNumericUpDown.Value, "Surat Jalan " + deliveryNumberExpedissionTextBox.Text, deliveryExpedissionTextBox.Text);

                //save pi hutang
                SavePiHutang();
            }
            else if (transactionPaymentComboBox.SelectedItem.ToString() == ListOfPayment.Cash.ToString())
            {
                //save to kas
                SaveTransactionJournal("100KAS001", ListOfJournalStatus.Kredit, deliveryCostNumericUpDown.Value, "Surat Jalan " + deliveryNumberExpedissionTextBox.Text, deliveryExpedissionTextBox.Text);
            }
        }
Example #3
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);
        }
Example #4
0
 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();
 }
Example #5
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);
        }
Example #6
0
        private void SavePiHutang()
        {
            TPiHutang pihutang = new TPiHutang();
            bool      isSave   = true;

            if (isInEdit)
            {
                pihutang = (TPiHutang)DataMaster.GetObjectByProperty(typeof(TPiHutang), TPiHutang.ColumnNames.TransactionId, delId);
                if (pihutang != null)
                {
                    isSave = false;
                }
            }

            pihutang.PiHutangCreditLong = piHutangCreditLongNumericUpDown.Value;
            pihutang.PiHutangDate       = deliverySentDateDateTimePicker.Value;
            pihutang.PiHutangDesc       = transactionReferenceFacturTextBox.Text;

            if (isSave)
            {
                pihutang.PiHutangDibayar = decimal.Zero;
                pihutang.PiHutangRetur   = decimal.Zero;
                pihutang.PiHutangSisa    = deliveryCostNumericUpDown.Value;
            }
            else
            {
                pihutang.PiHutangSisa = deliveryCostNumericUpDown.Value - pihutang.PiHutangDibayar - pihutang.PiHutangRetur;
            }

            pihutang.PiHutangJatuhTempo = deliverySentDateDateTimePicker.Value.AddDays(Convert.ToDouble(piHutangCreditLongNumericUpDown.Value));

            pihutang.PiHutangJumlah = deliveryCostNumericUpDown.Value;
            pihutang.PiHutangPic    = deliveryExpedissionTextBox.Text;
            pihutang.PiHutangStatus = ListOfPiHutangStatus.HutangJasa.ToString();
            pihutang.SubAccountId   = AppCode.GetHutangEkspedisiAccountNo();
            pihutang.TransactionId  = delId;

            pihutang.ModifiedBy   = lbl_UserName.Text;
            pihutang.ModifiedDate = DateTime.Now;

            if (isSave)
            {
                DataMaster.SavePersistence(pihutang);
            }
            else
            {
                DataMaster.UpdatePersistence(pihutang);
            }
        }
Example #7
0
        private void SaveTransactionJournal(string subAccountId, ListOfJournalStatus listOfJournalStatus, decimal saldo, string desc, string pic)
        {
            TJournal jur = new TJournal();

            jur.JournalDate   = DateTime.Now;
            jur.JournalDesc   = desc;
            jur.JournalJumlah = saldo;
            jur.JournalPic    = pic;
            jur.JournalStatus = listOfJournalStatus.ToString();
            jur.SubAccountId  = subAccountId;
            jur.VoucherNo     = voucherNo;
            jur.TransactionId = delId;
            jur.ModifiedBy    = lbl_UserName.Text;
            jur.ModifiedDate  = DateTime.Now;

            AppCode.SaveTJournal(jur);
        }
Example #8
0
        private void JurnalPembalik(decimal delId)
        {
            voucherNo = AppCode.GetVoucherNo();
            IList    listJournal = DataMaster.GetListEq(typeof(TJournal), TJournal.ColumnNames.TransactionId, delId);
            TJournal jurnal;

            for (int i = 0; i < listJournal.Count; i++)
            {
                jurnal = (TJournal)listJournal[i];
                if (jurnal.JournalStatus == ListOfJournalStatus.Debet.ToString())
                {
                    SaveTransactionJournal(jurnal.SubAccountId, ListOfJournalStatus.Kredit, jurnal.JournalJumlah, "Edit Transaksi : " + jurnal.JournalDesc, jurnal.JournalPic);
                }
                else
                {
                    SaveTransactionJournal(jurnal.SubAccountId, ListOfJournalStatus.Debet, jurnal.JournalJumlah, "Edit Transaksi : " + jurnal.JournalDesc, jurnal.JournalPic);
                }
            }
        }
Example #9
0
        void SetInitialCommonSettings()
        {
            if (IsDelete)
            {
                if (PiHutang == ListOfPiHutangStatus.Piutang)
                {
                    //beban penghapusan piutang dropdownlist
                    mSubAccountBindingSource.DataSource = DataMaster.GetListEq(typeof(MSubAccount), MSubAccount.ColumnNames.SubAccountId, AppCode.GetPiutangBebanAccountNo());
                }
                else if (PiHutang == ListOfPiHutangStatus.Hutang)
                {
                    //pendapatan penghapusan hutang dropdownlist
                    mSubAccountBindingSource.DataSource = DataMaster.GetListEq(typeof(MSubAccount), MSubAccount.ColumnNames.AccountId, AppCode.GetOtherRevenueAccountNo());
                }
            }
            else
            {
                //kas dropdownlist
                mSubAccountBindingSource.DataSource = DataMaster.GetListEq(typeof(MSubAccount), MSubAccount.ColumnNames.AccountId, AppCode.GetKasAccountNo());
            }


            //journal date
            ModuleControlSettings.SetDateTimePicker(journalDateDateTimePicker, false);

            //numeric up down
            ModuleControlSettings.SetNumericUpDown(journalJumlahNumericUpDown, true);

            //add column to grid
            tPiHutangDataGridView.ReadOnly = false;

            DataGridViewCheckBoxColumn cekColoumn = new DataGridViewCheckBoxColumn(false);

            cekColoumn.ReadOnly = false;
            tPiHutangDataGridView.Columns.Add(cekColoumn);

            for (int i = 1; i < 6; i++)
            {
                tPiHutangDataGridView.Columns.Add(i.ToString(), i.ToString());
                tPiHutangDataGridView.Columns[i].ReadOnly = true;
            }

            DataGridViewTextBoxColumn txtColumn = new DataGridViewTextBoxColumn();

            txtColumn.ValueType = typeof(decimal);
            tPiHutangDataGridView.Columns.Add(txtColumn);

            for (int i = 7; i < 9; i++)
            {
                tPiHutangDataGridView.Columns.Add(i.ToString(), i.ToString());
                tPiHutangDataGridView.Columns[i].ReadOnly = true;
            }


            //set width for grid view
            tPiHutangDataGridView.Columns[0].Width = label_Pay.Width;
            tPiHutangDataGridView.Columns[1].Width = label_FacturNo.Width;
            tPiHutangDataGridView.Columns[2].Width = label_DueDate.Width;
            tPiHutangDataGridView.Columns[3].Width = label_Jumlah.Width;
            tPiHutangDataGridView.Columns[4].Width = label_Retur.Width;
            tPiHutangDataGridView.Columns[5].Width = label_Sisa.Width;
            tPiHutangDataGridView.Columns[6].Width = label_Ammount.Width;
            tPiHutangDataGridView.Columns[7].Width = label_Ammount.Width;
            tPiHutangDataGridView.Columns[8].Width = label_Ammount.Width;

            tPiHutangDataGridView.Columns[2].DefaultCellStyle.Format = ModuleControlSettings.DateFormat();

            //set format
            for (int i = 3; i < 7; i++)
            {
                tPiHutangDataGridView.Columns[i].DefaultCellStyle.Format    = "N";
                tPiHutangDataGridView.Columns[i].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
            }
            //tPiHutangDataGridView.Columns[6].ReadOnly = false;
            tPiHutangDataGridView.Columns[7].Visible = false;
            tPiHutangDataGridView.Columns[8].Visible = false;


            //journal date
            ModuleControlSettings.SetDateTimePicker(journalDateDateTimePicker, false);

            //set display
            if (PiHutang == ListOfPiHutangStatus.Hutang)
            {
                SetInitialHutangSettings();
            }
            else if (PiHutang == ListOfPiHutangStatus.Piutang)
            {
                SetInitialPiutangSettings();
            }
            else if (PiHutang == ListOfPiHutangStatus.HutangJasa)
            {
                SetInitialHutangJasaSettings();
            }
        }
Example #10
0
        private void UpdatePiHutang(object sender, EventArgs e)
        {
            if (!ValidatePiHutang())
            {
                return;
            }

            simpanToolStripButton.Enabled = false;

            TJournal jur = new TJournal();

            jur.JournalDate   = journalDateDateTimePicker.Value;
            jur.JournalDesc   = journalDescTextBox.Text;
            jur.JournalJumlah = journalJumlahNumericUpDown.Value;
            jur.JournalPic    = piHutangPicComboBox.SelectedValue.ToString();

            if (!IsDelete)
            {
                if (PiHutang == ListOfPiHutangStatus.Piutang)
                {
                    jur.JournalStatus = ListOfJournalStatus.Debet.ToString();
                }
                else if (PiHutang == ListOfPiHutangStatus.Hutang)
                {
                    jur.JournalStatus = ListOfJournalStatus.Kredit.ToString();
                }
                else if (PiHutang == ListOfPiHutangStatus.HutangJasa)
                {
                    jur.JournalStatus = ListOfJournalStatus.Kredit.ToString();
                }
            }
            else
            {
                if (PiHutang == ListOfPiHutangStatus.Piutang)
                {
                    jur.JournalStatus = ListOfJournalStatus.Kredit.ToString();
                }
                else if (PiHutang == ListOfPiHutangStatus.Hutang)
                {
                    jur.JournalStatus = ListOfJournalStatus.Debet.ToString();
                }
                else if (PiHutang == ListOfPiHutangStatus.HutangJasa)
                {
                    jur.JournalStatus = ListOfJournalStatus.Debet.ToString();
                }
            }


            //if (IsDelete)
            //{
            //    jur.SubAccountId = subAccountIdComboBox.SelectedValue.ToString();
            //}
            //else
            //{
            jur.SubAccountId = subAccountIdComboBox.SelectedValue.ToString();
            //}

            jur.VoucherNo    = voucherNoTextBox.Text;
            jur.ModifiedBy   = lbl_UserName.Text;
            jur.ModifiedDate = DateTime.Now;
            AppCode.SaveTJournal(jur);


            TPiHutang piHut;

            for (int i = 0; i < tPiHutangDataGridView.RowCount; i++)
            {
                if (Convert.ToBoolean(tPiHutangDataGridView.Rows[i].Cells[0].Value) == true)
                {
                    piHut = (TPiHutang)DataMaster.GetObjectByProperty(typeof(TPiHutang), TPiHutang.ColumnNames.PiHutangId, Convert.ToDecimal(tPiHutangDataGridView.Rows[i].Cells[7].Value));
                    piHut.PiHutangDibayar += Convert.ToDecimal(tPiHutangDataGridView.Rows[i].Cells[6].Value);
                    piHut.PiHutangSisa     = piHut.PiHutangJumlah - piHut.PiHutangRetur - piHut.PiHutangDibayar;

                    if (piHut.PiHutangSisa == decimal.Zero)
                    {
                        piHut.PiHutangLunasDate = journalDateDateTimePicker.Value;
                        if (piHutang == ListOfPiHutangStatus.Piutang && !IsDelete)
                        {
                            ShareCommissionInterface(piHut.TransactionId);
                        }
                    }

                    piHut.ModifiedBy   = lbl_UserName.Text;
                    piHut.ModifiedDate = DateTime.Now;
                    DataMaster.UpdatePersistence(piHut);

                    jur               = new TJournal();
                    jur.JournalDate   = journalDateDateTimePicker.Value;
                    jur.JournalDesc   = journalDescTextBox.Text;
                    jur.JournalJumlah = Convert.ToDecimal(tPiHutangDataGridView.Rows[i].Cells[6].Value);
                    jur.JournalPic    = piHutangPicComboBox.SelectedValue.ToString();

                    if (!IsDelete)
                    {
                        if (PiHutang == ListOfPiHutangStatus.Piutang)
                        {
                            jur.JournalStatus = ListOfJournalStatus.Kredit.ToString();
                        }
                        else if (PiHutang == ListOfPiHutangStatus.Hutang)
                        {
                            jur.JournalStatus = ListOfJournalStatus.Debet.ToString();
                        }
                        else if (PiHutang == ListOfPiHutangStatus.HutangJasa)
                        {
                            jur.JournalStatus = ListOfJournalStatus.Debet.ToString();
                        }
                    }
                    else
                    {
                        if (PiHutang == ListOfPiHutangStatus.Piutang)
                        {
                            jur.JournalStatus = ListOfJournalStatus.Debet.ToString();
                        }
                        else if (PiHutang == ListOfPiHutangStatus.Hutang)
                        {
                            jur.JournalStatus = ListOfJournalStatus.Kredit.ToString();
                        }
                        else if (PiHutang == ListOfPiHutangStatus.HutangJasa)
                        {
                            jur.JournalStatus = ListOfJournalStatus.Kredit.ToString();
                        }
                    }


                    jur.SubAccountId = tPiHutangDataGridView.Rows[i].Cells[8].Value.ToString();
                    jur.VoucherNo    = voucherNoTextBox.Text;
                    jur.ModifiedBy   = lbl_UserName.Text;
                    jur.ModifiedDate = DateTime.Now;
                    AppCode.SaveTJournal(jur);
                }
            }

            MessageBox.Show(this.Text + " berhasil disimpan", AppCode.AssemblyProduct, MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
Example #11
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);
            }
        }
Example #12
0
        void SetInitialCommonSettings()
        {
            //kas dropdownlist
            mSubAccountBindingSource.DataSource = DataMaster.GetListEq(typeof(MSubAccount), MSubAccount.ColumnNames.AccountId, AppCode.GetKasAccountNo());

            //numeric up down
            ModuleControlSettings.SetNumericUpDown(kasJumlahNumericUpDown, true);
            ModuleControlSettings.SetNumericUpDown(journalJumlahNumericUpDown);

            //add column to grid
            for (int i = 0; i < 4; i++)
            {
                tJournalDataGridView.Columns.Add(i.ToString(), i.ToString());
            }

            //set width for grid view
            tJournalDataGridView.Columns[0].Width = label_AccId.Width;
            tJournalDataGridView.Columns[1].Width = label_AccName.Width;
            tJournalDataGridView.Columns[2].Width = label_JournalJumlah.Width;
            tJournalDataGridView.Columns[3].Width = label_JournalDesc.Width;

            //set format
            tJournalDataGridView.Columns[2].DefaultCellStyle.Format    = "N";
            tJournalDataGridView.Columns[2].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;

            //journal date
            ModuleControlSettings.SetDateTimePicker(journalDateDateTimePicker, false);

            //search sub acc
            PictureBox searchPic = new PictureBox();

            ModuleControlSettings.SetSearchPictureBox(subAccountIdTextBox, ListOfSearchWindow.SearchSubAccount.ToString(), searchPic);
            searchPic.Click += new EventHandler(searchPicSubAcc_Click);
            subAccountIdTextBox.Controls.Add(searchPic);

            //set display
            if (JournalStatus == ListOfJournalStatus.Debet)
            {
                SetInitialDebetSettings();
            }
            else if (JournalStatus == ListOfJournalStatus.Kredit)
            {
                SetInitialKreditSettings();
            }
        }
Example #13
0
        private void BindReport()
        {
            string title = "Laporan";

            reportViewer1.Reset();

            string namaTransaksi = string.Empty;

            switch (listOfTransaction)
            {
            case ListOfTransaction.Purchase:
                namaTransaksi = "Pembelian ";
                break;

            case ListOfTransaction.Sales:
                namaTransaksi = "Penjualan ";
                break;

            case ListOfTransaction.ReturSales:
                namaTransaksi = "Retur Penjualan ";
                break;

            case ListOfTransaction.ReturPurchase:
                namaTransaksi = "Retur Pembelian ";
                break;

            case ListOfTransaction.Correction:
                namaTransaksi = "Koreksi Stok ";
                break;

            case ListOfTransaction.Mutation:
                namaTransaksi = "Mutasi Stok ";
                break;

            default:
                break;
            }

            switch (listOfReports)
            {
            case ListOfReports.ReportTransactionDetail:
                reportViewer1.LocalReport.ReportEmbeddedResource = "Inventori.PointOfSales.Forms.Reports.ReportTransactionDetail.rdlc";
                FillVTotalTransactionDataSource(Convert.ToDecimal(DataId));
                title = "Laporan Detail Transaksi";
                break;

            case ListOfReports.ReportSalesFactur:
                reportViewer1.LocalReport.ReportEmbeddedResource = "Inventori.PointOfSales.Forms.Reports.ReportSalesFactur.rdlc";

                if (DataId != null)
                {
                    FillVTotalTransactionDataSource(Convert.ToDecimal(DataId));
                }
                title = "NOTA PENJUALAN";
                break;

            case ListOfReports.ReportLabaRugi:
                reportViewer1.LocalReport.ReportEmbeddedResource = "Inventori.PointOfSales.Forms.Reports.ReportLabaRugi.rdlc";
                FillVRekapSubAccountDataSource(ListOfAccountPosition.RugiLaba.ToString(), DataId.ToString());
                //FillVTotalTransactionDataSource(DateFrom, DateTo);
                title = "Laporan Laba/Rugi";

                //ReportParameter[] parameters = new ReportParameter[1];
                //parameters[0] = new ReportParameter("Report_Parameter_Periode","Juli 2007");
                //reportViewer1.LocalReport.SetParameters(parameters);

                break;

            case ListOfReports.ReportNeraca:
                reportViewer1.LocalReport.ReportEmbeddedResource = "Inventori.PointOfSales.Forms.Reports.ReportNeraca.rdlc";
                FillVRekapSubAccountDataSource(DataId.ToString());

                title = "Laporan Neraca";
                break;

            case ListOfReports.ReportTransactionByPIC:
                reportViewer1.LocalReport.ReportEmbeddedResource = "Inventori.PointOfSales.Forms.Reports.ReportTransactionByPIC.rdlc";
                FillVTotalTransactionDataSource(listOfTransaction.ToString(), DateFrom, DateTo, VTotalTransactionDetail.ColumnNames.TransactionBy, DataId.ToString());
                title = "Laporan " + namaTransaksi;
                break;

            case ListOfReports.ReportTransactionByItem:
                reportViewer1.LocalReport.ReportEmbeddedResource = "Inventori.PointOfSales.Forms.Reports.ReportTransactionByItem.rdlc";
                FillVTotalTransactionDataSource(listOfTransaction.ToString(), DateFrom, DateTo);
                title = "Laporan " + namaTransaksi;
                break;

            case ListOfReports.ReportTransactionInternalByItem:
                reportViewer1.LocalReport.ReportEmbeddedResource = "Inventori.PointOfSales.Forms.Reports.ReportTransactionInternalByItem.rdlc";
                FillVTotalTransactionDataSource(listOfTransaction.ToString(), DateFrom, DateTo);
                title = "Laporan " + namaTransaksi;
                break;

            case ListOfReports.ReportPiHutangDue:
                reportViewer1.LocalReport.ReportEmbeddedResource = "Inventori.PointOfSales.Forms.Reports.ReportPiHutangDue.rdlc";
                FillTPihutang(PiHutangStatus.ToString());
                title = "Laporan " + PiHutangStatus.ToString();
                break;

            case ListOfReports.ReportPajak:
                reportViewer1.LocalReport.ReportEmbeddedResource = "Inventori.PointOfSales.Forms.Reports.ReportPajak.rdlc";
                FillVTotalTransactionDataSource(listOfTransaction.ToString(), DateFrom, DateTo);
                title = "Laporan Pajak";
                break;

            case ListOfReports.ReportStokItem:
                reportViewer1.LocalReport.ReportEmbeddedResource = "Inventori.PointOfSales.Forms.Reports.ReportStokItem.rdlc";
                FillVItemDetail();
                title = "Laporan Stok Barang";
                break;

            case ListOfReports.ReportCommission:
                reportViewer1.LocalReport.ReportEmbeddedResource = "Inventori.PointOfSales.Forms.Reports.ReportCommission.rdlc";
                FillTCommission(DateFrom, DateTo);
                title = "Laporan Pembagian Tuslah";
                break;

            case ListOfReports.ReportPiHutangDetail:
                reportViewer1.LocalReport.ReportEmbeddedResource = "Inventori.PointOfSales.Forms.Reports.ReportPiHutangDetail.rdlc";
                FillTPihutang(PiHutangStatus.ToString(), DataId.ToString(), DateFrom, DateTo);
                title = "Laporan Detail " + PiHutangStatus.ToString();
                break;

            case ListOfReports.ReportTJournal:
                reportViewer1.LocalReport.ReportEmbeddedResource = "Inventori.PointOfSales.Forms.Reports.ReportTJournal.rdlc";
                FillTJournal(DateFrom, DateTo, AppCode.GetKasAccountNo());
                title = "Laporan Arus Kas";
                break;

            case ListOfReports.ReportStokCard:
                reportViewer1.LocalReport.ReportEmbeddedResource = "Inventori.PointOfSales.Forms.Reports.ReportStokCard.rdlc";
                FillVStokCard(DateFrom, DateTo);
                title = "Laporan Kartu Stok";
                break;

            case ListOfReports.ReportJournal:
                reportViewer1.LocalReport.ReportEmbeddedResource = "Inventori.PointOfSales.Forms.Reports.ReportJournal.rdlc";
                FillTJournal(DateFrom, DateTo);
                title = "Laporan Journal Umum";
                break;

            case ListOfReports.ReportChartSalesMonthly:
                reportViewer1.LocalReport.ReportEmbeddedResource = "Inventori.PointOfSales.Forms.Reports.ReportChartSalesMonthly.rdlc";
                FillVTotalTransactionDataSource(listOfTransaction.ToString(), DateFrom, DateTo, VTotalTransactionDetail.ColumnNames.TransactionBy, DataId.ToString());
                title = "Laporan Rekap Penjualan Per Bulan";
                break;

            case ListOfReports.ReportDelivery:
                reportViewer1.LocalReport.ReportEmbeddedResource = "Inventori.PointOfSales.Forms.Reports.ReportDelivery.rdlc";
                FillVTotalDelivery(DateFrom, DateTo, DataId.ToString());
                title = "Laporan Pengiriman Barang";
                break;

            case ListOfReports.ReportMCustomer:
                reportViewer1.LocalReport.ReportEmbeddedResource = "Inventori.PointOfSales.Forms.Reports.ReportMCustomer.rdlc";
                FillMaster(typeof(MCustomer));
                title = "Daftar Pelanggan";
                break;

            case ListOfReports.ReportMSupplier:
                reportViewer1.LocalReport.ReportEmbeddedResource = "Inventori.PointOfSales.Forms.Reports.ReportMSupplier.rdlc";
                FillMaster(typeof(MSupplier));
                title = "Daftar Supplier";
                break;

            case ListOfReports.ReportMEkspedission:
                reportViewer1.LocalReport.ReportEmbeddedResource = "Inventori.PointOfSales.Forms.Reports.ReportMEkspedission.rdlc";
                FillMaster(typeof(MEkspedission));
                title = "Daftar Ekspedisi";
                break;

            default:
                break;
            }

            reportViewer1.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(LocalReport_SubreportProcessing);

            this.Text    = title;
            this.TabText = title;

            this.reportViewer1.RefreshReport();
        }