Solved

Extend WMS - Add scan mode to ReceivePutAway

  • 13 February 2023
  • 2 replies
  • 282 views

Userlevel 1

Hello,
 

I am trying to add a scan mode to the Receive and Put Away screen. I've tried the guides on the help site but can't seem to get the mode redirect to work. https://help-2022r2.acumatica.com/(W(6))/Help?ScreenId=ShowWiki&pageid=365ee72f-d2f0-42fb-bdbb-315158ee5693
 

Here is the code i have so far:

using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;

using PX.Common;
using PX.Data;
using PX.Data.BQL;
using PX.Data.BQL.Fluent;
using PX.BarcodeProcessing;

using PX.Objects.Common;
using PX.Objects.IN;
using PX.Objects.IN.WMS;
using PX.Objects.PO.WMS;

namespace CWDasign
{
using WMSBase = WarehouseManagementSystem<ReceivePutAway, ReceivePutAway.Host>;


public class PrintLabelsExt : ReceivePutAway.ScanExtension
{
public static bool IsActive() => true;

[PXOverride]
public virtual IEnumerable<ScanMode<ReceivePutAway>> CreateScanModes(Func<IEnumerable<ScanMode<ReceivePutAway>>> base_CreateScanModes)
{
foreach (var mode in base_CreateScanModes())
yield return mode;

yield return new PrintLabelsMode();
}

[PXOverride]
public virtual ScanMode<ReceivePutAway> DecorateScanMode(
ScanMode<ReceivePutAway> original,
Func<ScanMode<ReceivePutAway>, ScanMode<ReceivePutAway>> base_DecorateScanMode)
{
var mode = base_DecorateScanMode(original);

if (mode is PrintLabelsMode countMode)
{
countMode
.Intercept.CreateRedirects.ByAppend(() => AllWMSRedirects.CreateFor<ReceivePutAway>());
}

return mode;
}


public sealed class PrintLabelsMode : ReceivePutAway.ScanMode
{
public const string Value = "PRTLBL";
public class value : BqlString.Constant<value> { public value() : base(PrintLabelsMode.Value) { } }

public override string Code => Value;
public override string Description => Msg.Description;



protected override IEnumerable<ScanState<ReceivePutAway>> CreateStates()
{
yield return new ReceivePutAway.ReceiveMode.ReceiptState();
yield return new WMSBase.InventoryItemState() { AlternateType = INPrimaryAlternateType.CPN };
//yield return new ConfirmState();
}

protected override IEnumerable<ScanTransition<ReceivePutAway>> CreateTransitions()
{
return StateFlow(flow => flow
.From<ReceivePutAway.ReceiveMode.ReceiptState>()
.NextTo<ReceivePutAway.InventoryItemState>());
}

protected override IEnumerable<ScanRedirect<ReceivePutAway>> CreateRedirects() => AllWMSRedirects.CreateFor<ReceivePutAway>();

protected override void ResetMode(bool fullReset)
{
base.ResetMode(fullReset);
}


#region Redirect
public new sealed class RedirectFrom<TForeignBasis> : WMSBase.RedirectFrom<TForeignBasis>.SetMode<PrintLabelsMode>
where TForeignBasis : PXGraphExtension, IBarcodeDrivenStateMachine
{
public override string Code => "PRTLBL";
public override string DisplayName => Msg.DisplayName;

private string RefNbr { get; set; }

public override bool IsPossible => true;


#region Messages
[PXLocalizable]
public abstract class Msg
{
public const string DisplayName = "Print Label";
}
#endregion

}
#endregion


#region Messages
[PXLocalizable]
new public abstract class Msg
{
public const string Description = "Print Labels";
}
#endregion
}


#region Redirect
public sealed class RedirectFrom<TForeignBasis> : WMSBase.RedirectFrom<TForeignBasis>.SetMode<PrintLabelsMode>
where TForeignBasis : PXGraphExtension, IBarcodeDrivenStateMachine
{
public override string Code => "PRTLBL";
public override string DisplayName => Msg.DisplayName;
public override bool IsPossible => true;


#region Messages
[PXLocalizable]
public abstract class Msg
{
public const string DisplayName = "Print Label";
}
#endregion

}
#endregion
}
}

 

Does anyone have some example code for adding scan modes

icon

Best answer by VidhyaHari 21 February 2023, 22:15

View original

2 replies

Userlevel 2
Badge

