Ejemplo n.º 1
0
        internal Vertex(VertexDeclaration declaration, ROW data)
        {
            System.Diagnostics.Debug.Assert(declaration.Stride == data.Count);

            _Declaration = declaration;
            _Data        = data;
        }
Ejemplo n.º 2
0
 internal Vector3 GetNormal(ROW vertex)
 {
     return(new Vector3
            (
                vertex[_NormalV3 + 0],
                vertex[_NormalV3 + 1],
                vertex[_NormalV3 + 2]
            ));
 }
Ejemplo n.º 3
0
 internal Vector3 GetPosition(ROW vertex)
 {
     return(new Vector3
            (
                vertex[_PositionV3 + 0],
                vertex[_PositionV3 + 1],
                vertex[_PositionV3 + 2]
            ));
 }
Ejemplo n.º 4
0
        public void FileManipulator_GetRealFileName_OriginalFileNameAndExistingFilenName_AreEqual()
        {
            var testData = new ROW
            {
                CustomerName     = "Avia Propeller s.r.o",
                ExistingFileName = "/Files/Upload/Edgecam/VF_HA_14R1_AVIA_V3-1-1.cgd",
                OriginalFileName = "VF_HA_14R1_AVIA_V3-1-1.cgd",
                PostName         = "HAAS VF3 YT "
            };

            Tuple <string, string> expected = new Tuple <string, string>("VF_HA_14R1_AVIA_V3-1-1.cgd", "VF_HA_14R1_AVIA_V3-1-1.cgd");
            Tuple <string, string> result   = new FileManipulator().GetRealFileName(testData);

            Assert.AreEqual(expected, result);
        }
Ejemplo n.º 5
0
    public void init(int _tile_id, COLOR _color, ROW _row, COL _col)
    {
        color   = _color;
        row     = _row;
        col     = _col;
        tile_id = _tile_id;

        //GENERATE WAYPOINTS ID

        wp_tl     = new waypoint(tile_id * 5 + 0, this);
        wp_tr     = new waypoint(tile_id * 5 + 1, this);
        wp_bl     = new waypoint(tile_id * 5 + 2, this);
        wp_br     = new waypoint(tile_id * 5 + 3, this);
        wp_center = new waypoint(tile_id * 5 + 3, this);
        //CALC POSTIONS FOR EACH WP
        wp_center.pos_x = this.gameObject.transform.position.x;
        wp_center.pos_y = this.gameObject.transform.position.z;
    }
Ejemplo n.º 6
0
        private void connect_Click(object sender, EventArgs e)
        {
            DateTime beforDT = DateTime.Now;
            string   con;

            //获取数据库信息
            con = "Server=" + server.Text.ToString()
                  + ";Database=" + database.Text.ToString()
                  + ";user id=" + username.Text.ToString()
                  + ";password="******";";
            //获取数据库信息
            con1 = new SqlConnection(con); //连接数据库
            try                            //连接异常处理
            {
                con1.Open();
            }
            catch
            {
                MessageBox.Show("Error!");
                return;
            }
            tabname = tablename.Text.ToString();        //获取目标表名
            select  = "select * from " + tabname + ";"; //构造查询
            //Console.WriteLine("123");
            myda  = new SqlDataAdapter(select, con);    //查询所有数据
            date1 = new DataSet();
            myda.Fill(date1, tabname);

            DataColumn[] keys = new DataColumn[1];
            keys[0] = date1.Tables[0].Columns["id"];
            date1.Tables[0].PrimaryKey = keys;

            dataGridView1.DataSource = date1.Tables[0];          //将dt的第 0 个表显示到 datagridview1
            ROW.Text = date1.Tables[0].Rows.Count.ToString();    //显示最大行数
            COL.Text = date1.Tables[0].Columns.Count.ToString(); //显示最大列数
            ROW.Show(); COL.Show();
            DateTime afterDT = DateTime.Now;
            TimeSpan ts      = afterDT.Subtract(beforDT);

            //MessageBox.Show("水印添加完成!");
            Console.WriteLine("DateTime总共花费{0}ms.", ts.TotalMilliseconds);
        }
Ejemplo n.º 7
0
 internal Vertex(VertexDeclaration declaration)
 {
     _Declaration = declaration;
     _Data        = new ROW(new Single[_Declaration.Stride]);
 }
