Skip to content

Instantly share code, notes, and snippets.

View BrianMRO's full-sized avatar

Brian Stevens BrianMRO

  • SETECH Supply Chain Solutions, LLC
View GitHub Profile
@BrianMRO
BrianMRO / SSINToolEntry_Workflow.cs
Created February 11, 2022 17:55
SSINToolEntry Workflow via Code
using PX.Data;
using PX.Data.WorkflowAPI;
namespace SSCS.IN
{
using State = SSINTool.Statuses;
public abstract class SSINToolEntry_Workflow : PXGraphExtension<SSINToolEntry>
{
public static bool IsActive() =>
SSCSAccess.FeatureInstalled<SSCSFeaturesSet.main>();
@BrianMRO
BrianMRO / TT22API.cs
Created January 27, 2022 04:03
Team Theta 2022 - Acumatica Centurion - API Calls
using System;
using PX.Data;
using Cloudmersive.APIClient.NET.ImageRecognition.Api;
using Cloudmersive.APIClient.NET.ImageRecognition.Model;
using Cloudmersive.APIClient.NET.VirusScan.Api;
using Cloudmersive.APIClient.NET.VirusScan.Model;
using IRConfiguration = Cloudmersive.APIClient.NET.ImageRecognition.Client.Configuration;
using VSConfiguration = Cloudmersive.APIClient.NET.VirusScan.Client.Configuration;
@BrianMRO
BrianMRO / TT22UploadFileMaintenanceExtension.cs
Created January 27, 2022 03:48
Team Theta 2022 - Acumatica Centurion - UploadFileMaintenanceExtension
using PX.Data;
using PX.SM;
namespace TeamTheta.TT
{
public class UploadFileMaintenanceExtension :PXGraphExtension<UploadFileMaintenance>
{
#region IsActive
public static bool IsActive()
{
@BrianMRO
BrianMRO / Replenishment_DetermineQty_Modified.cs
Last active December 29, 2021 23:01
Prepare Replenishment - Determine Qty (Modified)
public class INReplenishmentCreate_Extension : PXGraphExtension<INReplenishmentCreate>...
public delegate void OnRoundQtyByVendorDelegate(INReplenishmentItem rec, decimal qty);
[PXOverride]
public virtual decimal OnRoundQtyByVendor(INReplenishmentItem rec, decimal qty, OnRoundQtyByVendorDelegate del)
{
// DO NOT INVOKE BASE... THIS IS REPLACING TO FIX MULTIPLE OF LOT SIZE ORDERING OVER MAX
//return del.Invoke(rec, qty);
@BrianMRO
BrianMRO / Replenishment_DetermineQty_Standard.cs
Last active December 29, 2021 23:16
Prepare Replenishment - Determine Qty (Standard)
public class INReplenishmentCreate: PXGraph<INReplenishmentCreate>...
protected virtual decimal OnRoundQtyByVendor(INReplenishmentItem rec, decimal qty)
{
POVendorInventory vendorSettings =
FetchVendorSettings(this, rec) ?? new POVendorInventory();
if (rec.ReplenishmentMethod == INReplenishmentMethod.FixedReorder)
qty = vendorSettings.ERQ.GetValueOrDefault();
else
@BrianMRO
BrianMRO / GranularPOLines-FullCode.cs
Created October 26, 2021 14:06
Create Purchase Orders Without Merging Demand Into Single PO Lines - Full Code
#region CreatePOOrders - Replace base version (clone and inject code)
public static PXRedirectRequiredException CreatePOOrders(List<POFixedDemand> list, DateTime? PurchDate, bool extSort)
{
POOrderEntry docgraph = PXGraph.CreateInstance<POOrderEntry>();
docgraph.Views.Caches.Add(typeof(SOLineSplit3));
POSetup setup = docgraph.POSetup.Current;
DocumentList<POOrder> created = new DocumentList<POOrder>(docgraph);
Dictionary<String, DocumentList<POLine>> orderedByPlantype = new Dictionary<String, DocumentList<POLine>>();
DocumentList<POLine> ordered;
@BrianMRO
BrianMRO / GranularPOLines-AdditionsOnly.cs
Last active October 26, 2021 14:04
Create Purchase Orders Without Merging Demand Into Single PO Lines - Additions Only
#region CreatePOOrders - Replace base version (clone and inject code)
public static PXRedirectRequiredException CreatePOOrders(List<POFixedDemand> list, DateTime? PurchDate, bool extSort)
{
...
POLine line = null;
//Sales Orders to Blanket should not be grouped together
//Drop Ships to Blankets are not grouped either
@BrianMRO
BrianMRO / ApprovalAddCustomScreen.cs
Last active September 30, 2021 04:06
Approval - Add Custom Screen
using PX.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using SSCS;
namespace PX.Objects.EP
{
public class EPApprovalMapMaint_Extension : PXGraphExtension<EPApprovalMapMaint>
{
@BrianMRO
BrianMRO / ApprovalReasonForm.aspx
Created September 30, 2021 03:40
Approval Reason Form
<px:PXSmartPanel ID="panelReason" runat="server" Caption="Enter Reason" CaptionVisible="true" LoadOnDemand="true" Key="ReasonApproveRejectParams"
AutoCallBack-Enabled="true" AutoCallBack-Command="Refresh" CallBackMode-CommitChanges="True" Width="600px"
CallBackMode-PostData="Page" AcceptButtonID="btnReasonOk" CancelButtonID="btnReasonCancel" AllowResize="False">
<px:PXFormView ID="PXFormViewPanelReason" runat="server" DataSourceID="ds" CaptionVisible="False" DataMember="ReasonApproveRejectParams">
<ContentStyle BackColor="Transparent" BorderStyle="None" Width="100%" Height="100%" CssClass="" ></ContentStyle>
<Template>
<px:PXLayoutRule ID="PXLayoutRulePanelReason" runat="server" StartColumn="True" ></px:PXLayoutRule>
<px:PXPanel ID="PXPanelReason" runat="server" RenderStyle="Simple" >
<px:PXLayoutRule ID="PXLayoutRuleReason" runat="server" StartColumn="True" SuppressLabel="True" ></px:PXLayoutRule>
<px:PXTextEdit ID="edReason" runat="server" DataField="Reason" TextM
@BrianMRO
BrianMRO / RelatedAttributesAttributeTab.cs
Created September 28, 2021 19:41
Related Attributes - Attributes Tab
<px:PXTabItem Text="Attributes">
<Template>
<px:PXGrid ID="PXGridAnswers" runat="server" Caption="Attributes" DataSourceID="ds" Height="150px" MatrixMode="True" Width="420px" SkinID="Attributes">
<Levels>
<px:PXGridLevel DataKeyNames="AttributeID,EntityType,EntityID" DataMember="Answers">
<RowTemplate>
<px:PXLayoutRule runat="server" ControlSize="XM" LabelsWidth="M" StartColumn="True" ></px:PXLayoutRule>
<px:PXTextEdit ID="edParameterID" runat="server" DataField="AttributeID" Enabled="False" ></px:PXTextEdit>
<px:PXTextEdit ID="edAnswerValue" runat="server" DataField="Value" ></px:PXTextEdit>
</RowTemplate>