From 4f9e42cba0638a3efcbfa82baa0fb424da24b182 Mon Sep 17 00:00:00 2001 From: Srinath Date: Thu, 5 Mar 2026 12:04:33 +0530 Subject: [PATCH] Implement dynamic header and table color functionality --- src/Features/ThemeChange/ThemeChange.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/Features/ThemeChange/ThemeChange.js b/src/Features/ThemeChange/ThemeChange.js index 44bc209..0cf576b 100644 --- a/src/Features/ThemeChange/ThemeChange.js +++ b/src/Features/ThemeChange/ThemeChange.js @@ -544,11 +544,13 @@ const initialState = { PrintTemplate: null, DCPrintTemplate: null, PrintFieldDetails: null, + DCtoInvoicePrintFieldDetails: null, PricingAppPricingName: null, FeatureAddonData: [], SessionData: [], ThemeCreation: {}, printDatas: {}, + DCtoInvoice: {}, DefaultTheme: [], OthersTheme: [], SelectedTheme: {}, @@ -2407,12 +2409,16 @@ const ThemeSlice = createSlice({ item.SetasDefault == 'Y' && item.PrintTypeName === 'Delivery Chalan' )?.StyleName; - state.printDatas = action?.payload?.data?.data?.[0]?.ComponentDetails.find( (item) => item.SetasDefault == 'Y' && item.PrintTypeName === 'Sales' ); + state.DCtoInvoice = + action?.payload?.data?.data?.[0]?.ComponentDetails.find( + (item) => + item.SetasDefault == 'Y' && item.PrintTypeName === 'DC to Invoice' + ); state.PrintFieldDetails = action?.payload?.data?.data?.[0]?.ComponentDetails?.find( (item) => @@ -2421,6 +2427,14 @@ const ThemeSlice = createSlice({ acc[item.ConfigName] = true; return acc; }, {}); + state.DCtoInvoicePrintFieldDetails = + action?.payload?.data?.data?.[0]?.ComponentDetails?.find( + (item) => + item.SetasDefault == 'Y' && item.PrintTypeName === 'DC to Invoice' + )?.FieldDetails?.reduce((acc, item) => { + acc[item.ConfigName] = true; + return acc; + }, {}); } else if (action?.payload?.data?.statusCode == 0) { state.PrintTemplate = undefined; @@ -2755,6 +2769,7 @@ export const GlobalPricingAppPricingName = (state) => state?.theme?.PricingAppPricingName; export const SelectedPrintTemplate = (state) => state?.theme?.PrintTemplate; export const GloabalFieldDetails = (state) => state?.theme?.PrintFieldDetails; +export const GloabalDCtoInvoiceFieldDetails = (state) => state?.theme?.DCtoInvoicePrintFieldDetails; export const GlobalReprintDataFound = (state) => state.theme?.ReprintDataFound; export const GlobalPritdummyData = (state) => state.theme?.PrintdummyData; export const GlobalprintSize = (state) => state.theme?.printSize; @@ -2865,6 +2880,7 @@ export const SelectedGlobalSubCatgFont = (state) => state.theme.SelectedSubCatgFont; export const StoredSessionData = (state) => state.theme.SessionData; export const GlobalprintDatas = (state) => state.theme.printDatas; +export const GlobalDCtoInvoicePrint = (state) => state.theme.DCtoInvoice; export const GlobalDefaultTheme = (state) => state.theme.DefaultTheme; export const GlobalOthersTheme = (state) => state.theme.OthersTheme; export const GlobalSelectedTheme = (state) => state.theme.SelectedTheme;