Ejemplo n.º 8
0
        /// <summary>
        /// Performs the playback of actions in this module.
        /// </summary>
        /// <remarks>You should not call this method directly, instead pass the module
        /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method
        /// that will in turn invoke this method.</remarks>
        void ITestModule.Run()
        {
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.0;

            string sT5018Summary = @"C:\Users\Public\Documents\Simply Accounting\2018\Data\Summary of Contract Payments.pdf";// @"C:\Users\_sabvt\Documents\Simply Accounting\DATA\Summary of Contract Payments.pdf";

            string sInstallPath = Simply._SA_GetProgramPath();
            string sDllPath     = string.Format(@"{0}acPDFCreatorLib.Net.dll", sInstallPath);

            // Check Sage 50 pdf engine dll is installed before starting test case
            if (Functions.VerifyFileExists(sDllPath))
            {
                // Remove existing pdf file
                Functions.RemoveExistingFile(sT5018Summary);

                // Create a T5018 vendor
                VENDOR tvendor = new VENDOR();

                tvendor.name = StringFunctions.RandStr("A(9)");
                tvendor.includeFilingT5018CheckBox = true;
                PayablesLedger._SA_Create(tvendor);
                PayablesLedger._SA_Close();

                // Create an item
                ITEM       item      = new ITEM();
                ITEM_PRICE itemPrice = new ITEM_PRICE();
                itemPrice.currency            = "Canadian Dollars";
                itemPrice.priceList           = "Regular";
                itemPrice.pricePerSellingUnit = Functions.RandCashAmount();
                item.ItemPrices.Add(itemPrice);


                if (this.varItem == "")
                {
                    item.invOrServNumber = StringFunctions.RandStr("A(9)");

                    InventoryServicesLedger._SA_Create(item);
                    InventoryServicesLedger._SA_Close();
                }
                else
                {
                    item.invOrServNumber = this.varItem;
                }

                // Create purchase invoice using T5018 vendor
                PURCHASE_INVOICE purInv = new PURCHASE_INVOICE();
                purInv.Vendor      = tvendor;
                purInv.transNumber = StringFunctions.RandStr("9(8)");

                ROW firstRow = new ROW();
                firstRow.Item.invOrServNumber = item.invOrServNumber;
                firstRow.quantityReceived     = Functions.RandCashAmount(2);
                firstRow.price = Functions.RandCashAmount();
                purInv.GridRows.Add(firstRow);

                PurchasesJournal._SA_Create(purInv);
                PurchasesJournal._SA_Close();

                // Print T5018 summary to a file
                string sCraNumber = "403381601RZ0001";
                Simply._Print_T5018Summary(sCraNumber);


                // Verify printed file
                if (!Functions.VerifyFileExists(sT5018Summary))
                {
                    Functions.Verify(false, true, "Printed T5018 form found");
                }
            }
            else
            {
                Functions.Verify(false, true, "PDF engine dll file found");
            }

            // Wait 5 seconds before moving on to next testcase
            Thread.Sleep(5000);
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Performs the playback of actions in this module.
        /// </summary>
        /// <remarks>You should not call this method directly, instead pass the module
        /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method
        /// that will in turn invoke this method.</remarks>
        void ITestModule.Run()
        {
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.0;

            // Remove existing print file
            string printedInvoice = @"C:\Users\Public\Documents\Simply Accounting\2018\Data\Invoice.pdf"; // @"C:\Users\_sabvt\Documents\Simply Accounting\DATA\Invoice.pdf";

            Functions.RemoveExistingFile(printedInvoice);

            // Create a customer
            CUSTOMER cus = new CUSTOMER();

            if (this.varCustomer == "")
            {
                cus.name = "cust" + StringFunctions.RandStr("X(8)");

                ReceivablesLedger._SA_Create(cus);
                ReceivablesLedger._SA_Close();
            }
            else
            {
                cus.name = this.varCustomer;
            }


            // Create an item
            ITEM item = new ITEM();

            ITEM_PRICE itemPrice = new ITEM_PRICE();

            itemPrice.currency            = "Canadian Dollars";
            itemPrice.priceList           = "Regular";
            itemPrice.pricePerSellingUnit = Functions.RandCashAmount();
            item.ItemPrices.Add(itemPrice);

            if (this.varItem == "")
            {
                item.invOrServNumber = StringFunctions.RandStr("A(9)");
                InventoryServicesLedger._SA_Create(item);
                InventoryServicesLedger._SA_Close();
            }
            else
            {
                item.invOrServNumber = this._varItem;
            }

            // Create an invoice and print a Simply form
            SALES_INVOICE salesInv = new SALES_INVOICE();

            salesInv.Customer = cus;

            ROW firstRow = new ROW();

            firstRow.Item.invOrServNumber = item.invOrServNumber;
            firstRow.quantityShipped      = Functions.RandCashAmount(2);
            salesInv.GridRows.Add(firstRow);

            SalesJournal._SA_Create(salesInv, false);

            // Print. Install, then setup pdf printer to be default printer first
            SalesJournal._SA_PrintToFile(printedInvoice);

            // wait for file to be created
            Thread.Sleep(13000);

            // undo and close journal
            SalesJournal.UndoChanges();
            SalesJournal._SA_Close();

            // Verify file has been printed
            if (!Functions.VerifyFileExists(printedInvoice))
            {
                Functions.Verify(false, true, "Printed Simply form found");
            }
        }
Ejemplo n.º 10
0
 internal void SetNormal(ROW vertex, Vector3 value)
 {
     vertex[_NormalV3 + 0] = value.X;
     vertex[_NormalV3 + 1] = value.Y;
     vertex[_NormalV3 + 2] = value.Z;
 }
Ejemplo n.º 11
0
        /// <summary>
        /// Performs the playback of actions in this module.
        /// </summary>
        /// <remarks>You should not call this method directly, instead pass the module
        /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method
        /// that will in turn invoke this method.</remarks>
        void ITestModule.Run()
        {
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.0;

            // Create a customer
            CUSTOMER cus = new CUSTOMER();

            if (this.varCustomer == "")
            {
                cus.name = "cust" + StringFunctions.RandStr("X(8)");

                ReceivablesLedger._SA_Create(cus);
                ReceivablesLedger._SA_Close();
            }
            else
            {
                cus.name = this.varCustomer;
            }

            // Create an item to be used in invoice
            ITEM item = new ITEM();

            item.ItemPrices.Add(new ITEM_PRICE("Canadian Dollars"));
            item.ItemPrices[0].priceList           = "Regular";
            item.ItemPrices[0].pricePerSellingUnit = Functions.RandCashAmount();


            if (this.varItem == "")
            {
                item.invOrServNumber = StringFunctions.RandStr("A(9)");

                InventoryServicesLedger._SA_Create(item);
                InventoryServicesLedger._SA_Close();
            }
            else
            {
                item.invOrServNumber = this.varItem;
            }


            // Create an Invoice
            SALES_INVOICE sale = new SALES_INVOICE();

            sale.Customer = cus;

            ROW r = new ROW();

            r.Item            = item;
            r.quantityShipped = Functions.RandCashAmount(2);
            r.price           = Functions.RandCashAmount();

            sale.GridRows.Add(r);

            if (this.varSInvoice == "")
            {
                SalesJournal._SA_Create(sale);
                System.Threading.Thread.Sleep(1000);
                SalesJournal._SA_Close();
            }
            else
            {
                sale.transNumber = this.varSInvoice;
            }

            // Create a receipt
            RECEIPT receipt = new RECEIPT();

            receipt.Customer = cus;
            RECEIPT_ROW receiptRow = new RECEIPT_ROW();

            receiptRow.Invoice = sale;
            receipt.GridRows.Add(receiptRow);

            ReceiptsJournal._SA_Create(receipt);
            System.Threading.Thread.Sleep(1000);
            ReceiptsJournal._SA_Close();
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Performs the playback of actions in this module.
        /// </summary>
        /// <remarks>You should not call this method directly, instead pass the module
        /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method
        /// that will in turn invoke this method.</remarks>
        void ITestModule.Run()
        {
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.0;

            // create record to hold customer data
            CUSTOMER cus = new CUSTOMER();

            // only create a new customer if running test case alone
            if (this._varCustomer == "")
            {
                cus.name = "cust" + StringFunctions.RandStr("X(8)");

                ReceivablesLedger._SA_Create(cus);
                ReceivablesLedger._SA_Close();
            }
            else
            {
                // other wise take customer name from global variable
                cus.name = this._varCustomer;
            }

            // create item to use in invoice
            ITEM item = new ITEM();

            item.ItemPrices.Add(new ITEM_PRICE("Canadian Dollars"));
            item.ItemPrices[0].priceList           = "Regular";
            item.ItemPrices[0].pricePerSellingUnit = Functions.RandCashAmount();


            // only create a new item if running test case alone
            if (this._varItem == "")
            {
                item.invOrServNumber = StringFunctions.RandStr("A(9)");
                InventoryServicesLedger._SA_Create(item);
                InventoryServicesLedger._SA_Close();
            }
            else
            {
                item.invOrServNumber = this._varItem;
            }

            // Create an Invoice
            SALES_INVOICE sale = new SALES_INVOICE();

            sale.Customer = cus;

            ROW r = new ROW();

            r.Item            = item;
            r.quantityShipped = Functions.RandCashAmount(2);
            r.price           = Functions.RandCashAmount();

            sale.GridRows.Add(r);

            SalesJournal._SA_Create(sale);
            System.Threading.Thread.Sleep(2000);
            SalesJournal._SA_Close();

            this.varSInvoice = sale.transNumber;
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Performs the playback of actions in this module.
        /// </summary>
        /// <remarks>You should not call this method directly, instead pass the module
        /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method
        /// that will in turn invoke this method.</remarks>
        void ITestModule.Run()
        {
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.0;

            // Create a customer
            CUSTOMER cus = new CUSTOMER();

            cus.name = "cust" + StringFunctions.RandStr("X(8)");
            //cus.name = "International Oil";

            ReceivablesLedger._SA_Create(cus);
            ReceivablesLedger._SA_Close();

            // Create an item
            ITEM item = new ITEM();

            item.invOrServNumber = StringFunctions.RandStr("A(9)");
            //item.invOrServNumber = "C1020";
            item.ItemPrices.Add(new ITEM_PRICE("Canadian Dollars"));
            item.ItemPrices[0].priceList           = "Regular";
            item.ItemPrices[0].pricePerSellingUnit = Functions.RandCashAmount();

            InventoryServicesLedger._SA_Create(item);
            InventoryServicesLedger._SA_Close();

            // Create an Invoice
            SALES_INVOICE sale = new SALES_INVOICE();

            sale.Customer    = cus;
            sale.transNumber = StringFunctions.RandStr("9(8)");

            ROW r = new ROW();

            r.Item            = item;
            r.quantityShipped = Functions.RandCashAmount(2);
            r.price           = Functions.RandCashAmount();

            sale.GridRows.Add(r);

            SalesJournal._SA_Create(sale);
            System.Threading.Thread.Sleep(2000);
            SalesJournal._SA_Close();

//            // tmp
//            CUSTOMER cus = new CUSTOMER();
//            cus.name = "custYXTngnQw";
//            ITEM item = new ITEM();
//            item.invOrServNumber = "aqlUMddep";
//            SALES_INVOICE sale = new SALES_INVOICE();
//            sale.Customer = cus;
//            sale.transNumber = "15883414";
//
            // Create an receipt
            RECEIPT receipt = new RECEIPT();

            receipt.Customer = cus;
            RECEIPT_ROW row1 = new RECEIPT_ROW();

            row1.Invoice = sale;
            receipt.GridRows.Add(row1);

            ReceiptsJournal._SA_Create(receipt);
            System.Threading.Thread.Sleep(1000);
            ReceiptsJournal._SA_Close();
        }
Ejemplo n.º 14
0
        public static PURCHASE _SA_Read(PURCHASE TransRecord, bool bOneTime) //  method will read all fields and store the data in a PURCHASE record
        {
            PURCHASE Purch;

            // load it in adjustment mode first
            if (Functions.GoodData(TransRecord))        // load the transaction if specified
            {
                PurchasesJournal._SA_Open(TransRecord, true, bOneTime);
            }

            // set focus from the settings window back to the journal window
            //PurchasesJournal.Instance.Window.SetActive();

            // create the correct object based on the transaction type
            string transType = PurchasesJournal.repo.TransTypeDropDown.SelectedItemText;

            if (transType.ToLower().Contains("invoice"))
            {
                Purch = new PURCHASE_INVOICE();
            }
            else if (transType.ToLower().Contains("order"))
            {
                Purch = new PURCHASE_ORDER();
            }
            else if (transType.ToLower().Contains("quote"))
            {
                Purch = new PURCHASE_QUOTE();
            }
            else
            {
                Purch = new PURCHASE_INVOICE();
                //Functions.Verify(false, true, "Valid value from transaction list");
            }

            if (Purch.GetType() != typeof(PURCHASE_QUOTE))      // i.e. order or invoice
            {
                // Set Paid by and ChequeNumbers
                ((PURCHASE_COMMON_ORDER_INVOICE)Purch).paymentMethod = PurchasesJournal.repo.PaidBy.SelectedItemText;

                if (PurchasesJournal.repo.PaidFromInfo.Exists())
                {
                    {
                        ((PURCHASE_COMMON_ORDER_INVOICE)Purch).PaidFromAccount.acctNumber = PurchasesJournal.repo.PaidFrom.SelectedItemText;
                    }
                }
                if (PurchasesJournal.repo.ChequeNumberInfo.Exists())
                {
                    {
                        ((PURCHASE_COMMON_ORDER_INVOICE)Purch).chequeNumber = PurchasesJournal.repo.ChequeNumber.TextValue;
                    }
                }
            }
            if (Purch.GetType() == typeof(PURCHASE_INVOICE))    // set style for invoice, transaction number,  & Quote Number if present
            {
                {
                    Purch.transNumber = PurchasesJournal.repo.InvoiceNumber.TextValue;

                    if (PurchasesJournal.repo.OrderQuoteNoInfo.Exists())        // doesn't exists for one time
                    {
                        ((PURCHASE_INVOICE)Purch).quoteOrderTransNumber = PurchasesJournal.repo.OrderQuoteNoText.TextValue;
                    }
                }
            }
            else        // set transaction number and shipping date for order/quote
            {
                Purch.transNumber = PurchasesJournal.repo.OrderQuoteNoText.TextValue;
                Purch.shipDate    = PurchasesJournal.repo.ShipDate.TextValue;
            }

            Purch.Vendor.name = PurchasesJournal.repo.VendorNameText.TextValue;
            Purch.transDate   = PurchasesJournal.repo.InvoiceDate.TextValue;
            if (PurchasesJournal.repo.ExchangeRateInfo.Exists())
            {
                Purch.exchangeRate = PurchasesJournal.repo.ExchangeRate.TextValue;
            }
            if (PurchasesJournal.repo.StoreItemsAtInfo.Exists())
            {
                if (PurchasesJournal.repo.StoreItemsAt.Enabled)
                {
                    Purch.shipToLocation = PurchasesJournal.repo.StoreItemsAt.SelectedItemText;
                }
            }

            // prepare the container
            PURCH_TABLE PT = new PURCH_TABLE();
            // InitializeTable(PT);

            //int iNumOfCols = PurchasesJournal.repo.TransContainer.ColumnCount;
            //List<string[]> containerLine = ConvertFunctions.DataGridItemsToListOfString(PurchasesJournal.Instance.TransContainer.Items, iNumOfCols);
            List <List <string> > Contents = PurchasesJournal.repo.TransContainer.GetContents();

            List <ROW> lR = new List <ROW>()
            {
            };

            //for (int x = 0; x < containerLine.Count; x++)
            foreach (List <string> currRow in Contents)
            {
                // it's a blank row if the item number, quantity received, quantity ordered, description, and amount fields are all blank
                if ((currRow[PT.iItem] == "") && (currRow[PT.iQuantity] == "") && (currRow[PT.iOrder] == "") &&
                    (currRow[PT.iDescription] == "") && (currRow[PT.iAmount] == ""))
                {
                    // do not add
                }
                else
                {
                    ROW R = new ROW();

                    // assign recordset
                    R.Item.invOrServNumber = ConvertFunctions.CommaToText(currRow[PT.iItem]);
                    R.quantityReceived     = ConvertFunctions.CommaToText(currRow[PT.iQuantity]);
                    R.quantityOrdered      = ConvertFunctions.CommaToText(currRow[PT.iOrder]);
                    R.quantityBackordered  = ConvertFunctions.CommaToText(currRow[PT.iBackOrder]);
                    R.unit = ConvertFunctions.CommaToText(currRow[PT.iUnit]);
                    //R.Item.invOrServDescription = StrTran(containerLine[5+ iItmColID], "," ,"\comma") // wrong record field
                    R.description        = ConvertFunctions.CommaToText(currRow[PT.iDescription]);
                    R.price              = ConvertFunctions.CommaToText(currRow[PT.iPrice]);
                    R.TaxCode.code       = ConvertFunctions.CommaToText(currRow[PT.iTax]); // blank when no tax
                    R.amount             = ConvertFunctions.CommaToText(currRow[PT.iAmount]);
                    R.Account.acctNumber = ConvertFunctions.CommaToText(currRow[PT.iAccount]);

                    // append to detail list
                    lR.Add(R);
                }

                //// only remove if more than one line is present. NC - no longer needed so commented out
                //if(containerLine.Count >iNumOfCols)
                //{
                //    // remove line already recorded
                //    for ( int i = 0; i < iNumOfCols; i++)
                //    {
                //        containerLine.RemoveAt(1);
                //    }
                //}
                //else
                //{
                //    containerLine.RemoveAt(1);
                //}
            }

            // add rows to the record
            Purch.GridRows = lR;

            // read project allocation data
            if (Functions.GoodData(Purch.GridRows))
            {
                //PurchasesJournal.Instance.VendorName.SetFocus();    // Set focus within the journal first, or else sometimes cannot select the account field.
                for (int x = 0; x < Purch.GridRows.Count; x++)
                {
                    if (Functions.GoodData(Purch.GridRows[x].amount))                  // proceed only if amount is available
                    {
                        PurchasesJournal.repo.TransContainer.SelectCell("Account", x); // select account field
                        PurchasesJournal.repo.TransContainer.PressKeys("{Ctrl Shift}a");

                        if (ProjectAllocationDialog.repo.SelfInfo.Exists())
                        {
                            Purch.GridRows[x].Projects = ProjectAllocationDialog._SA_GetProjectAllocationDetails();   // get dialog content
                            ProjectAllocationDialog.repo.Cancel.Click();
                        }
                    }
                }
            }

            if (PurchasesJournal.repo.PrepayRefNumberInfo.Exists())
            {
                ((PURCHASE_ORDER)Purch).prepayRefNumber  = PurchasesJournal.repo.PrepayRefNumber.TextValue;
                ((PURCHASE_ORDER)Purch).prepaymentAmount = PurchasesJournal.repo.PrepaymentAmount.TextValue;
            }

            Purch.freightAmount       = PurchasesJournal.repo.FreightAmount.TextValue;
            Purch.FreightTaxCode.code = PurchasesJournal.repo.FreightCode.TextValue;
            if (PurchasesJournal.repo.FreightTaxTotalInfo.Exists())     // db has more than 2 taxes defined
            {
                Purch.freightTaxTotal = PurchasesJournal.repo.FreightTaxTotal.TextValue;
            }
            else        // only two taxes and both shown
            {
                Purch.freightTax1 = PurchasesJournal.repo.FreightTax1.TextValue;
                // will not show if only one tax is shown
                if (PurchasesJournal.repo.FreightTax2Info.Exists())
                {
                    Purch.freightTax2 = PurchasesJournal.repo.FreightTax2.TextValue;
                }
            }

            if (PurchasesJournal.repo.TermsPercentInfo.Exists())
            {
                Purch.termsPercent = PurchasesJournal.repo.TermsPercent.TextValue;
                Purch.termsDays    = PurchasesJournal.repo.TermsDay.TextValue;
                Purch.termsNetDays = PurchasesJournal.repo.TermsNetDays.TextValue;
            }
            if (PurchasesJournal.repo.EarlyDiscountInfo.Exists())
            {
                ((PURCHASE_INVOICE)Purch).earlyPaymentDiscountPercent = PurchasesJournal.repo.EarlyDiscount.TextValue;
            }
            if (Purch.GetType() == typeof(PURCHASE_INVOICE))    // set tracking
            {
                if (Functions.GoodData(Purch.shippedBy) || Functions.GoodData(Purch.trackingNumber))
                {
                    PurchasesJournal.repo.Self.PressKeys("{Ctrl}k");
                    Purch.shippedBy      = TrackShipments.repo.Shipper.SelectedItemText;
                    Purch.trackingNumber = TrackShipments.repo.TrackingNumber.TextValue;
                    TrackShipments.repo.OK.Click();
                }
            }
            return(Purch);
        }
Ejemplo n.º 15
0
        /// <summary>
        /// Performs the playback of actions in this module.
        /// </summary>
        /// <remarks>You should not call this method directly, instead pass the module
        /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method
        /// that will in turn invoke this method.</remarks>
        void ITestModule.Run()
        {
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.0;


            // create record to hold customer data
            CUSTOMER cus = new CUSTOMER();

            if (this.varCustomer == "")
            {
                cus.name = "cust" + StringFunctions.RandStr("X(8)");

                ReceivablesLedger._SA_Create(cus);
                ReceivablesLedger._SA_Close();
            }
            else
            {
                cus.name = this.varCustomer;
            }

            // create an item to use in invoice
            ITEM item = new ITEM();

            item.ItemPrices.Add(new ITEM_PRICE("Canadian Dollars"));
            item.ItemPrices[0].priceList           = "Regular";
            item.ItemPrices[0].pricePerSellingUnit = Functions.RandCashAmount();

            if (this.varCustomer == "")
            {
                item.invOrServNumber = StringFunctions.RandStr("A(9)");
                InventoryServicesLedger._SA_Create(item);
                InventoryServicesLedger._SA_Close();
            }
            else
            {
                item.invOrServNumber = this.varItem;
            }

            // Create an Invoice
            SALES_INVOICE sale = new SALES_INVOICE();

            sale.Customer = cus;



            ROW r = new ROW();

            r.Item            = item;
            r.quantityShipped = Functions.RandCashAmount(2);
            r.price           = Functions.RandCashAmount();

            sale.GridRows.Add(r);

            if (this._varSInvoice == "")
            {
                SalesJournal._SA_Create(sale);
                // sleep is setup in _SA_Close method
                SalesJournal._SA_Close();
            }
            else
            {
                sale.transNumber = this.varSInvoice;
            }

            // Adjust invoice
            ROW adjR = new ROW();

            r.quantityShipped = Functions.RandCashAmount(2);
            sale.GridRows.Add(adjR);

            SalesJournal._SA_Create(sale, true, true);
            SalesJournal._SA_Close();
        }
        /// <summary>
        /// Performs the playback of actions in this module.
        /// </summary>
        /// <remarks>You should not call this method directly, instead pass the module
        /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method
        /// that will in turn invoke this method.</remarks>
        void ITestModule.Run()
        {
            Mouse.DefaultMoveTime        = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor            = 1.0;

            // Create a vendor
            VENDOR ven = new VENDOR();

            if (this.varItem == "")
            {
                ven.name = "Vend" + StringFunctions.RandStr("X(8)");

                PayablesLedger._SA_Create(ven);
                PayablesLedger._SA_Close();
            }
            else
            {
                ven.name = this.varVendor;
            }

            // Create an item
            ITEM item = new ITEM();

            item.ItemPrices.Add(new ITEM_PRICE("Canadian Dollars"));
            item.ItemPrices[0].priceList           = "Regular";
            item.ItemPrices[0].pricePerSellingUnit = Functions.RandCashAmount();


            if (this.varItem == "")
            {
                item.invOrServNumber = StringFunctions.RandStr("A(9)");

                InventoryServicesLedger._SA_Create(item);
                InventoryServicesLedger._SA_Close();
            }
            else
            {
                item.invOrServNumber = this.varItem;
            }


            // Create an Invoice
            PURCHASE_INVOICE pi = new PURCHASE_INVOICE();

            pi.Vendor = ven;
            ROW r = new ROW();

            r.Item             = item;
            r.quantityReceived = Functions.RandCashAmount(2);
            r.price            = Functions.RandCashAmount();

            pi.GridRows.Add(r);

            if (this.varPInvoice == "")
            {
                pi.transNumber = StringFunctions.RandStr("9(8)");
                PurchasesJournal._SA_Create(pi);
                System.Threading.Thread.Sleep(2000);
                PurchasesJournal._SA_Close();
            }
            else
            {
                pi.transNumber = this.varPInvoice;
            }

            // Adjust the invoice

            pi.GridRows[0].quantityReceived = Functions.RandCashAmount(2);
            PurchasesJournal._SA_Create(pi, true, true);
            PurchasesJournal._SA_Close();
        }
Ejemplo n.º 17
0
 internal void SetPosition(ROW vertex, Vector3 value)
 {
     vertex[_PositionV3 + 0] = value.X;
     vertex[_PositionV3 + 1] = value.Y;
     vertex[_PositionV3 + 2] = value.Z;
 }