Exemplo n.º 1
0
        private SAPbobsCOM.BankPages PopulateBankPages(ExtractBanking pObjExtractBanking)
        {
            mObjBankPage = (SAPbobsCOM.BankPages)mObjCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oBankPages);

            mObjBankPage.AccountCode = pObjExtractBanking.AccountCode;
            mObjBankPage.DueDate     = pObjExtractBanking.Date;
            mObjBankPage.Reference   = pObjExtractBanking.Reference;
            mObjBankPage.Memo        = pObjExtractBanking.Detail;

            if (pObjExtractBanking.DebitAmount == 0 && pObjExtractBanking.CreditAmount == 0)
            {
            }

            if (pObjExtractBanking.DebitAmount > 0)
            {
                mObjBankPage.DebitAmount = pObjExtractBanking.DebitAmount;
            }

            if (pObjExtractBanking.CreditAmount > 0)
            {
                mObjBankPage.CreditAmount = pObjExtractBanking.CreditAmount;
            }

            return(mObjBankPage);
        }
Exemplo n.º 2
0
        private IList <ExtractBanking> GetScotiaBankExtractBanking(string[] pArrStrLines)
        {
            IList <ExtractBanking> lLstObjResult = new List <ExtractBanking>();

            for (int i = 0; i < pArrStrLines.Length; i++)
            {
                ExtractBanking lObjExtractBanking = new ExtractBanking();

                string lStrFecha       = pArrStrLines[i].Substring(26, 10);
                string lStrReferencia  = pArrStrLines[i].Substring(36, 10);
                string lStrImporte     = pArrStrLines[i].Substring(46, 17);
                string lStrCargoAbono  = pArrStrLines[i].Substring(63, 5);
                string lStrSaldo       = pArrStrLines[i].Substring(68, 17);
                string lStrTransaccion = pArrStrLines[i].Substring(134, 56);

                lObjExtractBanking.AccountCode = ((SAPbouiCOM.EditText)mObjForm.Items.Item("18").Specific).Value;
                lObjExtractBanking.Date        = Convert.ToDateTime(lStrFecha);
                lObjExtractBanking.Reference   = lStrReferencia;
                lObjExtractBanking.Detail      = lStrTransaccion;
                if (lStrCargoAbono.ToUpper() == "CARGO")
                {
                    lObjExtractBanking.DebitAmount = Convert.ToDouble(lStrImporte);
                }
                else
                {
                    lObjExtractBanking.CreditAmount = Convert.ToDouble(lStrImporte);
                }
                lLstObjResult.Add(lObjExtractBanking);
            }
            return(lLstObjResult);
        }
Exemplo n.º 3
0
        private IList <ExtractBanking> GetBanamexExtractBanking(string[] pArrStrLines)
        {
            //Comentario de prueba
            IList <ExtractBanking> lLstObjResult = new List <ExtractBanking>();

            for (int i = 13; i < pArrStrLines.Length; i++)
            {
                //@"\,([^\, \" ])"
                //string[] lArrStrColumns = Regex.Split(pArrStrLines[i], "\\,([^\\,\"0-9]+)", RegexOptions.IgnorePatternWhitespace);
                /*string[] lArrColumns = pArrStrLines[i].Split(',');*/
                string[] lArrStrColumns = Regex.Split(pArrStrLines[i], ",(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)");

                ExtractBanking lObjExtractBanking = new ExtractBanking();
                lObjExtractBanking.AccountCode = ((SAPbouiCOM.EditText)mObjForm.Items.Item("18").Specific).Value;
                lObjExtractBanking.Date        = Convert.ToDateTime(lArrStrColumns[0]);
                //lObjExtractBanking.Reference = lArrStrColumns[1].Substring(0, 16).Trim();

                lObjExtractBanking.Detail = lArrStrColumns[1]; //string.Format("{0}{1}", lArrStrColumns[1].Trim(), lArrStrColumns[2].Trim());

                if (lArrStrColumns[2] != "-")
                {
                    lObjExtractBanking.CreditAmount = Convert.ToDouble(lArrStrColumns[2].Trim('"'));
                }
                else
                {
                    lObjExtractBanking.DebitAmount = Convert.ToDouble(lArrStrColumns[3].Trim('"'));
                }

                if (!(lObjExtractBanking.DebitAmount == 0 && lObjExtractBanking.CreditAmount == 0))
                {
                    lLstObjResult.Add(lObjExtractBanking);
                }

                //if (lArrStrColumns[3] != "" && lArrStrColumns[3] != "-")
                //{

                //    lObjExtractBanking.DebitAmount = Convert.ToDouble(lArrStrColumns[4].Replace("\"", ""));
                //}

                //if (lArrStrColumns[5] != "" && lArrStrColumns[5] != "-")
                //{
                //    lObjExtractBanking.CreditAmount = Convert.ToDouble(lArrStrColumns[6].Replace("\"", ""));
                //}

                //if (!(lObjExtractBanking.DebitAmount == 0 && lObjExtractBanking.CreditAmount == 0))
                //{
                //    lLstObjResult.Add(lObjExtractBanking);
                //}
            }
            return(lLstObjResult);
        }
