Esempio n. 1
0
 public static void _SA_MatchDefaultsPayment_Remit(PAYMENT_REMIT PaymentRecord)
 {
     //need to fill this in
     if (!Functions.GoodData(PaymentRecord.chequeNumber))
     {
         PaymentRecord.chequeNumber = PaymentsJournal.repo.ChequeNo.TextValue;
     }
     if (!Functions.GoodData(PaymentRecord.TransDate))
     {
         PaymentRecord.TransDate = PaymentsJournal.repo.PaymentDate.TextValue;
     }
     if (!Functions.GoodData(PaymentRecord.periodEnding))
     {
         PaymentRecord.periodEnding = PaymentsJournal.repo.EndDate.TextValue;
     }
 }
Esempio n. 2
0
        public static PAYMENT_REMIT _SA_ReadPayment_Remit(PAYMENT_REMIT PaymentToRead) //  method will read all fields and store the data in a PAYMENT_REMIT record
        {
            PAYMENT_REMIT P = new PAYMENT_REMIT();

            if (Functions.GoodData(PaymentToRead))
            {
                PaymentsJournal._SA_Open(PaymentToRead);
            }

            P.Vendor.name = PaymentsJournal.repo.VendorName.TextValue;
            if (PaymentsJournal.repo.PaidFromInfo.Exists())
            {
                P.paidFrom.acctNumber = PaymentsJournal.repo.PaidFrom.SelectedItemText;
            }
            P.chequeNumber = PaymentsJournal.repo.ChequeNo.TextValue;
            P.TransDate    = PaymentsJournal.repo.PaymentDate.TextValue;
            P.comment      = PaymentsJournal.repo.Comment.TextValue;
            P.reference    = PaymentsJournal.repo.Reference.TextValue;

            PaymentsJournal.repo.FrequencyButton.Click();
            P.remitFrequency = SelectRemittingFrequency.repo.Frequency.SelectedItemText;
            SelectRemittingFrequency.repo.Cancel.Click();

            List <List <string> > lsContents = PaymentsJournal.repo.TransContainer.GetContents();

            if (lsContents.Count > 0)
            {
                int x;
                for (x = 0; x < lsContents.Count; x++)
                {
                    PAY_REMIT_ROW PR = new PAY_REMIT_ROW();
                    PR.remitName = ConvertFunctions.BlankStringToNULL(lsContents[x][0]);
                    //if (PR.remitName == "")
                    //{
                    //    PR.remitName = null;
                    //}
                    PR.amountOwing = ConvertFunctions.BlankStringToNULL(lsContents[x][1]);
                    //if (PR.amountOwing == "")
                    //{
                    //    PR.amountOwing = null;
                    //}
                    PR.adjustAccount = ConvertFunctions.BlankStringToNULL(lsContents[x][2]);
                    //if (PR.adjustAccount == "")
                    //{
                    //    PR.adjustAccount = null;
                    //}
                    PR.adjustment = ConvertFunctions.BlankStringToNULL(lsContents[x][3]);
                    //if (PR.adjustment == "")
                    //{
                    //    PR.adjustment = null;
                    //}
                    PR.amount = ConvertFunctions.BlankStringToNULL(lsContents[x][4]);
                    //if (PR.amount == "")
                    //{
                    //    PR.amount = null;
                    //}
                    P.GridRows.Add(PR);
                }
            }
            return(P);
        }
Esempio n. 3
0
 public static void _SA_CreatePayment_Remit(PAYMENT_REMIT PaymentRecord, bool bSave)
 {
     _SA_CreatePayment_Remit(PaymentRecord, bSave, false);
 }
Esempio n. 4
0
        public static void _SA_CreatePayment_Remit(PAYMENT_REMIT PaymentRecord, bool bSave, bool bEdit)
        {
            if (!PaymentsJournal.repo.SelfInfo.Exists())
            {
                PaymentsJournal._SA_Invoke();
            }

            if (!(bEdit))
            {
                Ranorex.Report.Info(String.Format("Creating Remittance {0} ", PaymentRecord.chequeNumber));
            }
            else
            {
                Ranorex.Report.Info(String.Format("Adjusting Remittance {0} ", PaymentRecord.chequeNumber));
            }

            PaymentsJournal.repo.Transaction.Select("Pay Remittance");
            PaymentsJournal._SA_MatchDefaultsPayment_Remit(PaymentRecord);

            Common_HeaderSetup(PaymentRecord, bEdit);
            if (Functions.GoodData(PaymentRecord.reference))
            {
                PaymentsJournal.repo.Reference.TextValue = PaymentRecord.reference;
            }
            if (Functions.GoodData(PaymentRecord.periodEnding) && PaymentsJournal.repo.EndDate.Enabled)
            {
                PaymentsJournal.repo.EndDate.TextValue = PaymentRecord.periodEnding;
                // PaymentsJournal.repo.EndDate.TypeKeys("<Tab>");
            }

            if ((Functions.GoodData(PaymentRecord.remitFrequency) && PaymentsJournal.repo.FrequencyButton.Enabled))
            {
                PaymentsJournal.repo.FrequencyButton.Click();
                SelectRemittingFrequency.repo.Frequency.SelectListItem(PaymentRecord.remitFrequency);
                SelectRemittingFrequency.repo.Select.Click();
            }

            if (PaymentsJournal.repo.TransContainer.Enabled)
            {
                // get the contents in the container
                List <List <string> > lsContents = PaymentsJournal.repo.TransContainer.GetContents();

                //PaymentsJournal.Instance.TransContainer.ClickFirstCell();
                //PaymentsJournal.Instance.TransContainer.MoveRight();

                if (PaymentRecord.GridRows.Count != 0)
                {
                    for (int x = 0; x < lsContents.Count; x++)
                    {
                        PaymentsJournal.repo.TransContainer.ClickFirstCell();
                        PaymentsJournal.repo.TransContainer.MoveRight();
                        PaymentsJournal.repo.TransContainer.PressKeys("{Down " + x + "}");

                        for (int y = 0; y < PaymentRecord.GridRows.Count; y++)
                        {
                            if (Functions.GoodData(PaymentRecord.GridRows[y].remitName))
                            {
                                if (lsContents[x][0] == PaymentRecord.GridRows[y].remitName)    // enter data for the matching payroll liability
                                {
                                    if (Functions.GoodData(PaymentRecord.GridRows[y].adjustAccount))
                                    {
                                        PaymentsJournal.repo.TransContainer.PressKeys(PaymentRecord.GridRows[y].adjustAccount);
                                    }
                                    PaymentsJournal.repo.TransContainer.MoveRight();
                                    if (Functions.GoodData(PaymentRecord.GridRows[y].adjustment))
                                    {
                                        PaymentsJournal.repo.TransContainer.PressKeys(PaymentRecord.GridRows[y].adjustment);
                                    }
                                    PaymentsJournal.repo.TransContainer.MoveRight();
                                    PaymentsJournal.repo.TransContainer.PressKeys(PaymentRecord.GridRows[y].amount);
                                    PaymentsJournal.repo.TransContainer.MoveRight();
                                    break;      // go to the outter loop
                                }
                            }
                        }
                    }
                }
            }

            if (bSave)
            {
                PaymentsJournal.repo.Post.Click();
            }
        }
Esempio n. 5
0
 public static void _SA_CreatePayment_Remit(PAYMENT_REMIT PaymentRecord)
 {
     _SA_CreatePayment_Remit(PaymentRecord, true, false);
 }