Пример #1
0
        protected virtual void RQBiddingVendor_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
        {
            RQBiddingVendor row = (RQBiddingVendor)e.Row;

            if (row == null)
            {
                return;
            }

            if (row.EntryDate == null)
            {
                row.EntryDate = sender.Graph.Accessinfo.BusinessDate;
            }

            if (BVendor.Current != null && BVendor.Current.AllowOverrideCury == true)
            {
                RQBidding bidding = (RQBidding)this.Bidding.View.SelectSingleBound(new object[] { e.Row });
                PXUIFieldAttribute.SetEnabled <RQBiddingVendor.curyID>(sender, e.Row, bidding == null);
            }
            else
            {
                PXUIFieldAttribute.SetEnabled <RQBiddingVendor.curyID>(sender, e.Row, false);
            }

            PXUIFieldAttribute.SetEnabled <RQBiddingVendor.curyTotalQuoteExtCost>(sender, e.Row, false);
            PXUIFieldAttribute.SetEnabled <RQBiddingVendor.totalQuoteExtCost>(sender, e.Row, false);
            PXUIFieldAttribute.SetEnabled <RQBiddingVendor.totalQuoteQty>(sender, e.Row, false);

            PORemitAddress remitAddress            = this.Remit_Address.Select();
            bool           enableAddressValidation = (remitAddress != null && remitAddress.IsDefaultAddress == false && remitAddress.IsValidated == false);

            this.validateAddresses.SetEnabled(enableAddressValidation);
        }
Пример #2
0
        /// <summary>
        /// Prepare <see cref="RQRequisitionLineBidding"/> in view delegate. This is an extension point used by Lexware PriceUnit customization.
        /// </summary>
        protected virtual RQRequisitionLineBidding PrepareRQRequisitionLineBiddingInViewDelegate(PXResult <RQRequisitionLineBidding, RQBidding> item)
        {
            RQRequisitionLineBidding rqLineBidding = item;
            RQBidding bidding = item;

            bidding       = Bidding.Locate(bidding) ?? item;
            rqLineBidding = (RQRequisitionLineBidding)Lines.Cache.CreateCopy(rqLineBidding);

            FillRequisitionLineBiddingPropertiesInViewDelegate(rqLineBidding, bidding);

            rqLineBidding = Lines.Insert(rqLineBidding) ?? (RQRequisitionLineBidding)Lines.Cache.Locate(rqLineBidding);
            return(rqLineBidding);
        }
Пример #3
0
        protected virtual void RQRequisitionLineBidding_RowUpdated(PXCache sender, PXRowUpdatedEventArgs e)
        {
            if (this.Vendor.Cache.GetStatus(this.Vendor.Current) == PXEntryStatus.Notchanged ||
                this.Vendor.Cache.GetStatus(this.Vendor.Current) == PXEntryStatus.Held)
            {
                this.Vendor.Cache.SetStatus(this.Vendor.Current, PXEntryStatus.Updated);
            }

            RQRequisitionLineBidding newRow = (RQRequisitionLineBidding)e.Row;
            RQRequisitionLineBidding oldRow = (RQRequisitionLineBidding)e.OldRow;

            if (newRow.MinQty != oldRow.MinQty ||
                newRow.QuoteUnitCost != oldRow.QuoteUnitCost ||
                newRow.QuoteQty != oldRow.QuoteQty ||
                newRow.QuoteNumber != oldRow.QuoteNumber)
            {
                RQBidding bidding =
                    PXSelect <RQBidding,
                              Where <RQBidding.reqNbr, Equal <Required <RQBidding.reqNbr> >,
                                     And <RQBidding.lineNbr, Equal <Required <RQBidding.lineNbr> >,
                                          And <RQBidding.vendorID, Equal <Required <RQBidding.vendorID> >,
                                               And <RQBidding.vendorLocationID, Equal <Required <RQBidding.vendorLocationID> > > > > > > .SelectWindowed(
                        this, 0, 1,
                        Vendor.Current.ReqNbr,
                        newRow.LineNbr,
                        Vendor.Current.VendorID,
                        Vendor.Current.VendorLocationID);

                if (bidding == null)
                {
                    bidding                  = new RQBidding();
                    bidding.VendorID         = Vendor.Current.VendorID;
                    bidding.VendorLocationID = Vendor.Current.VendorLocationID;
                    bidding.ReqNbr           = Vendor.Current.ReqNbr;
                    bidding.CuryInfoID       = Vendor.Current.CuryInfoID;
                    bidding.LineNbr          = newRow.LineNbr;
                }
                else
                {
                    bidding = (RQBidding)this.Bidding.Cache.CreateCopy(bidding);
                }

                bidding.QuoteQty          = newRow.QuoteQty;
                bidding.QuoteNumber       = newRow.QuoteNumber;
                bidding.QuoteUnitCost     = newRow.QuoteUnitCost;
                bidding.CuryQuoteUnitCost = newRow.CuryQuoteUnitCost;
                bidding.MinQty            = newRow.MinQty;

                this.Bidding.Update(bidding);
            }
        }
