protected virtual void ARSetup_RowUpdated(PXCache sender, PXRowUpdatedEventArgs e) { ARSetup row = e.Row as ARSetup; if (row != null && row.ConsolidatedDunningLetter == false) { row.DunningLetterBranchID = null; } if (row != null && row.ConsolidatedStatement == false) { row.StatementBranchID = null; } if (row != null && (!sender.ObjectsEqual <ARSetup.retentionType>(e.Row, e.OldRow) || !sender.ObjectsEqual <ARSetup.numberOfMonths>(e.Row, e.OldRow))) { if (row.RetentionType == RetentionTypeList.LastPrice) { sender.RaiseExceptionHandling <ARSetup.retentionType>(e.Row, ((ARSetup)e.Row).RetentionType, new PXSetPropertyException(Messages.LastPriceWarning, PXErrorLevel.Warning)); } if (row.RetentionType == RetentionTypeList.FixedNumOfMonths) { if (row.NumberOfMonths != 0) { sender.RaiseExceptionHandling <ARSetup.retentionType>(e.Row, ((ARSetup)e.Row).RetentionType, new PXSetPropertyException(Messages.HistoricalPricesWarning, PXErrorLevel.Warning, row.NumberOfMonths)); } if (row.NumberOfMonths == 0) { sender.RaiseExceptionHandling <ARSetup.retentionType>(e.Row, ((ARSetup)e.Row).RetentionType, new PXSetPropertyException(Messages.HistoricalPricesUnlimitedWarning, PXErrorLevel.Warning, row.NumberOfMonths)); } } } }
protected virtual void ARSetup_MigrationMode_FieldUpdated(PXCache sender, PXFieldUpdatedEventArgs e) { ARSetup row = e.Row as ARSetup; if (row == null) { return; } bool?oldvalue = (bool?)e.OldValue; if (row.MigrationMode == true && oldvalue != true) { GLTran glTransactionFromModule = PXSelect <GLTran, Where <GLTran.module, Equal <BatchModule.moduleAR> > > .SelectSingleBound(this, null); if (glTransactionFromModule != null) { sender.RaiseExceptionHandling <ARSetup.migrationMode>(row, row.MigrationMode, new PXSetPropertyException(Common.Messages.MigrationModeActivateGLTransactionFromModuleExist, PXErrorLevel.Warning)); } } else if (row.MigrationMode != true && oldvalue == true) { ARRegister unreleasedMigratedDocument = PXSelect <ARRegister, Where <ARRegister.released, NotEqual <True>, And <ARRegister.isMigratedRecord, Equal <True> > > > .SelectSingleBound(this, null); if (unreleasedMigratedDocument != null) { sender.RaiseExceptionHandling <ARSetup.migrationMode>(row, row.MigrationMode, new PXSetPropertyException(Common.Messages.MigrationModeDeactivateUnreleasedMigratedDocumentExist, PXErrorLevel.Warning)); } } }
public ARScheduleRun() { ARSetup setup = ARSetup.Current; Schedule_List.SetProcessCaption("Run Selected"); Schedule_List.SetProcessAllCaption("Run All"); }
protected virtual void ARSetup_RowSelected(PXCache sender, PXRowSelectedEventArgs e) { ARSetup row = e.Row as ARSetup; if (row != null) { bool useMultipleBranches = this.ShowBranches(); PXUIFieldAttribute.SetEnabled <ARSetup.invoicePrecision>(sender, row, (row.InvoiceRounding != RoundingType.Currency)); PXUIFieldAttribute.SetEnabled <ARSetup.statementBranchID>(sender, row, row.ConsolidatedStatement ?? false); PXUIFieldAttribute.SetEnabled <ARSetup.dunningLetterBranchID>(sender, row, row.ConsolidatedDunningLetter ?? false); PXUIFieldAttribute.SetEnabled <ARSetup.autoReleaseDunningLetter>(sender, row, row.DunningLetterProcessType == DunningProcessType.ProcessByDocument); PXUIFieldAttribute.SetEnabled <ARSetup.numberOfMonths>(sender, row, row.RetentionType == RetentionTypeList.FixedNumOfMonths); PXUIFieldAttribute.SetVisible <ARSetup.consolidatedStatement>(sender, row, useMultipleBranches || row.StatementBranchID.HasValue); PXUIFieldAttribute.SetVisible <ARSetup.consolidatedDunningLetter>(sender, row, useMultipleBranches || row.DunningLetterBranchID.HasValue); PXUIFieldAttribute.SetVisible <ARSetup.statementBranchID>(sender, row, useMultipleBranches || row.StatementBranchID.HasValue); PXUIFieldAttribute.SetVisible <ARSetup.dunningLetterBranchID>(sender, row, useMultipleBranches || row.DunningLetterBranchID.HasValue); PXUIFieldAttribute.SetVisible <ARSetup.applyQuantityDiscountBy>(sender, row, PXAccess.FeatureInstalled <FeaturesSet.customerDiscounts>() && PXAccess.FeatureInstalled <FeaturesSet.multipleUnitMeasure>()); PXUIFieldAttribute.SetEnabled <ARSetup.numberOfMonths>(sender, row, row.RetentionType == RetentionTypeList.FixedNumOfMonths); VerifyInvoiceRounding(sender, row); } }
protected virtual void ARSetup_RowSelected(PXCache sender, PXRowSelectedEventArgs e) { ARSetup row = e.Row as ARSetup; if (row != null) { bool useMultipleBranches = this.ShowBranches(); PXUIFieldAttribute.SetEnabled <ARSetup.invoicePrecision>(sender, row, (row.InvoiceRounding != RoundingType.Currency)); PXUIFieldAttribute.SetEnabled <ARSetup.statementBranchID>(sender, row, row.ConsolidatedStatement ?? false); PXUIFieldAttribute.SetEnabled <ARSetup.dunningLetterBranchID>(sender, row, row.ConsolidatedDunningLetter ?? false); if (row.DunningLetterProcessType == 1) { PXUIFieldAttribute.SetEnabled <ARSetup.autoReleaseDunningLetter>(sender, row, true); } PXUIFieldAttribute.SetVisible <ARSetup.consolidatedStatement>(sender, row, useMultipleBranches || row.StatementBranchID.HasValue); PXUIFieldAttribute.SetVisible <ARSetup.consolidatedDunningLetter>(sender, row, useMultipleBranches || row.DunningLetterBranchID.HasValue); PXUIFieldAttribute.SetVisible <ARSetup.statementBranchID>(sender, row, useMultipleBranches || row.StatementBranchID.HasValue); PXUIFieldAttribute.SetVisible <ARSetup.dunningLetterBranchID>(sender, row, useMultipleBranches || row.DunningLetterBranchID.HasValue); PXUIFieldAttribute.SetEnabled <ARSetup.numberOfMonths>(sender, row, row.RetentionType == RetentionTypeList.FixedNumOfMonths); VerifyInvoiceRounding(sender, row); } }
public virtual void CustomerClass_StatementCycleId_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e) { CustomerClass row = (CustomerClass)e.Row; if (row == null) { return; } if ((row.StatementCycleId != null)) { ARSetup setup = (ARSetup)PXSelect <ARSetup> .Select(this); if (setup != null && (setup.DefFinChargeFromCycle == true)) { ARStatementCycle arSC = PXSelect <ARStatementCycle, Where <ARStatementCycle.statementCycleId, Equal <Required <ARStatementCycle.statementCycleId> > > > . Select(this, row.StatementCycleId); if ((arSC != null) && (arSC.FinChargeID != null)) { row.FinChargeID = arSC.FinChargeID; this.CustomerClassRecord.Cache.RaiseFieldUpdated <CustomerClass.finChargeID>(row, null); } } } }
public ARSPCommissionDocEnq() { ARSetup setup = ARSetup.Current; this.SPDocs.Cache.AllowDelete = false; this.SPDocs.Cache.AllowUpdate = false; this.SPDocs.Cache.AllowInsert = false; }
public ARStatementForCustomer() { ARSetup setup = ARSetup.Current; Details.Cache.AllowDelete = false; Details.Cache.AllowInsert = false; Details.Cache.AllowUpdate = false; }
public ARStatementHistory() { ARSetup setup = ARSetup.Current; History.Cache.AllowDelete = false; History.Cache.AllowInsert = false; History.Cache.AllowUpdate = false; }
public ARAccess() { ARSetup setup = ARSetup.Current; Customer.Cache.AllowDelete = false; PXUIFieldAttribute.SetEnabled(Customer.Cache, null, false); PXUIFieldAttribute.SetEnabled <Customer.included>(Customer.Cache, null); PXUIFieldAttribute.SetEnabled <Customer.acctCD>(Customer.Cache, null); }
public ARScheduleMaint() { ARSetup ars = ARSetup.Current; Document_History.Cache.AllowDelete = false; Document_History.Cache.AllowInsert = false; Document_History.Cache.AllowUpdate = false; CopyPaste.SetVisible(false); }
public ARStatementPrint() { ARSetup setup = ARSetup.Current; Details.Cache.AllowDelete = false; Details.Cache.AllowInsert = false; Details.SetSelected <ARInvoice.selected>(); Details.SetProcessCaption(IN.Messages.Process); Details.SetProcessAllCaption(IN.Messages.ProcessAll); }
public ARCreateWriteOff() { ARSetup setup = ARSetup.Current; FieldDefaulting.AddHandler <BAccountR.type>((sender, e) => { if (e.Row != null) { e.NewValue = BAccountType.CustomerType; } }); }
public ARStatementForCustomer() { ARSetup setup = ARSetup.Current; Details.Cache.AllowDelete = false; Details.Cache.AllowInsert = false; Details.Cache.AllowUpdate = false; CustomerRepository = new CustomerRepository(this); }
public ARChargeInvoices() { ARSetup setup = ARSetup.Current; ARDocumentList.SetSelected <ARInvoice.selected>(); ARDocumentList.SetProcessCaption(Messages.Process); ARDocumentList.SetProcessAllCaption(Messages.ProcessAll); ARDocumentList.Cache.AllowInsert = false; PXUIFieldAttribute.SetEnabled <ARInvoice.docType>(ARDocumentList.Cache, null, true); PXUIFieldAttribute.SetEnabled <ARInvoice.refNbr>(ARDocumentList.Cache, null, true); }
public SalesPersonMaint() { ARSetup setup = ARSetup.Current; this.CommissionsHistory.Cache.AllowInsert = false; this.CommissionsHistory.Cache.AllowDelete = false; this.CommissionsHistory.Cache.AllowUpdate = false; PXUIFieldAttribute.SetEnabled <CustSalesPeople.locationID>(this.SPCustomers.Cache, null, false); PXUIFieldAttribute.SetDisplayName <Contact.salutation>(Caches[typeof(Contact)], CR.Messages.Attention); }
public ARAccessDetail() { ARSetup setup = ARSetup.Current; Customer.Cache.AllowDelete = false; Customer.Cache.AllowInsert = false; PXUIFieldAttribute.SetEnabled(Customer.Cache, null, false); PXUIFieldAttribute.SetEnabled <Customer.acctCD>(Customer.Cache, null); Views.Caches.Remove(Groups.GetItemType()); Views.Caches.Add(Groups.GetItemType()); }
protected virtual void ARSetup_RowPersisting(PXCache sender, PXRowPersistingEventArgs e) { ARSetup row = e.Row as ARSetup; if (row != null) { bool useMultipleBranches = PXSelect <GL.Branch> .Select(this).Count > 0; PXDefaultAttribute.SetPersistingCheck <ARSetup.statementBranchID>(sender, row, (useMultipleBranches && row.ConsolidatedStatement == true) ? PXPersistingCheck.NullOrBlank : PXPersistingCheck.Nothing); PXDefaultAttribute.SetPersistingCheck <ARSetup.dunningLetterBranchID>(sender, row, (useMultipleBranches && row.ConsolidatedDunningLetter == true) ? PXPersistingCheck.NullOrBlank : PXPersistingCheck.Nothing); } }
protected virtual void PrintParameters_RowSelected(PXCache sender, PXRowSelectedEventArgs e) { ARSetup setup = ARSetup.Current; bool bb = !(setup.ConsolidatedStatement ?? false); PrintParameters row = (PrintParameters)e.Row; if (row != null) { row.BranchCD = null; if (!bb) { row.BranchID = null; //Force null for the non-consolidated statements } if (row.BranchID != null) { Branch BrS = PXSelect <Branch, Where <Branch.branchID, Equal <Required <Branch.branchID> > > > .Select(this, row.BranchID); if (BrS != null) { row.BranchCD = BrS.BranchCD; } } PXUIFieldAttribute.SetVisible <PrintParameters.branchID>(sender, null, bb); PXUIFieldAttribute.SetEnabled <PrintParameters.statementDate>(sender, row, row.Action != PrintParameters.Actions.Regenerate); PrintParameters filter = (PrintParameters)this.Filter.Cache.CreateCopy(row); switch (row.Action) { case 0: Details.SetProcessDelegate(list => PrintStatements(filter, list, false)); break; case 1: Details.SetProcessDelegate(list => EmailStatements(filter, list, false)); break; case 2: Details.SetProcessDelegate(list => EmailStatements(filter, list, true)); break; case 3: Details.SetProcessDelegate(list => PrintStatements(filter, list, true)); break; case 4: Details.SetProcessDelegate(list => RegenerateStatements(filter, list)); break; } } }
public ARStatementPrint() { ARSetup setup = ARSetup.Current; Details.Cache.AllowDelete = false; Details.Cache.AllowInsert = false; Details.SetSelected <ARInvoice.selected>(); Details.SetProcessCaption(IN.Messages.Process); Details.SetProcessAllCaption(IN.Messages.ProcessAll); InquiriesFolder.MenuAutoOpen = true; InquiriesFolder.AddMenuAction(ViewDetails); }
public CCTransactionsHistoryEnq() { ARSetup setup = ARSetup.Current; this.CCTrans.Cache.AllowInsert = false; this.CCTrans.Cache.AllowUpdate = false; this.CCTrans.Cache.AllowDelete = false; PXUIFieldAttribute.SetRequired <ARPayment.customerID>(Caches[typeof(ARPayment)], false); PXUIFieldAttribute.SetRequired <Customer.acctName>(Caches[typeof(Customer)], false); PXUIFieldAttribute.SetRequired <CCProcTran.processingCenterID>(CCTrans.Cache, false); PXUIFieldAttribute.SetRequired <CCProcTran.startTime>(CCTrans.Cache, false); }
protected virtual void ARSetup_RowInserted(PXCache sender, PXRowInsertedEventArgs e) { ARSetup row = e.Row as ARSetup; if (row != null && row.ConsolidatedDunningLetter == false) { row.DunningLetterBranchID = null; } if (row != null && row.ConsolidatedStatement == false) { row.StatementBranchID = null; } }
public ARPrintInvoices() { ARSetup setup = arsetup.Current; PXUIFieldAttribute.SetEnabled(ARDocumentList.Cache, null, false); PXUIFieldAttribute.SetEnabled <ARInvoice.selected>(ARDocumentList.Cache, null, true); ARDocumentList.Cache.AllowInsert = false; ARDocumentList.Cache.AllowDelete = false; ARDocumentList.SetSelected <ARInvoice.selected>(); ARDocumentList.SetProcessCaption(IN.Messages.Process); ARDocumentList.SetProcessAllCaption(IN.Messages.ProcessAll); }
/// <summary> /// Calculates Sales Price. /// </summary> /// <param name="sender">Cache</param> /// <param name="inventoryID">Inventory</param> /// <param name="curyID">Currency</param> /// <param name="UOM">Unit of measure</param> /// <param name="date">Date</param> /// <returns>Sales Price.</returns> /// <remarks>AlwaysFromBaseCury flag in the SOSetup is considered when performing the calculation.</remarks> public static decimal?CalculateSalesPrice(PXCache sender, string custPriceClass, int?inventoryID, CurrencyInfo currencyinfo, string UOM, DateTime date) { bool alwaysFromBase = false; ARSetup arsetup = (ARSetup)sender.Graph.Caches[typeof(ARSetup)].Current ?? PXSelect <ARSetup> .Select(sender.Graph); if (arsetup != null) { alwaysFromBase = arsetup.AlwaysFromBaseCury == true; } return(ARSalesPriceMaint.CalculateSalesPrice(sender, custPriceClass, null, inventoryID, currencyinfo, 0m, UOM, date, alwaysFromBase)); }
public ARPaymentsAutoProcessing() { ARSetup setup = ARSetup.Current; PXCurrencyAttribute.SetBaseCalc <PaymentFilter.curySelTotal>(Filter.Cache, null, false); ARDocumentList.SetSelected <ARPaymentInfo.selected>(); ARDocumentList.SetProcessDelegate <ARPaymentCCProcessing>(delegate(ARPaymentCCProcessing aGraph, ARPaymentInfo doc) { ProcessPayment(aGraph, doc); } ); ARDocumentList.Cache.AllowInsert = false; }
/// <summary> /// Default constructor /// </summary> public ARDunningLetterPrint() { try { ARSetup setup = ARSetup.Current; Consolidated = setup.ConsolidatedDunningLetter.GetValueOrDefault(false); Details.Cache.AllowDelete = false; Details.Cache.AllowInsert = false; Details.SetSelected <ARInvoice.selected>(); //??? Details.SetProcessCaption(IN.Messages.Process); Details.SetProcessAllCaption(IN.Messages.ProcessAll); } catch { } }
public ARScheduleRun() { ARSetup setup = ARSetup.Current; Schedule_List.Join < LeftJoin <ARRegisterAccess, On <ARRegisterAccess.scheduleID, Equal <Schedule.scheduleID>, And <ARRegisterAccess.scheduled, Equal <True>, And <Not <Match <ARRegisterAccess, Current <AccessInfo.userName> > > > > > > >(); Schedule_List.WhereAnd <Where < Schedule.module, Equal <BatchModule.moduleAR>, And <ARRegisterAccess.docType, IsNull> > >(); }
public ARDunningLetterPrint() { ARSetup setup = ARSetup.Current; Consolidated = setup.ConsolidatedDunningLetter.GetValueOrDefault(false); if (setup.AutoReleaseDunningLetter == true) { PXDefaultAttribute.SetDefault <PrintParameters.action>(Filter.Cache, ActionTypes.Print); PXUIFieldAttribute.SetEnabled <PrintParameters.showAll>(Filter.Cache, null, true); } Details.Cache.AllowDelete = false; Details.Cache.AllowInsert = false; Details.SetSelected <ARInvoice.selected>(); Details.SetProcessCaption(IN.Messages.Process); Details.SetProcessAllCaption(IN.Messages.ProcessAll); }
protected virtual void ARSetup_DunningLetterProcessType_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e) { ARSetup row = (ARSetup)e.Row; int? oldValue = (int?)e.OldValue; if (row?.DunningLetterProcessType == DunningProcessType.ProcessByCustomer) { row.AutoReleaseDunningLetter = true; if (oldValue == DunningProcessType.ProcessByDocument) { cache.RaiseExceptionHandling <ARSetup.dunningLetterProcessType>(row, row.DunningLetterProcessType, new PXSetPropertyException(Messages.DunningLetterProcessSwithcedToCustomer, PXErrorLevel.Warning)); } } }
protected virtual void ARSetup_DunningFeeInventoryID_FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e) { ARSetup setup = e.Row as ARSetup; if (setup == null || e.NewValue == null) { return; } IN.InventoryItem item = (IN.InventoryItem)PXSelectorAttribute.Select <ARSetup.dunningFeeInventoryID>(sender, setup, e.NewValue); if (item != null && item.SalesAcctID == null) { e.NewValue = item.InventoryCD; throw new PXSetPropertyException(Messages.DunningLetterFeeEmptySalesAccount); } }