示例#1
0
        public void ResetProperties()
        {
            ID              = 0;
            MemberCode      = "";
            MemberName      = "";
            CheckNo         = "";
            CheckNo1        = "";
            AccountCode     = "";
            AccountTitle    = "";
            Debit           = 0m;
            Credit          = 0m;
            VoucherDate     = new DateTime();
            VoucherType     = VoucherTypes.CV;
            VoucherNo       = 0;
            TransactionType = "";
            IsPosted        = false;

            CheckNo          = "";
            DueDate          = new DateTime();
            PurchaseOrderNo  = "";
            TransactionType  = "";
            BeginningBalance = 0m;
            EndingBalance    = 0m;
            BankTitle        = "";
            CheckNo1         = "";

            LoanDetails        = new LoanDetails();
            TimeDepositDetails = new TimeDepositDetails();
        }
示例#2
0
        private Result PostTimeDepositEndBalance()
        {
            // post time desposit end balance debit side
            var member    = Nfmb.FindByCode(_accountDetail.MemberCode);
            var account   = Account.FindByCode(_accountDetail.AccountCode);
            var tdDetails = new TimeDepositDetails {
                CertificateNo = _accountDetail.TimeDepositDetails.CertificateNo
            };
            var cv = new CashVoucher
            {
                MemberCode         = member.MemberCode,
                MemberName         = member.MemberName,
                AccountCode        = account.AccountCode,
                AccountTitle       = account.AccountTitle,
                Debit              = _accountDetail.EndingBalance,
                VoucherDate        = _voucherDocument.VoucherDate,
                VoucherNo          = _voucherDocument.VoucherNo,
                TimeDepositDetails = tdDetails,
            };

            var postResult = cv.Create();

            if (!postResult.Success)
            {
                Rollback();
            }
            return(postResult);
        }
示例#3
0
        public void SetPropertiesFromDataRow(DataRow dataRow)
        {
            ID              = DataConverter.ToInteger(dataRow["ID"]);
            MemberCode      = DataConverter.ToString(dataRow["MEM_CODE"]);
            MemberName      = DataConverter.ToString(dataRow["MEM_NAME"]);
            CheckNo         = DataConverter.ToString(dataRow["CHECK_NUM"]);
            CheckNo1        = DataConverter.ToString(dataRow["CHECK_NUM1"]);
            AccountCode     = DataConverter.ToString(dataRow["ACC_CODE"]);
            AccountTitle    = DataConverter.ToString(dataRow["TITLE"]);
            Debit           = DataConverter.ToDecimal(dataRow["DEBIT"]);
            Credit          = DataConverter.ToDecimal(dataRow["CREDIT"]);
            VoucherDate     = DataConverter.ToDateTime(dataRow["DOC_DATE"]);
            VoucherType     = VoucherTypes.CV;
            VoucherNo       = DataConverter.ToInteger(dataRow["DOC_NUM"]);
            TransactionType = DataConverter.ToString(dataRow["TRN_TYPE"]);

            //Explanation = DataConverter.ToString(dataRow["EXPLAIN"]);
            Explanation = Encoding.UTF8.GetString(DataConverter.ToByteArray(dataRow["EXPLAIN"]));

            PayableTo         = DataConverter.ToString(dataRow["PAY_TO"]);
            DateCheckPosted   = DataConverter.ToDateTime(dataRow["DCP"]);
            DateCheckReceived = DataConverter.ToDateTime(dataRow["DCR"]);
            DateCheckDue      = DataConverter.ToDateTime(dataRow["DD"]);
            Bank             = DataConverter.ToString(dataRow["BANK"]);
            BankTitle        = DataConverter.ToString(dataRow["BANK_TITLE"]);
            Amount           = DataConverter.ToDecimal(dataRow["AMOUNT"]);
            AmountInWords    = DataConverter.ToString(dataRow["AMT_WORDS"]);
            WithdrawalSlipNo = DataConverter.ToInteger(dataRow["WS_NO"]);
            IsPosted         = DataConverter.ToBoolean(dataRow["POSTED"]);

            TimeDepositDetails = TimeDepositDetails.ExtractFromDataRow(dataRow);
            LoanDetails        = LoanDetails.ExtractFromDataRow(dataRow);
        }
        private void btnTdDetails_Click(object sender, RoutedEventArgs e)
        {
            string tdCode = GlobalSettings.CodeOfTimeDeposit;

            for (int index = 1; index < 12; index++)
            {
                if (_modelTellerCollector.AccountCodes(index) == tdCode)
                {
                    var timeDepositDetail = new TimeDepositDetails();
                    timeDepositDetail.DateIn = _transactionDateUser;
                    if (_modelTellerCollector.TimeDepositDetail != null)
                    {
                        timeDepositDetail.CertificateNo = _modelTellerCollector.TimeDepositDetail.CertificateNo;
                        timeDepositDetail.DateIn        = _modelTellerCollector.TimeDepositDetail.DateIn;
                        timeDepositDetail.Rate          = _modelTellerCollector.TimeDepositDetail.Rate;
                        timeDepositDetail.Term          = _modelTellerCollector.TimeDepositDetail.Term;
                    }
                    var timeDepositDetailsWindow = new TimeDepositEditView(timeDepositDetail);
                    timeDepositDetailsWindow.IsReadOnly = !CanModify;
                    if (timeDepositDetailsWindow.ShowDialog() == true)
                    {
                        _modelTellerCollector.TimeDepositDetail = timeDepositDetail;
                        return;
                    }
                    return;
                }
            }
            MessageWindow.ShowNotifyMessage("No Time Deposit entry found!");
        }
