[Browsable(false), BusinessFieldDisplayInEditor(), Description("Sales Order Quantity (converted)"), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public decimal spxSalesOrderQty { get { decimal mSOQty = 0; // sum all open sales orders less amount shipped and return the value here // all quantities must be converted to inventory units SalesOrderDetailsBO mDetails = new SalesOrderDetailsBO(); mDetails.FillByPart_ActiveOnly(this.partindex); if (mDetails.Count > 0) { foreach (SalesOrderDetailsBO mSODetail in mDetails.GetEnumerable()) { if (mSODetail.unitindex == this.inventoryunit) { mSOQty += mSODetail.quantity; } else { mSOQty += Aspire.Model.SpxConversions.ConvertSalesToInventory(mSODetail.quantity, mSODetail.unitindex, this.inventoryunit, this.length, this.lengthunit); } } } //this.CurrentRow["colSalesOrderQty"] = mSOQty; return mSOQty; } } [Browsable(false), BusinessFieldDisplayInEditor(), Description("Work Order Quantity"), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public decimal spxWorkOrderQty { get { // calculate the amount on open work orders decimal mWOQty = 0; ProductionWorkOrdersBO mWorkOrders = new ProductionWorkOrdersBO(); mWorkOrders.FillByPart_ActiveOnly(this.partindex); if (mWorkOrders.Count > 0) { foreach (ProductionWorkOrdersBO mWOBO in mWorkOrders.GetEnumerable()) { mWOQty += mWOBO.Quantity; } } // calculate the amount produced on the open work orders decimal mProdQty = 0; ProductionWorkOrderDataBO mProdData = new ProductionWorkOrderDataBO(); mProdData.FillByPart_ActiveOnly(this.partindex); if (mProdData.Count > 0) { foreach (ProductionWorkOrderDataBO mProdBO in mProdData.GetEnumerable()) { mProdQty += mProdBO.quantity; } } // return the balance remaining on any open work orders //this.CurrentRow["colWorkOrderQty"] = mWOQty - mProdQty; return mWOQty - mProdQty; } } [Browsable(false), BusinessFieldDisplayInEditor(), Description("Required Quantity"), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public decimal spxRequiredQty { get { decimal mReqQty = 0; mReqQty = (this.minstocklevel - this.onhandqty) + (this.spxSalesOrderQty - this.spxWorkOrderQty); if (mReqQty < 0) mReqQty = 0; //this.CurrentRow["colRequiredQty"] = mReqQty; return mReqQty; } } protected override FieldPropertyDescriptor[] GetCustomBindablePropertyDescriptors() { return new MicroFour.StrataFrame.Business.FieldPropertyDescriptor[] { new MicroFour.StrataFrame.Business.ReflectionPropertyDescriptor("OnSalesOrder", typeof(PartsBO)), new MicroFour.StrataFrame.Business.ReflectionPropertyDescriptor("spxSalesOrderQty", typeof(PartsBO)), new MicroFour.StrataFrame.Business.ReflectionPropertyDescriptor("spxWorkOrderQty", typeof(PartsBO)), new MicroFour.StrataFrame.Business.ReflectionPropertyDescriptor("spxRequiredQty", typeof(PartsBO)) }; }