Exemplo n.º 1
0
        protected override void _(Events.RowUpdated <Invoice> e)
        {
            base._(e);

            if (ShouldUpdateAdjustmentsOnDocumentUpdated(e))
            {
                foreach (Adjust2 adjust in AppliedAdjustments.Select())
                {
                    if (!e.Cache.ObjectsEqual <Invoice.branchID>(e.Row, e.OldRow))
                    {
                        AppliedAdjustments.Cache.SetDefaultExt <Adjust2.adjdBranchID>(adjust);
                    }

                    if (!e.Cache.ObjectsEqual <Invoice.headerTranPeriodID>(e.Row, e.OldRow))
                    {
                        FinPeriodIDAttribute.DefaultPeriods <Adjust2.adjgFinPeriodID>(AppliedAdjustments.Cache, adjust);
                        FinPeriodIDAttribute.DefaultPeriods <Adjust2.adjdFinPeriodID>(AppliedAdjustments.Cache, adjust);
                    }

                    (AppliedAdjustments.Cache as PXModelExtension <Adjust2>)?.UpdateExtensionMapping(adjust);

                    AppliedAdjustments.Cache.MarkUpdated(adjust);
                }
            }
        }
Exemplo n.º 2
0
        protected virtual void _(Events.RowUpdated <Payment> e)
        {
            if (!e.Cache.ObjectsEqual <Payment.adjDate, Payment.adjTranPeriodID, Payment.curyID, Payment.branchID>(e.Row, e.OldRow))
            {
                foreach (Adjust adjust in Adjustments.Select())
                {
                    if (!e.Cache.ObjectsEqual <Payment.branchID>(e.Row, e.OldRow))
                    {
                        Adjustments.Cache.SetDefaultExt <Adjust.adjgBranchID>(adjust);
                    }

                    if (!e.Cache.ObjectsEqual <Payment.adjTranPeriodID>(e.Row, e.OldRow))
                    {
                        FinPeriodIDAttribute.DefaultPeriods <Adjust.adjgFinPeriodID>(Adjustments.Cache, adjust);
                    }

                    (Adjustments.Cache as PXModelExtension <Adjust>)?.UpdateExtensionMapping(adjust);

                    Adjustments.Cache.MarkUpdated(adjust);
                }
            }
        }