Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public PXSelectReadonly2<Contract,
InnerJoin<ContractBillingSchedule, On<ContractBillingSchedule.contractID, Equal<Contract.contractID>>,
InnerJoin<CSAnswers,
On<CSAnswers.entityType, Equal<CSAnswerType.contractAnswerType>,
And<CSAnswers.entityID, Equal<Contract.contractID>,
And<CSAnswers.attributeID, Equal<AttributesConst.RevTypeAttribute>>>>,
InnerJoin<CSAttributeDetail,
On<CSAttributeDetail.attributeID, Equal<AttributesConst.RevTypeAttribute>,
And<CSAttributeDetail.valueID, Equal<CSAnswers.value>>>,
>>>,
Where<Contract.baseType, Equal<Contract.ContractBaseType>,
And2<Where<CSAnswers.value, Equal<LicenseTypes.pcp>, Or<CSAnswers.value, Equal<LicenseTypes.pcs>, Or<CSAnswers.value, Equal<LicenseTypes.saas>>>>,
And<Contract.status, NotEqual<Contract.status.canceled>, And<Contract.status, NotEqual<Contract.status.draft>, And<Contract.status, NotEqual<Contract.status.expired>,
And<Where<ContractBillingSchedule.accountID, Equal<Current<PartnerFilter.currentPartner>>>>>>>>>,
OrderBy<Asc<CSAttributeDetail.description, Asc<Contract.contractCD>>>> Renewals;
public IEnumerable renewals()
{
PXView select = new PXView(this, true, Renewals.View.BqlSelect);
Int32 totalrow = 0;
Int32 startrow = PXView.StartRow;
List<object> result = select.Select(PXView.Currents, PXView.Parameters, PXView.Searches,
PXView.SortColumns, PXView.Descendings, PXView.Filters, ref startrow, PXView.MaximumRows, ref totalrow);
PXView.StartRow = 0;
foreach (PXResult<Contract, ContractBillingSchedule, CSAnswers> row in result)
{
Contract contract = (Contract)row;
ContractExt contractExt = Renewals.Cache.GetExtension<ContractExt>(contract);
ContractBillingSchedule schedule = (ContractBillingSchedule)row;
contractExt.Renewed = schedule.LastDate > new DateTime(DateTime.Now.Year, 1, 1);
}
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.