Skip to main content
Solved

Default non-stock unit cost to 0.00?

  • 16 May 2024
  • 6 replies
  • 80 views

I need unit cost of non-stock item to default to 0.00 on Requisitions, PO’s, etc. Currently it defaults to the last cost. Anyone know if this can be done? I haven’t found a setting. 

6 replies

Userlevel 3
Badge

I haven't found a setting for this either, but I've been working on a similar issue. Here's a snippet of the code I've been experimenting with.

Without customization, achieving the specific requirement of having the unit cost default to 0.00 for previously ordered parts might be challenging directly through settings alone (that I have found). Acumatica is designed to retain last costs and vendor-specific pricing, which generally helps maintain consistent purchasing records.

using PX.Data;
using PX.Objects.PO;
using PX.Objects.IN;

public class POOrderEntry_Extension : PXGraphExtension<POOrderEntry>
{
protected void POLine_InventoryID_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e)
{
POLine row = e.Row as POLine;
if (row == null) return;

InventoryItem item = PXSelectorAttribute.Select<InventoryItem.inventoryID>(cache, row) as InventoryItem;
if (item != null && item.StkItem == false) // Non-stock item
{
cache.SetValueExt<POLine.curyUnitCost>(row, 0.00m);
}
}
}

 

 

Userlevel 5
Badge +1

Hi @jhouser,

I have a similar situation with Stock Items (our pricing gets negotiated for every order), and solved it with a Business Event that adds a zero price to the Vendor Prices (AP.20.20.00) screen if not there already.  A little janky, but it works for us!

 

Userlevel 5
Badge +1

@craig2 Thanks, I might use that

Userlevel 3
Badge

@craig2 This is what I may need to do as well. Just trying to determine how this would be created.

 

Any chance you are willing to share your GI / Business Event?

 

I have some Non Stock Items that have a number of Vendors associated with them and I am having trouble determining the best way to trigger a business event to catch all the Non Stock Items.

Userlevel 5
Badge +1

Hey @nhorvathNAW , sure thing.  I’m weird about sharing the actual exports out of the system, but here’s a bunch of screenshots.  The basic idea on this is to proactively create a 0.00 Vendor Price whenever there’s not an entry on the list.  I may have initially used the Import Scenario to zero out the existing entries, then modified it for ongoing maintenance.

 

Join fields are:

  • bAccountID = vendorID
  • orderType = orderType, orderNbr = orderNbr
  • vendorID = vendorID, inventoryID = inventoryID
  • inventoryID = inventoryID

Probably have to fine-tune Conditions to your needs:
 

 

 

 

Hopefully that at least gets you pointed in the right direction!

Userlevel 3
Badge

@craig2 This was so helpful. I truly appreciate the time you took to include all the details and included screenshots. Thank you!!

Reply