Пример #4
0
        protected virtual void RQRequisitionLineBidding_RowUpdated(PXCache sender, PXRowUpdatedEventArgs e)
        {
            this.Vendor.Cache.MarkUpdated(this.Vendor.Current);

            RQRequisitionLineBidding newRow = (RQRequisitionLineBidding)e.Row;
            RQRequisitionLineBidding oldRow = (RQRequisitionLineBidding)e.OldRow;

            if (newRow.MinQty != oldRow.MinQty || newRow.QuoteUnitCost != oldRow.QuoteUnitCost ||
                newRow.QuoteQty != oldRow.QuoteQty || newRow.QuoteNumber != oldRow.QuoteNumber)
            {
                RQBidding bidding = GetRQBiddingOnRequisitionLineBiddingRowUpdatedEvent(newRow);
                Bidding.Update(bidding);
            }
        }
Пример #5
0
        protected virtual void RQRequisitionLineBidding_RowUpdated(PXCache cache, PXRowUpdatedEventArgs e)
        {
            RQRequisitionLineBidding newRow = (RQRequisitionLineBidding)e.Row;
            RQRequisitionLineBidding oldRow = (RQRequisitionLineBidding)e.OldRow;

            RQRequisitionLineBiddingExt newExt = (RQRequisitionLineBiddingExt)cache.GetExtension <RQRequisitionLineBiddingExt>(e.Row);
            RQRequisitionLineBiddingExt oldExt = (RQRequisitionLineBiddingExt)cache.GetExtension <RQRequisitionLineBiddingExt>(e.OldRow);

            if (newRow.MinQty != oldRow.MinQty || newRow.QuoteUnitCost != oldRow.QuoteUnitCost ||
                newRow.QuoteQty != oldRow.QuoteQty || newRow.QuoteNumber != oldRow.QuoteNumber)
            {
                RQBidding bidding = PXSelect <RQBidding,
                                              Where <RQBidding.reqNbr, Equal <Required <RQBidding.reqNbr> >,
                                                     And <RQBidding.lineNbr, Equal <Required <RQBidding.lineNbr> >,
                                                          And <RQBidding.vendorID, Equal <Required <RQBidding.vendorID> >,
                                                               And <RQBidding.vendorLocationID, Equal <Required <RQBidding.vendorLocationID> > > > > > >
                                    .SelectWindowed(Base, 0, 1,
                                                    Base.Vendor.Current.ReqNbr,
                                                    newRow.LineNbr,
                                                    Base.Vendor.Current.VendorID,
                                                    Base.Vendor.Current.VendorLocationID);

                if (bidding == null)
                {
                    bidding = new RQBidding
                    {
                        VendorID         = Base.Vendor.Current.VendorID,
                        VendorLocationID = Base.Vendor.Current.VendorLocationID,
                        ReqNbr           = Base.Vendor.Current.ReqNbr,
                        CuryInfoID       = Base.Vendor.Current.CuryInfoID,
                        LineNbr          = newRow.LineNbr
                    };
                }
                else
                {
                    bidding = (RQBidding)Base.Bidding.Cache.CreateCopy(bidding);
                }

                RQBiddingExt biddingExt = Base.Bidding.Cache.GetExtension <RQBiddingExt>(bidding);

                biddingExt.UsrInitialCost        = newExt.UsrInitialCost;
                biddingExt.UsrCuryInitialCost    = newExt.UsrCuryInitialCost;
                biddingExt.UsrCuryInitialExtCost = newExt.UsrCuryInitialExtCost;
                biddingExt.UsrInitialExtCost     = newExt.UsrInitialExtCost;

                Base.Bidding.Update(bidding);
            }
        }
