Restricting Warehouse Location based on Customer Tax Zone

  • 1 December 2020
  • 5 replies

Hello, does anyone know what part of the code chooses which locations are assigned to a shipment line?

I am trying to restrict a warehouse location to customers who have a specific Tax Zone, so that only customers who have the tax zone can have quantity allocated from that location.


There are three locations in the warehouse: A, B, and C. A and B have higher pick priority than C.

Two Tax Zones: A and B

Item 123 is stocked in each of the locations. Stock in location A can only be allocated to customers with the Tax Zone A, stock in location B can only be allocated to customers with the Tax Zone B. Stock in location C can be allocated to any customer.

Say that location A has 1 available, B has 2 available, and C has 10 available.

If a customer in Tax Zone A orders 5 of the item, then the allocation should be 1 from location A and 4 from location C. Location B should be ignored even though it has higher priority than C.


I am looking through the SOShipmentEntry graph to see how quantity is allocated. My idea was to add a field UsrTaxZoneID to the INLocation, and apply a filter to whatever process does the allocation so that only locations whose tax zone matches that of the customer are considered.


Can anyone point me to what piece of code I’ll have to modify?

5 replies

HI @maxp78 
Could you provide more details about your inventory Allocation setup,
Are you using SA (sales order with allocation) or SO (Sales order without automated allocation) …?
do your Items are lot tracked…? if so there is a possibilty one could allocate the stock in the Sales order screen rather than shipment and in Sales order screen you don’t have the ability to choose the INLocation, if you could provide more information about your setup then we can suggest a solution   

Hi @KishoK,

These items would not be lot tracked.

Single warehouse.

Assume SO, but I don’t think it matters. Either way the system will suggest INLocation when the shipment is created, won’t it?

Assume SO, but I don’t think it matters. Either way the system will suggest INLocation when the shipment is created, won’t it?

Hi @maxp78 
yes System suggest the INLocation in shipment anyway, but if your item lot tracked and your users do the allocation in SO screen, system automaticaly pick the INLocation,I asked the question to find out in which screen your users doing allocation. 

Since you already planned to tag the tax zone with location. My suggestion is 
add a PXRestrictor with the existing selector of INLocation field in SOShipline 
the current selector is 
[SOLocationAvail(typeof, typeof, typeof, typeof, typeof)]
add a Restrictor something like below
        typeof(Where<Vendor.payToVendorID, IsNull,
            Or<Vendor.bAccountID, Equal<Current<POOrder.vendorID>>>>),
you can change the where condition as per you logic and make sure Customer TaxZone id is present 
in acumatica cache when you pass it through the  Equal<Current<Customer.CTaxZone>> BQL statement.



I’ve tried adding the restrictor to the LocationID of SOShipLine. With the restrictor, I can only choose a location with the customer’s tax zone through the UI.

I’ve also added the Restrictor to the SOShipLineSplit. When I Create Shipment from a sales order, the system is throwing the Restrictor’s error message. So the system is still trying to allocate stock from a restricted location. 

I think I need to modify the CreateShipment action. I’m going to take a look at the InsertSplitsForNonLotsOnLocation method.


Hi @maxp78 

I see, since the create shipment automatically assign the INLocation why don't you  subscribe field verifying event in SOShipline and SOShipLineSplit INlocation fields, even if user choose wrong location you can correct it by processing your logic and assign the correct INLocation to e.NewValue property, 

Try to achieve the requirement with minimal customization, customizing those virtual methods give you hard time when upgrading the version, every time you have to compare the method body with new source code and update it , always use this approach as your last resort .



About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2020  Acumatica, Inc. All rights reserved