@etrowbridge Below are the changes that I made to your code to make it redirect to the new mode:

  1. Added RedirectFrom<> for PrintMode and overridden PrepareRedirect() and CompleteRedirect() methods.
  2. Added new Command – PrintCommand with necessary properties and Process() logic (where you can add your logic to print labels - you can also make use of the DeviceHub feature to printlabels  for which I have added the logic).
  3. Inside CreateCommands() method of the PrintMode, added the newly added PrintCommand.
  4. In ReceivePutAwayExt, overridden DecorateScanMode to append PrintMode from both ReceiveMode and PutAwayMode.
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;

using PX.Common;
using PX.Data;
using PX.Data.BQL;
using PX.Data.BQL.Fluent;
using PX.BarcodeProcessing;

using PX.Objects.Common;
using PX.Objects.AP;
using PX.Objects.IN;
using PX.Objects.IN.WMS;
using PX.Objects.IN.Overrides.INDocumentRelease;
using PX.Objects.SO.WMS;
using System.Runtime.Remoting.Messaging;

namespace PX.Objects.PO.WMS
{
using static PX.BarcodeProcessing.BarcodeDrivenStateMachine<ReceivePutAway, ReceivePutAway.Host>;
using static PX.Objects.PO.WMS.ReceivePutAway;
using WMSBase = WarehouseManagementSystem<ReceivePutAway, ReceivePutAway.Host>;

public class ReceivePutAwayExt : ReceivePutAway.ScanExtension
{
public static bool IsActive() => true;

public sealed class PrintMode : ReceivePutAway.ScanMode
{
public const string Value = "PRTLBL";
public class value : BqlString.Constant<value> { public value() : base(PrintMode.Value) { } }

//public PrintMode.Logic Body => Get<PrintMode.Logic>();

public override string Code => Value;
public override string Description => Msg.Description;

#region State Machine
protected override IEnumerable<ScanState<ReceivePutAway>> CreateStates()
{
yield return new ReceivePutAway.ReceiveMode.ReceiptState();
yield return new WMSBase.InventoryItemState() { AlternateType = INPrimaryAlternateType.CPN };
}

protected override IEnumerable<ScanTransition<ReceivePutAway>> CreateTransitions()
{
return StateFlow(flow => flow
.From<ReceivePutAway.ReceiveMode.ReceiptState>()
.NextTo<ReceivePutAway.InventoryItemState>());
}

protected override IEnumerable<ScanCommand<ReceivePutAway>> CreateCommands()
{
yield return new PrintMode.PrintCommand();
}


protected override IEnumerable<ScanRedirect<ReceivePutAway>> CreateRedirects() => AllWMSRedirects.CreateFor<ReceivePutAway>();

protected override void ResetMode(bool fullReset)
{
base.ResetMode(fullReset);

if (fullReset)
{
Basis.PONbr = null;
Basis.PrevInventoryID = null;
}
}
#endregion

#region Commands
public sealed class PrintCommand : ScanCommand
{
public override string Code => "PRINT";
public override string ButtonName => "printLabels";
public override string DisplayName => Msg.DisplayName;
protected override bool IsEnabled => true;

protected override bool Process()
{
Get<Logic>().PrintLabels(false);
return true;
}

#region Logic
public class Logic : ScanExtension
{
public virtual void PrintLabels(bool printByDeviceHub)
{
if (printByDeviceHub) // print using DeviceHub
{
var userSetup = UserSetup.For(Basis);
bool printLabels = userSetup.PrintInventoryLabelsAutomatically == true;
string printLabelsReportID = printLabels ? userSetup.InventoryLabelsReportID : null;
bool printReceipt = userSetup.PrintPurchaseReceiptAutomatically == true;

var receipt = Basis.Receipt;

var receiptGraph = PXGraph.CreateInstance<POReceiptEntry>();
receiptGraph.Document.Current = receiptGraph.Document.Search<POReceipt.receiptNbr>(receipt.ReceiptNbr, receipt.ReceiptType);
receiptGraph.releaseFromHold.Press();
receipt = receiptGraph.Document.Current;

if (PXAccess.FeatureInstalled<CS.FeaturesSet.deviceHub>())
{
var inGraph = Lazy.By(() => PXGraph.CreateInstance<INReceiptEntry>());

if (!string.IsNullOrEmpty(printLabelsReportID))
{
string inventoryRefNbr = POReceipt.PK.Find(inGraph.Value, receipt)?.InvtRefNbr;
if (inventoryRefNbr != null)
{
var reportParameters = new Dictionary<string, string>()
{
[nameof(INRegister.RefNbr)] = inventoryRefNbr
};

DeviceHubTools.PrintReportViaDeviceHub<CR.BAccount>(inGraph.Value, printLabelsReportID, reportParameters, INNotificationSource.None, null);
}
}

if (printReceipt)
{
var reportParameters = new Dictionary<string, string>()
{
[nameof(POReceipt.ReceiptType)] = receipt.ReceiptType,
[nameof(POReceipt.ReceiptNbr)] = receipt.ReceiptNbr
};

Vendor vendor = Vendor.PK.Find(inGraph.Value, receipt.VendorID);
DeviceHubTools.PrintReportViaDeviceHub(inGraph.Value, "PO646000", reportParameters, PONotificationSource.Vendor, vendor);
}
}
}
else
{
// add your logic to print labels
}
}
}
#endregion

#region Messages
[PXLocalizable]
public abstract class Msg
{
public const string DisplayName = "Print Labels";
}
#endregion
}
#endregion

#region Redirect
public sealed class RedirectFrom<TForeignBasis> : WMSBase.RedirectFrom<TForeignBasis>.SetMode<PrintMode>
where TForeignBasis : PXGraphExtension, IBarcodeDrivenStateMachine
{
public override string Code => "PRTLBL";
public override string DisplayName => Msg.DisplayName;

private string RefNbr { get; set; }

public override bool IsPossible
{
get
{
return true;
}
}

protected override bool PrepareRedirect()
{
if (Basis is ReceivePutAway rpa && rpa.RefNbr != null)
{
if (rpa.FindMode<ReceivePutAwayExt.PrintMode>().TryValidate(rpa.Receipt).By<ReceivePutAway.ReceiptState>() is Validation valid && valid.IsError == true)
{
rpa.ReportError(valid.Message, valid.MessageArgs);
return false;
}
else
RefNbr = rpa.RefNbr;
}

return true;
}

protected override void CompleteRedirect()
{
if (Basis is ReceivePutAway rpa && rpa.CurrentMode.Code != ReceivePutAway.ReturnMode.Value && this.RefNbr != null)
if (rpa.TryProcessBy(ReceivePutAway.ReceiptState.Value, RefNbr, StateSubstitutionRule.KeepAll & ~StateSubstitutionRule.KeepPositiveReports))
{
rpa.SetDefaultState();
RefNbr = null;
}
}

#region Messages
[PXLocalizable]
public abstract class Msg
{
public const string DisplayName = "Print Label";
}
#endregion
}
#endregion

#region Messages
[PXLocalizable]
public abstract class Msg
{
public const string Description = "Print Labels";
}
#endregion
}

[PXOverride]
public virtual IEnumerable<ScanMode<ReceivePutAway>> CreateScanModes(Func<IEnumerable<ScanMode<ReceivePutAway>>> base_CreateScanModes)
{
foreach (var mode in base_CreateScanModes())
yield return mode;

yield return new PrintMode();
}


[PXOverride]
public virtual ScanMode<ReceivePutAway> DecorateScanMode(ScanMode<ReceivePutAway> original, Func<ScanMode<ReceivePutAway>, ScanMode<ReceivePutAway>> base_DecorateScanMode)
{
var mode = base_DecorateScanMode(original);
if (mode is ReceivePutAway.ReceiveMode receiveMode)
{
receiveMode
.Intercept.CreateRedirects.ByAppend(() => new ScanRedirect<ReceivePutAway>[] { new PrintMode.RedirectFrom<ReceivePutAway>() });
}
if (mode is ReceivePutAway.PutAwayMode putawayMode)
{
putawayMode
.Intercept.CreateRedirects.ByAppend(() => new ScanRedirect<ReceivePutAway>[] { new PrintMode.RedirectFrom<ReceivePutAway>() });
}
return mode;
}
}
}