Пример #6
0
        protected virtual RQRequisitionLineBidding PrepareRQRequisitionLineBiddingInViewDelegate(PXResult <RQRequisitionLineBidding, RQBidding> item)
        {
            RQRequisitionLineBidding rqLineBidding = item;
            RQBidding bidding = item;

            bidding = Base.Bidding.Locate(bidding) ?? item;
            RQBiddingExt biddingExt = Base.Bidding.Cache.GetExtension <RQBiddingExt>(bidding);

            rqLineBidding = (RQRequisitionLineBidding)this.Lines.Cache.CreateCopy(rqLineBidding);
            RQRequisitionLineBiddingExt rqLineBiddingExt = (RQRequisitionLineBiddingExt)this.Lines.Cache.GetExtension <RQRequisitionLineBiddingExt>(rqLineBidding);

            FillRequisitionLineBiddingPropertiesInViewDelegate(rqLineBidding, bidding, rqLineBiddingExt, biddingExt);

            rqLineBidding = this.Lines.Insert(rqLineBidding) ?? (RQRequisitionLineBidding)this.Lines.Cache.Locate(rqLineBidding);
            return(rqLineBidding);
        }
Пример #7
0
        /// <summary>
        /// Prepare <see cref="RQRequisitionLineBidding"/> in view delegate. This is an extension point used by Lexware PriceUnit customization.
        /// </summary>
        protected virtual RQRequisitionLineBidding PrepareRQRequisitionLineBiddingInViewDelegate(PXResult <RQRequisitionLineBidding, RQBidding> item)
        {
            RQRequisitionLineBidding rqLineBidding = item;

            if (Lines.Cache.GetStatus(rqLineBidding) != PXEntryStatus.Updated)
            {
                RQBidding bidding = item;
                FillRequisitionLineBiddingPropertiesInViewDelegate(rqLineBidding, bidding);

                if (bidding.LineID == null)
                {
                    Lines.Cache.Update(rqLineBidding);
                }
                else
                {
                    Lines.Cache.MarkUpdated(rqLineBidding);
                }
            }
            return(rqLineBidding);
        }
