protected virtual void AddInvoiceProc() { foreach (APInvoice item in DocumentList.Cache.Updated) { try { if (item.Selected == true) { APTaxTran tran = new APTaxTran(); tran.TranType = Document.Current.DocType; tran.RefNbr = Document.Current.RefNbr; tran.OrigTranType = item.DocType; tran.OrigRefNbr = item.RefNbr; tran.TaxID = Filter.Current.TaxID; Taxes.Insert(tran); } } finally { DocumentList.Cache.SetStatus(item, PXEntryStatus.Notchanged); DocumentList.Cache.Remove(item); } } }