Hi ,
I need help in changing Period Filter in Invoice Section and add Current Quarter ,Current Year in the dropdown.
Thank you.
Like
Dear Sushma,
In order to implement the required functionality please do the following:
1. Add a module that would be exactly the same as FixedFilterViewV2 (copy all the code except the name in define, localizable strings and images), e.g. UsrFixedFilterViewV2 https://prnt.sc/shwown .
2. In this module, modify the “getPeriodFixedButtonsViewConfig” function by adding the following code https://prnt.sc/shwpwh :
// new menu items
{
className: "Terrasoft.MenuItem",
caption: usrResources.localizableStrings.CurrentQuarter,
click: {bindTo: "setPeriod"},
tag: filterName + "_CurrentQuarter"
}, {
className: "Terrasoft.MenuItem",
caption: usrResources.localizableStrings.CurrentYear,
click: {bindTo: "setPeriod"},
tag: filterName + "_CurrentYear"
}]
3. Add a module that would be exactly the same as FixedFilterViewModelV2 (copy all the code except the name in define, localizable strings and images), e.g. UsrFixedFilterViewModelV2 https://prnt.sc/shwtvn .
4. In this module, modify the “setPeriod” function by adding the following code https://prnt.sc/shwumk :
case "CurrentQuarter":
startDate = Terrasoft.startOfQuarter(startDate);
dueDate = Terrasoft.endOfQuarter(startDate);
break;
case "CurrentYear":
startDate = Terrasoft.startOfYear(startDate);
dueDate = Terrasoft.endOfYear(startDate);
break;
5. Create a new module to override QuickFilterModuleV2 https://prnt.sc/shwwcg :
define("UsrQuickFilterModuleV2", ["QuickFilterModuleV2"], function() {
Ext.define("Terrasoft.UsrQuickFilterModuleV2", {
override: "Terrasoft.QuickFilterModule",
getDefaultModuleConfig: function() {
return {
FixedFilters: {
viewConfigModuleName: "UsrFixedFilterViewV2",
viewModelConfigModuleName: "UsrFixedFilterViewModelV2",
configPropertyName: "fixedFilterConfig"
},
CustomFilters: {
viewConfigModuleName: "CustomFilterViewV2",
viewModelConfigModuleName: "CustomFilterViewModelV2",
configPropertyName: "customFilterConfig"
},
FolderFilters: {
viewConfigModuleName: "FolderFilterViewV2",
viewModelConfigModuleName: "FolderFilterViewModelV2",
configPropertyName: "folderFilterConfig"
},
TagFilters: {
viewConfigModuleName: "TagFilterViewGeneratorV2",
viewModelConfigModuleName: "TagFilterViewModelGeneratorV2",
configPropertyName: "tagFilterConfig"
}
};
}
});
}
);
6. Add a dependency in the “InvoiceSectionV2” schema to the overridden “UsrQuickFilterModuleV2” module https://prnt.sc/shwzto :
define("InvoiceSectionV2", ["UsrQuickFilterModuleV2"], function(){
return {
"entitySchemaName": "Invoice"
};
});
Best regards,
Norton
Dear Sushma,
In order to implement the required functionality please do the following:
1. Add a module that would be exactly the same as FixedFilterViewV2 (copy all the code except the name in define, localizable strings and images), e.g. UsrFixedFilterViewV2 https://prnt.sc/shwown .
2. In this module, modify the “getPeriodFixedButtonsViewConfig” function by adding the following code https://prnt.sc/shwpwh :
// new menu items
{
className: "Terrasoft.MenuItem",
caption: usrResources.localizableStrings.CurrentQuarter,
click: {bindTo: "setPeriod"},
tag: filterName + "_CurrentQuarter"
}, {
className: "Terrasoft.MenuItem",
caption: usrResources.localizableStrings.CurrentYear,
click: {bindTo: "setPeriod"},
tag: filterName + "_CurrentYear"
}]
3. Add a module that would be exactly the same as FixedFilterViewModelV2 (copy all the code except the name in define, localizable strings and images), e.g. UsrFixedFilterViewModelV2 https://prnt.sc/shwtvn .
4. In this module, modify the “setPeriod” function by adding the following code https://prnt.sc/shwumk :
case "CurrentQuarter":
startDate = Terrasoft.startOfQuarter(startDate);
dueDate = Terrasoft.endOfQuarter(startDate);
break;
case "CurrentYear":
startDate = Terrasoft.startOfYear(startDate);
dueDate = Terrasoft.endOfYear(startDate);
break;
5. Create a new module to override QuickFilterModuleV2 https://prnt.sc/shwwcg :
define("UsrQuickFilterModuleV2", ["QuickFilterModuleV2"], function() {
Ext.define("Terrasoft.UsrQuickFilterModuleV2", {
override: "Terrasoft.QuickFilterModule",
getDefaultModuleConfig: function() {
return {
FixedFilters: {
viewConfigModuleName: "UsrFixedFilterViewV2",
viewModelConfigModuleName: "UsrFixedFilterViewModelV2",
configPropertyName: "fixedFilterConfig"
},
CustomFilters: {
viewConfigModuleName: "CustomFilterViewV2",
viewModelConfigModuleName: "CustomFilterViewModelV2",
configPropertyName: "customFilterConfig"
},
FolderFilters: {
viewConfigModuleName: "FolderFilterViewV2",
viewModelConfigModuleName: "FolderFilterViewModelV2",
configPropertyName: "folderFilterConfig"
},
TagFilters: {
viewConfigModuleName: "TagFilterViewGeneratorV2",
viewModelConfigModuleName: "TagFilterViewModelGeneratorV2",
configPropertyName: "tagFilterConfig"
}
};
}
});
}
);
6. Add a dependency in the “InvoiceSectionV2” schema to the overridden “UsrQuickFilterModuleV2” module https://prnt.sc/shwzto :
define("InvoiceSectionV2", ["UsrQuickFilterModuleV2"], function(){
return {
"entitySchemaName": "Invoice"
};
});
Best regards,
Norton