Solved

Bill / Ship separately setting for customers

  • 1 March 2022
  • 8 replies
  • 279 views

Userlevel 6
Badge +3

Hello,

Order types have a checkbox setting for

“Ship Separately” and “Bill Separately”

However, I do not see where we can designate this for a customer.

We have some customers who want this and some who do not and we need to control it at the customer level.

Any thoughts or guidance are appreciated!

icon

Best answer by markusray17 1 March 2022, 20:47

View original

8 replies

Userlevel 7
Badge +15

HI @ltussing03 

For this, you can override on the customer record the Bill-To Address and Ship-To Address. You can also create a second Location for a customer and use that location for Sales Orders. 

Userlevel 6
Badge +3

Kbeatty,

Thanks for the reply.  I am sorry, I do not see anywhere to set Bill Separately on the addresses/locations.

Can you please direct me to what I am missing?

Thanks again for replying!

Userlevel 7
Badge +15

Hi @ltussing03 

Apologies, I should have added screenshots for clarification.

You can Override on the Billing and Shipping of the Customer Record.

Or you can create a New Location for the customer to add on the sales orders. 

 

 

Userlevel 6
Badge +3

KBeatty,

I’m sorry, I think I didn’t explain this well.  This is the setting I want to set at the customer level instead of on the order types.  I don’t see this in any of your screen shots.

 

Userlevel 7
Badge +15

KBeatty,

I’m sorry, I think I didn’t explain this well.  This is the setting I want to set at the customer level instead of on the order types.  I don’t see this in any of your screen shots.

 

Correct, that is not currently functionality in the system. 

Userlevel 6
Badge +5

You would have to create a customization for this. Out of the box the system defaults the “Ship Separately” and “Bill Separately” values from the Order Type only.

 

You would need to create and add fields to the Customer DAC for bill/ship separately and then you would need to override the PXDefault attribute on the SOOrder DAC bill/ship separately fields to search the customer record before the order type. 

Userlevel 6
Badge +3

Thanks everyone for the replies!

For anyone looking to make this customization…

 

Add the fields to the customization project in Customer

Field Name Type
usrOverrideBillShipSeparately bool
usrShipSeparately bool
usrBillSeparately bool

 

Add the following to the customer DAC extension

namespace MyNamespace
{
public class CustomerExtension : PXCacheExtension<Customer>
{
#region UsrOverrideBillShipSeparately
public abstract class usrOverrideBillShipSeparately : BqlBool.Field<usrOverrideBillShipSeparately> { }
[PXDBBool]
[PXUIField(DisplayName = "Override")]
public virtual bool? UsrOverrideBillShipSeparately { get; set; }
#endregion

#region UsrShipSeparately
public abstract class usrShipSeparately : BqlBool.Field<usrShipSeparately> { }
[PXDBBool]
[PXUIField(DisplayName = "Ship Separately")]
public virtual bool? UsrShipSeparately { get; set; }
#endregion

#region UsrBillSeparately
public abstract class usrBillSeparately : BqlBool.Field<usrBillSeparately> { }
[PXDBBool]
[PXUIField(DisplayName = "Bill Separately")]
public virtual bool? UsrBillSeparately { get; set; }
#endregion
}
}

 

Then in the graph extension, add the RowSelected event

namespace MyNamespace
{
public class CustomerMaintExtension : PXGraphExtension<CustomerMaint>
{
protected virtual void _(Events.RowSelected<Customer> eventHandler, PXRowSelected baseHandler)
{
baseHandler?.Invoke(eventHandler.Cache, eventHandler.Args);

Customer row = eventHandler.Row;
CustomerExtension ext = row.GetExtension<CustomerExtension>();
if (row is null || ext is null) return;

PXUIFieldAttribute.SetEnabled<CustomerExtension.usrShipSeparately>(eventHandler.Cache, row, ext.UsrOverrideBillShipSeparately.GetValueOrDefault());
PXUIFieldAttribute.SetEnabled<CustomerExtension.usrBillSeparately>(eventHandler.Cache, row, ext.UsrOverrideBillShipSeparately.GetValueOrDefault());
}
}
}

 

You can then add the fields to the customer screen in the customization project

 

 

This will override the logic set per the order type settings to the settings specified in the customer.  Keep in mind this is just base logic, you may need more depending on your needs and application.

Reply


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 — 2024  Acumatica, Inc. All rights reserved