Exemplo n.º 1
0
 public static PartyRole CreateChequeRole(Cheque cheque, RoleType roleType, Party party, DateTime today)
 {
     PartyRole partyRole = new PartyRole();
     partyRole.Party = party;
     partyRole.RoleTypeId = roleType.Id;
     partyRole.EffectiveDate = today;
     partyRole.EndDate = null;
     cheque.PartyRole = partyRole;
     Context.Cheques.AddObject(cheque);
     return partyRole;
 }
 public ChequeViewModel(Cheque cheque, Receipt receipt)
 {
     this.BankName = cheque.PartyRole.Party.Name;
     this.Branch = cheque.PartyRole.Bank.Branch;
     this.CheckType = cheque.Payment.PaymentMethodType.Name;
     this.CheckNumber = cheque.Payment.PaymentReferenceNumber;
     this.CheckDate = cheque.CheckDate;
     this.TotalAmount = receipt.ReceiptBalance;
     //TODO:: Affected by change in payment table.
     //this.TotalAmount = c.Payment.Receipt.ReceiptBalance;
 }
Exemplo n.º 3
0
        public static ChequeStatu CreateChequeStatus(Cheque cheque, int chequeStatusTypeId, DateTime transitionDateTime, string remarks, bool isActive)
        {
            ChequeStatu newCheckStatus = new ChequeStatu();

            newCheckStatus.Cheque = cheque;
            newCheckStatus.CheckStatusTypeId = chequeStatusTypeId;
            newCheckStatus.TransitionDateTime = transitionDateTime;
            newCheckStatus.Remarks = remarks;
            newCheckStatus.IsActive = isActive;

            return newCheckStatus;
        }
Exemplo n.º 4
0
        public static ChequeStatu ChangeStatus(Cheque cheque, ChequeStatusType chequeStatusTo, string remarks)
        {
            var statusFrom = GetActive(cheque);
            if (statusFrom != null && statusFrom.IsActive == true)
            {
                statusFrom.IsActive = false;
            }

            ChequeStatu status = new ChequeStatu();
            if (statusFrom == null || statusFrom.IsActive == false)
                status = CreateChequeStatus(cheque, chequeStatusTo.Id, DateTime.Now, remarks, true);

            Context.ChequeStatus.AddObject(status);
            return status;
        }
Exemplo n.º 5
0
        public AddChequesModel(Cheque cheque)
        {
            this.IsNew = false;

            PartyRole partyRole = cheque.PartyRole;
            Party party = partyRole.Party;
            Organization bankName = party.Organization;
            this.BankName = bankName.OrganizationName;

            Bank bankBranch = partyRole.Bank;
            this.Branch = bankBranch.Branch;
            this.BankPartyRoleId = partyRole.Id;

            Payment checkPayment = cheque.Payment;
            this.CheckType = checkPayment.PaymentMethodType.Name;
            this.CheckNumber = checkPayment.PaymentReferenceNumber;
            this.Amount = checkPayment.TotalAmount;

            this.CheckDate = cheque.CheckDate;
        }
Exemplo n.º 6
0
 public static Cheque CreateCheque(Payment payment, int bankPartyRoleId, DateTime checkDate)
 {
     Cheque newCheck = new Cheque();
     newCheck.BankPartyRoleId = bankPartyRoleId;
     newCheck.CheckDate = checkDate;
     newCheck.PaymentId = payment.Id;
     return newCheck;
 }
Exemplo n.º 7
0
 public static ChequeStatu GetActive(Cheque cheque)
 {
     return cheque.ChequeStatus.FirstOrDefault(entity => entity.IsActive);
 }
