Beispiel #1
0
        public Account Process()
        {
            var debitAccount = this.Initialize(new Account());

            debitAccount.Data        = receiptDate.ToString("ddMM");
            debitAccount.ContaDebito = appSettings?.AccountSettings?.ContaDebito;
            debitAccount.Historico   = appSettings?.GetHistory(true);
            debitAccount.Especie     = total.ToString("0.00", InvariantCulture);
            return(debitAccount);
        }
Beispiel #2
0
        public IEnumerable <Account> Process(Receipt receipt)
        {
            var data = receipt.Recebimento.ToString("ddMM");

            var creditAccount = this.Initialize(new Account());

            creditAccount.Data         = data;
            creditAccount.Historico    = appSettings?.GetHistory(false, receipt);
            creditAccount.ContaCredito = appSettings?.GetContaCredito(receipt.Cnpj);
            creditAccount.Especie      = receipt.Liquido.ToString("0.00", InvariantCulture);
            yield return(creditAccount);

            var interest = receipt.Juros > 0;

            if (interest)
            {
                var interestAccount = this.Initialize(new Account());
                interestAccount.Data         = data;
                interestAccount.Historico    = appSettings?.GetHistory(false, receipt);
                interestAccount.Especie      = receipt.Juros.ToString("0.00", InvariantCulture);
                interestAccount.ContaCredito = appSettings?.AccountSettings?.ContaCreditoJuros;
                yield return(interestAccount);
            }
        }