Created
June 7, 2016 15:48
-
-
Save smarenich/3bda67553bb394d443db30f2959bc6eb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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