public virtual void UpdatePrice(POVendorInventoryExt item) { using (PXConnectionScope cs = new PXConnectionScope()) { using (PXTransactionScope ts = new PXTransactionScope()) { DateTime updateTime = DateTime.Now; item.LastPrice = item.EffPrice; item.EffPrice = item.PendingPrice; item.EffDate = item.PendingDate; item.PendingPrice = 0m; item.PendingDate = null; PXDatabase.Update <POVendorInventory>( new PXDataFieldAssign(typeof(POVendorInventory.lastPrice).Name, PXDbType.Decimal, item.LastPrice), new PXDataFieldAssign(typeof(POVendorInventory.effPrice).Name, PXDbType.Decimal, item.EffPrice), new PXDataFieldAssign(typeof(POVendorInventory.effDate).Name, PXDbType.DateTime, item.EffDate), new PXDataFieldAssign(typeof(POVendorInventory.pendingPrice).Name, PXDbType.Decimal, 0m), new PXDataFieldAssign(typeof(POVendorInventory.pendingDate).Name, PXDbType.DateTime, null), new PXDataFieldAssign(typeof(POVendorInventory.lastModifiedDateTime).Name, PXDbType.DateTime, updateTime), new PXDataFieldRestrict(typeof(POVendorInventory.recordID).Name, PXDbType.Int, item.RecordID) ); PXDatabase.Update <APSalesPrice>( new PXDataFieldAssign(typeof(APSalesPrice.lastPrice).Name, PXDbType.Decimal, item.LastPrice), new PXDataFieldAssign(typeof(APSalesPrice.salesPrice).Name, PXDbType.Decimal, item.EffPrice), new PXDataFieldAssign(typeof(APSalesPrice.lastDate).Name, PXDbType.DateTime, item.EffDate), new PXDataFieldAssign(typeof(APSalesPrice.pendingPrice).Name, PXDbType.Decimal, 0), new PXDataFieldAssign(typeof(APSalesPrice.effectiveDate).Name, PXDbType.DateTime, null), new PXDataFieldAssign(typeof(APSalesPrice.lastModifiedDateTime).Name, PXDbType.DateTime, updateTime), new PXDataFieldRestrict(typeof(APSalesPrice.inventoryID).Name, PXDbType.Int, item.InventoryID), new PXDataFieldRestrict(typeof(APSalesPrice.vendorID).Name, PXDbType.Int, item.VendorID), new PXDataFieldRestrict(typeof(APSalesPrice.vendorLocationID).Name, PXDbType.Int, item.VendorLocationID), new PXDataFieldRestrict(typeof(APSalesPrice.curyID).Name, PXDbType.NVarChar, item.CuryID), new PXDataFieldRestrict(typeof(APSalesPrice.uOM).Name, PXDbType.NVarChar, item.PurchaseUnit), new PXDataFieldRestrict(typeof(APSalesPrice.subItemID).Name, PXDbType.Int, item.SubItemID), new PXDataFieldRestrict(typeof(APSalesPrice.breakQty).Name, PXDbType.Decimal, 0), new PXDataFieldRestrict(typeof(APSalesPrice.pendingBreakQty).Name, PXDbType.Decimal, 0), new PXDataFieldRestrict(typeof(APSalesPrice.isPromotionalPrice).Name, PXDbType.Bit, false) ); ts.Complete(); } } }
protected static void UpdatePrice(POVendorInventoryUpdatePriceProcess graph, POVendorInventoryExt item) { graph.UpdatePrice(item); }