Exemplo n.º 1
0
        public Report MapVoucherToReport(AdjustmentLetter letter)
        {
            var voucher = letter.AdjustedVoucher;

            var headerRow = new HeaderRow
            {
                BusinessDate = voucher.voucher.processingDate.ToShortDateString(),
                ReportOn     = DateTime.Today.ToShortDateString(),
                Page         = "1"
            };

            var voucherList = letter.Vouchers.Select(vouch => new TableRow
            {
                AccountNo = vouch.voucher.accountNumber.ToString(),
                Ad        = vouch.voucher.auxDom,
                Amount    = FormatAmount(vouch.voucher.amount, "Decimal"),
                Bsb       = vouch.voucher.bsbNumber,
                Bch       = vouch.voucherBatch.scannedBatchNumber,
                NegBsb    = vouch.voucherBatch.collectingBank,
                Drcr      = vouch.voucher.documentType.ToString(),
                TransCode = vouch.voucher.transactionCode,
                Ean       = vouch.voucher.extraAuxDom,
                Din       = vouch.voucher.documentReferenceNumber
            }).ToList();

            var totalCredAmount = letter.Vouchers.Where(x => x.voucher.documentType.ToString().ToUpper() == "CR").Sum(x => Convert.ToDecimal(x.voucher.amount));
            var totalDebAmount  = letter.Vouchers.Where(x => x.voucher.documentType.ToString().ToUpper() == "DR").Sum(x => Convert.ToDecimal(x.voucher.amount));

            var footerRow = new FooterRow
            {
                TotalCreditAmount = totalCredAmount.ToString(CultureInfo.InvariantCulture),
                TotalDebitAmount  = totalDebAmount.ToString(CultureInfo.InvariantCulture),
                CreditCount       = letter.Vouchers.Count(x => x.voucher.documentType.ToString().ToUpper() == "CR").ToString(),
                DebitCount        = letter.Vouchers.Count(x => x.voucher.documentType.ToString().ToUpper() == "DR").ToString()
            };


            var report = new Report
            {
                HeaderInfo  = headerRow,
                VoucherRows = voucherList,
                FooterInfo  = footerRow
            };

            return(report);
        }
Exemplo n.º 2
0
        public Report MapVoucherToReport(AdjustmentLetter letter)
        {
            var voucher = letter.AdjustedVoucher;

            var headerRow = new HeaderRow
            {
                BusinessDate = voucher.voucher.processingDate.ToShortDateString(),
                ReportOn = DateTime.Today.ToShortDateString(),
                Page = "1"
            };

            var voucherList = letter.Vouchers.Select(vouch => new TableRow
            {
                AccountNo = vouch.voucher.accountNumber.ToString(),
                Ad = vouch.voucher.auxDom,
                Amount = FormatAmount(vouch.voucher.amount, "Decimal"),
                Bsb = vouch.voucher.bsbNumber,
                Bch = vouch.voucherBatch.scannedBatchNumber,
                NegBsb = vouch.voucherBatch.collectingBank,
                Drcr = vouch.voucher.documentType.ToString(),
                TransCode = vouch.voucher.transactionCode,
                Ean = vouch.voucher.extraAuxDom,
                Din = vouch.voucher.documentReferenceNumber
            }).ToList();

            var totalCredAmount = letter.Vouchers.Where(x => x.voucher.documentType.ToString().ToUpper() == "CR").Sum(x => Convert.ToDecimal(x.voucher.amount));
            var totalDebAmount = letter.Vouchers.Where(x => x.voucher.documentType.ToString().ToUpper() == "DR").Sum(x => Convert.ToDecimal(x.voucher.amount));

            var footerRow = new FooterRow
            {
                TotalCreditAmount = totalCredAmount.ToString(CultureInfo.InvariantCulture),
                TotalDebitAmount = totalDebAmount.ToString(CultureInfo.InvariantCulture),
                CreditCount = letter.Vouchers.Count(x => x.voucher.documentType.ToString().ToUpper() == "CR").ToString(),
                DebitCount = letter.Vouchers.Count(x => x.voucher.documentType.ToString().ToUpper() == "DR").ToString()
            };


            var report = new Report
            {
                HeaderInfo = headerRow,
                VoucherRows = voucherList,
                FooterInfo = footerRow
            };

            return report;

        }