Sample code only for reference.
[ExtensionOf(classStr(CustOverPaym))]
final class CustOverPaymCls_san_Extension
{
private container sanCustCRCTypes;
#define.CurrentVersion(3)
#localmacro.CurrentList
sanCustCRCTypes
#endmacro
/// <summary>
/// Set and get Parm customer credit management types
/// </summary>
/// <param name = "_sanParams">current params</param>
/// <returns>CustCRCTypes</returns>
public container san_parmCustCRCTypes(container _sanParams = sanCustCRCTypes)
{
sanCustCRCTypes = _sanParams;
return sanCustCRCTypes;
}
public container pack()
{
container packedClass = next pack();
return SysPackExtensions::appendExtension(packedClass, classStr(CustOverPaymCls_san_Extension), this.myPack());
}
private container myPack()
{
return [#CurrentVersion, #CurrentList];
}
public boolean unpack(container _packedClass)
{
boolean result = next unpack(_packedClass);
if (result)
{
container myState = SysPackExtensions::findExtension(_packedClass, classStr(CustOverPaymCls_san_Extension));
if (!this.myUnpack(myState))
{
result = false;
}
}
return result;
}
private boolean myUnpack(container packedClass)
{
Integer version = RunBase::getVersion(packedClass);
switch (version)
{
case #CurrentVersion:
[version, #currentList] = packedClass;
break;
default:
return false;
}
return true;
}
/// <summary>
/// Builds the cross company query used to calculate summarized totals. COC
/// </summary>
/// <param name = "_calcArgs">Contains arguments used to construct the query</param>
/// <returns>The generated query.</returns>
protected Query buildCrossCompanyQueryForCalcTotalSummarized(CustOverPaymCalcTotalArgs _calcArgs)
{
Query sanQuery;
sanQuery = next buildCrossCompanyQueryForCalcTotalSummarized(_calcArgs);
if(sanCustCRCTypes != conNull())
{
this.san_setQueryRangeCustCRCTypes(sanQuery);
}
return sanQuery;
}
/// <summary>
/// Builds the cross company query used to calculate not summarized totals. COC
/// </summary>
/// <param name = "_calcArgs">Contains arguments used to construct the query</param>
/// <returns>The generated query.</returns>
protected Query buildCrossCompanyQueryForCalcTotalNonSummarized(CustOverPaymCalcTotalArgs _calcArgs)
{
Query sanQuery;
sanQuery = next buildCrossCompanyQueryForCalcTotalNonSummarized(_calcArgs);
if(sanCustCRCTypes != conNull())
{
this.san_setQueryRangeCustCRCTypes(sanQuery);
}
return sanQuery;
}
/// <summary>
/// Builds the query used in methods <c>findTransactionsForReimbursementNonSummarized</c> and <c>findTransactionsForReimbursementSummarized</c>. COC
/// </summary>
/// <param name = "_findTransArgs">Contains arguments used to build the query.</param>
/// <returns>The generated query.</returns>
protected Query buildFindTransactionsForReimbursementQuery(CustOverPaymFindTransactionsForReimburseArgs _findTransArgs)
{
Query sanQuery;
sanQuery = next buildFindTransactionsForReimbursementQuery(_findTransArgs);
if(sanCustCRCTypes != conNull())
{
this.san_setQueryRangeCustCRCTypes(sanQuery);
}
return sanQuery;
}
/// <summary>
/// setting query range for customer credit management types to existing query
/// </summary>
/// <param name = "_query">Query</param>
public void san_setQueryRangeCustCRCTypes(Query _query)
{
QueryBuildDataSource qbdsCustTable;
str CustCRCTypesIds;
san_CustCreditManagementTypes custCreditManagementTypes;
#define.sanSemicolon(';')
#define.sanComma(',')
qbdsCustTable = _query.dataSourceTable(tableNum(CustTable));
if(qbdsCustTable == null)
{
qbdsCustTable = _query.addDataSource(tableNum(CustTable));
}
CustCRCTypesIds = con2StrUnlimited(sanCustCRCTypes,#sanComma);
if (CustCRCTypesIds)
{
CustCRCTypesIds = Global::strReplace(CustCRCTypesIds, #sanSemicolon, #sanComma);
qbdsCustTable.addRange(fieldNum(CustTrans, san_CustCreditMgmtType)).value(CustCRCTypesIds);
}
}
}
No comments:
Post a Comment