Skip to content

Instantly share code, notes, and snippets.

Sergey Marenich smarenich

Block or report user

Report or block smarenich

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View CallAutomationButton2018R1.cs
public class SOOrderEntry_Extension:PXGraphExtension<SOOrderEntry>
{
//Lets define additional button than will call automation button.
public PXAction<SOOrder> ButtonExample;
[PXButton()]
[PXUIField(DisplayName = "Button Example")]
public virtual IEnumerable buttonExample(PXAdapter adapter)
{
SOOrder order = Base.Document.Current;
@smarenich
smarenich / CashDiscountAP.cs
Last active Apr 9, 2019
Correcting Cash Discount calculation for non-inclusive taxes in AR and SO invoices and in purchase orders and AP bills.
View CashDiscountAP.cs
using PX.Data;
using PX.Objects;
using PX.Common;
using PX.Objects.GL;
using PX.Objects.CM;
using PX.Objects.CS;
using PX.Objects.TX;
using PX.Objects.CR;
using PX.Objects.CA;
View TaxPrecExtension.cs
using System;
using PX.Data;
using PX.Objects.CM;
using PX.Objects.CS;
using PX.Objects.IN;
using PX.Objects.TX;
namespace PX.Objects.AR
{
public class ARTaxExtensionAttribute : ARTaxAttribute
View ClearingSensitiveData.sql
--Specific customer data like email info, credit cards info, etc.
update PreferencesSecurity set PasswordMinLength = 3, PasswordComplexity = 0, PasswordSecurityType = 0
update users set password = '123', PasswordChangeOnNextLogin =0, PasswordNeverExpires = 1 where source = 0
delete from userfilter
Update EMailAccount set Password = '123'
UPDATE AUSchedule SET IsActive = 0
update CustomerPaymentMethodDetail set value = '' where detailid in ('CCDNUM', 'ADDLN1', 'ADDLN2', 'NAMEONCC', 'CVV')
update ccproctran set PCResponse = ''
update CCProcessingCenterDetail set Value = '1111' where DetailID='LOGINID' or DetailID = 'TRANKEY'
UPDATE TXAvalaraSetup SET Account = NULL, Licence = NULL WHERE CompanyID > 0
View RatesView.sql
IF OBJECT_ID ('dbo.[px_Rates]', 'V') IS NOT NULL
DROP VIEW [dbo].[px_Rates]
GO
CREATE VIEW [dbo].[px_Rates] AS
select FromCury.CompanyID as CompanyID, FromCury.CuryID as FromCuryID, ToCury.CuryID as ToCuryID, Date as CuryEffDate,
Coalesce((Select top 1 CuryRateID
from CurrencyRate r
where r.CuryEffDate <= Date and r.CompanyID = FromCury.CompanyID and r.FromCuryID = FromCury.CuryID and r.ToCuryID = ToCury.CuryID
order by CuryEffDate), 0) as RateID
View OnlineUsers.xml
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<data-set>
<relations format-version="3" relations-version="20180809" main-table="GIDesign" stable-sharing="True" file-name="(Name)">
<link from="GIFilter (DesignID)" to="GIDesign (DesignID)" />
<link from="GIGroupBy (DesignID)" to="GIDesign (DesignID)" />
<link from="GIMassAction (DesignID)" to="GIDesign (DesignID)" />
<link from="GIMassUpdateField (DesignID)" to="GIDesign (DesignID)" />
<link from="GINavigationScreen (DesignID)" to="GIDesign (DesignID)" />
<link from="GINavigationParameter (DesignID, ScreenID)" to="GINavigationScreen (DesignID, ScreenID)" />
<link from="GIOn (DesignID, RelationNbr)" to="GIRelation (DesignID, LineNbr)" />
View DynamicDropDown_Attribute.cs
public class SOARDocTypesListAttribute : PXStringListAttribute, IPXRowSelectedSubscriber
{
public Type _Module;
public class OrderTypesDefinition : IPrefetchable
{
public Dictionary<String, String> list = new Dictionary<String, String>();
public void Prefetch()
{
list.Clear();
View SubSelectForXML.cs
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using PX.Data;
using System.Text;
using System.Xml;
using System.IO;
using PX.Data.SQLTree;
View InterCompanyProcessing.cs
#region Processing
public static void ProcessRecords(List<ARRegister> records)
{
PXGraph graph = new PXGraph();
Boolean anyFailed = false;
foreach (ARRegister rec in records)
{
PXProcessing.SetCurrentItem(rec);
try
View MergedDAC
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using PX.Data;
using PX.Objects.AR;
using PX.Objects.GL;
using PX.Objects.CS;
using PX.Objects.CR;
using PX.Objects.SO;
You can’t perform that action at this time.