示例#5
0
        public void SetPropertiesFromDataRow(DataRow dataRow)
        {
            ID           = DataConverter.ToInteger(dataRow["ID"]);
            MemberCode   = DataConverter.ToString(dataRow["MEM_CODE"]);
            MemberName   = DataConverter.ToString(dataRow["MEM_NAME"]);
            AccountCode  = DataConverter.ToString(dataRow["ACC_CODE"]);
            AccountTitle = DataConverter.ToString(dataRow["TITLE"]);
            Debit        = DataConverter.ToDecimal(dataRow["DEBIT"]);
            Credit       = DataConverter.ToDecimal(dataRow["CREDIT"]);
            VoucherDate  = DataConverter.ToDateTime(dataRow["DOC_DATE"]);
            VoucherType  = VoucherTypes.OR;
            VoucherNo    = DataConverter.ToInteger(dataRow["DOC_NUM"]);
            ModePay      = DataConverter.ToString(dataRow["MODE_PAY"]);

            Collector = DataConverter.ToString(dataRow["COLLECTOR"]);
            //Explanation = DataConverter.ToString(dataRow["EXPLAIN"]);
            Explanation = Encoding.UTF8.GetString(DataConverter.ToByteArray(dataRow["EXPLAIN"]));

            IsPosted          = DataConverter.ToBoolean(dataRow["POSTED"]);
            Deno01            = DataConverter.ToInteger(dataRow["DEN1"]);
            Deno02            = DataConverter.ToInteger(dataRow["DEN2"]);
            Deno03            = DataConverter.ToInteger(dataRow["DEN3"]);
            Deno04            = DataConverter.ToInteger(dataRow["DEN4"]);
            Deno05            = DataConverter.ToInteger(dataRow["DEN5"]);
            Deno06            = DataConverter.ToInteger(dataRow["DEN6"]);
            Deno07            = DataConverter.ToInteger(dataRow["DEN7"]);
            Deno08            = DataConverter.ToInteger(dataRow["DEN8"]);
            Deno09            = DataConverter.ToInteger(dataRow["DEN9"]);
            Deno10            = DataConverter.ToInteger(dataRow["DEN10"]);
            BankName1         = DataConverter.ToString(dataRow["BNAME1"]);
            BankName2         = DataConverter.ToString(dataRow["BNAME2"]);
            BankName3         = DataConverter.ToString(dataRow["BNAME3"]);
            BankName4         = DataConverter.ToString(dataRow["BNAME4"]);
            BankName5         = DataConverter.ToString(dataRow["BNAME5"]);
            BankDate1         = DataConverter.ToDateTime(dataRow["BDATE1"]);
            BankDate2         = DataConverter.ToDateTime(dataRow["BDATE2"]);
            BankDate3         = DataConverter.ToDateTime(dataRow["BDATE3"]);
            BankDate4         = DataConverter.ToDateTime(dataRow["BDATE4"]);
            BankDate5         = DataConverter.ToDateTime(dataRow["BDATE5"]);
            BankCheck1        = DataConverter.ToString(dataRow["BCHECK1"]);
            BankCheck2        = DataConverter.ToString(dataRow["BCHECK2"]);
            BankCheck3        = DataConverter.ToString(dataRow["BCHECK3"]);
            BankCheck4        = DataConverter.ToString(dataRow["BCHECK4"]);
            BankCheck5        = DataConverter.ToString(dataRow["BCHECK5"]);
            BankAmount1       = DataConverter.ToDecimal(dataRow["BAMT1"]);
            BankAmount2       = DataConverter.ToDecimal(dataRow["BAMT2"]);
            BankAmount3       = DataConverter.ToDecimal(dataRow["BAMT3"]);
            BankAmount4       = DataConverter.ToDecimal(dataRow["BAMT4"]);
            BankAmount5       = DataConverter.ToDecimal(dataRow["BAMT5"]);
            DepositSlipNo     = DataConverter.ToInteger(dataRow["DS_NO"]);
            DepositSlipDate   = DataConverter.ToDateTime(dataRow["DS_DATE"]);
            BankDepositSlipNo = DataConverter.ToInteger(dataRow["DS_NO1"]);
            BankDeposited     = DataConverter.ToString(dataRow["BANK"]);
            BankTitle         = DataConverter.ToString(dataRow["BANK_TITLE"]);
            Amount            = DataConverter.ToDecimal(dataRow["AMT_DEP"]);
            AmountInWords     = DataConverter.ToString(dataRow["WORDS"]);

            TimeDepositDetails = TimeDepositDetails.ExtractFromDataRow(dataRow);
        }
