Ejemplo n.º 1
0
        public virtual IEnumerable zoneRecords()
        {
            TaxBuilderFilter filter = Filter.Current;

            if (filter == null)
            {
                yield break;
            }

            if (filter.State == null)
            {
                yield break;
            }

            bool found = false;

            foreach (ZoneRecord item in ZoneRecords.Cache.Inserted)
            {
                found = true;
                yield return(item);
            }
            if (found)
            {
                yield break;
            }

            foreach (ZoneRecord record in Zones)
            {
                ZoneRecords.Cache.SetStatus(record, PXEntryStatus.Inserted);
                yield return(record);
            }
        }
Ejemplo n.º 2
0
        public virtual IEnumerable zoneDetailRecords(string zoneID)
        {
            TaxBuilderFilter filter = Filter.Current;

            if (filter == null)
            {
                yield break;
            }

            if (filter.State == null)
            {
                yield break;
            }

            if (string.IsNullOrEmpty(zoneID))
            {
                yield break;
            }

            bool found = false;

            foreach (ZoneDetailRecord item in ZoneDetailRecords.Cache.Inserted)
            {
                if (item.ZoneID == zoneID)
                {
                    TaxRecord tx = (from t in Taxes
                                    where t.TaxID == item.TaxID
                                    select t).Single();

                    PXResult <ZoneDetailRecord, TaxRecord> res = new PXResult <ZoneDetailRecord, TaxRecord>(item, tx);

                    found = true;
                    yield return(res);
                }
            }
            if (found)
            {
                yield break;
            }

            foreach (ZoneDetailRecord record in ZoneDetails)
            {
                if (record.ZoneID == zoneID)
                {
                    ZoneDetailRecords.Cache.SetStatus(record, PXEntryStatus.Inserted);

                    TaxRecord tx = (from t in Taxes
                                    where t.TaxID == record.TaxID
                                    select t).Single();

                    PXResult <ZoneDetailRecord, TaxRecord> res = new PXResult <ZoneDetailRecord, TaxRecord>(record, tx);


                    yield return(res);
                }
            }
        }
Ejemplo n.º 3
0
        protected virtual void TaxBuilderFilter_State_FieldUpdated(PXCache sender, PXFieldUpdatedEventArgs e)
        {
            TaxBuilderFilter row = e.Row as TaxBuilderFilter;

            if (row != null)
            {
                result = null;
                TaxRecords.Cache.Clear();
                ZoneRecords.Cache.Clear();
                ZoneDetailRecords.Cache.Clear();
            }
        }