Exemplo n.º 4
0
        private IList <ExtractBanking> GetSantanderExtractBanking(string[] pArrStrLines)
        {
            int dateValue;
            IList <ExtractBanking> lLstObjResult = new List <ExtractBanking>();

            for (int i = 0; i < pArrStrLines.Length; i++)
            {
                string[] lArrStrColumns = pArrStrLines[i].Split(',');
                if (int.TryParse(Regex.Replace(lArrStrColumns[1].ToString(), @"[^\w]", ""), out dateValue))   //valide
                {
                    ExtractBanking lObjExtractBanking = new ExtractBanking();

                    string lStrConvertFecha = Regex.Replace(lArrStrColumns[1].ToString(), @"[^\w]", "");
                    string lStrCargoAbono   = lArrStrColumns[5].ToString();
                    string lStrImporte      = lArrStrColumns[6].Replace(",", "");

                    lObjExtractBanking.AccountCode = ((SAPbouiCOM.EditText)mObjForm.Items.Item("18").Specific).Value;
                    lObjExtractBanking.Date        = DateTime.ParseExact(lStrConvertFecha, "ddMMyyyy", CultureInfo.InvariantCulture);
                    lObjExtractBanking.Reference   = Regex.Replace(lArrStrColumns[8].ToString(), @"[^\w]", "");
                    lObjExtractBanking.Detail      = Regex.Replace(lArrStrColumns[4].ToString(), @"[^\w]", " ").Trim();

                    lStrCargoAbono = lStrCargoAbono.ToArray().Contains('+') ? "ABONO" : "CARGO";

                    if (lStrCargoAbono.ToUpper() == "CARGO")
                    {
                        lObjExtractBanking.DebitAmount = Convert.ToDouble(lStrImporte);
                    }
                    else
                    {
                        lObjExtractBanking.CreditAmount = Convert.ToDouble(lStrImporte);
                    }

                    lLstObjResult.Add(lObjExtractBanking);
                }
            }
            return(lLstObjResult);
        }
Exemplo n.º 5
0
        private IList <ExtractBanking> GetBanorteExtractBanking(string[] pArrStrLines)
        {
            DateTime dateValue;
            IList <ExtractBanking> lLstObjResult = new List <ExtractBanking>();

            for (int i = 0; i < pArrStrLines.Length; i++)
            {
                string[] lArrStrColumns = pArrStrLines[i].Split('|');
                if (DateTime.TryParse(lArrStrColumns[1], out dateValue))   //valide
                {
                    ExtractBanking lObjExtractBanking = new ExtractBanking();

                    lObjExtractBanking.AccountCode  = ((SAPbouiCOM.EditText)mObjForm.Items.Item("18").Specific).Value;
                    lObjExtractBanking.Date         = Convert.ToDateTime(lArrStrColumns[1]);
                    lObjExtractBanking.Reference    = lArrStrColumns[3];
                    lObjExtractBanking.Detail       = lArrStrColumns[4];
                    lObjExtractBanking.DebitAmount  = Convert.ToDouble(Regex.Replace(lArrStrColumns[8], @"[$\,]", ""));
                    lObjExtractBanking.CreditAmount = Convert.ToDouble(Regex.Replace(lArrStrColumns[7], @"[$\,]", ""));

                    lLstObjResult.Add(lObjExtractBanking);
                }
            }
            return(lLstObjResult);
        }