示例#6
0
        public Result Find(int docNum)
        {
            Action find = delegate
            {
                var sqlBuilder = new StringBuilder();
                sqlBuilder.AppendFormat("SELECT * FROM `OR` WHERE DOC_NUM = ?DOC_NUM");

                var sqlParam = new SqlParameter("?DOC_NUM", docNum);

                DataTable result = DatabaseController.ExecuteSelectQuery(sqlBuilder.ToString(),
                                                                         sqlParam);

                ResetProperties();
                VoucherNumber = docNum;
                string cashOnHandCode  = GlobalSettings.CodeOfCashOnHand;
                string timeDepositCode = GlobalSettings.CodeOfTimeDeposit;

                int index = 0;
                foreach (DataRow dataRow in result.Rows)
                {
                    if (index == 0)
                    {
                        VoucherDate   = DataConverter.ToDateTime(dataRow["DOC_DATE"]);
                        MemberCode    = DataConverter.ToString(dataRow["MEM_CODE"]);
                        IsCancelled   = MemberCode.ToUpper().Contains("CANCEL");
                        CollectorName = DataConverter.ToString(dataRow["COLLECTOR"]);
                    }

                    index++;

                    string  accountCode = DataConverter.ToString(dataRow["ACC_CODE"]);
                    decimal credit      = DataConverter.ToDecimal(dataRow["CREDIT"]);

                    if (accountCode != cashOnHandCode)
                    {
                        SetAccountCode(index, accountCode);
                        SetCreditAmount(index, credit);
                        if (accountCode == timeDepositCode)
                        {
                            TimeDepositDetail = TimeDepositDetails.ExtractFromDataRow(dataRow);
                        }
                    }
                    else
                    {
                        CashAndCheckDenomimation = CashAndCheckBreakDown.ExtractFromDataRow(dataRow);
                    }
                }

                //UpdateTotalAmount();
            };

            return(ActionController.InvokeAction(find));
        }
