Add extra values in Period Filter

Hi ,

 

I need help in changing Period Filter in Invoice Section and add Current Quarter ,Current Year in the dropdown.

 

Thank you.

File attachments
Like 0

Like

3 comments
Best reply

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

Norton Lingard,

Thank you for detail steps along with Screenshots.

Hi guys, would this also work for filtering on dashboards? So would be a solution for custom fiscal year periods? 

Show all comments