Пример #8
0
        protected virtual RQBidding GetRQBiddingOnRequisitionLineBiddingRowUpdatedEvent(RQRequisitionLineBidding updatedRQLineBidding)
        {
            RQBidding bidding =
                PXSelect <RQBidding,
                          Where <RQBidding.reqNbr, Equal <Required <RQBidding.reqNbr> >,
                                 And <RQBidding.lineNbr, Equal <Required <RQBidding.lineNbr> >,
                                      And <RQBidding.vendorID, Equal <Required <RQBidding.vendorID> >,
                                           And <RQBidding.vendorLocationID, Equal <Required <RQBidding.vendorLocationID> > > > > > > .SelectWindowed(
                    this, 0, 1,
                    Vendor.Current.ReqNbr,
                    updatedRQLineBidding.LineNbr,
                    Vendor.Current.VendorID,
                    Vendor.Current.VendorLocationID);

            if (bidding == null)
            {
                bidding = new RQBidding
                {
                    VendorID         = Vendor.Current.VendorID,
                    VendorLocationID = Vendor.Current.VendorLocationID,
                    ReqNbr           = Vendor.Current.ReqNbr,
                    CuryInfoID       = Vendor.Current.CuryInfoID,
                    LineNbr          = updatedRQLineBidding.LineNbr
                };
            }
            else
            {
                bidding = (RQBidding)Bidding.Cache.CreateCopy(bidding);
            }

            bidding.QuoteQty          = updatedRQLineBidding.QuoteQty;
            bidding.QuoteNumber       = updatedRQLineBidding.QuoteNumber;
            bidding.QuoteUnitCost     = updatedRQLineBidding.QuoteUnitCost;
            bidding.CuryQuoteUnitCost = updatedRQLineBidding.CuryQuoteUnitCost;
            bidding.MinQty            = updatedRQLineBidding.MinQty;
            return(bidding);
        }
        protected virtual void EnsureLine(RQRequisition row, RQRequisitionLine line, RQRequisitionLineExt lineext)
        {
            if (row.VendorID == null || row.VendorLocationID == null)
            {
                lineext.UsrPatternCost        = 0;
                lineext.UsrCuryPatternCost    = 0;
                lineext.UsrInitialCost        = 0;
                lineext.UsrCuryInitialCost    = 0;
                lineext.UsrCuryInitialExtCost = 0;
                lineext.UsrInitialExtCost     = 0;
            }
            else
            {
                PXCache   cache   = Base.Bidding.Cache;
                RQBidding bidding = PXSelect <RQBidding,
                                              Where <RQBidding.reqNbr, Equal <Required <RQBidding.reqNbr> >,
                                                     And <RQBidding.lineNbr, Equal <Required <RQBidding.lineNbr> >,
                                                          And <RQBidding.vendorID, Equal <Required <RQBidding.vendorID> >,
                                                               And <RQBidding.vendorLocationID, Equal <Required <RQBidding.vendorLocationID> > > > > > > .Select(Base, line.ReqNbr, line.LineNbr, row.VendorID, row.VendorLocationID);

                if (bidding != null)
                {
                    RQBiddingExt biddingext = bidding.GetExtension <RQBiddingExt>();

                    //Pattern
                    lineext.UsrCuryPatternCost = Tools.ConvertCurrency <RQRequisitionLine.curyInfoID>(Base.Lines.Cache, line, biddingext.UsrPatternCost ?? 0);
                    //Unit Cost
                    line.CuryEstUnitCost = Tools.ConvertCurrency <RQRequisitionLine.curyInfoID>(Base.Lines.Cache, line, bidding.QuoteUnitCost ?? 0);
                    //Ext Cost
                    line.CuryEstExtCost = Tools.ConvertCurrency <RQRequisitionLine.curyInfoID>(Base.Lines.Cache, line, bidding.QuoteExtCost ?? 0);
                    //Initial Cost
                    lineext.UsrCuryInitialCost = Tools.ConvertCurrency <RQRequisitionLine.curyInfoID>(Base.Lines.Cache, line, biddingext.UsrInitialCost ?? 0);
                    //Initial Ext Cost
                    lineext.UsrCuryInitialCost = Tools.ConvertCurrency <RQRequisitionLine.curyInfoID>(Base.Lines.Cache, line, biddingext.UsrInitialExtCost ?? 0);
                }
            }
        }
Пример #10
0
        /// <summary>
        /// Fill <see cref="RQRequisitionLineBidding"/> properties from <see cref="RQBidding"/> in view delegate. This is an extension point used by Lexware PriceUnit customization.
        /// </summary>
        /// <param name="rqLineBidding">The line bidding.</param>
        /// <param name="bidding">The bidding.</param>
        protected virtual void FillRequisitionLineBiddingPropertiesInViewDelegate(RQRequisitionLineBidding rqLineBidding, RQBidding bidding)
        {
            rqLineBidding.QuoteNumber       = bidding.QuoteNumber;
            rqLineBidding.QuoteQty          = bidding.QuoteQty ?? 0m;
            rqLineBidding.CuryInfoID        = Vendor.Current.CuryInfoID;
            rqLineBidding.CuryQuoteUnitCost = bidding.CuryQuoteUnitCost ?? 0m;
            rqLineBidding.QuoteUnitCost     = bidding.QuoteUnitCost ?? 0m;
            rqLineBidding.CuryQuoteExtCost  = bidding.CuryQuoteExtCost ?? 0m;
            rqLineBidding.QuoteExtCost      = bidding.QuoteExtCost ?? 0m;
            rqLineBidding.MinQty            = bidding.MinQty ?? 0m;

            if (bidding.CuryQuoteUnitCost == null && rqLineBidding.InventoryID != null)
            {
                string bidVendorCuryID = (string)Vendor.GetValueExt <RQBiddingVendor.curyID>(Vendor.Current);

                POItemCostManager.ItemCost cost = POItemCostManager.Fetch(this, Vendor.Current.VendorID, Vendor.Current.VendorLocationID,
                                                                          docDate: null,
                                                                          curyID: bidVendorCuryID,
                                                                          inventoryID: rqLineBidding.InventoryID,
                                                                          subItemID: rqLineBidding.SubItemID,
                                                                          siteID: null,
                                                                          uom: rqLineBidding.UOM);
                rqLineBidding.CuryQuoteUnitCost =
                    cost.Convert <RQRequisitionLineBidding.inventoryID, RQRequisitionLineBidding.curyInfoID>(this, rqLineBidding, rqLineBidding.UOM);
            }

            if (rqLineBidding.CuryQuoteUnitCost == null)
            {
                rqLineBidding.CuryQuoteUnitCost = 0m;
            }
        }
