private void InsertAPVendorPrice(POVendorInventory inventory) { APSalesPrice price = getAPSalesPrice(inventory); if (price == null) { APSalesPrice vp = new APSalesPrice(); vp.InventoryID = inventory.InventoryID; vp.VendorID = inventory.VendorID; vp.VendorLocationID = inventory.VendorLocationID; vp.UOM = inventory.PurchaseUnit; vp.SubItemID = inventory.SubItemID; vp.CuryID = inventory.CuryID; vp.EffectiveDate = inventory.PendingDate; vp.PendingPrice = inventory.PendingPrice; vp.LastDate = inventory.EffDate; vp.SalesPrice = inventory.EffPrice; vp.LastPrice = inventory.LastPrice; vp.IsPromotionalPrice = false; vp.PendingBreakQty = 0; vp.BreakQty = 0; vp.LastBreakQty = 0; VendorPrice.Insert(vp); } }
protected virtual void POVendorInventory_RowUpdated(PXCache sender, PXRowUpdatedEventArgs e) { POVendorInventory row = (POVendorInventory)e.Row; if (row != null && row.InventoryID != null && row.SubItemID != null && row.PurchaseUnit != null) { if (!sender.ObjectsEqual <POVendorInventory.pendingDate>(e.Row, e.OldRow) || !sender.ObjectsEqual <POVendorInventory.pendingPrice>(e.Row, e.OldRow) || !sender.ObjectsEqual <POVendorInventory.effPrice>(e.Row, e.OldRow)) { APSalesPrice sp = getAPSalesPrice(row); if (sp != null) { APSalesPrice copy = PXCache <APSalesPrice> .CreateCopy(sp); copy.PendingPrice = row.PendingPrice; copy.EffectiveDate = row.PendingDate; copy.SalesPrice = row.EffPrice; copy.LastDate = row.EffDate; copy.LastPrice = row.LastPrice; VendorPrice.Update(copy); } } this.VendorCatalogue.View.RequestRefresh(); } }
protected virtual void POVendorInventory_RowDeleted(PXCache sender, PXRowDeletedEventArgs e) { POVendorInventory vendor = e.Row as POVendorInventory; APSalesPrice price = getAPSalesPrice(vendor); if (price != null) { VendorPrice.Delete(price); } this.VendorCatalogue.View.RequestRefresh(); }