public virtual void Persist(Action persist) { if (Base.Document.Current != null && IsExternalTax(Base.Document.Current.TaxZoneID) && Base.Document.Current.Released != true) { //Avalara - validate that valid ShipTo address can be returned - no mixed carriers, and no mixeds shipto address: GetToAddress(Base.Document.Current); } persist(); if (IsDocumentExtTaxValid(Base.Document.Current) && Base.Document.Current.IsTaxValid != true && !skipExternalTaxCalcOnSave && Base.Document.Current.Released != true) { if (PXLongOperation.GetCurrentItem() == null) { PXLongOperation.StartOperation(Base, delegate { Base.RecalculateExternalTax(null, Base.Document.Current); }); } else { Base.RecalculateExternalTax(Base, Base.Document.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); } } }
public void Persist() { if (Base.Opportunity.Current != null && IsExternalTax(Base.Opportunity.Current.TaxZoneID) && !skipExternalTaxCalcOnSave && Base.Opportunity.Current.IsTaxValid != true) { if (PXLongOperation.GetCurrentItem() == null) { PXLongOperation.StartOperation(Base, delegate() { CalculateExternalTax(Base.Opportunity.Current); }); } else { CalculateExternalTax(Base.Opportunity.Current); } } }
public virtual void Persist(Action persist) { if (Base.Document.Current != null && IsExternalTax(Base.Document.Current.TaxZoneID) && Base.Document.Current.Released != true) { //Avalara - validate that valid ShipTo address can be returned - no mixed carriers, and no mixeds shipto address: GetToAddress(Base.Document.Current); } persist(); if (Base.Document.Current != null && IsExternalTax(Base.Document.Current.TaxZoneID) && Base.Document.Current.InstallmentNbr == null && Base.Document.Current.IsTaxValid != true && !skipExternalTaxCalcOnSave && Base.Document.Current.Released != true) { if (PXLongOperation.GetCurrentItem() == null) { PXLongOperation.StartOperation(Base, delegate { if (Base.Document.Current.OrigModule == GL.BatchModule.SO) { SOInvoiceEntry rg = PXGraph.CreateInstance <SOInvoiceEntry>(); rg.Document.Current = PXSelect <ARInvoice, Where <ARInvoice.docType, Equal <Required <ARInvoice.docType> >, And <ARInvoice.refNbr, Equal <Required <ARInvoice.refNbr> > > > > .Select(rg, Base.Document.Current.DocType, Base.Document.Current.RefNbr); rg.Document.Current.ApplyPaymentWhenTaxAvailable = Base.Document.Current.ApplyPaymentWhenTaxAvailable; rg.SODocument.Current = PXSelect <SOInvoice, Where <SOInvoice.docType, Equal <Required <SOInvoice.docType> >, And <SOInvoice.refNbr, Equal <Required <SOInvoice.refNbr> > > > > .Select(rg, Base.Document.Current.DocType, Base.Document.Current.RefNbr); rg.CalculateExternalTax(rg.Document.Current); } else { ARInvoiceEntry rg = PXGraph.CreateInstance <ARInvoiceEntry>(); rg.Document.Current = PXSelect <ARInvoice, Where <ARInvoice.docType, Equal <Required <ARInvoice.docType> >, And <ARInvoice.refNbr, Equal <Required <ARInvoice.refNbr> > > > > .Select(rg, Base.Document.Current.DocType, Base.Document.Current.RefNbr); rg.CalculateExternalTax(rg.Document.Current); } Base.RecalcUnbilledTax(); }); } else { Base.CalculateExternalTax(Base.Document.Current); Base.RecalcUnbilledTax(); } } }
public virtual void Persist() { if (Base.Document.Current != null && IsExternalTax(Base.Document.Current.TaxZoneID) && Base.Document.Current.IsTaxValid != true && !skipExternalTaxCalcOnSave) { if (PXLongOperation.GetCurrentItem() == null && asynchronousProcess) { PXLongOperation.StartOperation(Base, delegate() { ARCashSaleEntry rg = PXGraph.CreateInstance <ARCashSaleEntry>(); rg.Document.Current = PXSelect <ARCashSale, Where <ARCashSale.docType, Equal <Required <ARCashSale.docType> >, And <ARCashSale.refNbr, Equal <Required <ARCashSale.refNbr> > > > > .Select(rg, Base.Document.Current.DocType, Base.Document.Current.RefNbr); rg.CalculateExternalTax(rg.Document.Current); }); } else { Base.CalculateExternalTax(Base.Document.Current); } } }