Пример #11
0
        protected virtual IEnumerable lines()
        {
            if (Vendor.Current == null || Vendor.Current.VendorLocationID == null)
            {
                yield break;
            }
            using (ReadOnlyScope scope = new ReadOnlyScope(this.Lines.Cache))
            {
                bool reset = !Bidding.Cache.IsDirty;
                PXResultset <RQRequisitionLineBidding> list =
                    PXSelectJoin <RQRequisitionLineBidding,
                                  LeftJoin <RQBidding,
                                            On <RQBidding.reqNbr, Equal <RQRequisitionLineBidding.reqNbr>,
                                                And <RQBidding.lineNbr, Equal <RQRequisitionLineBidding.lineNbr>,
                                                     And <RQBidding.vendorID, Equal <Current <RQBiddingVendor.vendorID> >,
                                                          And <RQBidding.vendorLocationID, Equal <Current <RQBiddingVendor.vendorLocationID> > > > > > >,
                                  Where <RQRequisitionLineBidding.reqNbr, Equal <Current <RQBiddingVendor.reqNbr> > > >
                    .Select(this);

                if (reset)
                {
                    this.Lines.Cache.Clear();
                }
                foreach (PXResult <RQRequisitionLineBidding, RQBidding> item in list)
                {
                    RQRequisitionLineBidding result = item;
                    RQBidding bidding = item;
                    bidding = Bidding.Locate(bidding) ?? item;

                    result                   = (RQRequisitionLineBidding)this.Lines.Cache.CreateCopy(result);
                    result.QuoteNumber       = bidding.QuoteNumber;
                    result.QuoteQty          = bidding.QuoteQty ?? 0m;
                    result.CuryInfoID        = Vendor.Current.CuryInfoID;
                    result.CuryQuoteUnitCost = bidding.CuryQuoteUnitCost ?? 0m;
                    result.QuoteUnitCost     = bidding.QuoteUnitCost ?? 0m;
                    result.CuryQuoteExtCost  = bidding.CuryQuoteExtCost ?? 0m;
                    result.QuoteExtCost      = bidding.QuoteExtCost ?? 0m;
                    result.MinQty            = bidding.MinQty ?? 0m;

                    if (bidding.CuryQuoteUnitCost == null && result.InventoryID != null)
                    {
                        POItemCostManager.ItemCost cost =
                            POItemCostManager.Fetch(this,
                                                    Vendor.Current.VendorID,
                                                    Vendor.Current.VendorLocationID, null,
                                                    (string)Vendor.GetValueExt <RQBiddingVendor.curyID>(Vendor.Current),
                                                    result.InventoryID, result.SubItemID, null, result.UOM);
                        result.CuryQuoteUnitCost =
                            cost.Convert <RQRequisitionLineBidding.inventoryID, RQRequisitionLineBidding.curyInfoID>(this, result, result.UOM);;
                    }

                    if (result.CuryQuoteUnitCost == null)
                    {
                        result.CuryQuoteUnitCost = 0m;
                    }

                    result = this.Lines.Insert(result) ?? (RQRequisitionLineBidding)this.Lines.Cache.Locate(result);
                    yield return(result);
                }
            }
        }