public void ApproveRequest(string reqKey)
        {
            if (!TryGetEnvelope(reqKey, out ApprovalEnvelope <T> env))
            {
                throw Bad.Arg("Request Key", reqKey);
            }

            SendResponse(env, true);
        }
Example #2
0
 protected override decimal GetRegularDue(LeaseDTO lse, DateTime date)
 {
     if (!lse.IsActive(date)) return 0;
     if (date.Date < lse.FirstRentDueDate.Date) return 0;
     switch (lse.Rent.Interval)
     {
         case BillInterval.Daily  : return GetDailyDue   (lse, date);
         case BillInterval.Monthly: return GetMonthlyDue (lse, date);
         default: throw Bad.Arg("Rent.Interval", lse.Rent.Interval);
     }
 }
Example #3
0
        private void GenerateFrom(ITenantDBsDir dir)
        {
            if (Date > dir.Collections.LastPostedDate())
            {
                throw Bad.Arg("Daily Colxns Date", $"{Date:d MMM yyyy}");
            }

            FillSectionCollections(dir);
            FillOtherCollections(dir);
            DepositsSum = GetTotalDeposits(dir);

            if (CollectionsSum != DepositsSum)
            {
                throw Bad.Data($"Collections sum ({CollectionsSum:N2}) for [{Date:d-MMM-yyyy}] does not match deposits sum ({DepositsSum:N2}).");
            }

            this.SetSummary(SectionColxnsRow.GetSummary(this));
        }
Example #4
0
        private void LaunchReport(AppArguments args)
        {
            switch (args.Param1.ToUpper())
            {
            case "OVERDUES": WithOverduesReport.Show(args);        break;

            case "COLXNSMRY": ColxnSummaryExcelWriter.Launch(args); break;

            case "DAILYSTATUS": DailyStatusReportVM.Launch(args);     break;

            case "GLRECAP": GLRecapExcelWriter.Launch(args);      break;

            case "COLLECTORS": CollectorsMainVM.Launch(args);        break;

            case "CHKVOUCHERS": CheckVouchersReporter.Launch(args);   break;

            default: throw Bad.Arg("Param1", args.Param1);
            }
        }
Example #5
0
        public static int GetGLId(this OtherColxnDTO dto)
        {
            if (dto.GLAccount != null)
            {
                return(dto.GLAccount.Id);
            }
            switch (dto.OtherCode)
            {
            case OtherCode.CR_Fee: return(56);

            case OtherCode.Parking: return(55);

            case OtherCode.Processing_Fee: return(57);

            case OtherCode.Other: return(60);

            default:
                throw Bad.Arg("OtherColxnDTO.OtherCode", dto.OtherCode);
            }
        }