示例#7
0
        public TimeDepositDetails GenerateTimeDepositDetails()
        {
            var timeDepositDetails = new TimeDepositDetails();

            timeDepositDetails.Amount        = Amount;
            timeDepositDetails.CertificateNo = CertificateNo;
            timeDepositDetails.DateIn        = DateIn;
            timeDepositDetails.Maturity      = DateMaturity;
            timeDepositDetails.Rate          = SelectedItem.InterestRate;
            timeDepositDetails.Term          = SelectedTerm.Value;
            timeDepositDetails.TermsMode     = "Month";
            return(timeDepositDetails);
        }
示例#8
0
        public TimeDepositDetails GetTimeDepositDetail()
        {
            DataTable dataTable =
                DatabaseController.ExecuteStoredProcedure("SP_GetTimeDepositDetailsByTransactionDetailId",
                                                          new SqlParameter("?TransactionDetailId", TransactionDetailId));
            var td = new TimeDepositDetails();


            if (dataTable.Rows.Count > 0)
            {
                td = TimeDepositDetails.ExtractFromDataRow(dataTable.Rows[0]);
            }

            return(td);
        }
示例#9
0
        private TimeDepositDetails SetNewTimeDepositDetails()
        {
            var previousDetail    = _accountDetail.TimeDepositDetails;
            var timeDepositDetail = new TimeDepositDetails();

            timeDepositDetail.CertificateNo = previousDetail.CertificateNo;
            timeDepositDetail.Rate          = previousDetail.Rate;
            timeDepositDetail.DateIn        = GlobalSettings.DateOfOpenTransaction;
            var totalMonths = ((previousDetail.Maturity.Year - previousDetail.DateIn.Year) * 12) +
                              previousDetail.Maturity.Month - previousDetail.DateIn.Month;

            timeDepositDetail.Term      = totalMonths;
            timeDepositDetail.TermsMode = "Month";

            var timeDepositDetailsWindow = new TimeDepositEditView(timeDepositDetail);

            if (timeDepositDetailsWindow.ShowDialog() == true)
            {
                return(timeDepositDetail);
            }
            return(timeDepositDetail);
        }
示例#10
0
        public void SetPropertiesFromDataRow(DataRow dataRow)
        {
            ID           = DataConverter.ToInteger(dataRow["ID"]);
            MemberCode   = DataConverter.ToString(dataRow["MEM_CODE"]);
            MemberName   = DataConverter.ToString(dataRow["MEM_NAME"]);
            AccountCode  = DataConverter.ToString(dataRow["ACC_CODE"]);
            AccountTitle = DataConverter.ToString(dataRow["TITLE"]);
            Debit        = DataConverter.ToDecimal(dataRow["DEBIT"]);
            Credit       = DataConverter.ToDecimal(dataRow["CREDIT"]);

            VoucherDate = DataConverter.ToDateTime(dataRow["DOC_DATE"]);
            VoucherType = DataConverter.ToVoucherType(dataRow["DOC_TYPE"]);
            VoucherNo   = DataConverter.ToInteger(dataRow["DOC_NUM"]);

            TransactionType = DataConverter.ToString(dataRow["TRN_TYPE"]);
            //IsPosted = DataConverter.ToBoolean(dataRow["POSTED"]);

            CheckNo   = DataConverter.ToString(dataRow["CHECK_NUM"]);
            DueDate   = DataConverter.ToDateTime(dataRow["DUE_DATE"]);
            BankTitle = DataConverter.ToString(dataRow["BANK_TITLE"]);
            CheckNo1  = DataConverter.ToString(dataRow["CHECK_NUM1"]);

            PurchaseOrderNo  = DataConverter.ToString(dataRow["PO_NO"]);
            BeginningBalance = DataConverter.ToDecimal(dataRow["BEG_BAL"]);
            EndingBalance    = DataConverter.ToDecimal(dataRow["END_BAL"]);

            TimeDepositDetails = TimeDepositDetails.ExtractFromDataRow(dataRow);
            LoanDetails        = LoanDetails.ExtractFromDataRow(dataRow);
            if (LoanDetails != null)
            {
                // slbal column is different from cv and jv regarding loan terms
                LoanDetails.LoanTerms     = DataConverter.ToInteger(dataRow["TERMS1"]);
                LoanDetails.ModeOfPayment = DataConverter.ToModeOfPayment(dataRow["MODE_PAY1"]);
                LoanDetails.TermsMode     = DataConverter.ToTermsMode(dataRow["TERMS1"], dataRow["TERMS_MODE"]);
            }
        }
