Skip to main content

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!

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. 


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!


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. 

 

 


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.

 


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. 


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. 


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