Kindly let me know if this helps! Thanks :) 

Userlevel 1

Here is the final working code:

using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;

using PX.Common;
using PX.Data;
using PX.Data.BQL;
using PX.Data.BQL.Fluent;
using PX.BarcodeProcessing;

using PX.Objects.AP;
using PX.Objects.IN;
using PX.Objects.IN.WMS;
using PX.SM;

namespace PX.Objects.PO.WMS
{
using static PX.BarcodeProcessing.BarcodeDrivenStateMachine<ReceivePutAway, ReceivePutAway.Host>;
using static PX.Objects.IN.WMS.INScanWarehousePath.ScanPathMode;
using WMSBase = WarehouseManagementSystem<ReceivePutAway, ReceivePutAway.Host>;

public class ReceivePutAwayExt : ReceivePutAway.ScanExtension
{
public static bool IsActive() => true;

public sealed class PrintMode : ReceivePutAway.ScanMode
{
public const string Value = "PRTLBL";

public override string Code => Value;
public override string Description => Msg.Description;

#region State Machine
protected override IEnumerable<ScanState<ReceivePutAway>> CreateStates()
{
yield return new PrintMode.POReceiptState();
yield return new PrintMode.InventoryItemState().Intercept.HandleAbsence.ByAppend((basis, barcode) =>
{
if (basis.TryProcessBy<PrintMode.POReceiptState>(barcode,
StateSubstitutionRule.KeepPositiveReports |
StateSubstitutionRule.KeepApplication))
return AbsenceHandling.Done;
return AbsenceHandling.Skipped;
});
yield return new PrintMode.PrintQtyState();
yield return new PrintMode.ConfirmState();

}

protected override IEnumerable<ScanTransition<ReceivePutAway>> CreateTransitions()
{
return StateFlow(flow => flow
.From<PrintMode.POReceiptState>()
.NextTo<PrintMode.InventoryItemState>()
.NextTo<PrintMode.PrintQtyState>());
}

protected override IEnumerable<ScanRedirect<ReceivePutAway>> CreateRedirects() => AllWMSRedirects.CreateFor<ReceivePutAway>();

protected override void ResetMode(bool fullReset)
{
base.ResetMode(fullReset);

Clear<PrintMode.POReceiptState>(when: fullReset);
Clear<PrintMode.InventoryItemState>();
Clear<PrintMode.PrintQtyState>();

if (fullReset)
{
Basis.RefNbr = null;
Basis.InventoryID = null;
Basis.Qty = null;

Basis.NoteID = null;
}
}
#endregion

#region States

public sealed class POReceiptState : WMSBase.RefNbrState<POReceipt>
{
protected override string StatePrompt => Msg.Prompt;

protected override POReceipt GetByBarcode(string barcode)
{
POReceipt receipt =
SelectFrom<POReceipt>.
LeftJoin<Vendor>.On<POReceipt.vendorID.IsEqual<Vendor.bAccountID>>.SingleTableOnly.
Where<POReceipt.receiptNbr.IsEqual<@P.AsString>>.
View.ReadOnly.Select(Basis, barcode);
return receipt;
}

protected override void Apply(POReceipt receipt)
{
Basis.ReceiptType = receipt.ReceiptType;
Basis.RefNbr = receipt.ReceiptNbr;
Basis.TranDate = receipt.ReceiptDate;
Basis.NoteID = receipt.NoteID;

Basis.Graph.Document.Current = receipt;
}

protected override void ClearState()
{
Basis.Graph.Document.Current = null;

Basis.ReceiptType = null;
Basis.RefNbr = null;
Basis.TranDate = null;
Basis.NoteID = null;
}

protected override void ReportMissing(string barcode) => Basis.ReportError(Msg.Missing, barcode);
protected override void ReportSuccess(POReceipt receipt) => Basis.ReportInfo(Msg.Ready, receipt.ReceiptNbr);

#region Messages
[PXLocalizable]
public abstract class Msg
{
public const string Prompt = "Scan the PO receipt number.";
public const string Ready = "The {0} receipt is loaded and ready to be processed.";
public const string Missing = "The {0} receipt is not found.";
public const string InvalidType = "The {0} receipt cannot be processed because it has the {1} type.";
public const string InvalidOrderType = "The {0} receipt cannot be processed because it has the {1} order type.";
public const string MultiSites = "The {0} receipt should have only one warehouse to be processed.";
public const string HasNonStockKit = "The {0} receipt cannot be processed because it contains a non-stock kit item.";
}
#endregion
}

public sealed class InventoryItemState : EntityState<InventoryItem>
{
public const string Value = "ITEM";
public override string Code => Value;
protected override string StatePrompt => Msg.Prompt;

protected override InventoryItem GetByBarcode(string barcode)
{
InventoryItem item =
SelectFrom<InventoryItem>.
InnerJoin<INItemXRef>.On<INItemXRef.FK.InventoryItem>.
Where<
INItemXRef.alternateID.IsEqual<@P.AsString>.
And<INItemXRef.alternateType.IsEqual<INAlternateType.barcode>>.
And<InventoryItem.itemStatus.IsNotIn<InventoryItemStatus.inactive, InventoryItemStatus.markedForDeletion>>>.
OrderBy<INItemXRef.alternateType.Asc>.
View.ReadOnly
.Select(Basis, barcode).FirstOrDefault();

if (item == null)
{
var inventory = IN.InventoryItem.UK.Find(Basis, barcode);
if (inventory != null && inventory.ItemStatus.IsNotIn(InventoryItemStatus.Inactive, InventoryItemStatus.MarkedForDeletion))
return inventory;
}

return item;
}

protected override Validation Validate(InventoryItem entity)
{
POReceiptLine row = SelectFrom<POReceiptLine>
.Where<POReceiptLine.receiptNbr.IsEqual<@P.AsString>
.And<POReceiptLine.receiptType.IsEqual<@P.AsString>>
.And<POReceiptLine.inventoryID.IsEqual<@P.AsInt>>>
.View.ReadOnly.Select(Basis, Basis.RefNbr, Basis.ReceiptType, entity.InventoryID).FirstOrDefault();

if (row != null)
{
return Validation.Ok;
}
else
{
return Validation.Fail(Msg.NotOnReceipt, entity.InventoryCD.Trim());
}
}


protected override void ReportMissing(string barcode) => Basis.Reporter.Error(Msg.Missing, barcode);

protected override void Apply(InventoryItem entity)
{
Basis.InventoryID = entity.InventoryID;
}
protected override void ClearState()
{
Basis.InventoryID = null;
}

protected override void ReportSuccess(InventoryItem entity) => Basis.Reporter.Info(Msg.Ready, entity.InventoryCD.Trim());

#region Messages
[PXLocalizable]
public abstract class Msg
{
public const string Prompt = "Scan the barcode of an item on the receipt.";
public const string Ready = "The {0} item is selected.";
public const string Missing = "The {0} item barcode is not found.";
public const string NotOnReceipt = "The label cannot be printed. {0} item is not found in the receipt.";
}
#endregion
}

public sealed class PrintQtyState : WMSBase.EntityState<int?>
{
public const string Value = "PRTQTY";
public class value : BqlString.Constant<value> { public value() : base(SetNextIndexState.Value) { } }

public override string Code => Value;
protected override string StatePrompt => Msg.Prompt;

protected override int? GetByBarcode(string barcode) => int.TryParse(barcode, out int qty) ? qty : (int?)null;
protected override void ReportMissing(string barcode) => Basis.ReportError(Msg.BadFormat, barcode);

protected override void Apply(int? qty) => Basis.Qty = qty;
protected override void ClearState() => Basis.Qty = null;
protected override void ReportSuccess(int? qty) => Basis.ReportInfo(Msg.Ready, qty);

#region Messages
[PXLocalizable]
public abstract class Msg
{
public const string Prompt = "Enter the label Qty.";
public const string Ready = "The print qty is set to {0}.";
public const string BadFormat = "{0} is not a valid print qty.";
}
#endregion
}

public sealed class ConfirmState : WMSBase.ConfirmationState
{
public override string Prompt => Basis.Localize(Msg.Prompt, Basis.Qty, Basis.RefNbr, Basis.SightOf<WMSScanHeader.inventoryID>());

protected override FlowStatus PerformConfirmation() => Get<Logic>().Confirm();

public class Logic : ScanExtension
{
public static bool IsActive() => true;

public virtual FlowStatus Confirm()
{
UserPreferences userPreferences = SelectFrom<UserPreferences>.Where<UserPreferences.userID.IsEqual<@P.AsGuid>>.View.Select(this.Graph, this.Graph.Accessinfo.UserID);

if (userPreferences?.DefaultPrinterID != null)
{
Dictionary<string, string> reportParameters = new Dictionary<string, string>();
reportParameters["ReceiptNbr"] = Basis.RefNbr;
reportParameters["ReceiptType"] = Basis.ReceiptType;
reportParameters["InventoryID"] = Basis.InventoryID.ToString();

PXReportRequiredException report = new PXReportRequiredException(reportParameters, "SOReports.PrintPackSlipWave");

if (report != null && PXAccess.FeatureInstalled<CS.FeaturesSet.deviceHub>())
{
PrintSettings printSettings = new PrintSettings()
{
PrinterID = userPreferences.DefaultPrinterID,
NumberOfCopies = 1,
PrintWithDeviceHub = true,
DefinePrinterManually = true
};
SMPrintJobMaint graph = PXGraph.CreateInstance<SMPrintJobMaint>();

// loop to print multiple copies
foreach (var i in Enumerable.Range(0, (int)Basis.Qty))
{
graph.CreatePrintJob(printSettings, "CW302020", reportParameters, "LabelReport");
}

Basis.DispatchNext(Msg.Prompt, Basis.Qty, Basis.RefNbr, Basis.SightOf<WMSScanHeader.inventoryID>());
return FlowStatus.Ok.WithPrompt(Msg.ItemOrReceiptPrompt);
} else
{
return FlowStatus.Fail(Msg.FailedToPrint, "Device hub is not enabled.");
}
}
else
{
return FlowStatus.Fail(Msg.FailedToPrint, "A default printer is not setup for the current user.");
}
}
}

[PXLocalizable]
new public abstract class Msg
{
public const string Prompt = "Printing {0} labels for {1}: {2}";
public const string ItemOrReceiptPrompt = "Scan the barcode of the item or the next receipt number.";
public const string FailedToPrint = "Failed to print labels: {0}";
}
}

#endregion

#region Redirect
public sealed class RedirectFrom<TForeignBasis> : WMSBase.RedirectFrom<TForeignBasis>.SetMode<PrintMode>
where TForeignBasis : PXGraphExtension, IBarcodeDrivenStateMachine
{
public override string Code => "PRTLBL";
public override string DisplayName => Msg.DisplayName;

private string RefNbr { get; set; }

public override bool IsPossible
{
get
{
return true;
}
}

protected override bool PrepareRedirect()
{
if (Basis is ReceivePutAway rpa && rpa.RefNbr != null)
{
if (rpa.FindMode<ReceivePutAwayExt.PrintMode>().TryValidate(rpa.Receipt).By<ReceivePutAway.ReceiptState>() is Validation valid && valid.IsError == true)
{
rpa.ReportError(valid.Message, valid.MessageArgs);
return false;
}
else
RefNbr = rpa.RefNbr;
}

return true;
}

protected override void CompleteRedirect()
{
if (Basis is ReceivePutAway rpa && rpa.CurrentMode.Code != ReceivePutAway.ReturnMode.Value && this.RefNbr != null)
if (rpa.TryProcessBy(ReceivePutAway.ReceiptState.Value, RefNbr, StateSubstitutionRule.KeepAll & ~StateSubstitutionRule.KeepPositiveReports))
{
rpa.SetDefaultState();
RefNbr = null;
}
}

#region Messages
[PXLocalizable]
public abstract class Msg
{
public const string DisplayName = "Print Label";
}
#endregion
}
#endregion

#region Messages
[PXLocalizable]
public abstract class Msg
{
public const string Description = "Print Labels";
}
#endregion
}

[PXOverride]
public bool get_DocumentIsEditable(Func<bool> base_DocumentIsEditable)
{
if (Base1.Header.Mode == PrintMode.Value)
{
return true;
}
else
{
return base_DocumentIsEditable();
}
}

[PXOverride]
public virtual IEnumerable<ScanMode<ReceivePutAway>> CreateScanModes(Func<IEnumerable<ScanMode<ReceivePutAway>>> base_CreateScanModes)
{
foreach (var mode in base_CreateScanModes())
yield return mode;

yield return new PrintMode();
}


[PXOverride]
public virtual ScanMode<ReceivePutAway> DecorateScanMode(ScanMode<ReceivePutAway> original, Func<ScanMode<ReceivePutAway>, ScanMode<ReceivePutAway>> base_DecorateScanMode)
{
var mode = base_DecorateScanMode(original);
if (mode is ReceivePutAway.ReceiveMode receiveMode)
{
receiveMode
.Intercept.CreateRedirects.ByAppend(() => new ScanRedirect<ReceivePutAway>[] { new PrintMode.RedirectFrom<ReceivePutAway>() });
}
if (mode is ReceivePutAway.PutAwayMode putawayMode)
{
putawayMode
.Intercept.CreateRedirects.ByAppend(() => new ScanRedirect<ReceivePutAway>[] { new PrintMode.RedirectFrom<ReceivePutAway>() });
}
return mode;
}
}
}

 

 

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