2
0
mirror of https://github.com/frappe/books.git synced 2024-12-22 19:09:01 +00:00

feat: hide loyalty program in sidebar when not enabled

This commit is contained in:
AbleKSaju 2024-08-22 15:38:12 +05:30
parent 9bfcbbfc5e
commit 4ba91f0f20
2 changed files with 11 additions and 0 deletions

View File

@ -18,6 +18,7 @@ export class AccountingSettings extends Doc {
enableLead?: boolean;
enableFormCustomization?: boolean;
enableInvoiceReturns?: boolean;
enableLoyaltyProgram?: boolean;
enablePricingRule?: boolean;
static filters: FiltersMap = {
@ -56,6 +57,9 @@ export class AccountingSettings extends Doc {
enableInvoiceReturns: () => {
return !!this.enableInvoiceReturns;
},
enableLoyaltyProgram: () => {
return !!this.enableLoyaltyProgram;
},
};
override hidden: HiddenMap = {

View File

@ -202,6 +202,13 @@ function getCompleteSidebar(): SidebarConfig {
schemaName: 'Item',
filters: routeFilters.SalesItems,
},
{
label: t`Loyalty Program`,
name: 'loyalty-program',
route: '/list/LoyaltyProgram',
schemaName: 'LoyaltyProgram',
hidden: () => !fyo.singles.AccountingSettings?.enableLoyaltyProgram,
},
{
label: t`Lead`,
name: 'lead',