Exemplo n.º 8
0
        public static void SaveToDisbursementCheques(DateTime transactdate, DateTime entrydate, Payment parent, List<AddChequesModel> Cheques, int processedTo, int processedby, SpecificPaymentType specifictype, DisbursementType distype, string DisbursedToName, int CurrencyId)
        {
            foreach (var cheque in Cheques)
            {
                PaymentMethodType type = PaymentMethodType.PayCheckType;
                if (cheque.CheckType == PaymentMethodType.PersonalCheckType.Name)
                    type = PaymentMethodType.PersonalCheckType;
                Payment chequepayment = new Payment();

                chequepayment.PaymentMethodType = type;
                chequepayment.Payment2 = parent;
                chequepayment.ProcessedToPartyRoleId = processedTo;
                chequepayment.ProcessedByPartyRoleId = processedby;
                chequepayment.PaymentReferenceNumber = cheque.CheckNumber;
                chequepayment.TransactionDate = transactdate;
                chequepayment.EntryDate = entrydate;
                chequepayment.TotalAmount = cheque.Amount;
                chequepayment.PaymentType = PaymentType.Disbursement;
                chequepayment.SpecificPaymentType = specifictype;
                ObjectContext.Payments.AddObject(chequepayment);

                Disbursement disbursement = new Disbursement();
                disbursement.Payment = chequepayment;
                disbursement.DisbursementType = distype;
                if (string.IsNullOrEmpty(DisbursedToName) == false)
                    disbursement.DisbursedToName = DisbursedToName;
                ObjectContext.Disbursements.AddObject(disbursement);

                Cheque newCheque = new Cheque();
                newCheque.BankPartyRoleId = cheque.BankPartyRoleId;
                newCheque.Payment = chequepayment;
                newCheque.CheckDate = cheque.CheckDate;
                ObjectContext.Cheques.AddObject(newCheque);

                ChequeStatu newChequeStatus = new ChequeStatu();
                newChequeStatus.Cheque = newCheque;
                newChequeStatus.CheckStatusTypeId = ChequeStatusType.ClearedType.Id;
                newChequeStatus.TransitionDateTime = entrydate;
                newChequeStatus.IsActive = true;
                ObjectContext.ChequeStatus.AddObject(newChequeStatus);

                Currency.CreatePaymentCurrencyAssoc(chequepayment, CurrencyId);

            }
        }
Exemplo n.º 9
0
 private void FillCheque(Cheque check, Payment payment, string amountInWords)
 {
     lblDate.Text = String.Format("{0: MMMM d, yyyy}", check.CheckDate);
     lblName.Text = "***" + payment.PartyRole1.Party.Name.ToUpper() + "***";
     lblAmount.Text = "***" + payment.TotalAmount.ToString("N") + "***";
     lblAmountInWords.Text = "***" + amountInWords.ToUpper() + " " + "ONLY***";
     var bank = Context.Banks.SingleOrDefault(x => x.PartyRoleId == check.BankPartyRoleId);
     lblBankName.Text = bank.PartyRole.Party.Organization.OrganizationName.ToUpper() + " (" + payment.PaymentReferenceNumber + ")";
     lblCurrency.Text = "PESOS";
 }
Exemplo n.º 10
0
        protected Cheque CreateCheck(int paymentId)
        {
            var payment = ObjectContext.Payments.SingleOrDefault(entity => entity.Id == paymentId);
            Cheque newCheck = new Cheque();

            newCheck.BankPartyRoleId = int.Parse(hdnBankID.Text);
            newCheck.CheckDate = Convert.ToDateTime(dtCheckDate.Text);
            newCheck.PaymentId = paymentId;
            payment.PaymentReferenceNumber = txtCheckNumber.Text;

            ObjectContext.Cheques.AddObject(newCheck);
            return newCheck;
        }
Exemplo n.º 11
0
        protected void CreateCheckStatus(Cheque check, DateTime now)
        {
            ChequeStatu newCheckStatus = new ChequeStatu();

            newCheckStatus.CheckId = check.Id;
            newCheckStatus.CheckStatusTypeId = int.Parse(cmbCheckStatus.SelectedItem.Value);
            newCheckStatus.TransitionDateTime = now;
            newCheckStatus.Remarks = txtCheckRemarks.Text;
            newCheckStatus.IsActive = true;

            ObjectContext.ChequeStatus.AddObject(newCheckStatus);
        }
Exemplo n.º 12
0
        protected void CreateCheckStatus(Cheque check, DateTime now, ChequeStatusType CheckStatusType)
        {
            ChequeStatu newCheckStatus = new ChequeStatu();

            newCheckStatus.CheckId = check.Id;
            newCheckStatus.ChequeStatusType = CheckStatusType;
            newCheckStatus.TransitionDateTime = now;
            newCheckStatus.Remarks = txtCheckRemarks.Text;
            newCheckStatus.IsActive = true;

            ObjectContext.ChequeStatus.AddObject(newCheckStatus);
        }
Exemplo n.º 13
0
        protected Cheque CreateCheck(int paymentId)
        {
            Cheque newCheck = new Cheque();

            newCheck.BankPartyRoleId = int.Parse(hdnBankID.Text);
            newCheck.CheckDate = dtCheckDate.SelectedDate;
            newCheck.PaymentId = paymentId;

            ObjectContext.Cheques.AddObject(newCheck);
            return newCheck;
        }