Beispiel #1
0
        private string GenerateDetailPaymentEmployees(List <Overdraft> overdrafts)
        {
            StringBuilder paymentBankFormat = new StringBuilder();

            DetailCount = 1;

            foreach (Overdraft payment in overdrafts)
            {
                RowFileCount++;
                decimal amountPayment = overdraftManager.GetNetAmount(payment);
                paymentBankFormat.AppendFormat("{0}{1}{2}{3}{4}{5}{6}{7}"
                                               , TypeRegistryDetail
                                               , RowFileCount.ToString().PadLeft(5, '0')
                                               , FormatEmployeeCode(payment.Employee.Code)
                                               , FormatEmployeeName(GetNoNullString(payment.Employee.FirstLastName).ToUpper(), MaxLengthName)
                                               , FormatEmployeeName(GetNoNullString(payment.Employee.SecondLastName).ToUpper(), MaxLengthSecondLastName)
                                               , FormatEmployeeName(GetNoNullString(payment.Employee.Name).ToUpper(), MaxLengthName)
                                               , GetNoNullString(payment.Employee.BankAccount).PadRight(16, ' ')
                                               , amountPayment.ToString("#.00").Replace(".", string.Empty).PadLeft(18, '0')
                                               );

                if (DetailCount < overdrafts.Count)
                {
                    paymentBankFormat.Append(Environment.NewLine);
                }

                DetailCount++;
            }

            return(paymentBankFormat.ToString());
        }
Beispiel #2
0
        public string GenerateLayout(List <Overdraft> overdrafts, IBankAdditionalInformation additionalInformation)
        {
            int countPayment = 1;

            StringBuilder    paymentBankFormat = new StringBuilder();
            OverdraftManager overdraftManager  = new OverdraftManager();

            foreach (Overdraft payment in overdrafts)
            {
                decimal amountPayment = overdraftManager.GetNetAmount(payment);
                paymentBankFormat.AppendFormat("{0}{1}{2}{3}{4}{5}{6}{7}"
                                               , countPayment.ToString().PadLeft(9, '0')
                                               , GetNoNullString(payment.Employee.RFC).PadRight(16, ' ')
                                               , BankAccountType
                                               , GetNoNullString(payment.Employee.BankAccount).PadRight(20, ' ')
                                               , amountPayment.ToString("#.00").Replace(".", string.Empty).PadLeft(15, '0')
                                               , FormatEmployeeName(payment.Employee.FullName)
                                               , BankDestination
                                               , BankDestination);

                paymentBankFormat.Append(Environment.NewLine);

                countPayment++;
            }

            return(paymentBankFormat.ToString());
        }
Beispiel #3
0
        public string GenerateLayout(List <Overdraft> overdrafts, IBankAdditionalInformation additionalInformation)
        {
            var banamexAdditionalInformation = (BanamexAdditionalInformation)additionalInformation;
            var total = overdraftManager.GetNetAmount(overdrafts);

            totalPaymentOverdrafts = total.ToString("#.00").Replace(".", string.Empty).PadLeft(18, '0');

            StringBuilder paymentBankFormat = new StringBuilder();

            paymentBankFormat.AppendLine(GenerateFirstHeaderRegistry(banamexAdditionalInformation));
            paymentBankFormat.AppendLine(GenerateSecondHeaderRegistry(banamexAdditionalInformation));
            paymentBankFormat.Append(GenerateDetailPaymentEmployees(overdrafts, banamexAdditionalInformation));
            paymentBankFormat.AppendLine(GenerateFooterRegistry());

            return(paymentBankFormat.ToString());
        }
        private string GenerateDetailPaymentEmployees(List <Overdraft> overdrafts, ScotiabankAdditionalInformation additionalInformation)
        {
            StringBuilder paymentBankFormat = new StringBuilder();

            detailCount = 0;
            string paymentDate = string.Format("{0:yyyyMMdd}", additionalInformation.PaymentDate);

            foreach (Overdraft payment in overdrafts)
            {
                detailCount++;
                decimal amountPayment = overdraftManager.GetNetAmount(payment);
                paymentBankFormat.AppendFormat("{0}{1}{2}{3}{4}{5}{6}{7}{8}{9}{10}{11}{12}{13}{14}{15}{16}{17}{18}{19}{20}{21}{22}{23}"
                                               , TypeRegistryDetail
                                               , AccountPaymentMethod
                                               , "00"
                                               , amountPayment.ToString("#.00").Replace(".", string.Empty).PadLeft(15, '0')
                                               , paymentDate
                                               , "01"
                                               , detailCount.ToString().PadRight(20, ' ')
                                               , "".PadRight(13, ' ')
                                               , FormatEmployeeName(payment.Employee.Name, payment.Employee.FirstLastName, payment.Employee.SecondLastName)
                                               , detailCount.ToString().PadLeft(16, '0')
                                               , "".PadLeft(10, '0')
                                               , GetNoNullString(payment.Employee.BankAccount).PadLeft(20, '0')
                                               , "00000"
                                               , "".PadRight(40, ' ')
                                               , FormatBankAccountType(GetNoNullString(payment.Employee.BankAccount))
                                               , " "
                                               , "00000"
                                               , "044"
                                               , "044"
                                               , "001"
                                               , "NOMINA".PadRight(50, ' ')
                                               , "".PadRight(60, ' ')
                                               , "".PadRight(25, '0')
                                               , "".PadRight(22, ' ')
                                               );

                paymentBankFormat.Append(Environment.NewLine);
            }

            return(paymentBankFormat.ToString());
        }
        public string GenerateLayout(List <Overdraft> overdrafts, IBankAdditionalInformation additionalInformation)
        {
            StringBuilder    paymentBankFormat = new StringBuilder();
            OverdraftManager overdraftManager  = new OverdraftManager();

            foreach (Overdraft payment in overdrafts)
            {
                decimal amountPayment = overdraftManager.GetNetAmount(payment);
                paymentBankFormat.AppendFormat("{0}{1}{2}{3}"
                                               , GetNoNullString(payment.Employee.BankAccount).PadLeft(10, '0')
                                               , amountPayment.ToString("#.00").Replace(".", string.Empty).PadLeft(13, '0')
                                               , ReferencePayment.PadRight(30, ' ')
                                               , FormatEmployeeName(payment.Employee.Name, payment.Employee.FirstLastName, payment.Employee.SecondLastName)
                                               );

                paymentBankFormat.Append(Environment.NewLine);
            }

            return(paymentBankFormat.ToString());
        }
        private string GenerateDetailPaymentEmployees(List <Overdraft> overdrafts, BanorteAdditionalInformation additionalInformation)
        {
            StringBuilder paymentBankFormat = new StringBuilder();

            OverdraftManager overdraftManager = new OverdraftManager();

            foreach (Overdraft payment in overdrafts)
            {
                decimal amountPayment = overdraftManager.GetNetAmount(payment);
                paymentBankFormat.AppendFormat("{0}{1}{2}{3}{4}"
                                               , FormatEmployeeName(payment.Employee.Name, payment.Employee.FirstLastName, payment.Employee.SecondLastName)
                                               , additionalInformation.SystemID.PadLeft(3, '0')
                                               , GetNoNullString(payment.Employee.BankAccount).PadLeft(9, '0')
                                               , amountPayment.ToString("#.00").Replace(".", string.Empty).PadLeft(14, '0')
                                               , payment.Employee.Code.PadLeft(10, '0')
                                               );

                paymentBankFormat.Append(Environment.NewLine);
            }

            return(paymentBankFormat.ToString());
        }