Acumatica - 能够将相同序列号的物品分配给多个销售订单
创始人
2024-07-25 09:30:45
0

在Acumatica中,可以通过创建一个自定义的Inventory Allocation Rule来实现将相同序列号的物品分配给多个销售订单。

以下是一个示例代码,演示了如何在Acumatica中创建一个自定义的Inventory Allocation Rule:

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

public class CustomInventoryAllocationRule : INAllocationRule
{
    public CustomInventoryAllocationRule()
    {
        // 设置此规则的名称
        this.Name = "Custom Allocation Rule";
        
        // 设置此规则的描述
        this.Descr = "Custom rule to allocate items with the same serial number to multiple sales orders";
        
        // 设置此规则的适用条件
        this.Rule = INAllocationRuleConstants.ByInventoryID;
        
        // 设置此规则的优先级
        this.Priority = 10;
    }
    
    protected override bool CanAllocate(INItemPlan plan, INSiteLotSerial siteLotSerial)
    {
        // 检查序列号是否已分配给其他订单
        // 如果序列号已分配给其他订单,则返回false
        bool isAllocated = PXSelect>,
                                And>>>>
                            .SelectWindowed(this, 0, 1, siteLotSerial.LotSerialNbr, plan.RefNoteID)
                            .Count > 0;
        return !isAllocated;
    }
}

要使用自定义的Inventory Allocation Rule,需要在Acumatica中进行以下步骤:

  1. 在自定义的Inventory Allocation Rule代码中,根据实际需求进行修改。
  2. 将代码编译为程序集,并将程序集添加到Acumatica中。
  3. 在Acumatica中,转到Inventory Preferences页面(Inventory -> Configuration -> Inventory Preferences)。
  4. 在Inventory Preferences页面的Allocation Rules标签页中,单击“Add New Record”按钮。
  5. 在新记录中,选择自定义的Inventory Allocation Rule。
  6. 单击保存以保存更改。

完成上述步骤后,Acumatica将使用自定义的Inventory Allocation Rule来分配相同序列号的物品给多个销售订单。

相关内容

热门资讯

安装apache-beam==... 出现此错误可能是因为用户的Python版本太低,而apache-beam==2.34.0需要更高的P...
避免在粘贴双引号时向VS 20... 在粘贴双引号时向VS 2022添加反斜杠的问题通常是由于编辑器的自动转义功能引起的。为了避免这个问题...
Android Recycle... 要在Android RecyclerView中实现滑动卡片效果,可以按照以下步骤进行操作:首先,在项...
omi系统和安卓系统哪个好,揭... OMI系统和安卓系统哪个好?这个问题就像是在问“苹果和橘子哪个更甜”,每个人都有自己的答案。今天,我...
原生ios和安卓系统,原生对比... 亲爱的读者们,你是否曾好奇过,为什么你的iPhone和安卓手机在操作体验上有着天壤之别?今天,就让我...
Android - 无法确定任... 这个错误通常发生在Android项目中,表示编译Debug版本的Java代码时出现了依赖关系问题。下...
Android - NDK 预... 在Android NDK的构建过程中,LOCAL_SRC_FILES只能包含一个项目。如果需要在ND...
Akka生成Actor问题 在Akka框架中,可以使用ActorSystem对象生成Actor。但是,当我们在Actor类中尝试...
Agora-RTC-React... 出现这个错误原因是因为在 React 组件中使用,import AgoraRTC from “ago...
Alertmanager在pr... 首先,在Prometheus配置文件中,确保Alertmanager URL已正确配置。例如:ale...