Exemplo n.º 6
0
        private IList <ExtractBanking> GetBancomerExtractBanking(string[] pArrStrWords)
        {
            DateTime dateValue;
            IList <ExtractBanking> lLstObjResult = new List <ExtractBanking>();

            for (int i = 1; i < pArrStrWords.Length; i++)
            {
                string[] lArrStrColumns = pArrStrWords[i].Split('\t');

                ExtractBanking lObjExtractBanking = new ExtractBanking();

                string lStrFecha    = lArrStrColumns[0].ToString();
                string lStrConcepto = lArrStrColumns[1].ToString();

                string lStrCargo = lArrStrColumns[2].ToString();
                string lStrAbono = lArrStrColumns[3].ToString();

                lObjExtractBanking.AccountCode = ((SAPbouiCOM.EditText)mObjForm.Items.Item("18").Specific).Value;
                lObjExtractBanking.Date        = Convert.ToDateTime(lStrFecha);
                lObjExtractBanking.Detail      = lStrConcepto;
                if (lStrCargo != "")
                {
                    lObjExtractBanking.DebitAmount = Convert.ToDouble(Regex.Replace(lStrCargo, @"[$\,]", ""));
                }
                if (lStrCargo == "")
                {
                    lObjExtractBanking.DebitAmount = 0;
                }
                if (lStrAbono != "")
                {
                    lObjExtractBanking.CreditAmount = Convert.ToDouble(Regex.Replace(lStrAbono, @"[$\,]", ""));
                }
                if (lStrAbono == "")
                {
                    lObjExtractBanking.CreditAmount = 0;
                }

                lLstObjResult.Add(lObjExtractBanking);
            }
            //for (int i = 0; i < pArrStrWords.Count(); i++)
            //{
            //    if (DateTime.TryParse(pArrStrWords.Rows[i].ItemArray[0].ToString(), out dateValue))   //valide
            //    {
            //ExtractBanking lObjExtractBanking = new ExtractBanking();

            //        string lStrFecha = pArrStrWords.Rows[i].ItemArray[0].ToString();
            ////        string lStrConcepto = pArrStrWords.Rows[i].ItemArray[1].ToString();
            ////        string lStrReferencia = pArrStrWords.Rows[i].ItemArray[2].ToString();
            ////        string lStrCargo = pArrStrWords.Rows[i].ItemArray[4].ToString();
            ////        string lStrAbono = pArrStrWords.Rows[i].ItemArray[5].ToString();

            //lObjExtractBanking.AccountCode = ((SAPbouiCOM.EditText)mObjForm.Items.Item("18").Specific).Value;
            //lObjExtractBanking.Date = Convert.ToDateTime(lStrFecha);
            //lObjExtractBanking.Reference = lStrReferencia;
            //lObjExtractBanking.Detail = lStrConcepto;
            //if (lStrCargo != "")
            //    lObjExtractBanking.DebitAmount = Convert.ToDouble(Regex.Replace(lStrCargo, @"[$\,]", ""));
            //if (lStrCargo == "")
            //    lObjExtractBanking.DebitAmount = 0;
            //if (lStrAbono != "")
            //    lObjExtractBanking.CreditAmount = Convert.ToDouble(Regex.Replace(lStrAbono, @"[$\,]", ""));
            //if (lStrAbono == "")
            //    lObjExtractBanking.CreditAmount = 0;

            //        lLstObjResult.Add(lObjExtractBanking);
            //    }
            //}
            return(lLstObjResult);
        }