예제 #1
0
        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);
            }
        }
예제 #2
0
        /// <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);
        }
예제 #3
0
 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);
         }
     }
 }
예제 #4
0
 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);
         }
     }
 }
예제 #5
0
 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);
     }
 }
예제 #6
0
 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);
 }