示例#11
0
 public TimeDepositDetailsView(TimeDepositDetails timeDepositDetails)
 {
     InitializeComponent();
     _timeDepositDetails = timeDepositDetails;
     DataContext         = _timeDepositDetails;
 }
示例#12
0
        public void SetPropertiesFromDataRow(DataRow dataRow)
        {
            Pline            = DataConverter.ToInteger(dataRow["PLINE"]);
            Line             = DataConverter.ToInteger(dataRow["LINE"]);
            Rem              = DataConverter.ToString(dataRow["REM"]);
            MemberCode       = DataConverter.ToString(dataRow["MEM_CODE"]);
            MemberName       = DataConverter.ToString(dataRow["MEM_NAME"]);
            CheckNum         = DataConverter.ToString(dataRow["CHECK_NUM"]);
            Nature           = DataConverter.ToString(dataRow["NATURE"]);
            AccountCode      = DataConverter.ToString(dataRow["ACC_CODE"]);
            Title            = DataConverter.ToString(dataRow["TITLE"]);
            Debit            = DataConverter.ToDecimal(dataRow["DEBIT"]);
            Credit           = DataConverter.ToDecimal(dataRow["CREDIT"]);
            VoucherDate      = DataConverter.ToDateTime(dataRow["DOC_DATE"]);
            VoucherType      = DataConverter.ToString(dataRow["DOC_TYPE"]);
            VoucherNumber    = DataConverter.ToInteger(dataRow["DOC_NUM"]);
            TrnType          = DataConverter.ToString(dataRow["TRN_TYPE"]);
            BeginningBalance = DataConverter.ToDecimal(dataRow["BEG_BAL"]);
            EndingBalance    = DataConverter.ToDecimal(dataRow["END_BAL"]);
            Flag             = DataConverter.ToInteger(dataRow["FLAG"]);
            ModePay          = DataConverter.ToString(dataRow["MODE_PAY"]);
            Mark             = DataConverter.ToBoolean(dataRow["MARK"]);
            Space1           = DataConverter.ToString(dataRow["SPACE1"]);
            Initial          = DataConverter.ToString(dataRow["INITIAL"]);
            Remark           = DataConverter.ToString(dataRow["REMARK"]);
            Terms            = DataConverter.ToInteger(dataRow["TERMS"]);
            DueDate          = DataConverter.ToDateTime(dataRow["DUE_DATE"]);
            PoNo             = DataConverter.ToString(dataRow["PO_NO"]);
            Days             = DataConverter.ToInteger(dataRow["DAYS"]);
            ReleaseNo        = DataConverter.ToInteger(dataRow["RELEASE_NO"]);
            BankTitle        = DataConverter.ToString(dataRow["BANK_TITLE"]);
            CheckNum1        = DataConverter.ToString(dataRow["CHECK_NUM1"]);
            LoanAmount       = DataConverter.ToDecimal(dataRow["LOAN_AMT"]);
            TermsMode        = DataConverter.ToString(dataRow["TERMS_MODE"]);
            DateGrant        = DataConverter.ToDateTime(dataRow["DATE_GRANT"]);
            Maturity         = DataConverter.ToDateTime(dataRow["MATURITY"]);
            CutOff           = DataConverter.ToDateTime(dataRow["CUT_OFF"]);

            Reference = string.Format("{0} {1}", VoucherType, VoucherNumber);

            TimeDepositDetails = new TimeDepositDetails(dataRow);
            LoanDetails        = new LoanDetails(dataRow);
            //LoanDetails.ReleaseNo = DataConverter.ToInteger(dataRow["RELEASE_NO"]);
            //LoanDetails.LoanAmount = DataConverter.ToDecimal(dataRow["LOAN_AMT"]);
            //LoanDetails.LoanTerms = DataConverter.ToInteger(dataRow["TERMS1"]);
            //LoanDetails.TermsMode = DataConverter.ToTermsMode(dataRow["TERMS1"],dataRow["TERMS_MODE"]);
            //LoanDetails.GrantedDate = DataConverter.ToDateTime(dataRow["DATE_GRANT"]);
            //LoanDetails.MaturityDate = DataConverter.ToDateTime(dataRow["MATURITY"]);
            //LoanDetails.CutOffDate = DataConverter.ToDateTime(dataRow["CUT_OFF"]);
            //LoanDetails.ModeOfPayment = DataConverter.ToModeOfPayment(dataRow["MODE_PAY1"]);
            //LoanDetails.Payment = DataConverter.ToDecimal(dataRow["PAYMENT"]);
            //LoanDetails.InterestRate = DataConverter.ToDecimal(dataRow["INT_RATE"]);
            //LoanDetails.InterestAmount = DataConverter.ToDecimal(dataRow["INT_AMT"]);
            //LoanDetails.InterestAmortization = DataConverter.ToDecimal(dataRow["INT_AMORT"]);
            //LoanDetails.DateApproved = DataConverter.ToDateTime(dataRow["APPROVED"]);
            //LoanDetails.DateCancelled = DataConverter.ToDateTime(dataRow["CANCELLED"]);
            //LoanDetails.DateReleased = DataConverter.ToDateTime(dataRow["RELEASED"]);
            //LoanDetails.DateApplied = DataConverter.ToDateTime(dataRow["APPLIED"]);

            //LoanDetails.ThisMonth = DataConverter.ToDecimal(dataRow["THIS_MONTH"]);
            //LoanDetails.Collector = DataConverter.ToString(dataRow["COLLECTOR"]);
            //LoanDetails.Remarks = DataConverter.ToString(dataRow["REMARKS"]);
            //LoanDetails.IsWithCollateral = DataConverter.ToBoolean(dataRow["COLLAT"]);
            //LoanDetails.Description = DataConverter.ToString(dataRow["DESC"]);


            //LoanDetails.CoMakers[0] = new CoMaker(DataConverter.ToString(dataRow["CO_CODE1"]),
            //                                      DataConverter.ToString(dataRow["CO_NAME1"]));

            //LoanDetails.CoMakers[1] = new CoMaker(DataConverter.ToString(dataRow["CO_CODE2"]),
            //                                      DataConverter.ToString(dataRow["CO_NAME2"]));

            //LoanDetails.CoMakers[2] = new CoMaker(DataConverter.ToString(dataRow["CO_CODE3"]),
            //                                      DataConverter.ToString(dataRow["CO_NAME3"]));

            //LoanDetails.CoMakers[3] = new CoMaker(DataConverter.ToString(dataRow["CO_CODE4"]),
            //                                      DataConverter.ToString(dataRow["CO_NAME4"]));

            //LoanDetails.CoMakers[4] = new CoMaker(DataConverter.ToString(dataRow["CO_CODE5"]),
            //                                      DataConverter.ToString(dataRow["CO_NAME5"]));

            //LoanDetails.Notices[0] = DataConverter.ToBoolean(dataRow["NOTICE1"]);
            //LoanDetails.Notices[1] = DataConverter.ToBoolean(dataRow["NOTICE2"]);
            //LoanDetails.Notices[2] = DataConverter.ToBoolean(dataRow["NOTICE3"]);
        }
示例#13
0
        private void ShowTimeDepositDetailsWindow(TimeDepositDetails timeDepositDetails)
        {
            var timeDepositDetailWindow = new TimeDepositDetailsView(timeDepositDetails);

            timeDepositDetailWindow.ShowDialog();
        }