Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Correcting Cash Discount calculation for non-inclusive taxes in AR and SO invoices and in purchase orders and AP bills.
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;
namespace PX.Objects.AP
{
public class APInvoice_Extension : PXCacheExtension<APInvoice>
{
#region CuryClientTotal
public abstract class curyClientTotal : PX.Data.IBqlField
{
}
[PXCurrency(typeof(APInvoice.curyInfoID), typeof(APInvoice_Extension.clientTotal))]
[PXFormula(typeof(Sub<APInvoice.curyLineTotal, APInvoice.curyDiscTot>))]
public virtual Decimal? CuryClientTotal { get; set; }
#endregion
#region ClientTotal
public abstract class clientTotal : PX.Data.IBqlField { }
[PXDecimal(4)]
public virtual Decimal? ClientTotal { get; set; }
#endregion
#region TermsID
public abstract class termsID : PX.Data.IBqlField { }
[PXMergeAttributes(Method = MergeMethod.Merge)]
[Terms(typeof(APInvoice.docDate), typeof(APInvoice.dueDate), typeof(APInvoice.discDate), typeof(APInvoice_Extension.curyClientTotal), typeof(APInvoice.curyOrigDiscAmt))]
public virtual String TermsID { get; set; }
#endregion
}
}
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;
namespace PX.Objects.AR
{
public class ARInvoiceEntry_Extension : PXGraphExtension<ARInvoiceEntry>
{
[PXMergeAttributes(Method = MergeMethod.Merge)]
[Terms(typeof(ARInvoice.docDate), typeof(ARInvoice.dueDate), typeof(ARInvoice.discDate), typeof(ARInvoice_Extension.curyClientTotal), typeof(ARInvoice.curyOrigDiscAmt))]
protected virtual void ARInvoice_TermsID_CacheAttached(PXCache sender)
{
}
}
public class ARInvoice_Extension : PXCacheExtension<ARInvoice>
{
#region CuryClientTotal
public abstract class curyClientTotal : PX.Data.IBqlField
{
}
[PXCurrency(typeof(ARInvoice.curyInfoID), typeof(ARInvoice_Extension.clientTotal))]
[PXFormula(typeof(Sub<ARInvoice.curyLineTotal, ARInvoice.curyDiscTot>))]
public virtual Decimal? CuryClientTotal { get; set; }
#endregion
#region ClientTotal
public abstract class clientTotal : PX.Data.IBqlField { }
[PXDecimal(4)]
public virtual Decimal? ClientTotal { get; set; }
#endregion
}
}
@megamorphg

This comment has been minimized.

Copy link

megamorphg commented Apr 9, 2019

Can you please create as a customization package for Acumatica?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.