private void RecalcFormulas(RUTROT rutrot, DocExt document) { if (document.IsRUTROTDeductible == true) { foreach (Tran tran in Transactions.Select()) { if (PXCache <Tran> .GetExtension <TranExt>(tran)?.IsRUTROTDeductible == true) { Transactions.Cache.RaiseFieldUpdated("IsRUTROTDeductible", tran, false); //this is required for updating formula on ARTranRUTROT.CuryRUTROTAvailableAmt } } foreach (RUTROTDistribution distribution in RRDistribution.Select()) { RRDistribution.Cache.RaiseFieldUpdated <RUTROTDistribution.extra>(distribution, !distribution.Extra); //this is required for updating formula on RUTROTDistribution.curyAllowance } PXUnboundFormulaAttribute.CalcAggregate <ARTranRUTROT.curyRUTROTTotal>(Transactions.Cache, rutrot); PXFormulaAttribute.CalcAggregate <ARTranRUTROT.curyRUTROTAvailableAmt>(Transactions.Cache, rutrot); PXUnboundFormulaAttribute.CalcAggregate <SOLineRUTROT.curyRUTROTTotal>(Transactions.Cache, rutrot); PXFormulaAttribute.CalcAggregate <SOLineRUTROT.curyRUTROTAvailableAmt>(Transactions.Cache, rutrot); PXFormulaAttribute.CalcAggregate <RUTROTDistribution.curyAllowance>(RRDistribution.Cache, rutrot); } }
/// <summary> /// It`s a work around for the <see cref="RUTROT.curyTotalAmt"/> field, /// which was calculated incorrectly when the document existed the group discount. /// </summary> protected virtual void ARTran_RowUpdated(PXCache sender, PXRowUpdatedEventArgs e) { if (e.Row == null || Rutrots.Current == null) { return; } PXFormulaAttribute.CalcAggregate <ARTranRUTROT.curyRUTROTAvailableAmt>(Base.Transactions.Cache, Rutrots.Current); }
protected virtual void FARegister_RowSelecting(PXCache sender, PXRowSelectingEventArgs e) { if (e.Row != null && PXLongOperation.GetCurrentItem() == null) //Calculate totals only not in long operation { using (new PXConnectionScope()) { PXFormulaAttribute.CalcAggregate <FATran.tranAmt>(Trans.Cache, e.Row, true); } } }
protected virtual void FARegister_RowSelecting(PXCache sender, PXRowSelectingEventArgs e) { if (e.Row != null) { using (new PXConnectionScope()) { PXFormulaAttribute.CalcAggregate <FATran.tranAmt>(Trans.Cache, e.Row, true); } } }
public void RecalcFormulas(RUTROT rowRR, ARInvoiceRUTROT row) { if (row.IsRUTROTDeductible == true) { foreach (ARTran tran in Base.Transactions.Select()) { if (PXCache <ARTran> .GetExtension <ARTranRUTROT>(tran).IsRUTROTDeductible == true) { Base.Transactions.Cache.RaiseFieldUpdated <ARTranRUTROT.isRUTROTDeductible>(tran, false); //this is required for updating formula on ARTranRUTROT.CuryRUTROTAvailableAmt Base.Transactions.Update(tran); } } PXUnboundFormulaAttribute.CalcAggregate <ARTranRUTROT.curyRUTROTTotal>(Base.Transactions.Cache, rowRR); PXFormulaAttribute.CalcAggregate <ARTranRUTROT.curyRUTROTAvailableAmt>(Base.Transactions.Cache, rowRR); } }
public virtual void RecalcApplAmounts(PXCache sender, APPayment row, bool aReadOnly, Action <PXCache, APPayment, bool> baseMethod) { PXFormulaAttribute.CalcAggregate <POAdjust.curyAdjgAmt>(POAdjustments.Cache, row, aReadOnly); baseMethod?.Invoke(sender, row, aReadOnly); }