public ActionResult DeleteConfirmed(int id) { PURCHASE_ORDER pURCHASE_ORDER = db.PURCHASE_ORDER.Find(id); db.PURCHASE_ORDER.Remove(pURCHASE_ORDER); db.SaveChanges(); return(RedirectToAction("Index")); }
public int PURCHASE_ORDER_Update(PURCHASE_ORDER obj, string ID) { try { return(DataProvider.ExecuteNonquery(DataProvider.ConnectionString, "PURCHASE_ORDER_Update", ID, obj.RefDate , obj.Ref_OrgNo , obj.RefType , obj.RefStatus , obj.Status , obj.PaymentMethod , obj.TermID , obj.PaymentDate , obj.DeliveryDate , obj.Barcode , obj.Department_ID , obj.Employee_ID , obj.Stock_ID , obj.Branch_ID , obj.Contract_ID , obj.Customer_ID , obj.CustomerName , obj.CustomerAddress , obj.Contact , obj.Reason , obj.Payment , obj.Currency_ID , obj.ExchangeRate , obj.Vat , obj.VatAmount , obj.Amount , obj.FAmount , obj.DiscountDate , obj.DiscountRate , obj.Discount , obj.OtherDiscount , obj.Charge , obj.IsClose , obj.Description , obj.Sorted , obj.User_ID , obj.Createdate , obj.CreateBy , obj.ModifiedDate , obj.ModifiedBy , obj.Active , obj.LastEditDate , obj.CreationDate )); } catch { //throw ex; return(-1); } }
public ActionResult Edit([Bind(Include = "ID,NGAY_ORDER,THOI_GIAN_YEU_CAU_CUA_KINH_DOANH,MA_HANG_HT,TINH_TRANG,GIA_BAN,GIA_NHAP,CHENH_LECH,MA_NHOM_HANG,SL_NHAP,SL_THUC_NHAN,NGAY_HANG_VE,KINH_DOANH_BAN,GHI_CHU")] PURCHASE_ORDER pURCHASE_ORDER) { if (ModelState.IsValid) { db.Entry(pURCHASE_ORDER).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.MA_NHOM_HANG = new SelectList(db.PRODUCT_CATEGORIES, "MA_NHOM_HANG", "TEN_NHOM_HANG", pURCHASE_ORDER.MA_NHOM_HANG); ViewBag.MA_HANG_HT = new SelectList(db.PRODUCTS, "MA_HANG_HT", "MA_HANG_NHAP", pURCHASE_ORDER.MA_HANG_HT); ViewBag.KINH_DOANH_BAN = new SelectList(db.USERS, "USER_ID", "USERNAME", pURCHASE_ORDER.KINH_DOANH_BAN); return(View(pURCHASE_ORDER)); }
// GET: HopLong/PURCHASE_ORDER/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PURCHASE_ORDER pURCHASE_ORDER = db.PURCHASE_ORDER.Find(id); if (pURCHASE_ORDER == null) { return(HttpNotFound()); } return(View(pURCHASE_ORDER)); }
// GET: HopLong/PURCHASE_ORDER/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PURCHASE_ORDER pURCHASE_ORDER = db.PURCHASE_ORDER.Find(id); if (pURCHASE_ORDER == null) { return(HttpNotFound()); } ViewBag.MA_NHOM_HANG = new SelectList(db.PRODUCT_CATEGORIES, "MA_NHOM_HANG", "TEN_NHOM_HANG", pURCHASE_ORDER.MA_NHOM_HANG); ViewBag.MA_HANG_HT = new SelectList(db.PRODUCTS, "MA_HANG_HT", "MA_HANG_NHAP", pURCHASE_ORDER.MA_HANG_HT); ViewBag.KINH_DOANH_BAN = new SelectList(db.USERS, "USER_ID", "USERNAME", pURCHASE_ORDER.KINH_DOANH_BAN); return(View(pURCHASE_ORDER)); }
/// <summary> /// Validate a purchase order /// </summary> /// <returns>string - purchase order number</returns> public string validatePurchaseOrder() { string _value = promptForRename("Must provide a Lyn-Tron Purchase Order # to proceed."); //Validate that the receiver is in Visual before proceeding. var doc = new PURCHASE_ORDER(); var isValid = doc.Count(where : "WHERE ID=:0", args: _value); if (isValid != 1) { log.Error("Could not find target purchase order id: (" + targetRenamed + ") in the DB: " + ConstantsEnums.connectionStringName); throw new Exception("The Purchase Order ID you entered is not found in Raw Material Maintenance."); } else { log.Info("target file: (" + targetRenamed + ") was found in the DB: " + ConstantsEnums.connectionStringName); } return(_value); }
protected override EntityBase CreateAndBuildEntity(DataHelper.Framework.SafeDataReader dr) { PURCHASE_ORDER theEntity = new PURCHASE_ORDER(); theEntity.PK_ID = !dr.IsDBNull(0) ? dr.GetValue(0).ToString() : string.Empty; theEntity.PURCHASE_ORDER_NUMBER = !dr.IsDBNull(1) ? dr.GetValue(1).ToString() : string.Empty; theEntity.ORDER_DAY = !dr.IsDBNull(2) ? dr.GetValue(2).ToString() : string.Empty; theEntity.ORDER_MONTH = !dr.IsDBNull(3) ? dr.GetValue(3).ToString() : string.Empty; theEntity.ORDER_YEAR = !dr.IsDBNull(4) ? dr.GetValue(4).ToString() : string.Empty; theEntity.ORDER_DATE = !dr.IsDBNull(5) ? dr.GetValue(5).ToString() : string.Empty; theEntity.ORDER_FISCALYEAR = !dr.IsDBNull(6) ? dr.GetValue(6).ToString() : string.Empty; theEntity.SUPPLIER_ID = !dr.IsDBNull(7) ? dr.GetValue(7).ToString() : string.Empty; theEntity.DELIVERY_DATE = !dr.IsDBNull(8) ? dr.GetValue(8).ToString() : string.Empty; theEntity.DELIVERY_PLACE = !dr.IsDBNull(9) ? dr.GetValue(9).ToString() : string.Empty; theEntity.ISSUE_BY = !dr.IsDBNull(10) ? dr.GetValue(10).ToString() : string.Empty; theEntity.DEPARTMENT_HEAD = !dr.IsDBNull(11) ? dr.GetValue(11).ToString() : string.Empty; theEntity.GRAND_TOTAL = !dr.IsDBNull(12) ? dr.GetValue(12).ToString() : string.Empty; theEntity.SUPPLIER_REPRESENTATIVE = !dr.IsDBNull(13) ? dr.GetValue(13).ToString() : string.Empty; theEntity.SUPPLY_RECEIVE_DATE = !dr.IsDBNull(14) ? dr.GetValue(14).ToString() : string.Empty; theEntity.OFFICE_CODE = !dr.IsDBNull(15) ? dr.GetValue(15).ToString() : string.Empty; return(theEntity); }
protected override IDbDataParameter[] CreateSelectParameters(EntityBase anEntity) { PURCHASE_ORDER theEntity = (PURCHASE_ORDER)anEntity; List <IDbDataParameter> cmdParams = new List <IDbDataParameter>(); if (!string.IsNullOrEmpty(theEntity.PK_ID)) { cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_PK_ID", theEntity.PK_ID)); } if (!string.IsNullOrEmpty(theEntity.PURCHASE_ORDER_NUMBER)) { cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_PURCHASE_ORDER_NUMBER", theEntity.PURCHASE_ORDER_NUMBER)); } if (!string.IsNullOrEmpty(theEntity.ORDER_DAY)) { cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_ORDER_DAY", theEntity.ORDER_DAY)); } if (!string.IsNullOrEmpty(theEntity.ORDER_MONTH)) { cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_ORDER_MONTH", theEntity.ORDER_MONTH)); } if (!string.IsNullOrEmpty(theEntity.ORDER_YEAR)) { cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_ORDER_YEAR", theEntity.ORDER_YEAR)); } if (!string.IsNullOrEmpty(theEntity.ORDER_DATE)) { cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_ORDER_DATE", theEntity.ORDER_DATE)); } if (!string.IsNullOrEmpty(theEntity.ORDER_FISCALYEAR)) { cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_ORDER_FISCALYEAR", theEntity.ORDER_FISCALYEAR)); } if (!string.IsNullOrEmpty(theEntity.SUPPLIER_ID)) { cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_SUPPLIER_ID", theEntity.SUPPLIER_ID)); } if (!string.IsNullOrEmpty(theEntity.DELIVERY_DATE)) { cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_DELIVERY_DATE", theEntity.DELIVERY_DATE)); } if (!string.IsNullOrEmpty(theEntity.DELIVERY_PLACE)) { cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_DELIVERY_PLACE", theEntity.DELIVERY_PLACE)); } if (!string.IsNullOrEmpty(theEntity.ISSUE_BY)) { cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_ISSUE_BY", theEntity.ISSUE_BY)); } if (!string.IsNullOrEmpty(theEntity.DEPARTMENT_HEAD)) { cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_DEPARTMENT_HEAD", theEntity.DEPARTMENT_HEAD)); } if (!string.IsNullOrEmpty(theEntity.GRAND_TOTAL)) { cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_GRAND_TOTAL", theEntity.GRAND_TOTAL)); } if (!string.IsNullOrEmpty(theEntity.SUPPLIER_REPRESENTATIVE)) { cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_SUPPLIER_REPRESENTATIVE", theEntity.SUPPLIER_REPRESENTATIVE)); } if (!string.IsNullOrEmpty(theEntity.SUPPLY_RECEIVE_DATE)) { cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_SUPPLY_RECEIVE_DATE", theEntity.SUPPLY_RECEIVE_DATE)); } if (!string.IsNullOrEmpty(theEntity.OFFICE_CODE)) { cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_OFFICE_CODE", theEntity.OFFICE_CODE)); } cmdParams.Add(DataAccessFactory.CreateDataParameter("Result", "")); return(cmdParams.ToArray()); }
partial void DeletePURCHASE_ORDER(PURCHASE_ORDER instance);
partial void UpdatePURCHASE_ORDER(PURCHASE_ORDER instance);
partial void InsertPURCHASE_ORDER(PURCHASE_ORDER instance);
private List <PURCHASE_ORDER> MapPURCHASE_ORDER(DataTable dt) { List <PURCHASE_ORDER> rs = new List <PURCHASE_ORDER>(); for (int i = 0; i < dt.Rows.Count; i++) { PURCHASE_ORDER obj = new PURCHASE_ORDER(); if (dt.Columns.Contains("ID")) { obj.ID = dt.Rows[i]["ID"].ToString(); } if (dt.Columns.Contains("RefDate")) { obj.RefDate = DateTime.Parse(dt.Rows[i]["RefDate"].ToString()); } if (dt.Columns.Contains("Ref_OrgNo")) { obj.Ref_OrgNo = dt.Rows[i]["Ref_OrgNo"].ToString(); } if (dt.Columns.Contains("RefType")) { obj.RefType = int.Parse(dt.Rows[i]["RefType"].ToString()); } if (dt.Columns.Contains("RefStatus")) { obj.RefStatus = int.Parse(dt.Rows[i]["RefStatus"].ToString()); } if (dt.Columns.Contains("Status")) { obj.Status = int.Parse(dt.Rows[i]["Status"].ToString()); } if (dt.Columns.Contains("PaymentMethod")) { obj.PaymentMethod = new Guid(dt.Rows[i]["PaymentMethod"].ToString()); } if (dt.Columns.Contains("TermID")) { obj.TermID = dt.Rows[i]["TermID"].ToString(); } if (dt.Columns.Contains("PaymentDate")) { obj.PaymentDate = DateTime.Parse(dt.Rows[i]["PaymentDate"].ToString()); } if (dt.Columns.Contains("DeliveryDate")) { obj.DeliveryDate = DateTime.Parse(dt.Rows[i]["DeliveryDate"].ToString()); } if (dt.Columns.Contains("Barcode")) { obj.Barcode = dt.Rows[i]["Barcode"].ToString(); } if (dt.Columns.Contains("Department_ID")) { obj.Department_ID = dt.Rows[i]["Department_ID"].ToString(); } if (dt.Columns.Contains("Employee_ID")) { obj.Employee_ID = dt.Rows[i]["Employee_ID"].ToString(); } if (dt.Columns.Contains("Stock_ID")) { obj.Stock_ID = dt.Rows[i]["Stock_ID"].ToString(); } if (dt.Columns.Contains("Branch_ID")) { obj.Branch_ID = dt.Rows[i]["Branch_ID"].ToString(); } if (dt.Columns.Contains("Contract_ID")) { obj.Contract_ID = dt.Rows[i]["Contract_ID"].ToString(); } if (dt.Columns.Contains("Customer_ID")) { obj.Customer_ID = dt.Rows[i]["Customer_ID"].ToString(); } if (dt.Columns.Contains("CustomerName")) { obj.CustomerName = dt.Rows[i]["CustomerName"].ToString(); } if (dt.Columns.Contains("CustomerAddress")) { obj.CustomerAddress = dt.Rows[i]["CustomerAddress"].ToString(); } if (dt.Columns.Contains("Contact")) { obj.Contact = dt.Rows[i]["Contact"].ToString(); } if (dt.Columns.Contains("Reason")) { obj.Reason = dt.Rows[i]["Reason"].ToString(); } if (dt.Columns.Contains("Payment")) { obj.Payment = int.Parse(dt.Rows[i]["Payment"].ToString()); } if (dt.Columns.Contains("Currency_ID")) { obj.Currency_ID = dt.Rows[i]["Currency_ID"].ToString(); } if (dt.Columns.Contains("ExchangeRate")) { obj.ExchangeRate = double.Parse(dt.Rows[i]["ExchangeRate"].ToString()); } if (dt.Columns.Contains("Vat")) { obj.Vat = int.Parse(dt.Rows[i]["Vat"].ToString()); } if (dt.Columns.Contains("VatAmount")) { obj.VatAmount = double.Parse(dt.Rows[i]["VatAmount"].ToString()); } if (dt.Columns.Contains("Amount")) { obj.Amount = double.Parse(dt.Rows[i]["Amount"].ToString()); } if (dt.Columns.Contains("FAmount")) { obj.FAmount = double.Parse(dt.Rows[i]["FAmount"].ToString()); } if (dt.Columns.Contains("DiscountDate")) { obj.DiscountDate = DateTime.Parse(dt.Rows[i]["DiscountDate"].ToString()); } if (dt.Columns.Contains("DiscountRate")) { obj.DiscountRate = double.Parse(dt.Rows[i]["DiscountRate"].ToString()); } if (dt.Columns.Contains("Discount")) { obj.Discount = double.Parse(dt.Rows[i]["Discount"].ToString()); } if (dt.Columns.Contains("OtherDiscount")) { obj.OtherDiscount = double.Parse(dt.Rows[i]["OtherDiscount"].ToString()); } if (dt.Columns.Contains("IsClose")) { obj.IsClose = bool.Parse(dt.Rows[i]["IsClose"].ToString()); } if (dt.Columns.Contains("Description")) { obj.Description = dt.Rows[i]["Description"].ToString(); } if (dt.Columns.Contains("Sorted")) { obj.Sorted = int.Parse(dt.Rows[i]["Sorted"].ToString()); } if (dt.Columns.Contains("User_ID")) { obj.User_ID = dt.Rows[i]["User_ID"].ToString(); } if (dt.Columns.Contains("Active")) { obj.Active = bool.Parse(dt.Rows[i]["Active"].ToString()); } if (dt.Columns.Contains("CreateBy")) { obj.CreateBy = dt.Rows[i]["CreateBy"].ToString(); } if (dt.Columns.Contains("Createdate")) { obj.Createdate = DateTime.Parse(dt.Rows[i]["Createdate"].ToString()); } if (dt.Columns.Contains("ModifiedBy")) { obj.ModifiedBy = dt.Rows[i]["ModifiedBy"].ToString(); } if (dt.Columns.Contains("ModifiedDate")) { obj.ModifiedDate = DateTime.Parse(dt.Rows[i]["ModifiedDate"].ToString()); } //if (dt.Columns.Contains("Timestamp")) //obj.Timestamp = DateTime.Parse(dt.Rows[i]["Timestamp"].ToString()); if (dt.Columns.Contains("LastEditDate")) { obj.LastEditDate = DateTime.Parse(dt.Rows[i]["LastEditDate"].ToString()); } if (dt.Columns.Contains("CreationDate")) { obj.CreationDate = DateTime.Parse(dt.Rows[i]["CreationDate"].ToString()); } rs.Add(obj); } return(rs); }
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); }