Resolve conflicts with main
This commit is contained in:
commit
1d64c7cd3b
|
|
@ -804,37 +804,34 @@ export const getPaymentOptionFeatureApi = createAsyncThunk(
|
||||||
);
|
);
|
||||||
|
|
||||||
export const getProductsearch = createAsyncThunk(
|
export const getProductsearch = createAsyncThunk(
|
||||||
"BookingData/getProductsearch",
|
'BookingData/getProductsearch',
|
||||||
async (
|
async (
|
||||||
{ CompId, BranchId, AppId, ProdName },
|
{ CompId, BranchId, AppId, ProdName },
|
||||||
{ signal, rejectWithValue }
|
{ signal, rejectWithValue }
|
||||||
) => {
|
) => {
|
||||||
try {
|
try {
|
||||||
if (!CompId || !BranchId || !AppId || !ProdName) {
|
if (!CompId || !BranchId || !AppId || !ProdName) {
|
||||||
return rejectWithValue("Invalid params");
|
return rejectWithValue('Invalid params');
|
||||||
}
|
}
|
||||||
|
|
||||||
const response = await axiosRetailInstanceData.get(
|
const response = await axiosRetailInstanceData.get(`/productCardList`, {
|
||||||
`/productCardList`,
|
params: {
|
||||||
{
|
CompId,
|
||||||
params: {
|
BranchId,
|
||||||
CompId,
|
AppId,
|
||||||
BranchId,
|
ProdName,
|
||||||
AppId,
|
},
|
||||||
ProdName,
|
signal, // ✅ Abort works here
|
||||||
},
|
});
|
||||||
signal, // ✅ Abort works here
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
return response.data; // ✅ return only data
|
return response.data; // ✅ return only data
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// ✅ Abort error – ignore
|
// ✅ Abort error – ignore
|
||||||
if (error.name === "CanceledError" || error.name === "AbortError") {
|
if (error.name === 'CanceledError' || error.name === 'AbortError') {
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
|
|
||||||
return rejectWithValue(error.response?.data || "API Error");
|
return rejectWithValue(error.response?.data || 'API Error');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
@ -1472,7 +1469,6 @@ export const CustomerOrderList = createAsyncThunk(
|
||||||
`/LastBuyProductList?compId=${CompId}&branchId=${BranchId}&appId=${AppId}&mobileNo=${MobileNo}`
|
`/LastBuyProductList?compId=${CompId}&branchId=${BranchId}&appId=${AppId}&mobileNo=${MobileNo}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -1493,8 +1489,6 @@ export const getmultipleSearch = createAsyncThunk(
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const initialState = {
|
const initialState = {
|
||||||
PrintStyle: null,
|
PrintStyle: null,
|
||||||
CustId: null,
|
CustId: null,
|
||||||
|
|
@ -1995,9 +1989,8 @@ const BookingData = createSlice({
|
||||||
state.SelectedDatas = [];
|
state.SelectedDatas = [];
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
|
||||||
builder.addCase(getProductsearch.fulfilled, (state, action) => {
|
builder.addCase(getProductsearch.fulfilled, (state, action) => {
|
||||||
console.log(action?.payload, "mohanaacacacca")
|
console.log(action?.payload, 'mohanaacacacca');
|
||||||
if (action?.payload?.statusCode === 1) {
|
if (action?.payload?.statusCode === 1) {
|
||||||
state.SelectedDatas = action?.payload?.data;
|
state.SelectedDatas = action?.payload?.data;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,7 @@ export const getPurProdvaraiantdata = createAsyncThunk(
|
||||||
data?.prodName !== undefined
|
data?.prodName !== undefined
|
||||||
) {
|
) {
|
||||||
return await axiosRetailInstanceData.get(
|
return await axiosRetailInstanceData.get(
|
||||||
`/ProductCardList?CompId=${data?.CompId}&BranchId=${data?.BranchId}&AppId=${data?.AppId}&prodName=${encodeURIComponent(data?.prodName)}`
|
`/ProductCardList?CompId=${data?.CompId}&BranchId=${data?.BranchId}&AppId=${data?.AppId}&prodName=${encodeURIComponent(data?.prodName)}&type=S`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ export const getInvoiceImageData = createAsyncThunk(
|
||||||
formData.append("file", file); // 👈 actual file here
|
formData.append("file", file); // 👈 actual file here
|
||||||
|
|
||||||
const response = await axiosRetailOcrData.post(
|
const response = await axiosRetailOcrData.post(
|
||||||
"/invoiceupload",
|
"/invoice",
|
||||||
formData,
|
formData,
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
|
|
|
||||||
|
|
@ -364,7 +364,14 @@ export const getPrintSelectionComponentData = createAsyncThunk(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
export const getSalesTemplate = createAsyncThunk(
|
||||||
|
'theme/getSalesTemplate',
|
||||||
|
async (Data) => {
|
||||||
|
return await axiosRetailInstanceData.get(
|
||||||
|
`${apiUrl}/ThemeMaster?compId=${Data.CompId}&branchId=${Data.BranchId}&appId=${Data.AppId}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
export const PricingAppPricingNameData = createAsyncThunk(
|
export const PricingAppPricingNameData = createAsyncThunk(
|
||||||
'theme/PricingAppPricingNameData',
|
'theme/PricingAppPricingNameData',
|
||||||
async (data) => {
|
async (data) => {
|
||||||
|
|
@ -463,6 +470,7 @@ const initialState = {
|
||||||
notes: false,
|
notes: false,
|
||||||
SignatureImage: '',
|
SignatureImage: '',
|
||||||
BillName: '',
|
BillName: '',
|
||||||
|
SelectedHeaderColor: '#000000',
|
||||||
allColors: [],
|
allColors: [],
|
||||||
allColorsCat: [],
|
allColorsCat: [],
|
||||||
LayoutOverallColorsList: [],
|
LayoutOverallColorsList: [],
|
||||||
|
|
@ -2139,6 +2147,9 @@ const ThemeSlice = createSlice({
|
||||||
changeBillName: (state, action) => {
|
changeBillName: (state, action) => {
|
||||||
state.BillName = action?.payload;
|
state.BillName = action?.payload;
|
||||||
},
|
},
|
||||||
|
changeSelectedHeaderColor: (state, action) => {
|
||||||
|
state.SelectedHeaderColor = action?.payload;
|
||||||
|
},
|
||||||
changeCurrentColor: (state, action) => {
|
changeCurrentColor: (state, action) => {
|
||||||
const { color } = action?.payload;
|
const { color } = action?.payload;
|
||||||
state.CurrentColor = color;
|
state.CurrentColor = color;
|
||||||
|
|
@ -2332,16 +2343,7 @@ const ThemeSlice = createSlice({
|
||||||
getPrintSelectionComponentData.fulfilled,
|
getPrintSelectionComponentData.fulfilled,
|
||||||
(state, action) => {
|
(state, action) => {
|
||||||
if (action?.payload?.data?.statusCode === 1) {
|
if (action?.payload?.data?.statusCode === 1) {
|
||||||
const Advance = state?.PricingAppPricingName?.some(
|
|
||||||
(item) => item.PricingName === 'Premium'
|
|
||||||
);
|
|
||||||
const hasCustomizedTemplate =
|
|
||||||
state.FeatureAddonData?.FeatureDtls?.some(
|
|
||||||
(item) =>
|
|
||||||
item?.FeatureAddonName?.toLowerCase() ===
|
|
||||||
'customized template'
|
|
||||||
);
|
|
||||||
if (Advance || hasCustomizedTemplate) {
|
|
||||||
state.PrintTemplate =
|
state.PrintTemplate =
|
||||||
action?.payload?.data?.data?.[0]?.ComponentDetails?.find(
|
action?.payload?.data?.data?.[0]?.ComponentDetails?.find(
|
||||||
(item) =>
|
(item) =>
|
||||||
|
|
@ -2367,7 +2369,7 @@ const ThemeSlice = createSlice({
|
||||||
acc[item.ConfigName] = true;
|
acc[item.ConfigName] = true;
|
||||||
return acc;
|
return acc;
|
||||||
}, {});
|
}, {});
|
||||||
}
|
|
||||||
} else if (action?.payload?.data?.statusCode == 0) {
|
} else if (action?.payload?.data?.statusCode == 0) {
|
||||||
state.PrintTemplate = undefined;
|
state.PrintTemplate = undefined;
|
||||||
}
|
}
|
||||||
|
|
@ -2683,6 +2685,7 @@ export const {
|
||||||
changeOthersTheme,
|
changeOthersTheme,
|
||||||
changeActiveTheme,
|
changeActiveTheme,
|
||||||
changeScanTemplate,
|
changeScanTemplate,
|
||||||
|
changeSelectedHeaderColor,
|
||||||
} = ThemeSlice.actions;
|
} = ThemeSlice.actions;
|
||||||
|
|
||||||
export const GlobalPricingAppPricingName = (state) =>
|
export const GlobalPricingAppPricingName = (state) =>
|
||||||
|
|
@ -2713,6 +2716,8 @@ export const GlobalthemeFormat = (state) => state.theme?.themeFormat;
|
||||||
export const Globalnotes = (state) => state.theme?.notes;
|
export const Globalnotes = (state) => state.theme?.notes;
|
||||||
export const GlobalSignatureImage = (state) => state.theme?.SignatureImage;
|
export const GlobalSignatureImage = (state) => state.theme?.SignatureImage;
|
||||||
export const GlobalBillName = (state) => state.theme?.BillName;
|
export const GlobalBillName = (state) => state.theme?.BillName;
|
||||||
|
export const GlobalSelectedPrintHeaderColor = (state) =>
|
||||||
|
state.theme?.SelectedHeaderColor;
|
||||||
|
|
||||||
export const changeCurrentColorValue = (state) => state.theme?.CurrentColor;
|
export const changeCurrentColorValue = (state) => state.theme?.CurrentColor;
|
||||||
export const changeCurrentTextValue = (state) => state.theme?.CurrentText;
|
export const changeCurrentTextValue = (state) => state.theme?.CurrentText;
|
||||||
|
|
|
||||||
|
|
@ -580,28 +580,16 @@ console.log(iswarehouse,'iswarehouseiswarehouseiswarehouse');
|
||||||
'GST Invoice Setup',
|
'GST Invoice Setup',
|
||||||
`${subDirectory}setting/gst-invoice-setup`
|
`${subDirectory}setting/gst-invoice-setup`
|
||||||
),
|
),
|
||||||
((Advance ||
|
(!iswarehouse) &&
|
||||||
featureaddDetails?.find(
|
|
||||||
(item) =>
|
|
||||||
item?.FeatureAddonName?.toLowerCase() === 'customized template'
|
|
||||||
)) && !iswarehouse) &&
|
|
||||||
getsubItem('Customization', `${subDirectory}setting/Customize`, null, [
|
getsubItem('Customization', `${subDirectory}setting/Customize`, null, [
|
||||||
(Advance ||
|
|
||||||
featureaddDetails?.find(
|
|
||||||
(item) =>
|
|
||||||
item?.FeatureAddonName?.toLowerCase() === 'customized template'
|
|
||||||
)) &&
|
|
||||||
!iswarehouse
|
!iswarehouse
|
||||||
? getsubItem(
|
? getsubItem(
|
||||||
'Sales Screen',
|
'Sales Screen',
|
||||||
`${subDirectory}saleslayouts/sales-selection`
|
`${subDirectory}saleslayouts/sales-selection`
|
||||||
)
|
)
|
||||||
: '',
|
: '',
|
||||||
(Advance ||
|
|
||||||
featureaddDetails?.find(
|
|
||||||
(item) =>
|
|
||||||
item?.FeatureAddonName?.toLowerCase() === 'customized template'
|
|
||||||
)) &&
|
|
||||||
!iswarehouse
|
!iswarehouse
|
||||||
? getsubItem(
|
? getsubItem(
|
||||||
'Print Forms',
|
'Print Forms',
|
||||||
|
|
@ -616,11 +604,7 @@ console.log(iswarehouse,'iswarehouseiswarehouseiswarehouse');
|
||||||
`${subDirectory}saleslayouts/kiosk-selection`
|
`${subDirectory}saleslayouts/kiosk-selection`
|
||||||
)
|
)
|
||||||
: '',
|
: '',
|
||||||
(Advance ||
|
|
||||||
featureaddDetails?.find(
|
|
||||||
(item) =>
|
|
||||||
item?.FeatureAddonName?.toLowerCase() === 'customized template'
|
|
||||||
)) &&
|
|
||||||
!iswarehouse
|
!iswarehouse
|
||||||
? getsubItem(
|
? getsubItem(
|
||||||
'Barcode / QR',
|
'Barcode / QR',
|
||||||
|
|
@ -1318,29 +1302,17 @@ console.log(iswarehouse,'iswarehouseiswarehouseiswarehouse');
|
||||||
'GST Invoice Setup',
|
'GST Invoice Setup',
|
||||||
`${subDirectory}setting/gst-invoice-setup`
|
`${subDirectory}setting/gst-invoice-setup`
|
||||||
),
|
),
|
||||||
((Advance ||
|
(
|
||||||
featureaddDetails?.find(
|
|
||||||
(item) =>
|
|
||||||
item?.FeatureAddonName?.toLowerCase() === 'customized template'
|
|
||||||
)) &&
|
|
||||||
!iswarehouse) &&
|
!iswarehouse) &&
|
||||||
getsubItem('Customization', `${subDirectory}setting/Customize`, null, [
|
getsubItem('Customization', `${subDirectory}setting/Customize`, null, [
|
||||||
(Advance ||
|
|
||||||
featureaddDetails?.find(
|
|
||||||
(item) =>
|
|
||||||
item?.FeatureAddonName?.toLowerCase() === 'customized template'
|
|
||||||
)) &&
|
|
||||||
!iswarehouse
|
!iswarehouse
|
||||||
? getsubItem(
|
? getsubItem(
|
||||||
'Sales Screen',
|
'Sales Screen',
|
||||||
`${subDirectory}saleslayouts/sales-selection`
|
`${subDirectory}saleslayouts/sales-selection`
|
||||||
)
|
)
|
||||||
: '',
|
: '',
|
||||||
(Advance ||
|
|
||||||
featureaddDetails?.find(
|
|
||||||
(item) =>
|
|
||||||
item?.FeatureAddonName?.toLowerCase() === 'customized template'
|
|
||||||
)) &&
|
|
||||||
!iswarehouse
|
!iswarehouse
|
||||||
? getsubItem(
|
? getsubItem(
|
||||||
'Print Forms',
|
'Print Forms',
|
||||||
|
|
@ -1355,11 +1327,7 @@ console.log(iswarehouse,'iswarehouseiswarehouseiswarehouse');
|
||||||
`${subDirectory}saleslayouts/kiosk-selection`
|
`${subDirectory}saleslayouts/kiosk-selection`
|
||||||
)
|
)
|
||||||
: '',
|
: '',
|
||||||
(Advance ||
|
|
||||||
featureaddDetails?.find(
|
|
||||||
(item) =>
|
|
||||||
item?.FeatureAddonName?.toLowerCase() === 'customized template'
|
|
||||||
)) &&
|
|
||||||
!iswarehouse
|
!iswarehouse
|
||||||
? getsubItem(
|
? getsubItem(
|
||||||
'Barcode / QR',
|
'Barcode / QR',
|
||||||
|
|
@ -2563,26 +2531,14 @@ const customizedmenuitem = []
|
||||||
'GST Invoice Setup',
|
'GST Invoice Setup',
|
||||||
`${subDirectory}setting/gst-invoice-setup`
|
`${subDirectory}setting/gst-invoice-setup`
|
||||||
),
|
),
|
||||||
(Advance ||
|
|
||||||
featureaddDetails?.find(
|
|
||||||
(item) =>
|
|
||||||
item?.FeatureAddonName?.toLowerCase() === 'customized template'
|
|
||||||
) ||
|
|
||||||
featureaddDetails?.find(
|
|
||||||
(item) => item?.FeatureAddonName?.toLowerCase() === 'kiosk sales'
|
|
||||||
)) &&
|
|
||||||
!sportsAppPreference &&
|
!sportsAppPreference &&
|
||||||
getsubItem(
|
getsubItem(
|
||||||
'Customization',
|
'Customization',
|
||||||
`${subDirectory}setting/Customized`,
|
`${subDirectory}setting/Customized`,
|
||||||
null,
|
null,
|
||||||
[
|
[
|
||||||
(Advance ||
|
|
||||||
featureaddDetails?.find(
|
|
||||||
(item) =>
|
|
||||||
item?.FeatureAddonName?.toLowerCase() ===
|
|
||||||
'customized template'
|
|
||||||
)) &&
|
|
||||||
!sportsAppPreference &&
|
!sportsAppPreference &&
|
||||||
!iswarehouse
|
!iswarehouse
|
||||||
? getsubItem(
|
? getsubItem(
|
||||||
|
|
@ -2590,12 +2546,7 @@ const customizedmenuitem = []
|
||||||
`${subDirectory}saleslayouts/sales-selection`
|
`${subDirectory}saleslayouts/sales-selection`
|
||||||
)
|
)
|
||||||
: '',
|
: '',
|
||||||
(Advance ||
|
|
||||||
featureaddDetails?.find(
|
|
||||||
(item) =>
|
|
||||||
item?.FeatureAddonName?.toLowerCase() ===
|
|
||||||
'customized template'
|
|
||||||
)) &&
|
|
||||||
!iswarehouse
|
!iswarehouse
|
||||||
? getsubItem(
|
? getsubItem(
|
||||||
'Print Forms',
|
'Print Forms',
|
||||||
|
|
@ -2611,12 +2562,7 @@ const customizedmenuitem = []
|
||||||
`${subDirectory}saleslayouts/kiosk-selection`
|
`${subDirectory}saleslayouts/kiosk-selection`
|
||||||
)
|
)
|
||||||
: '',
|
: '',
|
||||||
(Advance ||
|
|
||||||
featureaddDetails?.find(
|
|
||||||
(item) =>
|
|
||||||
item?.FeatureAddonName?.toLowerCase() ===
|
|
||||||
'customized template'
|
|
||||||
)) &&
|
|
||||||
!iswarehouse &&
|
!iswarehouse &&
|
||||||
!sportsAppPreference
|
!sportsAppPreference
|
||||||
? getsubItem(
|
? getsubItem(
|
||||||
|
|
|
||||||
|
|
@ -87,11 +87,13 @@ const BSBillingEditQuantity = (props) => {
|
||||||
);
|
);
|
||||||
const ReorderProductData = useSelector(GlobalReorderProductDetails);
|
const ReorderProductData = useSelector(GlobalReorderProductDetails);
|
||||||
const templateData = useSelector(getTemplateData);
|
const templateData = useSelector(getTemplateData);
|
||||||
const OfferCheckedInSetup = templateData?.BookingNavbar?.[1].some(
|
const OfferCheckedInSetup =
|
||||||
(item) => item?.OptionName == 'Offer'
|
templateData?.BookingNavbar?.[1].some(
|
||||||
) || (templateData?.BookingCombo1?.[1]?.some(
|
(item) => item?.OptionName == 'Offer'
|
||||||
(item) => item?.OptionName == 'Offer'
|
) ||
|
||||||
));
|
templateData?.BookingCombo1?.[1]?.some(
|
||||||
|
(item) => item?.OptionName == 'Offer'
|
||||||
|
);
|
||||||
const [ClearQuantity, setClearQuantity] = useState(false);
|
const [ClearQuantity, setClearQuantity] = useState(false);
|
||||||
const CartOrderDetails = useSelector(GlobalOrderCardDetails);
|
const CartOrderDetails = useSelector(GlobalOrderCardDetails);
|
||||||
const SettingDataSelector = useSelector(PreferenceData);
|
const SettingDataSelector = useSelector(PreferenceData);
|
||||||
|
|
@ -704,7 +706,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
return (
|
return (
|
||||||
cartItem?.InwardDtlId === editedProduct?.InwardDtlId &&
|
cartItem?.InwardDtlId === editedProduct?.InwardDtlId &&
|
||||||
cartItem?.OfferMessage?.[0]?.OfferId ===
|
cartItem?.OfferMessage?.[0]?.OfferId ===
|
||||||
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
||||||
cartItem?.OfferMode === editedProduct?.OfferMode &&
|
cartItem?.OfferMode === editedProduct?.OfferMode &&
|
||||||
cartItem?.BookingTypeName !== editedProduct?.BookingTypeName
|
cartItem?.BookingTypeName !== editedProduct?.BookingTypeName
|
||||||
);
|
);
|
||||||
|
|
@ -838,7 +840,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
cartItem?.InwardDtlId === editedProduct?.InwardDtlId &&
|
cartItem?.InwardDtlId === editedProduct?.InwardDtlId &&
|
||||||
cartItem?.OrderRate === editedProduct?.OrderRate &&
|
cartItem?.OrderRate === editedProduct?.OrderRate &&
|
||||||
cartItem?.BookingTypeName !==
|
cartItem?.BookingTypeName !==
|
||||||
editedProduct?.BookingTypeName &&
|
editedProduct?.BookingTypeName &&
|
||||||
!cartItem?.OfferMode &&
|
!cartItem?.OfferMode &&
|
||||||
cartItem?.Offer === 0
|
cartItem?.Offer === 0
|
||||||
);
|
);
|
||||||
|
|
@ -852,7 +854,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
cartItem?.InwardDtlId === editedProduct?.InwardDtlId &&
|
cartItem?.InwardDtlId === editedProduct?.InwardDtlId &&
|
||||||
cartItem?.OrderRate === editedProduct?.OrderRate &&
|
cartItem?.OrderRate === editedProduct?.OrderRate &&
|
||||||
cartItem?.BookingTypeName !==
|
cartItem?.BookingTypeName !==
|
||||||
editedProduct?.BookingTypeName &&
|
editedProduct?.BookingTypeName &&
|
||||||
cartItem?.OfferMode === editedProduct?.OfferMode &&
|
cartItem?.OfferMode === editedProduct?.OfferMode &&
|
||||||
cartItem?.Offer > 0
|
cartItem?.Offer > 0
|
||||||
);
|
);
|
||||||
|
|
@ -985,7 +987,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
)
|
)
|
||||||
) &&
|
) &&
|
||||||
product?.OfferId ===
|
product?.OfferId ===
|
||||||
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
||||||
product?.OfferMode === editedProduct?.OfferMode
|
product?.OfferMode === editedProduct?.OfferMode
|
||||||
) {
|
) {
|
||||||
const freeQty =
|
const freeQty =
|
||||||
|
|
@ -1018,7 +1020,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
// Also check main offer conditions
|
// Also check main offer conditions
|
||||||
const isMatchingOffer =
|
const isMatchingOffer =
|
||||||
offerProduct?.OfferId ===
|
offerProduct?.OfferId ===
|
||||||
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
||||||
offerProduct?.OfferMode === editedProduct?.OfferMode;
|
offerProduct?.OfferMode === editedProduct?.OfferMode;
|
||||||
|
|
||||||
if (hasMatchingFreeProduct && isMatchingOffer) {
|
if (hasMatchingFreeProduct && isMatchingOffer) {
|
||||||
|
|
@ -1101,7 +1103,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
)
|
)
|
||||||
) &&
|
) &&
|
||||||
product?.OfferId ===
|
product?.OfferId ===
|
||||||
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
||||||
product?.OfferMode === editedProduct?.OfferMode
|
product?.OfferMode === editedProduct?.OfferMode
|
||||||
) {
|
) {
|
||||||
return {
|
return {
|
||||||
|
|
@ -1131,7 +1133,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
// Also check main offer conditions
|
// Also check main offer conditions
|
||||||
const isMatchingOffer =
|
const isMatchingOffer =
|
||||||
offerProduct?.OfferId ===
|
offerProduct?.OfferId ===
|
||||||
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
||||||
offerProduct?.OfferMode === editedProduct?.OfferMode;
|
offerProduct?.OfferMode === editedProduct?.OfferMode;
|
||||||
|
|
||||||
if (hasMatchingFreeProduct && isMatchingOffer) {
|
if (hasMatchingFreeProduct && isMatchingOffer) {
|
||||||
|
|
@ -1318,7 +1320,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
// Also check main offer conditions
|
// Also check main offer conditions
|
||||||
const isMatchingOffer =
|
const isMatchingOffer =
|
||||||
offerProduct?.OfferId ===
|
offerProduct?.OfferId ===
|
||||||
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
||||||
offerProduct?.OfferMode === editedProduct?.OfferMode;
|
offerProduct?.OfferMode === editedProduct?.OfferMode;
|
||||||
|
|
||||||
if (hasMatchingFreeProduct && isMatchingOffer) {
|
if (hasMatchingFreeProduct && isMatchingOffer) {
|
||||||
|
|
@ -1420,7 +1422,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
// Also check main offer conditions
|
// Also check main offer conditions
|
||||||
const isMatchingOffer =
|
const isMatchingOffer =
|
||||||
offerProduct?.OfferId ===
|
offerProduct?.OfferId ===
|
||||||
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
editedProduct?.OfferMessage?.[0]?.OfferId &&
|
||||||
offerProduct?.OfferMode === editedProduct?.OfferMode;
|
offerProduct?.OfferMode === editedProduct?.OfferMode;
|
||||||
|
|
||||||
if (hasMatchingFreeProduct && isMatchingOffer) {
|
if (hasMatchingFreeProduct && isMatchingOffer) {
|
||||||
|
|
@ -1574,7 +1576,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
) &&
|
) &&
|
||||||
cartItem?.Offer &&
|
cartItem?.Offer &&
|
||||||
isFreeProductApplicable?.OfferId ===
|
isFreeProductApplicable?.OfferId ===
|
||||||
cartItem?.OfferMessage?.[0]?.OfferId
|
cartItem?.OfferMessage?.[0]?.OfferId
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
@ -1863,11 +1865,11 @@ const BSBillingEditQuantity = (props) => {
|
||||||
product?.ProdId === editedProduct?.ProdId &&
|
product?.ProdId === editedProduct?.ProdId &&
|
||||||
product?.InwardDtlId === editedProduct?.InwardDtlId &&
|
product?.InwardDtlId === editedProduct?.InwardDtlId &&
|
||||||
product?.OfferId ===
|
product?.OfferId ===
|
||||||
(sameBookingTypeProduct?.OfferMessage?.[0]?.OfferId ||
|
(sameBookingTypeProduct?.OfferMessage?.[0]?.OfferId ||
|
||||||
otherBookingTypeProduct?.OfferMessage?.[0]?.OfferId) &&
|
otherBookingTypeProduct?.OfferMessage?.[0]?.OfferId) &&
|
||||||
product?.OfferMode ===
|
product?.OfferMode ===
|
||||||
(sameBookingTypeProduct?.OfferMode ||
|
(sameBookingTypeProduct?.OfferMode ||
|
||||||
otherBookingTypeProduct?.OfferMode)
|
otherBookingTypeProduct?.OfferMode)
|
||||||
) {
|
) {
|
||||||
return {
|
return {
|
||||||
...product,
|
...product,
|
||||||
|
|
@ -1901,11 +1903,11 @@ const BSBillingEditQuantity = (props) => {
|
||||||
// Also check main offer conditions
|
// Also check main offer conditions
|
||||||
const isMatchingOffer =
|
const isMatchingOffer =
|
||||||
offerProduct?.OfferId ===
|
offerProduct?.OfferId ===
|
||||||
(sameBookingTypeProduct?.OfferMessage?.[0]?.OfferId ||
|
(sameBookingTypeProduct?.OfferMessage?.[0]?.OfferId ||
|
||||||
otherBookingTypeProduct?.OfferMessage?.[0]?.OfferId) &&
|
otherBookingTypeProduct?.OfferMessage?.[0]?.OfferId) &&
|
||||||
offerProduct?.OfferMode ===
|
offerProduct?.OfferMode ===
|
||||||
(sameBookingTypeProduct?.OfferMode ||
|
(sameBookingTypeProduct?.OfferMode ||
|
||||||
otherBookingTypeProduct?.OfferMode);
|
otherBookingTypeProduct?.OfferMode);
|
||||||
|
|
||||||
if (hasMatchingFreeProduct && isMatchingOffer) {
|
if (hasMatchingFreeProduct && isMatchingOffer) {
|
||||||
// Get loyalty points from the matching free product
|
// Get loyalty points from the matching free product
|
||||||
|
|
@ -2046,7 +2048,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
cartItem?.Offer > 0 &&
|
cartItem?.Offer > 0 &&
|
||||||
isFreeProductApplicable?.OfferMode === cartItem?.OfferMode &&
|
isFreeProductApplicable?.OfferMode === cartItem?.OfferMode &&
|
||||||
isFreeProductApplicable?.OfferId ===
|
isFreeProductApplicable?.OfferId ===
|
||||||
cartItem?.OfferMessage?.[0]?.OfferId
|
cartItem?.OfferMessage?.[0]?.OfferId
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
@ -2149,11 +2151,11 @@ const BSBillingEditQuantity = (props) => {
|
||||||
if (
|
if (
|
||||||
cartItem.ProdId === otherBookingTypeProduct.ProdId &&
|
cartItem.ProdId === otherBookingTypeProduct.ProdId &&
|
||||||
cartItem.InwardDtlId ===
|
cartItem.InwardDtlId ===
|
||||||
otherBookingTypeProduct.InwardDtlId &&
|
otherBookingTypeProduct.InwardDtlId &&
|
||||||
cartItem.BookingTypeName ===
|
cartItem.BookingTypeName ===
|
||||||
otherBookingTypeProduct.BookingTypeName &&
|
otherBookingTypeProduct.BookingTypeName &&
|
||||||
cartItem.OrderRate ===
|
cartItem.OrderRate ===
|
||||||
otherBookingTypeProduct.OrderRate &&
|
otherBookingTypeProduct.OrderRate &&
|
||||||
cartItem.OfferMode &&
|
cartItem.OfferMode &&
|
||||||
cartItem.Offer > 0
|
cartItem.Offer > 0
|
||||||
) {
|
) {
|
||||||
|
|
@ -2224,12 +2226,12 @@ const BSBillingEditQuantity = (props) => {
|
||||||
product?.ProdId === editedProduct?.ProdId &&
|
product?.ProdId === editedProduct?.ProdId &&
|
||||||
product?.InwardDtlId === editedProduct?.InwardDtlId &&
|
product?.InwardDtlId === editedProduct?.InwardDtlId &&
|
||||||
product?.OfferId ===
|
product?.OfferId ===
|
||||||
(sameBookingTypeFreeProduct?.OfferMessage?.[0]?.OfferId ||
|
(sameBookingTypeFreeProduct?.OfferMessage?.[0]?.OfferId ||
|
||||||
otherBookingTypeFreeProduct?.OfferMessage?.[0]
|
otherBookingTypeFreeProduct?.OfferMessage?.[0]
|
||||||
?.OfferId) &&
|
?.OfferId) &&
|
||||||
product?.OfferMode ===
|
product?.OfferMode ===
|
||||||
(sameBookingTypeFreeProduct?.OfferMode ||
|
(sameBookingTypeFreeProduct?.OfferMode ||
|
||||||
otherBookingTypeFreeProduct?.OfferMode)
|
otherBookingTypeFreeProduct?.OfferMode)
|
||||||
) {
|
) {
|
||||||
return {
|
return {
|
||||||
...product,
|
...product,
|
||||||
|
|
@ -2263,13 +2265,13 @@ const BSBillingEditQuantity = (props) => {
|
||||||
// Also check main offer conditions
|
// Also check main offer conditions
|
||||||
const isMatchingOffer =
|
const isMatchingOffer =
|
||||||
offerProduct?.OfferId ===
|
offerProduct?.OfferId ===
|
||||||
(sameBookingTypeFreeProduct?.OfferMessage?.[0]
|
(sameBookingTypeFreeProduct?.OfferMessage?.[0]
|
||||||
?.OfferId ||
|
?.OfferId ||
|
||||||
otherBookingTypeFreeProduct?.OfferMessage?.[0]
|
otherBookingTypeFreeProduct?.OfferMessage?.[0]
|
||||||
?.OfferId) &&
|
?.OfferId) &&
|
||||||
offerProduct?.OfferMode ===
|
offerProduct?.OfferMode ===
|
||||||
(sameBookingTypeFreeProduct?.OfferMode ||
|
(sameBookingTypeFreeProduct?.OfferMode ||
|
||||||
otherBookingTypeFreeProduct?.OfferMode);
|
otherBookingTypeFreeProduct?.OfferMode);
|
||||||
|
|
||||||
if (hasMatchingFreeProduct && isMatchingOffer) {
|
if (hasMatchingFreeProduct && isMatchingOffer) {
|
||||||
// Get loyalty points from the matching free product
|
// Get loyalty points from the matching free product
|
||||||
|
|
@ -2351,11 +2353,11 @@ const BSBillingEditQuantity = (props) => {
|
||||||
if (
|
if (
|
||||||
cartItem.ProdId === sameBookingTypeProduct.ProdId &&
|
cartItem.ProdId === sameBookingTypeProduct.ProdId &&
|
||||||
cartItem.InwardDtlId ===
|
cartItem.InwardDtlId ===
|
||||||
sameBookingTypeProduct.InwardDtlId &&
|
sameBookingTypeProduct.InwardDtlId &&
|
||||||
cartItem.BookingTypeName ===
|
cartItem.BookingTypeName ===
|
||||||
sameBookingTypeProduct.BookingTypeName &&
|
sameBookingTypeProduct.BookingTypeName &&
|
||||||
cartItem.OrderRate ===
|
cartItem.OrderRate ===
|
||||||
sameBookingTypeProduct.OrderRate &&
|
sameBookingTypeProduct.OrderRate &&
|
||||||
cartItem.OfferMode &&
|
cartItem.OfferMode &&
|
||||||
cartItem.Offer > 0
|
cartItem.Offer > 0
|
||||||
) {
|
) {
|
||||||
|
|
@ -2408,11 +2410,11 @@ const BSBillingEditQuantity = (props) => {
|
||||||
if (
|
if (
|
||||||
cartItem.ProdId === sameBookingTypeProduct.ProdId &&
|
cartItem.ProdId === sameBookingTypeProduct.ProdId &&
|
||||||
cartItem.InwardDtlId ===
|
cartItem.InwardDtlId ===
|
||||||
sameBookingTypeProduct.InwardDtlId &&
|
sameBookingTypeProduct.InwardDtlId &&
|
||||||
cartItem.BookingTypeName ===
|
cartItem.BookingTypeName ===
|
||||||
sameBookingTypeProduct.BookingTypeName &&
|
sameBookingTypeProduct.BookingTypeName &&
|
||||||
cartItem.OrderRate ===
|
cartItem.OrderRate ===
|
||||||
sameBookingTypeProduct.OrderRate &&
|
sameBookingTypeProduct.OrderRate &&
|
||||||
cartItem.OfferMode &&
|
cartItem.OfferMode &&
|
||||||
cartItem.Offer > 0
|
cartItem.Offer > 0
|
||||||
) {
|
) {
|
||||||
|
|
@ -2501,11 +2503,11 @@ const BSBillingEditQuantity = (props) => {
|
||||||
if (
|
if (
|
||||||
cartItem.ProdId === otherBookingTypeProduct.ProdId &&
|
cartItem.ProdId === otherBookingTypeProduct.ProdId &&
|
||||||
cartItem?.InwardDtlId ===
|
cartItem?.InwardDtlId ===
|
||||||
otherBookingTypeProduct.InwardDtlId &&
|
otherBookingTypeProduct.InwardDtlId &&
|
||||||
cartItem?.BookingTypeName ===
|
cartItem?.BookingTypeName ===
|
||||||
otherBookingTypeProduct.BookingTypeName &&
|
otherBookingTypeProduct.BookingTypeName &&
|
||||||
cartItem?.OrderRate ===
|
cartItem?.OrderRate ===
|
||||||
otherBookingTypeProduct.OrderRate &&
|
otherBookingTypeProduct.OrderRate &&
|
||||||
cartItem?.OfferMode &&
|
cartItem?.OfferMode &&
|
||||||
cartItem?.Offer > 0
|
cartItem?.Offer > 0
|
||||||
) {
|
) {
|
||||||
|
|
@ -2534,11 +2536,11 @@ const BSBillingEditQuantity = (props) => {
|
||||||
if (
|
if (
|
||||||
cartItem.ProdId === otherBookingTypeProduct.ProdId &&
|
cartItem.ProdId === otherBookingTypeProduct.ProdId &&
|
||||||
cartItem.InwardDtlId ===
|
cartItem.InwardDtlId ===
|
||||||
otherBookingTypeProduct.InwardDtlId &&
|
otherBookingTypeProduct.InwardDtlId &&
|
||||||
cartItem.BookingTypeName ===
|
cartItem.BookingTypeName ===
|
||||||
otherBookingTypeProduct.BookingTypeName &&
|
otherBookingTypeProduct.BookingTypeName &&
|
||||||
cartItem.OrderRate ===
|
cartItem.OrderRate ===
|
||||||
otherBookingTypeProduct.OrderRate &&
|
otherBookingTypeProduct.OrderRate &&
|
||||||
cartItem.OfferMode &&
|
cartItem.OfferMode &&
|
||||||
cartItem.Offer > 0
|
cartItem.Offer > 0
|
||||||
) {
|
) {
|
||||||
|
|
@ -2568,11 +2570,11 @@ const BSBillingEditQuantity = (props) => {
|
||||||
if (
|
if (
|
||||||
cartItem.ProdId === otherBookingTypeProduct.ProdId &&
|
cartItem.ProdId === otherBookingTypeProduct.ProdId &&
|
||||||
cartItem.InwardDtlId ===
|
cartItem.InwardDtlId ===
|
||||||
otherBookingTypeProduct.InwardDtlId &&
|
otherBookingTypeProduct.InwardDtlId &&
|
||||||
cartItem.BookingTypeName ===
|
cartItem.BookingTypeName ===
|
||||||
otherBookingTypeProduct.BookingTypeName &&
|
otherBookingTypeProduct.BookingTypeName &&
|
||||||
cartItem.OrderRate ===
|
cartItem.OrderRate ===
|
||||||
otherBookingTypeProduct.OrderRate &&
|
otherBookingTypeProduct.OrderRate &&
|
||||||
cartItem.OfferMode &&
|
cartItem.OfferMode &&
|
||||||
cartItem.Offer > 0
|
cartItem.Offer > 0
|
||||||
) {
|
) {
|
||||||
|
|
@ -2671,12 +2673,12 @@ const BSBillingEditQuantity = (props) => {
|
||||||
product?.ProdId === editedProduct?.ProdId &&
|
product?.ProdId === editedProduct?.ProdId &&
|
||||||
product?.InwardDtlId === editedProduct?.InwardDtlId &&
|
product?.InwardDtlId === editedProduct?.InwardDtlId &&
|
||||||
product?.OfferId ===
|
product?.OfferId ===
|
||||||
(sameBookingTypeFreeProduct?.OfferMessage?.[0]?.OfferId ||
|
(sameBookingTypeFreeProduct?.OfferMessage?.[0]?.OfferId ||
|
||||||
otherBookingTypeFreeProduct?.OfferMessage?.[0]
|
otherBookingTypeFreeProduct?.OfferMessage?.[0]
|
||||||
?.OfferId) &&
|
?.OfferId) &&
|
||||||
product?.OfferMode ===
|
product?.OfferMode ===
|
||||||
(sameBookingTypeFreeProduct?.OfferMode ||
|
(sameBookingTypeFreeProduct?.OfferMode ||
|
||||||
otherBookingTypeFreeProduct?.OfferMode)
|
otherBookingTypeFreeProduct?.OfferMode)
|
||||||
) {
|
) {
|
||||||
return {
|
return {
|
||||||
...product,
|
...product,
|
||||||
|
|
@ -2710,12 +2712,12 @@ const BSBillingEditQuantity = (props) => {
|
||||||
// Also check main offer conditions
|
// Also check main offer conditions
|
||||||
const isMatchingOffer =
|
const isMatchingOffer =
|
||||||
offerProduct?.OfferId ===
|
offerProduct?.OfferId ===
|
||||||
(sameBookingTypeProduct?.OfferMessage?.[0]?.OfferId ||
|
(sameBookingTypeProduct?.OfferMessage?.[0]?.OfferId ||
|
||||||
otherBookingTypeProduct?.OfferMessage?.[0]
|
otherBookingTypeProduct?.OfferMessage?.[0]
|
||||||
?.OfferId) &&
|
?.OfferId) &&
|
||||||
offerProduct?.OfferMode ===
|
offerProduct?.OfferMode ===
|
||||||
(sameBookingTypeProduct?.OfferMode ||
|
(sameBookingTypeProduct?.OfferMode ||
|
||||||
otherBookingTypeProduct?.OfferMode);
|
otherBookingTypeProduct?.OfferMode);
|
||||||
|
|
||||||
if (hasMatchingFreeProduct && isMatchingOffer) {
|
if (hasMatchingFreeProduct && isMatchingOffer) {
|
||||||
// Get loyalty points from the matching free product
|
// Get loyalty points from the matching free product
|
||||||
|
|
@ -2794,11 +2796,11 @@ const BSBillingEditQuantity = (props) => {
|
||||||
if (
|
if (
|
||||||
cartItem.ProdId === sameBookingTypeProduct.ProdId &&
|
cartItem.ProdId === sameBookingTypeProduct.ProdId &&
|
||||||
cartItem.InwardDtlId ===
|
cartItem.InwardDtlId ===
|
||||||
sameBookingTypeProduct.InwardDtlId &&
|
sameBookingTypeProduct.InwardDtlId &&
|
||||||
cartItem.BookingTypeName ===
|
cartItem.BookingTypeName ===
|
||||||
sameBookingTypeProduct.BookingTypeName &&
|
sameBookingTypeProduct.BookingTypeName &&
|
||||||
cartItem.OrderRate ===
|
cartItem.OrderRate ===
|
||||||
sameBookingTypeProduct.OrderRate &&
|
sameBookingTypeProduct.OrderRate &&
|
||||||
cartItem.OfferMode &&
|
cartItem.OfferMode &&
|
||||||
cartItem.Offer > 0
|
cartItem.Offer > 0
|
||||||
) {
|
) {
|
||||||
|
|
@ -2857,11 +2859,11 @@ const BSBillingEditQuantity = (props) => {
|
||||||
if (
|
if (
|
||||||
cartItem.ProdId === otherBookingTypeProduct.ProdId &&
|
cartItem.ProdId === otherBookingTypeProduct.ProdId &&
|
||||||
cartItem.InwardDtlId ===
|
cartItem.InwardDtlId ===
|
||||||
otherBookingTypeProduct.InwardDtlId &&
|
otherBookingTypeProduct.InwardDtlId &&
|
||||||
cartItem.BookingTypeName ===
|
cartItem.BookingTypeName ===
|
||||||
otherBookingTypeProduct.BookingTypeName &&
|
otherBookingTypeProduct.BookingTypeName &&
|
||||||
cartItem.OrderRate ===
|
cartItem.OrderRate ===
|
||||||
otherBookingTypeProduct.OrderRate &&
|
otherBookingTypeProduct.OrderRate &&
|
||||||
cartItem.OfferMode &&
|
cartItem.OfferMode &&
|
||||||
cartItem.Offer > 0
|
cartItem.Offer > 0
|
||||||
) {
|
) {
|
||||||
|
|
@ -2933,12 +2935,12 @@ const BSBillingEditQuantity = (props) => {
|
||||||
product?.ProdId === editedProduct?.ProdId &&
|
product?.ProdId === editedProduct?.ProdId &&
|
||||||
product?.InwardDtlId === editedProduct?.InwardDtlId &&
|
product?.InwardDtlId === editedProduct?.InwardDtlId &&
|
||||||
product?.OfferId ===
|
product?.OfferId ===
|
||||||
(sameBookingTypeFreeProduct?.OfferMessage?.[0]?.OfferId ||
|
(sameBookingTypeFreeProduct?.OfferMessage?.[0]?.OfferId ||
|
||||||
otherBookingTypeFreeProduct?.OfferMessage?.[0]
|
otherBookingTypeFreeProduct?.OfferMessage?.[0]
|
||||||
?.OfferId) &&
|
?.OfferId) &&
|
||||||
product?.OfferMode ===
|
product?.OfferMode ===
|
||||||
(sameBookingTypeFreeProduct?.OfferMode ||
|
(sameBookingTypeFreeProduct?.OfferMode ||
|
||||||
otherBookingTypeFreeProduct?.OfferMode)
|
otherBookingTypeFreeProduct?.OfferMode)
|
||||||
) {
|
) {
|
||||||
return {
|
return {
|
||||||
...product,
|
...product,
|
||||||
|
|
@ -2972,12 +2974,12 @@ const BSBillingEditQuantity = (props) => {
|
||||||
// Also check main offer conditions
|
// Also check main offer conditions
|
||||||
const isMatchingOffer =
|
const isMatchingOffer =
|
||||||
offerProduct?.OfferId ===
|
offerProduct?.OfferId ===
|
||||||
(sameBookingTypeProduct?.OfferMessage?.[0]?.OfferId ||
|
(sameBookingTypeProduct?.OfferMessage?.[0]?.OfferId ||
|
||||||
otherBookingTypeProduct?.OfferMessage?.[0]
|
otherBookingTypeProduct?.OfferMessage?.[0]
|
||||||
?.OfferId) &&
|
?.OfferId) &&
|
||||||
offerProduct?.OfferMode ===
|
offerProduct?.OfferMode ===
|
||||||
(sameBookingTypeProduct?.OfferMode ||
|
(sameBookingTypeProduct?.OfferMode ||
|
||||||
otherBookingTypeProduct?.OfferMode);
|
otherBookingTypeProduct?.OfferMode);
|
||||||
|
|
||||||
if (hasMatchingFreeProduct && isMatchingOffer) {
|
if (hasMatchingFreeProduct && isMatchingOffer) {
|
||||||
// Get loyalty points from the matching free product
|
// Get loyalty points from the matching free product
|
||||||
|
|
@ -3131,17 +3133,17 @@ const BSBillingEditQuantity = (props) => {
|
||||||
changeOrderCardDetails(
|
changeOrderCardDetails(
|
||||||
CartOrderDetails?.map((i) =>
|
CartOrderDetails?.map((i) =>
|
||||||
i?.InwardDtlId == updatedProduct?.InwardDtlId &&
|
i?.InwardDtlId == updatedProduct?.InwardDtlId &&
|
||||||
i?.BookingTypeName == updatedProduct?.BookingTypeName &&
|
i?.BookingTypeName == updatedProduct?.BookingTypeName &&
|
||||||
i?.localId === updatedProduct?.localId
|
i?.localId === updatedProduct?.localId
|
||||||
? {
|
? {
|
||||||
...updatedProduct,
|
...updatedProduct,
|
||||||
Offer: 0,
|
Offer: 0,
|
||||||
OfferType:
|
OfferType:
|
||||||
updatedProduct?.Type === 'C'
|
updatedProduct?.Type === 'C'
|
||||||
? updatedProduct?.OfferType
|
? updatedProduct?.OfferType
|
||||||
: null,
|
: null,
|
||||||
OfferMessage: null,
|
OfferMessage: null,
|
||||||
}
|
}
|
||||||
: i
|
: i
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
@ -3158,9 +3160,10 @@ const BSBillingEditQuantity = (props) => {
|
||||||
|
|
||||||
const UpdatedCartItemWithOffer = {
|
const UpdatedCartItemWithOffer = {
|
||||||
...updatedProduct,
|
...updatedProduct,
|
||||||
Offer: (bestOffer?.OfferMode === 'I' || bestOffer?.OfferMode === 'Q') ?
|
Offer:
|
||||||
bestOffer?.OfferAmount || updatedProduct.Offer :
|
bestOffer?.OfferMode === 'I' || bestOffer?.OfferMode === 'Q'
|
||||||
updatedProduct.Offer || bestOffer?.OfferAmount,
|
? bestOffer?.OfferAmount || updatedProduct.Offer
|
||||||
|
: updatedProduct.Offer || bestOffer?.OfferAmount,
|
||||||
OfferType: updatedProduct?.OfferType || bestOffer?.OfferType,
|
OfferType: updatedProduct?.OfferType || bestOffer?.OfferType,
|
||||||
OfferMessage: updatedProduct?.OfferMessage || bestOffer?.OfferMessage,
|
OfferMessage: updatedProduct?.OfferMessage || bestOffer?.OfferMessage,
|
||||||
};
|
};
|
||||||
|
|
@ -3175,10 +3178,11 @@ const BSBillingEditQuantity = (props) => {
|
||||||
!c.SalesId &&
|
!c.SalesId &&
|
||||||
((c?.OfferModeType && c?.OfferMode === 'B'
|
((c?.OfferModeType && c?.OfferMode === 'B'
|
||||||
? true
|
? true
|
||||||
: c?.OfferMode !== 'B')
|
: c?.OfferMode !== 'B') &&
|
||||||
&& c?.OfferMode !== 'P'
|
c?.OfferMode !== 'P' &&
|
||||||
&& c?.OfferMode !== 'C' && c?.OfferMode !== 'O'
|
c?.OfferMode !== 'C' &&
|
||||||
&& c?.OfferMode !== 'L'
|
c?.OfferMode !== 'O' &&
|
||||||
|
c?.OfferMode !== 'L'
|
||||||
? true
|
? true
|
||||||
: c?.Offer === 0);
|
: c?.Offer === 0);
|
||||||
|
|
||||||
|
|
@ -3708,9 +3712,10 @@ const BSBillingEditQuantity = (props) => {
|
||||||
/>
|
/>
|
||||||
<DefaultModal
|
<DefaultModal
|
||||||
title={
|
title={
|
||||||
<div className="EditQuantity-title">
|
'Change'
|
||||||
<FormHeader title={'Change'} />
|
// <div className="EditQuantity-title">
|
||||||
</div>
|
// <FormHeader title={'Change'} />
|
||||||
|
// </div>
|
||||||
}
|
}
|
||||||
open={EditOpen}
|
open={EditOpen}
|
||||||
width={600}
|
width={600}
|
||||||
|
|
@ -3817,38 +3822,38 @@ const BSBillingEditQuantity = (props) => {
|
||||||
✖
|
✖
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="grid-container">
|
<div className="gridEQcontainer">
|
||||||
<div className="grid-item" onClick={() => AddQuantity(1)}>
|
<div className="gridEQitem" onClick={() => AddQuantity(1)}>
|
||||||
1
|
1
|
||||||
</div>
|
</div>
|
||||||
<div className="grid-item" onClick={() => AddQuantity(2)}>
|
<div className="gridEQitem" onClick={() => AddQuantity(2)}>
|
||||||
2
|
2
|
||||||
</div>
|
</div>
|
||||||
<div className="grid-item" onClick={() => AddQuantity(3)}>
|
<div className="gridEQitem" onClick={() => AddQuantity(3)}>
|
||||||
3
|
3
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="grid-item" onClick={() => AddQuantity(4)}>
|
<div className="gridEQitem" onClick={() => AddQuantity(4)}>
|
||||||
4
|
4
|
||||||
</div>
|
</div>
|
||||||
<div className="grid-item" onClick={() => AddQuantity(5)}>
|
<div className="gridEQitem" onClick={() => AddQuantity(5)}>
|
||||||
5
|
5
|
||||||
</div>
|
</div>
|
||||||
<div className="grid-item" onClick={() => AddQuantity(6)}>
|
<div className="gridEQitem" onClick={() => AddQuantity(6)}>
|
||||||
6
|
6
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="grid-item" onClick={() => AddQuantity(7)}>
|
<div className="gridEQitem" onClick={() => AddQuantity(7)}>
|
||||||
7
|
7
|
||||||
</div>
|
</div>
|
||||||
<div className="grid-item" onClick={() => AddQuantity(8)}>
|
<div className="gridEQitem" onClick={() => AddQuantity(8)}>
|
||||||
8
|
8
|
||||||
</div>
|
</div>
|
||||||
<div className="grid-item" onClick={() => AddQuantity(9)}>
|
<div className="gridEQitem" onClick={() => AddQuantity(9)}>
|
||||||
9
|
9
|
||||||
</div>
|
</div>
|
||||||
<div></div>
|
<div></div>
|
||||||
<div className="grid-item" onClick={() => AddQuantity(0)}>
|
<div className="gridEQitem" onClick={() => AddQuantity(0)}>
|
||||||
0
|
0
|
||||||
</div>
|
</div>
|
||||||
<div></div>
|
<div></div>
|
||||||
|
|
@ -3903,7 +3908,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
? `${parts[0]}.${parts.slice(1).join('')}`
|
? `${parts[0]}.${parts.slice(1).join('')}`
|
||||||
: cleanedValue;
|
: cleanedValue;
|
||||||
}}
|
}}
|
||||||
// isOnChange={formType == "edit" || formRef.current?.getFieldsValue()?.CustName ? true : false}
|
// isOnChange={formType == "edit" || formRef.current?.getFieldsValue()?.CustName ? true : false}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
)}
|
)}
|
||||||
|
|
@ -3966,7 +3971,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
? `${parts[0]}.${parts.slice(1).join('')}`
|
? `${parts[0]}.${parts.slice(1).join('')}`
|
||||||
: cleanedValue;
|
: cleanedValue;
|
||||||
}}
|
}}
|
||||||
// isOnChange={formType == "edit" || formRef.current?.getFieldsValue()?.CustName ? true : false}
|
// isOnChange={formType == "edit" || formRef.current?.getFieldsValue()?.CustName ? true : false}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
{/* <input type="text"
|
{/* <input type="text"
|
||||||
|
|
@ -4002,14 +4007,14 @@ const BSBillingEditQuantity = (props) => {
|
||||||
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
|
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
|
||||||
{((RadioBtnSelection == 'Price' && disableSubmitButton) ||
|
{((RadioBtnSelection == 'Price' && disableSubmitButton) ||
|
||||||
RadioBtnSelection == 'Quantity') && (
|
RadioBtnSelection == 'Quantity') && (
|
||||||
<Buttons
|
<Buttons
|
||||||
buttonText="Submit"
|
buttonText="Submit"
|
||||||
color="901D77"
|
color="901D77"
|
||||||
htmlType
|
htmlType
|
||||||
// handleSubmit={AddProductQuantity}
|
// handleSubmit={AddProductQuantity}
|
||||||
icon={<ArrowRightOutlined />}
|
icon={<ArrowRightOutlined />}
|
||||||
></Buttons>
|
></Buttons>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</Form>
|
</Form>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -222,6 +222,7 @@ import pozologoimg from '../../../../../Images/pozologoimg.png';
|
||||||
import PaymentGatewayEmbedded from '../../UtillComponents/PaymentGatewayEmbedded.jsx';
|
import PaymentGatewayEmbedded from '../../UtillComponents/PaymentGatewayEmbedded.jsx';
|
||||||
import MobileMultiPdfPrintTrigger from '../../UtillComponents/MobileMultiPdfPrintTrigger.jsx';
|
import MobileMultiPdfPrintTrigger from '../../UtillComponents/MobileMultiPdfPrintTrigger.jsx';
|
||||||
import { useDateStore } from '../../../../../Features/BookingScreen/BookingData/DateStore.js';
|
import { useDateStore } from '../../../../../Features/BookingScreen/BookingData/DateStore.js';
|
||||||
|
import CustomerOrders from '../../BookingFunctionality/CustomerOrders.jsx';
|
||||||
|
|
||||||
const subDirectory = import.meta.env.ENV_BASE_URL;
|
const subDirectory = import.meta.env.ENV_BASE_URL;
|
||||||
const MainHomeUrl = import.meta.env.ENV_MAIN_BASE_URL;
|
const MainHomeUrl = import.meta.env.ENV_MAIN_BASE_URL;
|
||||||
|
|
|
||||||
|
|
@ -836,7 +836,7 @@ const BSBilling4Payment = () => {
|
||||||
|
|
||||||
const selectedStyle =
|
const selectedStyle =
|
||||||
stylesMap[
|
stylesMap[
|
||||||
printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle
|
printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle
|
||||||
];
|
];
|
||||||
console.log(selectedStyle, style, 'style');
|
console.log(selectedStyle, style, 'style');
|
||||||
if (selectedStyle) {
|
if (selectedStyle) {
|
||||||
|
|
@ -2074,15 +2074,15 @@ const BSBilling4Payment = () => {
|
||||||
OrderStatus: 'O',
|
OrderStatus: 'O',
|
||||||
OrderType:
|
OrderType:
|
||||||
BookingType === 'Dine In' ||
|
BookingType === 'Dine In' ||
|
||||||
BookingTypeBoth ||
|
BookingTypeBoth ||
|
||||||
Estimation?.SettingValue == 'N'
|
Estimation?.SettingValue == 'N'
|
||||||
? 'S'
|
? 'S'
|
||||||
: GlobEstBooking === 'OvrAllEst'
|
: GlobEstBooking === 'OvrAllEst'
|
||||||
? 'E'
|
? 'E'
|
||||||
: GlobEstBooking === 'ParEst'
|
: GlobEstBooking === 'ParEst'
|
||||||
? GlobProdwisedata?.includes(
|
? GlobProdwisedata?.includes(
|
||||||
a.InwardDtlId + ' ' + a?.BookingTypeName
|
a.InwardDtlId + ' ' + a?.BookingTypeName
|
||||||
)
|
)
|
||||||
? 'E'
|
? 'E'
|
||||||
: 'S'
|
: 'S'
|
||||||
: 'S',
|
: 'S',
|
||||||
|
|
@ -2175,7 +2175,7 @@ const BSBilling4Payment = () => {
|
||||||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||||
? 'S'
|
? 'S'
|
||||||
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
? 'S'
|
? 'S'
|
||||||
: 'P',
|
: 'P',
|
||||||
OrderDtlDetails:
|
OrderDtlDetails:
|
||||||
|
|
@ -2192,9 +2192,9 @@ const BSBilling4Payment = () => {
|
||||||
? globalTipAmount === 0
|
? globalTipAmount === 0
|
||||||
? SelectedTableDetails
|
? SelectedTableDetails
|
||||||
: SelectedTableDetails?.map((item) => ({
|
: SelectedTableDetails?.map((item) => ({
|
||||||
...item,
|
...item,
|
||||||
TipsAmount: globalTipAmount,
|
TipsAmount: globalTipAmount,
|
||||||
}))
|
}))
|
||||||
: null,
|
: null,
|
||||||
SalesPaymentType: 'normal',
|
SalesPaymentType: 'normal',
|
||||||
PaymentDetail: [
|
PaymentDetail: [
|
||||||
|
|
@ -2207,8 +2207,8 @@ const BSBilling4Payment = () => {
|
||||||
? PaymentgatewayUPI?.[0]?.ModeId
|
? PaymentgatewayUPI?.[0]?.ModeId
|
||||||
: SelectedUPIPayOption?.toLowerCase() === 'business'
|
: SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||||
? BusinessPayOption?.find(
|
? BusinessPayOption?.find(
|
||||||
(busupi) => busupi?.ModeId === UpiId
|
(busupi) => busupi?.ModeId === UpiId
|
||||||
)?.ModeId
|
)?.ModeId
|
||||||
: paybtnselected
|
: paybtnselected
|
||||||
: paybtnselected
|
: paybtnselected
|
||||||
? paybtnselected
|
? paybtnselected
|
||||||
|
|
@ -2216,9 +2216,9 @@ const BSBilling4Payment = () => {
|
||||||
Amount: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? previousNetAmount - currentOrderNetAmount : Math.round(TotalAmount),
|
Amount: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? previousNetAmount - currentOrderNetAmount : Math.round(TotalAmount),
|
||||||
MerchantId: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? null :
|
MerchantId: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? null :
|
||||||
Paybtnnameselected?.toLowerCase() === 'upi' &&
|
Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'business'
|
SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||||
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
||||||
?.MerchantId
|
?.MerchantId
|
||||||
: null,
|
: null,
|
||||||
PaymentOptionType: (salesBillEdit && currentOrderNetAmount < previousNetAmount) && (refundPaySelectedName?.toLowerCase() === 'cash' || refundPaySelectedName?.toLowerCase() === 'credit') ? 'PC' :
|
PaymentOptionType: (salesBillEdit && currentOrderNetAmount < previousNetAmount) && (refundPaySelectedName?.toLowerCase() === 'cash' || refundPaySelectedName?.toLowerCase() === 'credit') ? 'PC' :
|
||||||
Paybtnnameselected?.toLowerCase() === 'cash'
|
Paybtnnameselected?.toLowerCase() === 'cash'
|
||||||
|
|
@ -2237,26 +2237,26 @@ const BSBilling4Payment = () => {
|
||||||
ModeOfPayment: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? null :
|
ModeOfPayment: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? null :
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId)
|
? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId)
|
||||||
?.UPIDetailId
|
?.UPIDetailId
|
||||||
: SelectedUPIPayOption?.toLowerCase() === 'business'
|
: SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||||
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
||||||
?.MerchantUPIId
|
?.MerchantUPIId
|
||||||
: null,
|
: null,
|
||||||
AccountDtl: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? [] :
|
AccountDtl: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? [] :
|
||||||
Paybtnnameselected?.toLowerCase() === 'upi' &&
|
Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find(
|
? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find(
|
||||||
(upipay) => upipay?.UPIId === UpiId
|
(upipay) => upipay?.UPIId === UpiId
|
||||||
)
|
)
|
||||||
: (Paybtnnameselected?.toLowerCase() === 'upi' &&
|
: (Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'pd') ||
|
SelectedUPIPayOption?.toLowerCase() === 'pd') ||
|
||||||
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
||||||
SelectedCardOption?.toLowerCase() === 'pd')
|
SelectedCardOption?.toLowerCase() === 'pd')
|
||||||
? useOptions?.[0]?.PaymentDetails?.PaymentDevice
|
? useOptions?.[0]?.PaymentDetails?.PaymentDevice
|
||||||
: (Paybtnnameselected?.toLowerCase() === 'upi' &&
|
: (Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'pg') ||
|
SelectedUPIPayOption?.toLowerCase() === 'pg') ||
|
||||||
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
||||||
SelectedCardOption?.toLowerCase() === 'pg')
|
SelectedCardOption?.toLowerCase() === 'pg')
|
||||||
? useOptions?.[0]?.PaymentDetails?.PaymentGateway
|
? useOptions?.[0]?.PaymentDetails?.PaymentGateway
|
||||||
: [],
|
: [],
|
||||||
PaymentStatus: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? 'S' :
|
PaymentStatus: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? 'S' :
|
||||||
|
|
@ -2265,7 +2265,7 @@ const BSBilling4Payment = () => {
|
||||||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||||
? 'S'
|
? 'S'
|
||||||
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
? 'S'
|
? 'S'
|
||||||
: 'P',
|
: 'P',
|
||||||
Debit: (salesBillEdit && currentOrderNetAmount < previousNetAmount && refundPaySelectedName?.toLowerCase() === 'credit') ? Math.round(previousNetAmount - currentOrderNetAmount) : 0,
|
Debit: (salesBillEdit && currentOrderNetAmount < previousNetAmount && refundPaySelectedName?.toLowerCase() === 'credit') ? Math.round(previousNetAmount - currentOrderNetAmount) : 0,
|
||||||
|
|
@ -2340,14 +2340,14 @@ const BSBilling4Payment = () => {
|
||||||
setMessageType('success');
|
setMessageType('success');
|
||||||
setMessageData(
|
setMessageData(
|
||||||
response?.data?.response +
|
response?.data?.response +
|
||||||
' ' +
|
' ' +
|
||||||
(response?.data?.OrderDetails?.length > 0
|
(response?.data?.OrderDetails?.length > 0
|
||||||
? response?.data?.OrderId &&
|
? response?.data?.OrderId &&
|
||||||
extractLastNumberOrderId(
|
extractLastNumberOrderId(
|
||||||
response?.data?.OrderId,
|
response?.data?.OrderId,
|
||||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||||
)
|
)
|
||||||
: '')
|
: '')
|
||||||
);
|
);
|
||||||
response?.data?.OrderDetails?.length > 0 &&
|
response?.data?.OrderDetails?.length > 0 &&
|
||||||
setPrintOrderDetails([response?.data]);
|
setPrintOrderDetails([response?.data]);
|
||||||
|
|
@ -2508,14 +2508,14 @@ const BSBilling4Payment = () => {
|
||||||
setMessageType('success');
|
setMessageType('success');
|
||||||
setMessageData(
|
setMessageData(
|
||||||
response?.data?.response +
|
response?.data?.response +
|
||||||
' ' +
|
' ' +
|
||||||
(response?.data?.OrderDetails?.length > 0
|
(response?.data?.OrderDetails?.length > 0
|
||||||
? response?.data?.OrderId &&
|
? response?.data?.OrderId &&
|
||||||
extractLastNumberOrderId(
|
extractLastNumberOrderId(
|
||||||
response?.data?.OrderId,
|
response?.data?.OrderId,
|
||||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||||
)
|
)
|
||||||
: '')
|
: '')
|
||||||
);
|
);
|
||||||
response?.data?.OrderDetails?.length > 0 &&
|
response?.data?.OrderDetails?.length > 0 &&
|
||||||
setPrintOrderDetails([response?.data]);
|
setPrintOrderDetails([response?.data]);
|
||||||
|
|
@ -2622,14 +2622,14 @@ const BSBilling4Payment = () => {
|
||||||
}
|
}
|
||||||
setMessageData(
|
setMessageData(
|
||||||
response?.data?.response +
|
response?.data?.response +
|
||||||
' ' +
|
' ' +
|
||||||
(response?.data?.OrderDetails?.length > 0
|
(response?.data?.OrderDetails?.length > 0
|
||||||
? response?.data?.OrderId &&
|
? response?.data?.OrderId &&
|
||||||
extractLastNumberOrderId(
|
extractLastNumberOrderId(
|
||||||
response?.data?.OrderId,
|
response?.data?.OrderId,
|
||||||
response?.data?.OrderDetails?.[0]?.FYStatus
|
response?.data?.OrderDetails?.[0]?.FYStatus
|
||||||
)
|
)
|
||||||
: '')
|
: '')
|
||||||
);
|
);
|
||||||
if (response?.data?.OrderDetails?.length > 0) {
|
if (response?.data?.OrderDetails?.length > 0) {
|
||||||
setPrintOrderDetails([response?.data]);
|
setPrintOrderDetails([response?.data]);
|
||||||
|
|
@ -2805,14 +2805,14 @@ const BSBilling4Payment = () => {
|
||||||
setMessageType('success');
|
setMessageType('success');
|
||||||
setMessageData(
|
setMessageData(
|
||||||
bookingpaymentupdate?.data?.response +
|
bookingpaymentupdate?.data?.response +
|
||||||
' ' +
|
' ' +
|
||||||
(bookingpaymentupdate?.data?.OrderDetails?.length > 0
|
(bookingpaymentupdate?.data?.OrderDetails?.length > 0
|
||||||
? bookingpaymentupdate?.data?.OrderId &&
|
? bookingpaymentupdate?.data?.OrderId &&
|
||||||
extractLastNumberOrderId(
|
extractLastNumberOrderId(
|
||||||
bookingpaymentupdate?.data?.OrderId,
|
bookingpaymentupdate?.data?.OrderId,
|
||||||
bookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus
|
bookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus
|
||||||
)
|
)
|
||||||
: '')
|
: '')
|
||||||
);
|
);
|
||||||
bookingpaymentupdate?.data?.OrderDetails?.length > 0 &&
|
bookingpaymentupdate?.data?.OrderDetails?.length > 0 &&
|
||||||
setPrintOrderDetails([bookingpaymentupdate?.data]);
|
setPrintOrderDetails([bookingpaymentupdate?.data]);
|
||||||
|
|
@ -2831,7 +2831,7 @@ const BSBilling4Payment = () => {
|
||||||
if (
|
if (
|
||||||
Date.now() - startTime >
|
Date.now() - startTime >
|
||||||
useOptions?.[0]?.PDConfigDetails?.[0]?.AutoCancelDurationInMinutes *
|
useOptions?.[0]?.PDConfigDetails?.[0]?.AutoCancelDurationInMinutes *
|
||||||
60000
|
60000
|
||||||
) {
|
) {
|
||||||
// 60,000 ms = 1 minute
|
// 60,000 ms = 1 minute
|
||||||
|
|
||||||
|
|
@ -3068,9 +3068,9 @@ const BSBilling4Payment = () => {
|
||||||
AppId: AppId,
|
AppId: AppId,
|
||||||
...(AvailableDate && selectedDate
|
...(AvailableDate && selectedDate
|
||||||
? {
|
? {
|
||||||
fromDate: selectedDate?.[0],
|
fromDate: selectedDate?.[0],
|
||||||
toDate: selectedDate?.[1],
|
toDate: selectedDate?.[1],
|
||||||
}
|
}
|
||||||
: {}),
|
: {}),
|
||||||
};
|
};
|
||||||
await dispatch(getSelectedFavItems(data)).unwrap();
|
await dispatch(getSelectedFavItems(data)).unwrap();
|
||||||
|
|
@ -3082,9 +3082,9 @@ const BSBilling4Payment = () => {
|
||||||
ProdSubCat: ProdSubCat,
|
ProdSubCat: ProdSubCat,
|
||||||
...(AvailableDate && selectedDate
|
...(AvailableDate && selectedDate
|
||||||
? {
|
? {
|
||||||
fromDate: selectedDate?.[0],
|
fromDate: selectedDate?.[0],
|
||||||
toDate: selectedDate?.[1],
|
toDate: selectedDate?.[1],
|
||||||
}
|
}
|
||||||
: {}),
|
: {}),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -3095,9 +3095,9 @@ const BSBilling4Payment = () => {
|
||||||
prodCat: prodCat,
|
prodCat: prodCat,
|
||||||
...(AvailableDate && selectedDate
|
...(AvailableDate && selectedDate
|
||||||
? {
|
? {
|
||||||
fromDate: selectedDate?.[0],
|
fromDate: selectedDate?.[0],
|
||||||
toDate: selectedDate?.[1],
|
toDate: selectedDate?.[1],
|
||||||
}
|
}
|
||||||
: {}),
|
: {}),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -3717,9 +3717,9 @@ const BSBilling4Payment = () => {
|
||||||
OrderCardDetail?.length > 0 && 'not-allowed',
|
OrderCardDetail?.length > 0 && 'not-allowed',
|
||||||
color:
|
color:
|
||||||
OrderCardDetail?.length > 0 ||
|
OrderCardDetail?.length > 0 ||
|
||||||
(selOption?.value === undefined &&
|
(selOption?.value === undefined &&
|
||||||
GlobalAddCustomerDetails1?.length === 0 &&
|
GlobalAddCustomerDetails1?.length === 0 &&
|
||||||
GetCustId?.CustMobile === undefined)
|
GetCustId?.CustMobile === undefined)
|
||||||
? 'gray'
|
? 'gray'
|
||||||
: 'rgb(18, 146, 238)',
|
: 'rgb(18, 146, 238)',
|
||||||
fontSize: '28px',
|
fontSize: '28px',
|
||||||
|
|
@ -3740,16 +3740,16 @@ const BSBilling4Payment = () => {
|
||||||
(BookingType === 'Dine In' ||
|
(BookingType === 'Dine In' ||
|
||||||
BookingTypeBoth ||
|
BookingTypeBoth ||
|
||||||
CheckOrderType?.length > 0) &&
|
CheckOrderType?.length > 0) &&
|
||||||
!unpaidFlow &&
|
!unpaidFlow &&
|
||||||
OrderStatus
|
OrderStatus
|
||||||
? 'none'
|
? 'none'
|
||||||
: 'auto',
|
: 'auto',
|
||||||
opacity:
|
opacity:
|
||||||
(BookingType === 'Dine In' ||
|
(BookingType === 'Dine In' ||
|
||||||
BookingTypeBoth ||
|
BookingTypeBoth ||
|
||||||
CheckOrderType?.length > 0) &&
|
CheckOrderType?.length > 0) &&
|
||||||
!unpaidFlow &&
|
!unpaidFlow &&
|
||||||
OrderStatus
|
OrderStatus
|
||||||
? 0.5
|
? 0.5
|
||||||
: 1,
|
: 1,
|
||||||
width: '2rem',
|
width: '2rem',
|
||||||
|
|
@ -3770,14 +3770,14 @@ const BSBilling4Payment = () => {
|
||||||
width: '1.5rem',
|
width: '1.5rem',
|
||||||
cursor:
|
cursor:
|
||||||
OrderCardDetail?.length === 0 ||
|
OrderCardDetail?.length === 0 ||
|
||||||
CheckBookingStatus == 'Close' ||
|
CheckBookingStatus == 'Close' ||
|
||||||
addnewAccess
|
addnewAccess
|
||||||
? 'not-allowed'
|
? 'not-allowed'
|
||||||
: 'pointer',
|
: 'pointer',
|
||||||
color:
|
color:
|
||||||
OrderCardDetail?.length === 0 ||
|
OrderCardDetail?.length === 0 ||
|
||||||
CheckBookingStatus == 'Close' ||
|
CheckBookingStatus == 'Close' ||
|
||||||
addnewAccess
|
addnewAccess
|
||||||
? 'gray'
|
? 'gray'
|
||||||
: 'rgb(18, 146, 238)',
|
: 'rgb(18, 146, 238)',
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
|
|
@ -3789,40 +3789,7 @@ const BSBilling4Payment = () => {
|
||||||
</div>
|
</div>
|
||||||
</TooltipWrapper>
|
</TooltipWrapper>
|
||||||
)}
|
)}
|
||||||
{/* Customer Orders */}
|
|
||||||
{GetCustId && (
|
|
||||||
<Tooltip title="Customer Orders" isMobile={isMobile}>
|
|
||||||
{' '}
|
|
||||||
<div
|
|
||||||
className="BSBillingNav-icon-table-icon"
|
|
||||||
onClick={() => {
|
|
||||||
if (
|
|
||||||
CheckBookingStatus !== 'Close' &&
|
|
||||||
!addnewAccess &&
|
|
||||||
!(OrderCardDetail?.length > 0)
|
|
||||||
) {
|
|
||||||
setCustomerPreviesOrders(true);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
style={{
|
|
||||||
cursor: OrderCardDetail?.length > 0 && 'not-allowed',
|
|
||||||
color:
|
|
||||||
OrderCardDetail?.length > 0 ||
|
|
||||||
(OrderCardDetail?.length > 0 &&
|
|
||||||
GetCustId?.CustMobile === undefined)
|
|
||||||
? 'gray'
|
|
||||||
: 'rgb(18, 146, 238)',
|
|
||||||
fontSize: '25px',
|
|
||||||
display: 'flex',
|
|
||||||
alignItems: 'center',
|
|
||||||
height: '2.46rem',
|
|
||||||
width: '1.5rem',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<FaCartPlus />
|
|
||||||
</div>
|
|
||||||
</Tooltip>
|
|
||||||
)}
|
|
||||||
{OtherServicesglobal && OrderCardDetail.length >= 1 && (
|
{OtherServicesglobal && OrderCardDetail.length >= 1 && (
|
||||||
<TooltipWrapper title="Vehicle Number" isMobile={isMobile}>
|
<TooltipWrapper title="Vehicle Number" isMobile={isMobile}>
|
||||||
{' '}
|
{' '}
|
||||||
|
|
@ -3837,14 +3804,14 @@ const BSBilling4Payment = () => {
|
||||||
width: '1.5rem',
|
width: '1.5rem',
|
||||||
cursor:
|
cursor:
|
||||||
OrderCardDetail?.length === 0 ||
|
OrderCardDetail?.length === 0 ||
|
||||||
CheckBookingStatus == 'Close' ||
|
CheckBookingStatus == 'Close' ||
|
||||||
addnewAccess
|
addnewAccess
|
||||||
? 'not-allowed'
|
? 'not-allowed'
|
||||||
: 'pointer',
|
: 'pointer',
|
||||||
color:
|
color:
|
||||||
OrderCardDetail?.length === 0 ||
|
OrderCardDetail?.length === 0 ||
|
||||||
CheckBookingStatus == 'Close' ||
|
CheckBookingStatus == 'Close' ||
|
||||||
addnewAccess
|
addnewAccess
|
||||||
? 'gray'
|
? 'gray'
|
||||||
: 'rgb(18, 146, 238)',
|
: 'rgb(18, 146, 238)',
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
|
|
@ -3859,6 +3826,41 @@ const BSBilling4Payment = () => {
|
||||||
{/* </React.Fragment> */}
|
{/* </React.Fragment> */}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{/* Customer Orders */}
|
||||||
|
{GetCustId && (
|
||||||
|
<Tooltip title="Customer Orders" isMobile={isMobile}>
|
||||||
|
{' '}
|
||||||
|
<div
|
||||||
|
className="BSBillingNav-icon-table-icon"
|
||||||
|
onClick={() => {
|
||||||
|
if (
|
||||||
|
CheckBookingStatus !== 'Close' &&
|
||||||
|
!addnewAccess &&
|
||||||
|
!(OrderCardDetail?.length > 0)
|
||||||
|
) {
|
||||||
|
setCustomerPreviesOrders(true);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
style={{
|
||||||
|
cursor: OrderCardDetail?.length > 0 && 'not-allowed',
|
||||||
|
color:
|
||||||
|
OrderCardDetail?.length > 0 ||
|
||||||
|
(OrderCardDetail?.length > 0 &&
|
||||||
|
GetCustId?.CustMobile === undefined)
|
||||||
|
? 'gray'
|
||||||
|
: 'rgb(18, 146, 238)',
|
||||||
|
fontSize: '25px',
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
height: '2.46rem',
|
||||||
|
width: '1.5rem',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<FaCartPlus />
|
||||||
|
</div>
|
||||||
|
</Tooltip>
|
||||||
|
)}
|
||||||
{tabledata?.length > 0 && (
|
{tabledata?.length > 0 && (
|
||||||
<div style={{ width: '2rem' }}>
|
<div style={{ width: '2rem' }}>
|
||||||
{tableOptions
|
{tableOptions
|
||||||
|
|
@ -3926,61 +3928,61 @@ const BSBilling4Payment = () => {
|
||||||
<>
|
<>
|
||||||
{unpaidFlow == false
|
{unpaidFlow == false
|
||||||
? item?.OptionName == 'Hold' &&
|
? item?.OptionName == 'Hold' &&
|
||||||
BookingType !== 'Dine In' &&
|
BookingType !== 'Dine In' &&
|
||||||
!BookingTypeBoth &&
|
!BookingTypeBoth &&
|
||||||
OrderCardDetail?.length != 0 &&
|
OrderCardDetail?.length != 0 &&
|
||||||
CheckOrderType?.length === 0 &&
|
CheckOrderType?.length === 0 &&
|
||||||
OrderType != 'Failed' &&
|
OrderType != 'Failed' &&
|
||||||
paybtns?.length > 0 &&
|
paybtns?.length > 0 &&
|
||||||
CheckBookingStatus != 'Close' &&
|
CheckBookingStatus != 'Close' &&
|
||||||
!addnewAccess && (
|
!addnewAccess && (
|
||||||
<TooltipWrapper title={'Hold'} isMobile={isMobile}>
|
<TooltipWrapper title={'Hold'} isMobile={isMobile}>
|
||||||
{' '}
|
{' '}
|
||||||
<PozoHoldIcon
|
<PozoHoldIcon
|
||||||
className="BSBillingNav-icon-table-icon"
|
className="BSBillingNav-icon-table-icon"
|
||||||
onClick={() => AddBookingDetails('Hold')}
|
onClick={() => AddBookingDetails('Hold')}
|
||||||
style={{
|
style={{
|
||||||
fontSize: '30px',
|
fontSize: '30px',
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
color: '' ? '#52c41a' : '#1292EE',
|
color: '' ? '#52c41a' : '#1292EE',
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</TooltipWrapper>
|
</TooltipWrapper>
|
||||||
)
|
)
|
||||||
: ''}
|
: ''}
|
||||||
{unpaidFlow == false
|
{unpaidFlow == false
|
||||||
? item?.OptionName == 'Hold' &&
|
? item?.OptionName == 'Hold' &&
|
||||||
BookingType !== 'Dine In' &&
|
BookingType !== 'Dine In' &&
|
||||||
!BookingTypeBoth &&
|
!BookingTypeBoth &&
|
||||||
Holddata?.length > 0 &&
|
Holddata?.length > 0 &&
|
||||||
OrderCardDetail?.length == 0 &&
|
OrderCardDetail?.length == 0 &&
|
||||||
paybtns?.length > 0 &&
|
paybtns?.length > 0 &&
|
||||||
CheckBookingStatus != 'Close' &&
|
CheckBookingStatus != 'Close' &&
|
||||||
!addnewAccess && (
|
!addnewAccess && (
|
||||||
<TooltipWrapper
|
<TooltipWrapper
|
||||||
title={'Recall'}
|
title={'Recall'}
|
||||||
isMobile={isMobile}
|
isMobile={isMobile}
|
||||||
>
|
|
||||||
{' '}
|
|
||||||
<Badge
|
|
||||||
count={Holddata?.length}
|
|
||||||
size={'small'}
|
|
||||||
offset={[0, 7]}
|
|
||||||
>
|
>
|
||||||
<PozoHoldIcon
|
{' '}
|
||||||
className="BSBillingNav-icon-table-icon"
|
<Badge
|
||||||
onClick={() => HandleholdModelOpen()}
|
count={Holddata?.length}
|
||||||
style={{
|
size={'small'}
|
||||||
fontSize: '28px',
|
offset={[0, 7]}
|
||||||
cursor: 'pointer',
|
>
|
||||||
color: Holddata ? '#52c41a' : 'default',
|
<PozoHoldIcon
|
||||||
pointerEvents:
|
className="BSBillingNav-icon-table-icon"
|
||||||
OrderType === 'Failed' ? 'none' : 'auto',
|
onClick={() => HandleholdModelOpen()}
|
||||||
}}
|
style={{
|
||||||
/>
|
fontSize: '28px',
|
||||||
</Badge>
|
cursor: 'pointer',
|
||||||
</TooltipWrapper>
|
color: Holddata ? '#52c41a' : 'default',
|
||||||
)
|
pointerEvents:
|
||||||
|
OrderType === 'Failed' ? 'none' : 'auto',
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Badge>
|
||||||
|
</TooltipWrapper>
|
||||||
|
)
|
||||||
: ''}
|
: ''}
|
||||||
</>
|
</>
|
||||||
))}
|
))}
|
||||||
|
|
@ -4006,16 +4008,16 @@ const BSBilling4Payment = () => {
|
||||||
(BookingType === 'Dine In' ||
|
(BookingType === 'Dine In' ||
|
||||||
BookingTypeBoth ||
|
BookingTypeBoth ||
|
||||||
CheckOrderType?.length > 0) &&
|
CheckOrderType?.length > 0) &&
|
||||||
!unpaidFlow &&
|
!unpaidFlow &&
|
||||||
OrderStatus
|
OrderStatus
|
||||||
? 'none'
|
? 'none'
|
||||||
: 'auto',
|
: 'auto',
|
||||||
opacity:
|
opacity:
|
||||||
(BookingType === 'Dine In' ||
|
(BookingType === 'Dine In' ||
|
||||||
BookingTypeBoth ||
|
BookingTypeBoth ||
|
||||||
CheckOrderType?.length > 0) &&
|
CheckOrderType?.length > 0) &&
|
||||||
!unpaidFlow &&
|
!unpaidFlow &&
|
||||||
OrderStatus
|
OrderStatus
|
||||||
? 0.5
|
? 0.5
|
||||||
: 1,
|
: 1,
|
||||||
}}
|
}}
|
||||||
|
|
@ -4026,10 +4028,10 @@ const BSBilling4Payment = () => {
|
||||||
<button
|
<button
|
||||||
className={
|
className={
|
||||||
paybtnselected === payment.ModeId &&
|
paybtnselected === payment.ModeId &&
|
||||||
(UpinotSelected || CardoptionnotSelected)
|
(UpinotSelected || CardoptionnotSelected)
|
||||||
? 'Btn-payment-mode-notupisel'
|
? 'Btn-payment-mode-notupisel'
|
||||||
: paybtnselected === payment.ModeId &&
|
: paybtnselected === payment.ModeId &&
|
||||||
(!UpinotSelected || !CardoptionnotSelected)
|
(!UpinotSelected || !CardoptionnotSelected)
|
||||||
? 'Btn-payment-mode'
|
? 'Btn-payment-mode'
|
||||||
: 'Btn-payment-mode-sel'
|
: 'Btn-payment-mode-sel'
|
||||||
}
|
}
|
||||||
|
|
@ -4043,13 +4045,13 @@ const BSBilling4Payment = () => {
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
payment?.ModeName?.toLowerCase() === 'upi' // Change the condition to payment.Id
|
payment?.ModeName?.toLowerCase() === 'upi' // Change the condition to payment.Id
|
||||||
? handleUPIButtonClick(
|
? handleUPIButtonClick(
|
||||||
payment.ModeId,
|
payment.ModeId,
|
||||||
payment.ModeName
|
payment.ModeName
|
||||||
)
|
)
|
||||||
: handlePaymentMode(
|
: handlePaymentMode(
|
||||||
payment.ModeId,
|
payment.ModeId,
|
||||||
payment.ModeName
|
payment.ModeName
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{/* {UpiOption === "" && payment?.ModeName?.toLowerCase() === "upi" && <p> UPI</p>} */}
|
{/* {UpiOption === "" && payment?.ModeName?.toLowerCase() === "upi" && <p> UPI</p>} */}
|
||||||
|
|
@ -4391,7 +4393,7 @@ const BSBilling4Payment = () => {
|
||||||
<div
|
<div
|
||||||
className="Table4-rate"
|
className="Table4-rate"
|
||||||
style={{ fontFamily: FontFamily['head'] }}
|
style={{ fontFamily: FontFamily['head'] }}
|
||||||
// onClick={() => AddBookingDetails(BookingType, true)}
|
// onClick={() => AddBookingDetails(BookingType, true)}
|
||||||
>
|
>
|
||||||
{isMobile ? (
|
{isMobile ? (
|
||||||
`₹ ${Math.round(
|
`₹ ${Math.round(
|
||||||
|
|
@ -4582,8 +4584,8 @@ const BSBilling4Payment = () => {
|
||||||
columns={columns}
|
columns={columns}
|
||||||
data={TableData}
|
data={TableData}
|
||||||
dataSource={TableData}
|
dataSource={TableData}
|
||||||
// pagination={handlePageChange}
|
// pagination={handlePageChange}
|
||||||
// onChange={handleChange}
|
// onChange={handleChange}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
@ -4691,9 +4693,9 @@ const BSBilling4Payment = () => {
|
||||||
|
|
||||||
const qty = isGroup
|
const qty = isGroup
|
||||||
? OrderCardDetail.filter((o) => o.id === groupKey).reduce(
|
? OrderCardDetail.filter((o) => o.id === groupKey).reduce(
|
||||||
(sum, o) => sum + (o.OrderQty || 1),
|
(sum, o) => sum + (o.OrderQty || 1),
|
||||||
0
|
0
|
||||||
)
|
)
|
||||||
: item.OrderQty || 1;
|
: item.OrderQty || 1;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -220,6 +220,7 @@ import UpiPopover from '../StandardTable/Utils/UpiPopOver.jsx';
|
||||||
import PaymentGatewayEmbedded from '../../UtillComponents/PaymentGatewayEmbedded.jsx';
|
import PaymentGatewayEmbedded from '../../UtillComponents/PaymentGatewayEmbedded.jsx';
|
||||||
import MobileMultiPdfPrintTrigger from '../../UtillComponents/MobileMultiPdfPrintTrigger.jsx';
|
import MobileMultiPdfPrintTrigger from '../../UtillComponents/MobileMultiPdfPrintTrigger.jsx';
|
||||||
import { useDateStore } from '../../../../../Features/BookingScreen/BookingData/DateStore.js';
|
import { useDateStore } from '../../../../../Features/BookingScreen/BookingData/DateStore.js';
|
||||||
|
import CustomerOrders from '../../BookingFunctionality/CustomerOrders.jsx';
|
||||||
|
|
||||||
const subDirectory = import.meta.env.ENV_BASE_URL;
|
const subDirectory = import.meta.env.ENV_BASE_URL;
|
||||||
const MainHomeUrl = import.meta.env.ENV_MAIN_BASE_URL;
|
const MainHomeUrl = import.meta.env.ENV_MAIN_BASE_URL;
|
||||||
|
|
|
||||||
|
|
@ -350,7 +350,10 @@ const BSC1Payment = (props) => {
|
||||||
)?.PreferenceCatDetails;
|
)?.PreferenceCatDetails;
|
||||||
const sportsAppPreference = commonModulePreference?.find(
|
const sportsAppPreference = commonModulePreference?.find(
|
||||||
(preference) => preference?.PreferredSubCatName === 'SportsApp'
|
(preference) => preference?.PreferredSubCatName === 'SportsApp'
|
||||||
|
&&
|
||||||
|
preference?.PreferredStatus == 'Y'
|
||||||
);
|
);
|
||||||
|
console.log(sportsAppPreference,commonModulePreference,"sportsAppPreference")
|
||||||
const bookingTypePreference = appPreferences?.find(
|
const bookingTypePreference = appPreferences?.find(
|
||||||
(preference) => preference?.PreferredCatName === 'Booking Type'
|
(preference) => preference?.PreferredCatName === 'Booking Type'
|
||||||
)?.PreferenceCatDetails;
|
)?.PreferenceCatDetails;
|
||||||
|
|
|
||||||
|
|
@ -2640,6 +2640,8 @@ export default function BSC1Search(props) {
|
||||||
?.StockDetails?.[stockIndex]?.OnePcsPrice
|
?.StockDetails?.[stockIndex]?.OnePcsPrice
|
||||||
: a?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[VarientIndex]
|
: a?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[VarientIndex]
|
||||||
?.StockDetails?.[stockIndex]?.MRP,
|
?.StockDetails?.[stockIndex]?.MRP,
|
||||||
|
FullProductIdentifierDtls:a?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[VarientIndex]
|
||||||
|
?.StockDetails?.[stockIndex]?.ProductIdentifierDtls,
|
||||||
OrderRate: parseFloat(TotalOrderRate).toFixed(2),
|
OrderRate: parseFloat(TotalOrderRate).toFixed(2),
|
||||||
SellingPrice: parseFloat(TotalOrderRate).toFixed(2),
|
SellingPrice: parseFloat(TotalOrderRate).toFixed(2),
|
||||||
SuppId:
|
SuppId:
|
||||||
|
|
@ -2769,6 +2771,8 @@ export default function BSC1Search(props) {
|
||||||
Offer:
|
Offer:
|
||||||
a?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[VarientIndex]
|
a?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[VarientIndex]
|
||||||
?.StockDetails?.[stockIndex]?.OfferPrice,
|
?.StockDetails?.[stockIndex]?.OfferPrice,
|
||||||
|
FullProductIdentifierDtls:a?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[VarientIndex]
|
||||||
|
?.StockDetails?.[stockIndex]?.ProductIdentifierDtls,
|
||||||
BookingTypeName: BookingType,
|
BookingTypeName: BookingType,
|
||||||
CounterName: a?.CounterName,
|
CounterName: a?.CounterName,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,339 +1,481 @@
|
||||||
import { useDispatch } from "react-redux";
|
import { useDispatch } from 'react-redux';
|
||||||
import { changeOrderCardDetails, CustomerOrderList, getProductsearch } from "../../../../Features/BookingScreen/BookingData/BookingData";
|
import {
|
||||||
import { useEffect, useState } from "react";
|
changeOrderCardDetails,
|
||||||
import { ExtractDateFormate, getSession } from "../../../../Services/Others";
|
CustomerOrderList,
|
||||||
import { Tables } from "../../../../Components/Tables/Table";
|
getProductsearch,
|
||||||
import { IoEye } from "react-icons/io5";
|
getStockDetailsByVariantName,
|
||||||
import { DatePicker, Modal } from "antd";
|
} from '../../../../Features/BookingScreen/BookingData/BookingData';
|
||||||
import dayjs from "dayjs";
|
import { useEffect, useState } from 'react';
|
||||||
|
import { ExtractDateFormate, getSession } from '../../../../Services/Others';
|
||||||
|
import { Tables } from '../../../../Components/Tables/Table';
|
||||||
|
import { IoEye } from 'react-icons/io5';
|
||||||
|
import { DatePicker, Modal } from 'antd';
|
||||||
|
import dayjs from 'dayjs';
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
|
import { Buttons, DefaultModal } from '../../../../../ownLib/my-ui-lib';
|
||||||
|
import { ArrowRightOutlined } from '@ant-design/icons';
|
||||||
const CustomerOrders = ({ CustomerDetails, close }) => {
|
const CustomerOrders = ({ CustomerDetails, close }) => {
|
||||||
|
const CompId = getSession('CompId');
|
||||||
|
const BranchId = getSession('BranchId');
|
||||||
|
const AppId = getSession('AppId');
|
||||||
|
const { RangePicker } = DatePicker;
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
const [custpmerOrderData, setCustpmerOrderData] = useState();
|
||||||
|
console.log(CustomerDetails, 'CustomerDetails');
|
||||||
|
|
||||||
const CompId = getSession('CompId');
|
const [page, setpage] = useState(1);
|
||||||
const BranchId = getSession('BranchId');
|
const [selectedProducts, setSelectedProducts] = useState();
|
||||||
const AppId = getSession('AppId');
|
const [productModal, setProductModal] = useState(false);
|
||||||
const { RangePicker } = DatePicker;
|
const [selectedRange, setSelectedRange] = useState([dayjs(), dayjs()]);
|
||||||
const dispatch = useDispatch();
|
const [stockDetailModel, setStockDetailModel] = useState(false);
|
||||||
const [custpmerOrderData, setCustpmerOrderData] = useState();
|
const [StockDetails, setStockDetails] = useState([]);
|
||||||
console.log(CustomerDetails, 'CustomerDetails');
|
console.log(StockDetails, 'StockDetails');
|
||||||
|
useEffect(() => {
|
||||||
|
if (selectedRange && selectedRange[0] && selectedRange[1]) {
|
||||||
|
customerFetch();
|
||||||
|
}
|
||||||
|
}, [selectedRange]);
|
||||||
|
|
||||||
const [page, setpage] = useState(1);
|
const getApiRange = () => {
|
||||||
const [selectedProducts, setSelectedProducts] = useState();
|
if (!selectedRange || !selectedRange[0] || !selectedRange[1])
|
||||||
const [productModal, setProductModal] = useState(false);
|
return { fromDate: '', toDate: '' };
|
||||||
const [selectedRange, setSelectedRange] = useState([dayjs(), dayjs()]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
return {
|
||||||
setSelectedRange([dayjs(), dayjs()]);
|
fromDate: selectedRange[0].format('YYYY-MM-DD'),
|
||||||
customerFetch();
|
toDate: selectedRange[1].format('YYYY-MM-DD'),
|
||||||
}, []);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (selectedRange && selectedRange[0] && selectedRange[1]) {
|
|
||||||
customerFetch();
|
|
||||||
}
|
|
||||||
}, [selectedRange]);
|
|
||||||
|
|
||||||
const getApiRange = () => {
|
|
||||||
if (!selectedRange || !selectedRange[0] || !selectedRange[1]) return { fromDate: '', toDate: '' };
|
|
||||||
|
|
||||||
return {
|
|
||||||
fromDate: selectedRange[0].format('YYYY-MM-DD'),
|
|
||||||
toDate: selectedRange[1].format('YYYY-MM-DD'),
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
const customerFetch = async () => {
|
const customerFetch = async () => {
|
||||||
const { fromDate, toDate } = getApiRange();
|
const { fromDate, toDate } = getApiRange();
|
||||||
const data = {
|
const data = {
|
||||||
AppId: AppId,
|
AppId: AppId,
|
||||||
BranchId: BranchId,
|
BranchId: BranchId,
|
||||||
CompId: CompId,
|
CompId: CompId,
|
||||||
MobileNo: CustomerDetails?.value,
|
MobileNo: CustomerDetails?.value,
|
||||||
FromDate: fromDate,
|
FromDate: fromDate,
|
||||||
ToDate: toDate,
|
ToDate: toDate,
|
||||||
}
|
};
|
||||||
const response = await dispatch(CustomerOrderList(data)).unwrap();
|
const response = await dispatch(CustomerOrderList(data)).unwrap();
|
||||||
if (response?.data?.statusCode === 1) {
|
if (response?.data?.statusCode === 1) {
|
||||||
setCustpmerOrderData(response?.data?.data)
|
setCustpmerOrderData(response?.data?.data);
|
||||||
}
|
} else {
|
||||||
else {
|
setCustpmerOrderData();
|
||||||
setCustpmerOrderData()
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
|
const ViewProductdetails = (products) => {
|
||||||
|
setSelectedProducts(products);
|
||||||
|
setProductModal(true);
|
||||||
|
};
|
||||||
|
const handlePageChange = (current) => {
|
||||||
|
setpage(current);
|
||||||
|
};
|
||||||
|
// const handleRowDataClick = (record) => {
|
||||||
|
// dispatch(changeOrderCardDetails(record?.productDetails));
|
||||||
|
// close();
|
||||||
|
// };
|
||||||
|
|
||||||
|
// const getProductsearchData = async (prodName) => {
|
||||||
|
// const data = {
|
||||||
|
// CompId,
|
||||||
|
// BranchId,
|
||||||
|
// AppId,
|
||||||
|
// ProdName: prodName
|
||||||
|
// }
|
||||||
|
// const response = await dispatch(getProductsearch(data)).unwrap();
|
||||||
|
// console.log(response, 'response23232323');
|
||||||
|
|
||||||
|
// }
|
||||||
|
const getLastBuyQty = (index, variant, prodId) => {
|
||||||
|
const productDetails = custpmerOrderData?.[index]?.productDetails;
|
||||||
|
if (!productDetails) return 0;
|
||||||
|
|
||||||
|
let SalesQty = 0;
|
||||||
|
for (let i = 0; i < productDetails.length; i++) {
|
||||||
|
const product = productDetails[i];
|
||||||
|
if (product?.ProdId === prodId && product?.ProdVariantName === variant) {
|
||||||
|
SalesQty += product?.SalesQty;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return SalesQty;
|
||||||
|
};
|
||||||
|
|
||||||
const ViewProductdetails = (products) => {
|
const getStockAllocation = (StockDtls, Qty) => {
|
||||||
setSelectedProducts(products);
|
let AllocatedData = [];
|
||||||
setProductModal(true);
|
let RemainngQty = Qty;
|
||||||
};
|
for (let i = 0; i < StockDtls?.length; i++) {
|
||||||
const handlePageChange = (current) => {
|
const stock = StockDtls[i];
|
||||||
setpage(current);
|
if (RemainngQty <= 0) break;
|
||||||
};
|
if (stock?.BalanceQty > 0) {
|
||||||
// const handleRowDataClick = (record) => {
|
const allocQty = Math.min(stock.BalanceQty, RemainngQty);
|
||||||
// dispatch(changeOrderCardDetails(record?.productDetails));
|
AllocatedData.push({
|
||||||
// close();
|
InwardDtlId: stock.InwardDtlId,
|
||||||
// };
|
AllocatedQty: allocQty,
|
||||||
|
MRP: stock?.MRP,
|
||||||
|
SellPrice: stock?.SellPrice,
|
||||||
|
InwardId: stock?.InwardId,
|
||||||
const getProductsearchData = async (prodName) => {
|
BatchRef: stock?.BatchRef,
|
||||||
const data = {
|
SuppId: stock?.SuppName,
|
||||||
CompId,
|
SuppName: stock?.SuppName,
|
||||||
BranchId,
|
InwardDate: stock?.InwardDate,
|
||||||
AppId,
|
});
|
||||||
ProdName: prodName
|
RemainngQty -= allocQty;
|
||||||
}
|
}
|
||||||
const response = await dispatch(getProductsearch(data)).unwrap();
|
|
||||||
console.log(response, 'response23232323');
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleRowDataClick = (record) => {
|
return AllocatedData;
|
||||||
if (!record?.productDetails?.length) return;
|
};
|
||||||
const prodName = record.productDetails[0]?.ProdName;
|
const handleRowDataClick = async (record, index) => {
|
||||||
getProductsearchData(prodName);
|
if (!record?.productDetails?.length) return;
|
||||||
|
let products = record?.productDetails?.map((e) => ({
|
||||||
console.log(record.productDetails[0]?.ProdName, 'record?.productDetails');
|
prodId: e?.ProdId,
|
||||||
|
ProdVariantName: e?.ProdVariantName,
|
||||||
const formattedData = record.productDetails.map((prod) => ({
|
}));
|
||||||
ProdCat: prod.ProdCat,
|
let Data = {
|
||||||
Type: prod.Type,
|
products: products,
|
||||||
|
|
||||||
OverallQuantity: prod.OverallQuantity ?? 0,
|
|
||||||
ActiveStatus: record.ActiveStatus,
|
|
||||||
|
|
||||||
AvailableFrom: prod.AvailableFrom,
|
|
||||||
AvailableTo: prod.AvailableTo,
|
|
||||||
|
|
||||||
Cess: prod.Cess ?? 0,
|
|
||||||
HSNCode: prod.HSN ?? null,
|
|
||||||
|
|
||||||
BrandName: prod.BrandName ?? null,
|
|
||||||
OpeningQty: prod.OpeningQty ?? 0,
|
|
||||||
PartNumber: prod.PartNumber ?? null,
|
|
||||||
|
|
||||||
ProdId: prod.ProdId,
|
|
||||||
ProdLogo: prod.ProdLogo ?? null,
|
|
||||||
ProdName: prod.ProdName,
|
|
||||||
|
|
||||||
QRCode: prod.QRCode ?? null,
|
|
||||||
QtyBasedPrice: prod.QtyBasedPrice ?? null,
|
|
||||||
Rack: prod.Rack ?? null,
|
|
||||||
Size: prod.Size,
|
|
||||||
|
|
||||||
StockAvailable: prod.StockAvailable ?? null,
|
|
||||||
TokenAvailable: prod.TokenAvailable ?? null,
|
|
||||||
|
|
||||||
TaxId: prod.ProdTaxId ?? null,
|
|
||||||
TaxPercentage: prod.ProdTaxPercentage ?? 0,
|
|
||||||
TaxName: prod.TaxName ?? null,
|
|
||||||
|
|
||||||
UniqueId: prod.UniqueId ?? null,
|
|
||||||
UomName: prod.UomName,
|
|
||||||
|
|
||||||
SinglePc: prod.SinglePc ?? null,
|
|
||||||
NoOfPcs: prod.NoOfPcs ?? 0,
|
|
||||||
|
|
||||||
ProdVariantName: prod.ProdVariantName ?? null,
|
|
||||||
VariantAvailableFrom: prod.VariantAvailableFrom ?? null,
|
|
||||||
VariantAvailableTo: prod.VariantAvailableTo ?? null,
|
|
||||||
|
|
||||||
BalanceQty: prod.BalanceQty ?? 0,
|
|
||||||
BatchRef: prod.BatchRef ?? null,
|
|
||||||
|
|
||||||
FullProductIdentifierDtls: prod.ProductIdentifierDtls ?? [],
|
|
||||||
|
|
||||||
InwardDate: prod.BookingDate ?? null,
|
|
||||||
InwardDtlId: prod.InwardDtlId ?? null,
|
|
||||||
InwardId: prod.InwardId ?? null,
|
|
||||||
|
|
||||||
MRP: prod.MRP ?? 0,
|
|
||||||
OrderRate: prod.Rate ?? 0,
|
|
||||||
SellingPrice: prod.Rate ?? 0,
|
|
||||||
|
|
||||||
SuppId: prod.SuppId ?? null,
|
|
||||||
SuppName: prod.SuppName ?? null,
|
|
||||||
|
|
||||||
OverAllPcs: prod.OverAllPcs ?? 0,
|
|
||||||
Offer: prod.OfferAmt ?? 0,
|
|
||||||
|
|
||||||
BookingTypeName: prod.BookingTypeName ?? null,
|
|
||||||
CounterName: prod.CounterName ?? null,
|
|
||||||
|
|
||||||
DiscountLimitType: prod.DiscountLimitType ?? null,
|
|
||||||
DiscountLimit: prod.DiscountLimit ?? 0,
|
|
||||||
|
|
||||||
BookedDate: prod.BookedDate ?? [],
|
|
||||||
BalanceBookedQty: prod.BalanceBookedQty ?? null,
|
|
||||||
|
|
||||||
ScaleType: prod.ScaleType ?? "",
|
|
||||||
|
|
||||||
localId: prod.localId ?? uuidv4(),
|
|
||||||
|
|
||||||
OrderQty: prod.SalesQty ?? 0,
|
|
||||||
TotalAmt: prod.TotalAmt ?? 0,
|
|
||||||
TaxAmt: prod.TaxAmt ?? 0,
|
|
||||||
WithoutTaxRate: prod.WithoutTaxRate ?? 0,
|
|
||||||
}));
|
|
||||||
|
|
||||||
dispatch(changeOrderCardDetails(formattedData));
|
|
||||||
close();
|
|
||||||
};
|
};
|
||||||
|
let Response = await dispatch(getStockDetailsByVariantName(Data)).unwrap();
|
||||||
|
if (Response?.data?.statusCode == 1) {
|
||||||
|
const result =
|
||||||
|
Response?.data?.data?.flatMap((product) =>
|
||||||
|
product?.ProductDetail?.flatMap((detail) =>
|
||||||
|
detail?.ProdVariantDetails?.flatMap((variant) => {
|
||||||
|
const prevQty = getLastBuyQty(
|
||||||
|
index,
|
||||||
|
variant.ProdVariantName,
|
||||||
|
variant.ProdId
|
||||||
|
);
|
||||||
|
|
||||||
|
const allocations = getStockAllocation(
|
||||||
|
variant?.StockDetails,
|
||||||
|
prevQty
|
||||||
|
);
|
||||||
|
|
||||||
const columns = [
|
const safeAllocations =
|
||||||
{
|
allocations?.length > 0
|
||||||
title: 'Sl.No',
|
? allocations
|
||||||
key: 'sno',
|
: [
|
||||||
align: 'center',
|
{
|
||||||
render: (_, __, index) => (page - 1) * 10 + index + 1,
|
InwardDtlId: variant?.StockDetails?.[0]?.InwardDtlId,
|
||||||
onCell: (record) => ({
|
InwardId: variant?.StockDetails?.[0]?.InwardId,
|
||||||
onClick: () => handleRowDataClick(record),
|
InwardDate: variant?.StockDetails?.[0]?.InwardDate,
|
||||||
style: { cursor: 'pointer' },
|
AllocatedQty: prevQty,
|
||||||
}),
|
SellPrice: variant?.StockDetails?.[0]?.SellPrice ?? 0,
|
||||||
},
|
MRP: variant?.StockDetails?.[0]?.MRP ?? 0,
|
||||||
{
|
OrderRate: variant?.StockDetails?.[0]?.SellPrice ?? 0,
|
||||||
title: 'Sales Date',
|
TotalAmt:
|
||||||
dataIndex: 'SalesDate',
|
(prevQty ?? 0) *
|
||||||
key: 'SalesDate',
|
(variant?.StockDetails?.[0]?.SellPrice ?? 0),
|
||||||
align: 'center',
|
BatchRef: null,
|
||||||
render: (text) => ExtractDateFormate(text),
|
SuppId: null,
|
||||||
onCell: (record) => ({
|
SuppName: null,
|
||||||
onClick: () => handleRowDataClick(record),
|
},
|
||||||
style: { cursor: 'pointer' },
|
];
|
||||||
}),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Amount',
|
|
||||||
dataIndex: 'NetAmount',
|
|
||||||
key: 'NetAmount',
|
|
||||||
align: 'center',
|
|
||||||
onCell: (record) => ({
|
|
||||||
onClick: () => handleRowDataClick(record),
|
|
||||||
style: { cursor: 'pointer' },
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
return safeAllocations.map((allocation) => ({
|
||||||
title: 'No of Products',
|
...variant,
|
||||||
key: 'productCount',
|
|
||||||
align: 'center',
|
|
||||||
render: (_, record) => (
|
|
||||||
<span
|
|
||||||
style={{ color: '#1292EE', fontSize: '16px', cursor: 'pointer' }}
|
|
||||||
onClick={(e) => {
|
|
||||||
e.stopPropagation(); // 👈 IMPORTANT
|
|
||||||
ViewProductdetails(record.productDetails);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{record?.productDetails?.length || 0}
|
|
||||||
</span>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
const productColumns = [
|
// ===== PRODUCT LEVEL =====
|
||||||
{
|
ProdId: detail.ProdId,
|
||||||
title: 'Sl.No',
|
ProdName: detail.ProdName,
|
||||||
key: 'sno',
|
ProdCat: product.ProdCat,
|
||||||
align: 'center',
|
BrandName: detail.BrandName ?? null,
|
||||||
render: (_, __, index) => index + 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Product Name',
|
|
||||||
dataIndex: 'ProdName',
|
|
||||||
key: 'ProdName',
|
|
||||||
align: 'center',
|
|
||||||
render: (_, record) =>
|
|
||||||
`${record?.ProdName || '-'}${record?.UomName ? ` ${record.Size + record.UomName}` : ''}`,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Qty',
|
|
||||||
dataIndex: 'SalesQty',
|
|
||||||
key: 'SalesQty',
|
|
||||||
align: 'center',
|
|
||||||
render: (_, record) =>
|
|
||||||
record?.SalesQty || '-',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Variant',
|
|
||||||
key: 'ProdVariantName',
|
|
||||||
align: 'ProdVariantName',
|
|
||||||
render: (_, record) =>
|
|
||||||
record?.ProdVariantName || '-',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Rate',
|
|
||||||
key: 'Rate',
|
|
||||||
align: 'right',
|
|
||||||
render: (_, record) =>
|
|
||||||
record?.Rate || 0,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'MRP',
|
|
||||||
key: 'MRP',
|
|
||||||
align: 'right',
|
|
||||||
render: (_, record) =>
|
|
||||||
record?.MRP || 0,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
const disableFutureDates = (current) => {
|
// ===== VARIANT / STOCK =====
|
||||||
return current && current > dayjs().endOf('day');
|
PreviousPurchasedQty: prevQty,
|
||||||
};
|
available:
|
||||||
const onRangeChange = (dates) => {
|
detail?.StockAvailable === 'N'
|
||||||
setSelectedRange(dates);
|
? true
|
||||||
};
|
: (variant.OverAllQty ?? 0) >= prevQty,
|
||||||
const getRangePickerValue = () => selectedRange || [dayjs(), dayjs()];
|
InwardDtlId: allocation.InwardDtlId,
|
||||||
|
InwardId: allocation.InwardId,
|
||||||
|
OrderQty: allocation.AllocatedQty,
|
||||||
|
InwardDate: allocation.InwardDate,
|
||||||
|
|
||||||
|
TotalAmt:
|
||||||
|
(allocation.AllocatedQty ?? 0) * (allocation.SellPrice ?? 0),
|
||||||
|
|
||||||
return (
|
BalanceQty: detail.BalanceQty ?? 0,
|
||||||
<>
|
BatchRef: allocation.BatchRef,
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
|
||||||
<div>
|
// ===== PRICE =====
|
||||||
<p>Customer Name : {CustomerDetails?.CustName}</p>
|
MRP: allocation.MRP ?? 0,
|
||||||
<p>Customer Name : {CustomerDetails?.value}</p>
|
OrderRate: allocation.SellPrice ?? 0,
|
||||||
</div>
|
SellingPrice: allocation.SellPrice ?? 0,
|
||||||
<div className='fromlabelDate'>
|
|
||||||
<label>Select Date</label>
|
// ===== TAX =====
|
||||||
<RangePicker
|
TaxId: detail.TaxId ?? null,
|
||||||
onChange={onRangeChange}
|
TaxPercentage: detail.TaxPercentage ?? 0,
|
||||||
format="DD-MMM-YYYY" // display format
|
TaxAmt: detail.TaxAmt ?? 0,
|
||||||
disabledDate={disableFutureDates}
|
TaxName: detail.TaxName,
|
||||||
inputReadOnly={true}
|
WithoutTaxRate: detail.WithoutTaxRate ?? 0,
|
||||||
value={getRangePickerValue()}
|
|
||||||
/>
|
// ===== OTHERS =====
|
||||||
</div>
|
SinglePc: 'N',
|
||||||
|
Size: detail.Size,
|
||||||
|
StockAvailable: detail.StockAvailable,
|
||||||
|
PartNumber: detail.PartNumber,
|
||||||
|
SuppId: allocation.SuppId,
|
||||||
|
SuppName: allocation.SuppName,
|
||||||
|
QRCode: detail.QRCode,
|
||||||
|
QtyBasedPrice: detail.QtyBasedPrice,
|
||||||
|
HSNCode: detail.HSNCode ?? null,
|
||||||
|
Rack: detail.Rack ?? null,
|
||||||
|
|
||||||
|
BookingTypeName: 'TakeAway',
|
||||||
|
ActiveStatus: 'A',
|
||||||
|
ModelNumber: null,
|
||||||
|
NoOfPcs: 0,
|
||||||
|
Offer: 0,
|
||||||
|
OpeningQty: 0,
|
||||||
|
FullProductIdentifierDtls: [],
|
||||||
|
CounterName: product.CounterName,
|
||||||
|
Type: 'P',
|
||||||
|
|
||||||
|
// ===== META =====
|
||||||
|
UniqueId: detail.UniqueId,
|
||||||
|
UomName: detail.UomName,
|
||||||
|
ScaleType: detail.ScaleType ?? '',
|
||||||
|
TokenAvailable: detail.TokenAvailable,
|
||||||
|
localId: uuidv4(),
|
||||||
|
}));
|
||||||
|
})
|
||||||
|
)
|
||||||
|
) ?? [];
|
||||||
|
|
||||||
|
setStockDetails(result);
|
||||||
|
setpage(1);
|
||||||
|
setStockDetailModel(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// close();
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSave = () => {
|
||||||
|
let Data = StockDetails?.filter((e) => e?.available == true)?.map(
|
||||||
|
({ stockDetails, available, PreviousPurchasedQty, ...rest }) => rest
|
||||||
|
);
|
||||||
|
dispatch(changeOrderCardDetails(Data));
|
||||||
|
close();
|
||||||
|
};
|
||||||
|
const columns = [
|
||||||
|
{
|
||||||
|
title: 'Sl.No',
|
||||||
|
key: 'sno',
|
||||||
|
align: 'center',
|
||||||
|
render: (_, __, index) => (page - 1) * 10 + index + 1,
|
||||||
|
onCell: (record, index) => ({
|
||||||
|
onClick: () => handleRowDataClick(record, index),
|
||||||
|
style: { cursor: 'pointer' },
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Sales Date',
|
||||||
|
dataIndex: 'SalesDate',
|
||||||
|
key: 'SalesDate',
|
||||||
|
align: 'center',
|
||||||
|
render: (text) => ExtractDateFormate(text),
|
||||||
|
onCell: (record, index) => ({
|
||||||
|
onClick: () => handleRowDataClick(record, index),
|
||||||
|
style: { cursor: 'pointer' },
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Amount',
|
||||||
|
dataIndex: 'NetAmount',
|
||||||
|
key: 'NetAmount',
|
||||||
|
align: 'center',
|
||||||
|
onCell: (record, index) => ({
|
||||||
|
onClick: () => handleRowDataClick(record, index),
|
||||||
|
style: { cursor: 'pointer' },
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
title: 'No of Products',
|
||||||
|
key: 'productCount',
|
||||||
|
align: 'center',
|
||||||
|
render: (_, record) => (
|
||||||
|
<span
|
||||||
|
style={{ color: '#1292EE', fontSize: '16px', cursor: 'pointer' }}
|
||||||
|
onClick={(e) => {
|
||||||
|
e.stopPropagation(); // 👈 IMPORTANT
|
||||||
|
ViewProductdetails(record.productDetails);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{record?.productDetails?.length || 0}
|
||||||
|
</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
const stockcolumns = [
|
||||||
|
{
|
||||||
|
title: 'Sl.No',
|
||||||
|
key: 'sno',
|
||||||
|
align: 'center',
|
||||||
|
render: (_, __, index) => (page - 1) * 10 + index + 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Product',
|
||||||
|
key: 'ProdName',
|
||||||
|
dataIndex: 'ProdName',
|
||||||
|
align: 'center',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Variant',
|
||||||
|
key: 'ProdVariantName',
|
||||||
|
dataIndex: 'ProdVariantName',
|
||||||
|
align: 'center',
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
title: 'Purchased Qty',
|
||||||
|
key: 'PreviousPurchasedQty',
|
||||||
|
dataIndex: 'PreviousPurchasedQty',
|
||||||
|
align: 'center',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Total Qty',
|
||||||
|
key: 'OverAllQty',
|
||||||
|
dataIndex: 'OverAllQty',
|
||||||
|
align: 'center',
|
||||||
|
render: (value, record) =>
|
||||||
|
record?.StockAvailable == 'N' ? '-' : record?.OverAllQty,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
title: 'available',
|
||||||
|
key: 'available',
|
||||||
|
dataIndex: 'available',
|
||||||
|
align: 'center',
|
||||||
|
render: (value) => (value ? 'Yes' : 'No'),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const productColumns = [
|
||||||
|
{
|
||||||
|
title: 'Sl.No',
|
||||||
|
key: 'sno',
|
||||||
|
align: 'center',
|
||||||
|
render: (_, __, index) => index + 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Product Name',
|
||||||
|
dataIndex: 'ProdName',
|
||||||
|
key: 'ProdName',
|
||||||
|
align: 'center',
|
||||||
|
render: (_, record) =>
|
||||||
|
`${record?.ProdName || '-'}${record?.UomName ? ` ${record.Size + record.UomName}` : ''}`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Qty',
|
||||||
|
dataIndex: 'SalesQty',
|
||||||
|
key: 'SalesQty',
|
||||||
|
align: 'center',
|
||||||
|
render: (_, record) => record?.SalesQty || '-',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Variant',
|
||||||
|
key: 'ProdVariantName',
|
||||||
|
align: 'ProdVariantName',
|
||||||
|
render: (_, record) => record?.ProdVariantName || '-',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Rate',
|
||||||
|
key: 'Rate',
|
||||||
|
align: 'right',
|
||||||
|
render: (_, record) => record?.Rate || 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'MRP',
|
||||||
|
key: 'MRP',
|
||||||
|
align: 'right',
|
||||||
|
render: (_, record) => record?.MRP || 0,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const disableFutureDates = (current) => {
|
||||||
|
return current && current > dayjs().endOf('day');
|
||||||
|
};
|
||||||
|
const onRangeChange = (dates) => {
|
||||||
|
setSelectedRange(dates);
|
||||||
|
};
|
||||||
|
const getRangePickerValue = () => selectedRange || [dayjs(), dayjs()];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
||||||
|
<div>
|
||||||
|
<p>Customer Name : {CustomerDetails?.CustName}</p>
|
||||||
|
<p>Customer Name : {CustomerDetails?.value}</p>
|
||||||
|
</div>
|
||||||
|
<div className="fromlabelDate">
|
||||||
|
<label>Select Date</label>
|
||||||
|
<RangePicker
|
||||||
|
onChange={onRangeChange}
|
||||||
|
format="DD-MMM-YYYY" // display format
|
||||||
|
disabledDate={disableFutureDates}
|
||||||
|
inputReadOnly={true}
|
||||||
|
value={getRangePickerValue()}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="reportTable">
|
||||||
|
<Tables
|
||||||
|
columns={columns}
|
||||||
|
data={custpmerOrderData}
|
||||||
|
dataSource={custpmerOrderData}
|
||||||
|
pagination={handlePageChange}
|
||||||
|
/>{' '}
|
||||||
|
<Modal
|
||||||
|
open={productModal}
|
||||||
|
title="Product Details"
|
||||||
|
width={700}
|
||||||
|
footer={null}
|
||||||
|
onCancel={() => setProductModal(false)}
|
||||||
|
>
|
||||||
|
<Tables
|
||||||
|
columns={productColumns}
|
||||||
|
data={selectedProducts}
|
||||||
|
pagination={false}
|
||||||
|
/>
|
||||||
|
</Modal>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<DefaultModal
|
||||||
|
open={stockDetailModel}
|
||||||
|
title="Stock Details"
|
||||||
|
handleCancel={() => {
|
||||||
|
setStockDetailModel(false);
|
||||||
|
setStockDetails([]);
|
||||||
|
}}
|
||||||
|
footer={false}
|
||||||
|
width={700}
|
||||||
|
children={
|
||||||
|
<div>
|
||||||
|
<Tables
|
||||||
|
columns={stockcolumns}
|
||||||
|
data={StockDetails}
|
||||||
|
pagination={handlePageChange}
|
||||||
|
/>{' '}
|
||||||
|
<div style={{ display: 'flex', flexDirection: 'row-reverse' }}>
|
||||||
|
<Buttons
|
||||||
|
buttonText="SUBMIT"
|
||||||
|
color="901D77"
|
||||||
|
icon={<ArrowRightOutlined />}
|
||||||
|
handleSubmit={() => {
|
||||||
|
handleSave();
|
||||||
|
}}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
<div className="reportTable">
|
export default CustomerOrders;
|
||||||
<Tables
|
|
||||||
columns={columns}
|
|
||||||
data={custpmerOrderData}
|
|
||||||
dataSource={custpmerOrderData}
|
|
||||||
pagination={handlePageChange}
|
|
||||||
/>{' '}
|
|
||||||
|
|
||||||
|
|
||||||
<Modal
|
|
||||||
open={productModal}
|
|
||||||
title="Product Details"
|
|
||||||
width={700}
|
|
||||||
footer={null}
|
|
||||||
onCancel={() => setProductModal(false)}
|
|
||||||
>
|
|
||||||
<Tables
|
|
||||||
columns={productColumns}
|
|
||||||
data={selectedProducts}
|
|
||||||
pagination={false}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default CustomerOrders;
|
|
||||||
|
|
|
||||||
|
|
@ -2278,6 +2278,7 @@ const SelectionComponent = forwardRef((props, ref) => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const validateFontsTable = async (values) => {
|
const validateFontsTable = async (values) => {
|
||||||
|
console.log(values,"table font")
|
||||||
const apiUrl = `https://www.googleapis.com/webfonts/v1/webfonts?key=AIzaSyDP1HqNkLI53iIAH-SB9_mt_24QdkUZ_24`;
|
const apiUrl = `https://www.googleapis.com/webfonts/v1/webfonts?key=AIzaSyDP1HqNkLI53iIAH-SB9_mt_24QdkUZ_24`;
|
||||||
fetch(apiUrl)
|
fetch(apiUrl)
|
||||||
.then((response) => response.json())
|
.then((response) => response.json())
|
||||||
|
|
@ -4982,7 +4983,9 @@ const SelectionComponent = forwardRef((props, ref) => {
|
||||||
className="plusOutlinedIcon"
|
className="plusOutlinedIcon"
|
||||||
|
|
||||||
/>
|
/>
|
||||||
<DefaultModal
|
|
||||||
|
</div>
|
||||||
|
<DefaultModal
|
||||||
open={TableModelopen}
|
open={TableModelopen}
|
||||||
title="Fonts"
|
title="Fonts"
|
||||||
footer={true}
|
footer={true}
|
||||||
|
|
@ -5026,7 +5029,6 @@ const SelectionComponent = forwardRef((props, ref) => {
|
||||||
handleSubmit={TablehandleSubmit}
|
handleSubmit={TablehandleSubmit}
|
||||||
buttonText="SAVE"
|
buttonText="SAVE"
|
||||||
/>
|
/>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
{SelectedBillTableCheckValues?.filter(
|
{SelectedBillTableCheckValues?.filter(
|
||||||
(item) =>
|
(item) =>
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ import { DropDowns } from "../../../../Components/Forms/DropDown";
|
||||||
import { Switch } from "antd";
|
import { Switch } from "antd";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
import KioskPrinterSelection from "./KioskPrinterSelection";
|
import KioskPrinterSelection from "./KioskPrinterSelection";
|
||||||
|
import { GlobalFeatAddOnData } from "../../../../Features/BookingScreen/BookingData/BookingData";
|
||||||
|
|
||||||
const PrinterSelection = (props) => {
|
const PrinterSelection = (props) => {
|
||||||
const CompId = getSession("CompId");
|
const CompId = getSession("CompId");
|
||||||
|
|
@ -28,6 +29,7 @@ const PrinterSelection = (props) => {
|
||||||
const [activePrinterId, setActivePrinterId] = useState(null);
|
const [activePrinterId, setActivePrinterId] = useState(null);
|
||||||
const [initialPrinters, setInitialPrinters] = useState([]);
|
const [initialPrinters, setInitialPrinters] = useState([]);
|
||||||
const PrinterDetails = useSelector(GlobalPrinterMappingDtls);
|
const PrinterDetails = useSelector(GlobalPrinterMappingDtls);
|
||||||
|
const FeatureAddonData = useSelector(GlobalFeatAddOnData);
|
||||||
const [MyPrinter, setMyPrinter] = useState(true);
|
const [MyPrinter, setMyPrinter] = useState(true);
|
||||||
const [MyKioskPrinter, setMyKioskPrinter] = useState(false);
|
const [MyKioskPrinter, setMyKioskPrinter] = useState(false);
|
||||||
const { onClose } = props;
|
const { onClose } = props;
|
||||||
|
|
@ -314,6 +316,10 @@ const PrinterSelection = (props) => {
|
||||||
{/* <HiOutlineSquares2X2 size={16} /> */}
|
{/* <HiOutlineSquares2X2 size={16} /> */}
|
||||||
My Printer
|
My Printer
|
||||||
</div>
|
</div>
|
||||||
|
{FeatureAddonData?.FeatureDtls?.find(
|
||||||
|
(item) =>
|
||||||
|
item?.FeatureAddonName?.toLowerCase() === 'kiosk sales'
|
||||||
|
) &&
|
||||||
<div
|
<div
|
||||||
className={MyKioskPrinter ? 'selected' : ''}
|
className={MyKioskPrinter ? 'selected' : ''}
|
||||||
onClick={openKioskPrinter}
|
onClick={openKioskPrinter}
|
||||||
|
|
@ -321,6 +327,7 @@ const PrinterSelection = (props) => {
|
||||||
{/* <HiSquaresPlus size={16} /> */}
|
{/* <HiSquaresPlus size={16} /> */}
|
||||||
Kiosk Printer
|
Kiosk Printer
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,7 @@ import {
|
||||||
changeSelectedLogo,
|
changeSelectedLogo,
|
||||||
changeSelectedCredit,
|
changeSelectedCredit,
|
||||||
changeSelectedTax,
|
changeSelectedTax,
|
||||||
|
changeSelectedHeaderColor,
|
||||||
} from '../../../../Features/ThemeChange/ThemeChange';
|
} from '../../../../Features/ThemeChange/ThemeChange';
|
||||||
import '../../../../Styles/BookingScreen/Components/SelectionComponent/SelectionComponent.scss';
|
import '../../../../Styles/BookingScreen/Components/SelectionComponent/SelectionComponent.scss';
|
||||||
import { useAuth } from '../../../../AuthContext.jsx';
|
import { useAuth } from '../../../../AuthContext.jsx';
|
||||||
|
|
@ -732,6 +733,13 @@ const SelectionComponent = forwardRef((props, ref) => {
|
||||||
)
|
)
|
||||||
? dispatch(changeNotes(true))
|
? dispatch(changeNotes(true))
|
||||||
: dispatch(changeNotes(false));
|
: dispatch(changeNotes(false));
|
||||||
|
|
||||||
|
checkedValues?.includes(
|
||||||
|
sizeCheckList.find((item) => item.ConfigName === 'Header Colour')
|
||||||
|
?.ConfigId
|
||||||
|
)
|
||||||
|
? setisheadercolour(true)
|
||||||
|
: setisheadercolour(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleOptions = async () => {
|
const handleOptions = async () => {
|
||||||
|
|
@ -1278,12 +1286,7 @@ const SelectionComponent = forwardRef((props, ref) => {
|
||||||
>
|
>
|
||||||
<Row>
|
<Row>
|
||||||
{sizeCheckList
|
{sizeCheckList
|
||||||
?.filter(
|
?.filter((item) => item.ConfigName)
|
||||||
(item) =>
|
|
||||||
item.ConfigName &&
|
|
||||||
(SelectedStyleName == 'TaxInvoice' ||
|
|
||||||
item.ConfigName != 'Header Colour')
|
|
||||||
)
|
|
||||||
?.map((value, key) => (
|
?.map((value, key) => (
|
||||||
<Checkbox
|
<Checkbox
|
||||||
style={{ padding: '12px' }}
|
style={{ padding: '12px' }}
|
||||||
|
|
@ -1383,14 +1386,18 @@ const SelectionComponent = forwardRef((props, ref) => {
|
||||||
</Modal>
|
</Modal>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{isheadercolour && SelectedStyleName == 'TaxInvoice' && (
|
{isheadercolour && (
|
||||||
|
// {isheadercolour && SelectedStyleName == 'TaxInvoice' && (
|
||||||
<div style={{ marginTop: '1rem' }}>
|
<div style={{ marginTop: '1rem' }}>
|
||||||
<Title level={5} style={{ marginBottom: 12 }}>
|
<Title level={5} style={{ marginBottom: 12 }}>
|
||||||
Header Color
|
Header Color
|
||||||
</Title>
|
</Title>
|
||||||
<ColorPicker
|
<ColorPicker
|
||||||
value={selectedColour}
|
value={selectedColour}
|
||||||
onChange={setSelectedColour}
|
onChange={(color) => {
|
||||||
|
setSelectedColour(color);
|
||||||
|
dispatch(changeSelectedHeaderColor(color));
|
||||||
|
}}
|
||||||
placeholder="Select color"
|
placeholder="Select color"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,68 +1,78 @@
|
||||||
import { useState } from "react";
|
import { useState } from 'react';
|
||||||
import { IoMdSettings } from "react-icons/io";
|
import { IoMdAdd, IoMdSettings } from 'react-icons/io';
|
||||||
import { DefaultModal } from "../../../../Components/Modal/DefaultModal";
|
import { DefaultModal } from '../../../../Components/Modal/DefaultModal';
|
||||||
import TooltipWrapper from "../../../../Components/Tooltip/Tooltip";
|
import TooltipWrapper from '../../../../Components/Tooltip/Tooltip';
|
||||||
|
import './AllSalesPageSettings.scss';
|
||||||
|
import TableHeadersetting from './TableHeadersetting';
|
||||||
|
import PaymentOptions from '../../../Payment/PaymentOptions/PaymentOptions';
|
||||||
|
|
||||||
const AllSalesPageSettings = () => {
|
const AllSalesPageSettings = () => {
|
||||||
const [settingModal,setsettingModal] = useState(false)
|
const [settingModal, setsettingModal] = useState(false);
|
||||||
const [checkboxItems, setCheckboxItems] = useState([
|
const [selectedComponent, setselectedComponent] = useState('Payment');
|
||||||
{ id: 'item1', label: 'Show Details', checked: true },
|
|
||||||
{ id: 'item2', label: 'Auto Refresh', checked: false },
|
const onclose = () => {
|
||||||
{ id: 'item3', label: 'Notifications', checked: true }
|
setsettingModal(false);
|
||||||
])
|
};
|
||||||
console.log(settingModal,"settingModal")
|
const ComponentSelect = (value) => {
|
||||||
const onclose = () => {
|
setselectedComponent(value);
|
||||||
setsettingModal(false)
|
};
|
||||||
}
|
return (
|
||||||
return (
|
<>
|
||||||
<>
|
<TooltipWrapper>
|
||||||
<TooltipWrapper>
|
<div
|
||||||
<div
|
onClick={() => setsettingModal(true)}
|
||||||
onClick={() => setsettingModal(true)}
|
style={{
|
||||||
style={{
|
cursor: 'pointer',
|
||||||
cursor: 'pointer',
|
display: 'flex',
|
||||||
display: 'flex',
|
alignItems: 'center',
|
||||||
alignItems: 'center',
|
gap: '5px',
|
||||||
gap: '5px',
|
padding: '5px 10px',
|
||||||
padding: '5px 10px',
|
borderRadius: '4px',
|
||||||
borderRadius: '4px',
|
fontSize: '14px',
|
||||||
|
backgroundColor: '#f0f0f0',
|
||||||
fontSize: '14px',
|
}}
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<IoMdSettings />
|
<IoMdSettings size={16} />
|
||||||
</div>
|
</div>
|
||||||
</TooltipWrapper>
|
</TooltipWrapper>
|
||||||
|
|
||||||
<DefaultModal
|
<DefaultModal
|
||||||
open={settingModal}
|
open={settingModal}
|
||||||
footer={false}
|
footer={false}
|
||||||
handleCancel={onclose}
|
handleCancel={onclose}
|
||||||
|
title={'Settings'}
|
||||||
title={"Settings"} width={500}>
|
width={850}
|
||||||
<div style={{ padding: '20px' }}>
|
>
|
||||||
{checkboxItems.map(item => (
|
<div className="AllSalesPageSettingsMainDiv">
|
||||||
<div key={item.id} style={{ marginBottom: '10px' }}>
|
<div className="SettingsListSwitchBTN">
|
||||||
<label style={{ display: 'flex', alignItems: 'center', gap: '8px', cursor: 'pointer' }}>
|
<div
|
||||||
<input
|
className={selectedComponent === 'Payment' ? 'selected' : ''}
|
||||||
type="checkbox"
|
onClick={() => ComponentSelect('Payment')}
|
||||||
checked={item.checked}
|
>
|
||||||
onChange={(e) => {
|
Payment Option
|
||||||
setCheckboxItems(prev =>
|
</div>
|
||||||
prev.map(i =>
|
<div
|
||||||
i.id === item.id ? { ...i, checked: e.target.checked } : i
|
className={selectedComponent === 'Table' ? 'selected' : ''}
|
||||||
)
|
onClick={() => ComponentSelect('Table')}
|
||||||
)
|
>
|
||||||
}}
|
Table
|
||||||
/>
|
</div>
|
||||||
{item.label}
|
</div>
|
||||||
</label>
|
<div className="SettingsComponentDiv">
|
||||||
</div>
|
{selectedComponent == 'Payment' && (
|
||||||
))}
|
<div>
|
||||||
</div>
|
<PaymentOptions setModalOpen={setsettingModal}/>
|
||||||
</DefaultModal>
|
</div>
|
||||||
</>
|
)}
|
||||||
)
|
|
||||||
}
|
{selectedComponent === 'Table' && (
|
||||||
|
<TableHeadersetting setModalOpen={setsettingModal} />
|
||||||
export default AllSalesPageSettings;
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</DefaultModal>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default AllSalesPageSettings;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,184 @@
|
||||||
|
// /// Another swtich button style code
|
||||||
|
|
||||||
|
// .SettingsListSwitchBTN {
|
||||||
|
// display: inline-flex;
|
||||||
|
// gap: 16px;
|
||||||
|
// font-family: "Poppins";
|
||||||
|
// margin-bottom: 12px;
|
||||||
|
// border-bottom: 1px solid #d1d5db;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// .SettingsListSwitchBTN > div {
|
||||||
|
// font-size: 22px;
|
||||||
|
// font-weight: 600;
|
||||||
|
// cursor: pointer;
|
||||||
|
// color: #6b7280;
|
||||||
|
// display: flex;
|
||||||
|
// align-items: center;
|
||||||
|
// gap: 6px;
|
||||||
|
// position: relative;
|
||||||
|
// border: none;
|
||||||
|
// background: transparent;
|
||||||
|
// font-family: "Gilroy";
|
||||||
|
// transition: color 0.2s ease;
|
||||||
|
// @media (max-width: 600px) {
|
||||||
|
// font-size: 18px;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// .SettingsListSwitchBTN > div:hover {
|
||||||
|
// color: #0f172a;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// .SettingsSwitchBTN > div.selected {
|
||||||
|
// color: #0f172a;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// .SettingsListSwitchBTN > div.selected::after {
|
||||||
|
// content: "";
|
||||||
|
// position: absolute;
|
||||||
|
// left: 0;
|
||||||
|
// bottom: -1px;
|
||||||
|
// width: 100%;
|
||||||
|
// height: 2px;
|
||||||
|
// background: #2c88ee;
|
||||||
|
// border-radius: 2px;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// .SettingsListSwitchBTN > div.selected svg {
|
||||||
|
// color: #4765db !important;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // End
|
||||||
|
// .settingsales-DropDown-Selection {
|
||||||
|
// width: 150px !important;
|
||||||
|
// }
|
||||||
|
// .settingaddNewSalesFiledBTN {
|
||||||
|
// background-color: #2563eb;
|
||||||
|
// // background-color: #1292ee;
|
||||||
|
// color: #fff !important;
|
||||||
|
// width: max-content;
|
||||||
|
// height: max-content;
|
||||||
|
// padding: 4px 8px;
|
||||||
|
// font-size: 13px;
|
||||||
|
// font-weight: 400;
|
||||||
|
// display: flex;
|
||||||
|
// align-items: center;
|
||||||
|
// gap: 4px;
|
||||||
|
// cursor: pointer;
|
||||||
|
// border-radius: 6px;
|
||||||
|
// svg {
|
||||||
|
// color: #fff !important;
|
||||||
|
// font-weight: 500;
|
||||||
|
// display: flex;
|
||||||
|
// font-size: 16px;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
.AllSalesPageSettingsMainDiv {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 1rem;
|
||||||
|
font-family: "Poppins", sans-serif;
|
||||||
|
justify-content: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.SettingsComponentDiv {
|
||||||
|
height: max-content;
|
||||||
|
max-height: 80vh;
|
||||||
|
width: 100%;
|
||||||
|
scrollbar-width: thin;
|
||||||
|
padding-right: 10px;
|
||||||
|
overflow: auto;
|
||||||
|
.option-maindiv {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
.ant-checkbox-wrapper {
|
||||||
|
padding: 8px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.SettingsListSwitchBTN {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 6px;
|
||||||
|
width: 210px;
|
||||||
|
height: 100%;
|
||||||
|
overflow: auto;
|
||||||
|
background-color: #d8e5ff;
|
||||||
|
padding: 5px;
|
||||||
|
border-radius: 4px;
|
||||||
|
height: 80vh;
|
||||||
|
div {
|
||||||
|
width: 100%;
|
||||||
|
background-color: #fff;
|
||||||
|
outline: none;
|
||||||
|
border: none;
|
||||||
|
font-family: "Poppins", sans-serif;
|
||||||
|
padding: 8px 6px;
|
||||||
|
cursor: pointer;
|
||||||
|
border-radius: 4px;
|
||||||
|
transition: all 0.2s ease-in-out;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 400;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: #d1d8ec;
|
||||||
|
}
|
||||||
|
&.selected {
|
||||||
|
background-color: #ffffff;
|
||||||
|
color: #2563eb;
|
||||||
|
font-weight: 500;
|
||||||
|
border-right: 3px solid #2563eb;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.settingaddNewSalesFiledBTN {
|
||||||
|
background-color: #2563eb;
|
||||||
|
// background-color: #1292ee;
|
||||||
|
color: #fff !important;
|
||||||
|
width: max-content;
|
||||||
|
height: max-content;
|
||||||
|
padding: 4px 8px;
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 400;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
border-radius: 6px;
|
||||||
|
svg {
|
||||||
|
color: #fff !important;
|
||||||
|
font-weight: 500;
|
||||||
|
display: flex;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Table Header Setting CSS start here|||
|
||||||
|
|
||||||
|
.SelectionComponentSubHeading {
|
||||||
|
color: #333;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 500;
|
||||||
|
font-family: "Poppins", sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
.selctfontBackInputMain {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 8px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
.selctfontBackInput {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 4px;
|
||||||
|
}
|
||||||
|
|
@ -1,126 +1,125 @@
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { getSession } from "../../../../Services/Others";
|
import { getSession } from "../../../../Services/Others";
|
||||||
import { useDispatch } from "react-redux";
|
import { useDispatch } from "react-redux";
|
||||||
import { getmultipleSearch, PostProductSearch } from "../../../../Features/BookingScreen/BookingData/BookingData";
|
import {
|
||||||
|
getmultipleSearch,
|
||||||
|
PostProductSearch,
|
||||||
|
} from "../../../../Features/BookingScreen/BookingData/BookingData";
|
||||||
import Buttons from "../../../../Components/Forms/Buttons";
|
import Buttons from "../../../../Components/Forms/Buttons";
|
||||||
|
|
||||||
|
|
||||||
const MultipleSearch = ({ close }) => {
|
const MultipleSearch = ({ close }) => {
|
||||||
const CompId = getSession("CompId");
|
const CompId = getSession("CompId");
|
||||||
const BranchId = getSession("BranchId");
|
const BranchId = getSession("BranchId");
|
||||||
const AppId = getSession("AppId");
|
const AppId = getSession("AppId");
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
|
const options = [
|
||||||
|
{ label: "Product Name", value: "ProdName" },
|
||||||
|
{ label: "Product Variant Name", value: "ProdVariantName" },
|
||||||
|
// { label: "Product ID", value: "ProdId" },
|
||||||
|
{ label: "One Piece QR", value: "OnePcQR" },
|
||||||
|
{ label: "QR Code", value: "QrCode" },
|
||||||
|
{ label: "Product Name Code", value: "ProdNameCode" },
|
||||||
|
{ label: "Category Name", value: "CategoryName" },
|
||||||
|
{ label: "Sub Category Name", value: "SubCategoryName" },
|
||||||
|
{ label: "Brand Name", value: "BrandName" },
|
||||||
|
];
|
||||||
|
|
||||||
const options = [
|
const [selectedValues, setSelectedValues] = useState([]);
|
||||||
{ label: "Product Name", value: "ProdName" },
|
console.log(selectedValues, "selectedValuesselectedValues");
|
||||||
{ label: "Product Variant Name", value: "ProdVariantName" },
|
|
||||||
// { label: "Product ID", value: "ProdId" },
|
|
||||||
{ label: "One Piece QR", value: "OnePcQR" },
|
|
||||||
{ label: "QR Code", value: "QrCode" },
|
|
||||||
{ label: "Product Name Code", value: "ProdNameCode" },
|
|
||||||
{ label: "Category Name", value: "CategoryName" },
|
|
||||||
{ label: "Sub Category Name", value: "SubCategoryName" },
|
|
||||||
{ label: "Brand Name", value: "BrandName" },
|
|
||||||
];
|
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
GetmultipleSearchData();
|
||||||
|
}, []);
|
||||||
|
|
||||||
const [selectedValues, setSelectedValues] = useState([]);
|
const postMultipleSearch = async () => {
|
||||||
console.log(selectedValues, 'selectedValuesselectedValues');
|
if (selectedValues.length === 0) {
|
||||||
|
alert("Please select at least one option!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const data = {
|
||||||
|
CompId: CompId,
|
||||||
|
BranchId: BranchId,
|
||||||
|
AppId: AppId,
|
||||||
|
SearchTerms: selectedValues,
|
||||||
|
};
|
||||||
|
try {
|
||||||
|
const response = await dispatch(PostProductSearch(data)).unwrap();
|
||||||
|
console.log("Search Response:", response);
|
||||||
|
if (response?.data?.statusCode == 1) {
|
||||||
|
setSelectedValues("");
|
||||||
|
close(false);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Search Error:", error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
const GetmultipleSearchData = async () => {
|
||||||
GetmultipleSearchData();
|
const data = {
|
||||||
}, []);
|
AppId,
|
||||||
|
CompId,
|
||||||
|
BranchId,
|
||||||
const postMultipleSearch = async () => {
|
|
||||||
if (selectedValues.length === 0) {
|
|
||||||
alert("Please select at least one option!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const data = {
|
|
||||||
CompId: CompId,
|
|
||||||
BranchId: BranchId,
|
|
||||||
AppId: AppId,
|
|
||||||
SearchTerms: selectedValues,
|
|
||||||
};
|
|
||||||
try {
|
|
||||||
const response = await dispatch(PostProductSearch(data)).unwrap();
|
|
||||||
console.log("Search Response:", response);
|
|
||||||
if (response?.data?.statusCode == 1) {
|
|
||||||
setSelectedValues('')
|
|
||||||
close(false);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error("Search Error:", error);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
|
const response = await dispatch(getmultipleSearch(data)).unwrap();
|
||||||
|
|
||||||
const GetmultipleSearchData = async () => {
|
if (response?.data?.statusCode === 1) {
|
||||||
const data = {
|
const selected =
|
||||||
AppId,
|
response?.data?.data?.[0]?.SearchTermDtl?.map(
|
||||||
CompId,
|
(item) => item?.SearchTerm,
|
||||||
BranchId,
|
) || [];
|
||||||
};
|
|
||||||
|
|
||||||
try {
|
setSelectedValues(selected);
|
||||||
const response = await dispatch(getmultipleSearch(data)).unwrap();
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Get Search Terms Error:", error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
if (response?.data?.statusCode === 1) {
|
return (
|
||||||
const selected = response?.data?.data?.[0]?.SearchTermDtl?.map(
|
<>
|
||||||
(item) => item?.SearchTerm
|
<div
|
||||||
) || [];
|
style={{ fontFamily: "Poppins", fontWeight: "500", marginTop: "10px" }}
|
||||||
|
>
|
||||||
setSelectedValues(selected);
|
{options.map((item) => (
|
||||||
}
|
<label
|
||||||
} catch (error) {
|
key={item.value}
|
||||||
console.error("Get Search Terms Error:", error);
|
style={{
|
||||||
}
|
display: "block",
|
||||||
};
|
marginBottom: "6px",
|
||||||
|
cursor: "pointer",
|
||||||
return (
|
fontSize: "14px",
|
||||||
<>
|
color: "#333",
|
||||||
<div>
|
margin: "6px 0",
|
||||||
{options.map((item) => (
|
}}
|
||||||
<label
|
>
|
||||||
key={item.value}
|
<input
|
||||||
style={{
|
type="checkbox"
|
||||||
display: "block",
|
checked={selectedValues.includes(item.value)}
|
||||||
marginBottom: "6px",
|
onChange={() => {
|
||||||
cursor: "pointer",
|
setSelectedValues((prev) =>
|
||||||
fontSize: "14px",
|
prev.includes(item.value)
|
||||||
color: "#333",
|
? prev.filter((i) => i !== item.value)
|
||||||
}}
|
: [...prev, item.value],
|
||||||
>
|
);
|
||||||
<input
|
}}
|
||||||
type="checkbox"
|
style={{ marginRight: "8px" }}
|
||||||
checked={selectedValues.includes(item.value)}
|
/>
|
||||||
onChange={() => {
|
{item.label}
|
||||||
setSelectedValues((prev) =>
|
</label>
|
||||||
prev.includes(item.value)
|
))}
|
||||||
? prev.filter((i) => i !== item.value)
|
</div>
|
||||||
: [...prev, item.value]
|
<div style={{ display: "flex", width: "100%", marginTop: "2rem" }}>
|
||||||
);
|
<Buttons
|
||||||
}}
|
buttonText={"Submit"}
|
||||||
style={{ marginRight: "8px" }}
|
handleSubmit={postMultipleSearch}
|
||||||
/>
|
color="901D77"
|
||||||
{item.label}
|
/>
|
||||||
</label>
|
</div>
|
||||||
))}
|
</>
|
||||||
|
);
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<Buttons
|
|
||||||
buttonText={'Submit'}
|
|
||||||
handleSubmit={postMultipleSearch}
|
|
||||||
color="901D77"
|
|
||||||
// icon={<PlusOutlined />}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default MultipleSearch;
|
export default MultipleSearch;
|
||||||
|
|
|
||||||
|
|
@ -1,449 +1,518 @@
|
||||||
import { shallowEqual, useSelector } from "react-redux";
|
import { shallowEqual, useSelector } from 'react-redux';
|
||||||
import { GlobalAccessForOthers, GlobalCardAccess, GlobalCombosearch, GlobalItemCard, GlobalProductCategorie, GlobalSelectedDatas, GlobalWithoutSubCatItemCard, triggerProductCard } from "../../../../Features/BookingScreen/BookingData/BookingData";
|
import {
|
||||||
import { DefaultModal } from "../../../../Components/Modal/DefaultModal";
|
GlobalAccessForOthers,
|
||||||
import { useCallback, useEffect, useRef, useState } from "react";
|
GlobalCardAccess,
|
||||||
import { Tables } from "../../../../Components/Tables/Table";
|
GlobalCombosearch,
|
||||||
import { InputField } from "../../../../Components/Forms/InputField";
|
GlobalItemCard,
|
||||||
import { Form, Pagination, Tooltip } from "antd";
|
GlobalProductCategorie,
|
||||||
import { getSession } from "../../../../Services/Others";
|
GlobalSelectedDatas,
|
||||||
import { Messages } from "../../../../Components/Notifications/Messages";
|
GlobalWithoutSubCatItemCard,
|
||||||
import { useDispatch } from "react-redux";
|
triggerProductCard,
|
||||||
import { PutStockPrice } from "../../../../Features/StockPriceUpdate/StockPriceUpdateMaster";
|
} from '../../../../Features/BookingScreen/BookingData/BookingData';
|
||||||
import PriceChange from "../../../../Images/PayOptImgs/PriceChange.svg"
|
import { DefaultModal } from '../../../../Components/Modal/DefaultModal';
|
||||||
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||||
|
import { Tables } from '../../../../Components/Tables/Table';
|
||||||
|
import { InputField } from '../../../../Components/Forms/InputField';
|
||||||
|
import { Form, Pagination, Tooltip } from 'antd';
|
||||||
|
import { getSession } from '../../../../Services/Others';
|
||||||
|
import { Messages } from '../../../../Components/Notifications/Messages';
|
||||||
|
import { useDispatch } from 'react-redux';
|
||||||
|
import { PutStockPrice } from '../../../../Features/StockPriceUpdate/StockPriceUpdateMaster';
|
||||||
|
import PriceChange from '../../../../Images/PayOptImgs/PriceChange.svg';
|
||||||
|
|
||||||
const ProductPriceChange = ({ showButton = true, priceChangeProduct = null, productPriceChange = false, setProductPriceChange = () => { }, setPriceChangeProduct = () => { } }) => {
|
const ProductPriceChange = ({
|
||||||
|
showButton = true,
|
||||||
|
priceChangeProduct = [],
|
||||||
|
productPriceChange = false,
|
||||||
|
setProductPriceChange = () => {},
|
||||||
|
setPriceChangeProduct = () => {},
|
||||||
|
}) => {
|
||||||
|
const formRef = useRef(null);
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
const formRef = useRef(null);
|
const AppId = getSession('AppId');
|
||||||
const dispatch = useDispatch();
|
const CompId = getSession('CompId');
|
||||||
|
const BranchId = getSession('BranchId');
|
||||||
|
const UserId = getSession('UserId');
|
||||||
|
|
||||||
const AppId = getSession('AppId');
|
const [messageData, setMessageData] = useState(null);
|
||||||
const CompId = getSession('CompId');
|
const [messageType, setMessageType] = useState(null);
|
||||||
const BranchId = getSession('BranchId');
|
const [currentPage, setCurrentPage] = useState(1);
|
||||||
const UserId = getSession('UserId');
|
const [pageSize] = useState(10);
|
||||||
|
|
||||||
const [messageData, setMessageData] = useState(null);
|
const [noSubcatCardData, setNoSubcatCardData] = useState();
|
||||||
const [messageType, setMessageType] = useState(null);
|
const [priceChangeModal, setPriceChangeModal] = useState(false);
|
||||||
const [currentPage, setCurrentPage] = useState(1);
|
|
||||||
const [pageSize] = useState(10);
|
|
||||||
|
|
||||||
const [noSubcatCardData, setNoSubcatCardData] = useState();
|
const comboSearch = useSelector(GlobalCombosearch);
|
||||||
const [priceChangeModal, setPriceChangeModal] = useState(false);
|
const ProdCat = useSelector(GlobalProductCategorie, shallowEqual);
|
||||||
|
const ItemCard = useSelector(GlobalItemCard, shallowEqual);
|
||||||
|
const withoutSubCatItemCard = useSelector(
|
||||||
|
GlobalWithoutSubCatItemCard,
|
||||||
|
shallowEqual
|
||||||
|
);
|
||||||
|
const CardAccess = useSelector(GlobalCardAccess, shallowEqual);
|
||||||
|
const globalAccessForOthers = useSelector(
|
||||||
|
GlobalAccessForOthers,
|
||||||
|
shallowEqual
|
||||||
|
);
|
||||||
|
const SelectedDatas = useSelector(GlobalSelectedDatas, shallowEqual);
|
||||||
|
const [tableData, setTableData] = useState([]);
|
||||||
|
const [editingKey, setEditingKey] = useState(null);
|
||||||
|
const [priceChangedProducts, setPriceChangedProducts] = useState([]);
|
||||||
|
console.log(comboSearch, 'comboSearch');
|
||||||
|
|
||||||
const comboSearch = useSelector(GlobalCombosearch);
|
// console.log(noSubcatCardData, "noSubcatCardData")
|
||||||
const ProdCat = useSelector(GlobalProductCategorie, shallowEqual);
|
|
||||||
const ItemCard = useSelector(GlobalItemCard, shallowEqual);
|
|
||||||
const withoutSubCatItemCard = useSelector(GlobalWithoutSubCatItemCard, shallowEqual);
|
|
||||||
const CardAccess = useSelector(GlobalCardAccess, shallowEqual);
|
|
||||||
const globalAccessForOthers = useSelector(GlobalAccessForOthers, shallowEqual);
|
|
||||||
const SelectedDatas = useSelector(GlobalSelectedDatas, shallowEqual);
|
|
||||||
const [tableData, setTableData] = useState([]);
|
|
||||||
const [editingKey, setEditingKey] = useState(null);
|
|
||||||
const [priceChangedProducts, setPriceChangedProducts] = useState([]);
|
|
||||||
console.log(comboSearch, "comboSearch")
|
|
||||||
|
|
||||||
// console.log(noSubcatCardData, "noSubcatCardData")
|
useEffect(() => {
|
||||||
|
if (
|
||||||
|
ProdCat &&
|
||||||
|
(ItemCard || withoutSubCatItemCard) &&
|
||||||
|
(!noSubcatCardData || noSubcatCardData?.length === 0)
|
||||||
|
) {
|
||||||
|
setNoSubcatCardData(
|
||||||
|
ItemCard?.length === 0 ? withoutSubCatItemCard : ItemCard
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}, [ProdCat, ItemCard, withoutSubCatItemCard, noSubcatCardData]);
|
||||||
|
|
||||||
useEffect(() => {
|
const priceChangeColumns = [
|
||||||
if (ProdCat && (ItemCard || withoutSubCatItemCard) && (!noSubcatCardData || noSubcatCardData?.length === 0)) {
|
{
|
||||||
setNoSubcatCardData(ItemCard?.length === 0 ? withoutSubCatItemCard : ItemCard);
|
title: 'S.No',
|
||||||
}
|
dataIndex: 'SlNo',
|
||||||
}, [ProdCat, ItemCard, withoutSubCatItemCard, noSubcatCardData]);
|
key: 'SlNo',
|
||||||
|
width: '60px',
|
||||||
|
align: 'center',
|
||||||
|
render: (text, record, index) => (
|
||||||
|
<div>{(currentPage - 1) * pageSize + index + 1}</div>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Product Name',
|
||||||
|
dataIndex: 'ProdName',
|
||||||
|
key: 'ProdName',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Old MRP',
|
||||||
|
dataIndex: 'MRP',
|
||||||
|
key: 'MRP',
|
||||||
|
width: '100px',
|
||||||
|
align: 'right',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'New MRP (Optional)',
|
||||||
|
dataIndex: 'NewMRP',
|
||||||
|
key: 'NewMRP',
|
||||||
|
width: '100px',
|
||||||
|
align: 'right',
|
||||||
|
render: (text, record, index) => {
|
||||||
|
// if (index === editingKey) {
|
||||||
|
|
||||||
const priceChangeColumns = [
|
// }
|
||||||
{
|
// return <div>{text ? text : 'Enter New MRP'}</div>
|
||||||
title: 'S.No',
|
return (
|
||||||
dataIndex: 'SlNo',
|
<Form.Item
|
||||||
key: 'SlNo',
|
name={`NewMRP${index}`}
|
||||||
width: '60px',
|
rules={[
|
||||||
align: 'center',
|
{
|
||||||
render: (text, record, index) => <div>{(currentPage - 1) * pageSize + index + 1}</div>
|
validator: async (_, value) => {
|
||||||
},
|
if (value === '') {
|
||||||
{
|
return Promise.resolve();
|
||||||
title: 'Product Name',
|
} else if (parseFloat(value) < 1) {
|
||||||
dataIndex: 'ProdName',
|
return Promise.reject(`MRP should be greater than 0`);
|
||||||
key: 'ProdName',
|
}
|
||||||
},
|
return Promise.resolve();
|
||||||
{
|
},
|
||||||
title: 'Old MRP',
|
},
|
||||||
dataIndex: 'MRP',
|
]}
|
||||||
key: 'MRP',
|
>
|
||||||
width: '100px',
|
<InputField
|
||||||
align: 'right',
|
value={text}
|
||||||
},
|
placeholder="Enter New MRP"
|
||||||
{
|
onChange={(e) => handleNewMRPChange(e?.target?.value, index)}
|
||||||
title: 'New MRP (Optional)',
|
inputMode="decimal"
|
||||||
dataIndex: 'NewMRP',
|
onInput={(e) => {
|
||||||
key: 'NewMRP',
|
let cleanedValue = e.target.value.replace(/[^0-9.]/g, ''); // Remove invalid characters
|
||||||
width: '100px',
|
const parts = cleanedValue.split('.');
|
||||||
align: 'right',
|
|
||||||
render: (text, record, index) => {
|
|
||||||
// if (index === editingKey) {
|
|
||||||
|
|
||||||
// }
|
if (cleanedValue.startsWith('.')) {
|
||||||
// return <div>{text ? text : 'Enter New MRP'}</div>
|
cleanedValue = '0' + cleanedValue;
|
||||||
return (
|
}
|
||||||
<Form.Item
|
|
||||||
name={`NewMRP${index}`}
|
|
||||||
rules={[
|
|
||||||
{
|
|
||||||
validator: async (_, value) => {
|
|
||||||
if (value === '') {
|
|
||||||
return Promise.resolve();
|
|
||||||
} else if (parseFloat(value) < 1) {
|
|
||||||
return Promise.reject(`MRP should be greater than 0`)
|
|
||||||
}
|
|
||||||
return Promise.resolve();
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]}>
|
|
||||||
<InputField
|
|
||||||
value={text}
|
|
||||||
placeholder="Enter New MRP"
|
|
||||||
onChange={(e) => handleNewMRPChange(e?.target?.value, index)}
|
|
||||||
inputMode="decimal"
|
|
||||||
onInput={(e) => {
|
|
||||||
let cleanedValue = e.target.value.replace(
|
|
||||||
/[^0-9.]/g,
|
|
||||||
''
|
|
||||||
); // Remove invalid characters
|
|
||||||
const parts = cleanedValue.split('.');
|
|
||||||
|
|
||||||
if (cleanedValue.startsWith('.')) {
|
e.target.value =
|
||||||
cleanedValue = '0' + cleanedValue;
|
parts.length > 2
|
||||||
}
|
? `${parts[0]}.${parts.slice(1).join('')}`
|
||||||
|
: cleanedValue;
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Old Sell Price',
|
||||||
|
dataIndex: 'SellPrice',
|
||||||
|
key: 'SellPrice',
|
||||||
|
width: '120px',
|
||||||
|
align: 'right',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'New Sell Price',
|
||||||
|
dataIndex: 'NewSellPrice',
|
||||||
|
key: 'NewSellPrice',
|
||||||
|
width: '160px',
|
||||||
|
align: 'right',
|
||||||
|
render: (text, record, index) => {
|
||||||
|
// if (index === editingKey) {
|
||||||
|
|
||||||
e.target.value =
|
// }
|
||||||
parts.length > 2
|
// return <div>{text ? text : 'Enter New Sell Price'}</div>
|
||||||
? `${parts[0]}.${parts.slice(1).join('')}`
|
return (
|
||||||
: cleanedValue;
|
<Form.Item
|
||||||
}}
|
name={`NewSellPrice${index}`}
|
||||||
/>
|
rules={[
|
||||||
</Form.Item>
|
{
|
||||||
);
|
validator: async (_, value) => {
|
||||||
},
|
if (value === '') {
|
||||||
},
|
return Promise.resolve();
|
||||||
{
|
} else if (parseFloat(value) < 1) {
|
||||||
title: 'Old Sell Price',
|
return Promise.reject(
|
||||||
dataIndex: 'SellPrice',
|
`Sell Price should be greater than 0`
|
||||||
key: 'SellPrice',
|
);
|
||||||
width: '120px',
|
}
|
||||||
align: 'right',
|
return Promise.resolve();
|
||||||
},
|
},
|
||||||
{
|
},
|
||||||
title: 'New Sell Price',
|
]}
|
||||||
dataIndex: 'NewSellPrice',
|
>
|
||||||
key: 'NewSellPrice',
|
<InputField
|
||||||
width: '160px',
|
value={text}
|
||||||
align: 'right',
|
placeholder="Enter New Sell Price"
|
||||||
render: (text, record, index) => {
|
onChange={(e) =>
|
||||||
// if (index === editingKey) {
|
handleNewSellPriceChange(e?.target?.value, index)
|
||||||
|
}
|
||||||
|
inputMode="decimal"
|
||||||
|
onInput={(e) => {
|
||||||
|
let cleanedValue = e.target.value.replace(/[^0-9.]/g, ''); // Remove invalid characters
|
||||||
|
const parts = cleanedValue.split('.');
|
||||||
|
|
||||||
// }
|
if (cleanedValue.startsWith('.')) {
|
||||||
// return <div>{text ? text : 'Enter New Sell Price'}</div>
|
cleanedValue = '0' + cleanedValue;
|
||||||
return (
|
}
|
||||||
<Form.Item
|
|
||||||
name={`NewSellPrice${index}`}
|
|
||||||
rules={[
|
|
||||||
{
|
|
||||||
validator: async (_, value) => {
|
|
||||||
if (value === '') {
|
|
||||||
return Promise.resolve();
|
|
||||||
} else if (parseFloat(value) < 1) {
|
|
||||||
return Promise.reject(`Sell Price should be greater than 0`)
|
|
||||||
}
|
|
||||||
return Promise.resolve();
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
<InputField
|
|
||||||
value={text}
|
|
||||||
placeholder="Enter New Sell Price"
|
|
||||||
onChange={(e) => handleNewSellPriceChange(e?.target?.value, index)}
|
|
||||||
inputMode="decimal"
|
|
||||||
onInput={(e) => {
|
|
||||||
let cleanedValue = e.target.value.replace(
|
|
||||||
/[^0-9.]/g,
|
|
||||||
''
|
|
||||||
); // Remove invalid characters
|
|
||||||
const parts = cleanedValue.split('.');
|
|
||||||
|
|
||||||
if (cleanedValue.startsWith('.')) {
|
e.target.value =
|
||||||
cleanedValue = '0' + cleanedValue;
|
parts.length > 2
|
||||||
}
|
? `${parts[0]}.${parts.slice(1).join('')}`
|
||||||
|
: cleanedValue;
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
e.target.value =
|
const cardData = !globalAccessForOthers
|
||||||
parts.length > 2
|
? CardAccess
|
||||||
? `${parts[0]}.${parts.slice(1).join('')}`
|
? SelectedDatas?.length > 1
|
||||||
: cleanedValue;
|
? SelectedDatas
|
||||||
}}
|
: SelectedDatas?.[0]?.AppId === 0 && SelectedDatas?.[0]?.CompId === 0
|
||||||
/>
|
? []
|
||||||
</Form.Item>
|
: SelectedDatas
|
||||||
);
|
: ItemCard?.length === 0 ||
|
||||||
},
|
(ItemCard?.[0]?.AppId === 0 && ItemCard?.[0]?.CompId === 0)
|
||||||
},
|
? noSubcatCardData
|
||||||
];
|
: ItemCard
|
||||||
|
: [];
|
||||||
|
|
||||||
const cardData = !globalAccessForOthers
|
console.log(cardData, 'noSubcatCardDatanoSubcatCardData', ItemCard);
|
||||||
? CardAccess
|
|
||||||
? SelectedDatas?.length > 1
|
|
||||||
? SelectedDatas
|
|
||||||
: SelectedDatas?.[0]?.AppId === 0 && SelectedDatas?.[0]?.CompId === 0
|
|
||||||
? []
|
|
||||||
: SelectedDatas
|
|
||||||
: ItemCard?.length === 0 || (ItemCard?.[0]?.AppId === 0 && ItemCard?.[0]?.CompId === 0)
|
|
||||||
? noSubcatCardData
|
|
||||||
: ItemCard
|
|
||||||
: '';
|
|
||||||
|
|
||||||
console.log(cardData, "noSubcatCardDatanoSubcatCardData", ItemCard)
|
useEffect(() => {
|
||||||
|
if (priceChangeModal || productPriceChange) {
|
||||||
|
const extractStockDtls = (data) => {
|
||||||
|
if (data?.length === 0 || !data) return [];
|
||||||
|
|
||||||
useEffect(() => {
|
let stockDtls = [];
|
||||||
const extractStockDtls = (data) => {
|
|
||||||
if (data?.length === 0) return [];
|
|
||||||
|
|
||||||
let stockDtls = [];
|
data?.forEach((item) => {
|
||||||
|
let products = item?.ProductDetail?.flatMap((product) => product);
|
||||||
|
|
||||||
data?.forEach(item => {
|
let variants = products?.flatMap(
|
||||||
let products = item?.ProductDetail?.flatMap(product => product);
|
(product) => product?.ProdVariantDetails
|
||||||
|
);
|
||||||
|
const filteredVariants = variants?.filter(
|
||||||
|
(variant) => variant?.StockDetails?.length > 0
|
||||||
|
);
|
||||||
|
const stocks = filteredVariants?.flatMap((variant) =>
|
||||||
|
variant?.StockDetails?.map((stock) => ({
|
||||||
|
...stock,
|
||||||
|
ProdName:
|
||||||
|
products?.[0]?.ProdName +
|
||||||
|
(variant?.ProdVariantName
|
||||||
|
? ` (${variant?.ProdVariantName})`
|
||||||
|
: ''),
|
||||||
|
StockAvailable: products?.[0]?.StockAvailable,
|
||||||
|
ProdVariantName: variant?.ProdVariantName,
|
||||||
|
}))
|
||||||
|
);
|
||||||
|
|
||||||
let variants = products?.flatMap(product => product?.ProdVariantDetails);
|
stockDtls.push(
|
||||||
const filteredVariants = variants?.filter(variant => variant?.StockDetails?.length > 0);
|
...stocks?.filter((stock) =>
|
||||||
const stocks = filteredVariants?.flatMap(variant =>
|
stock?.StockAvailable === 'Y' ? stock?.BatchRef : true
|
||||||
variant?.StockDetails?.map(stock => ({
|
)
|
||||||
...stock,
|
);
|
||||||
ProdName: products?.[0]?.ProdName + (variant?.ProdVariantName ? ` (${variant?.ProdVariantName})` : ''),
|
});
|
||||||
StockAvailable: products?.[0]?.StockAvailable,
|
console.log('extractStockDtls', stockDtls);
|
||||||
ProdVariantName: variant?.ProdVariantName
|
return stockDtls;
|
||||||
}))
|
};
|
||||||
);
|
setTableData(extractStockDtls(priceChangeProduct || cardData || []));
|
||||||
|
setCurrentPage(1);
|
||||||
|
}
|
||||||
|
}, [cardData, priceChangeProduct, priceChangeModal, productPriceChange]);
|
||||||
|
|
||||||
stockDtls.push(...stocks?.filter(stock =>
|
const handleNewMRPChange = (value, index) => {
|
||||||
stock?.StockAvailable === 'Y'
|
const updatedTableData = [...tableData];
|
||||||
? stock?.BatchRef
|
updatedTableData[index].NewMRP = value;
|
||||||
: true
|
setTableData(updatedTableData);
|
||||||
));
|
updatedTableData[index].NewSellPrice = null;
|
||||||
|
formRef.current.setFieldsValue({
|
||||||
|
[`NewMRP${index}`]: value,
|
||||||
|
[`NewSellPrice${index}`]: null,
|
||||||
|
});
|
||||||
|
|
||||||
});
|
const priceChangedProdList = [...priceChangedProducts];
|
||||||
console.log("extractStockDtls", stockDtls);
|
const prodIndex = priceChangedProdList?.findIndex(
|
||||||
return stockDtls;
|
(prod) => prod?.InwardDtlId === updatedTableData[index]?.InwardDtlId
|
||||||
}
|
);
|
||||||
setTableData(extractStockDtls(priceChangeProduct || cardData))
|
if (prodIndex !== -1) {
|
||||||
setCurrentPage(1)
|
priceChangedProdList[prodIndex] = {
|
||||||
}, [cardData, priceChangeProduct])
|
...priceChangedProdList?.[prodIndex],
|
||||||
|
NewMRP: value,
|
||||||
|
NewSellPrice: null,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
setPriceChangedProducts(priceChangedProdList);
|
||||||
|
};
|
||||||
|
|
||||||
const handleNewMRPChange = (value, index) => {
|
const handleNewSellPriceChange = (value, index) => {
|
||||||
|
const updatedTableData = [...tableData];
|
||||||
const updatedTableData = [...tableData];
|
if (updatedTableData[index]?.NewMRP) {
|
||||||
updatedTableData[index].NewMRP = value;
|
if (parseFloat(value) > parseFloat(updatedTableData[index]?.NewMRP)) {
|
||||||
setTableData(updatedTableData);
|
setMessageType('error');
|
||||||
|
setMessageData('New Sell Price cannot be greater than New MRP');
|
||||||
|
formRef.current.setFieldsValue({
|
||||||
|
[`NewSellPrice${index}`]: null,
|
||||||
|
});
|
||||||
updatedTableData[index].NewSellPrice = null;
|
updatedTableData[index].NewSellPrice = null;
|
||||||
formRef.current.setFieldsValue({
|
|
||||||
[`NewMRP${index}`]: value,
|
|
||||||
[`NewSellPrice${index}`]: null,
|
|
||||||
});
|
|
||||||
|
|
||||||
const priceChangedProdList = [...priceChangedProducts];
|
|
||||||
const prodIndex = priceChangedProdList?.findIndex(prod => prod?.InwardDtlId === updatedTableData[index]?.InwardDtlId);
|
|
||||||
if (prodIndex !== -1) {
|
|
||||||
priceChangedProdList[prodIndex] = {
|
|
||||||
...priceChangedProdList?.[prodIndex],
|
|
||||||
NewMRP: value,
|
|
||||||
NewSellPrice: null,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
setPriceChangedProducts(priceChangedProdList);
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleNewSellPriceChange = (value, index) => {
|
|
||||||
const updatedTableData = [...tableData];
|
|
||||||
if (updatedTableData[index]?.NewMRP) {
|
|
||||||
if (parseFloat(value) > parseFloat(updatedTableData[index]?.NewMRP)) {
|
|
||||||
setMessageType('error');
|
|
||||||
setMessageData('New Sell Price cannot be greater than New MRP');
|
|
||||||
formRef.current.setFieldsValue({
|
|
||||||
[`NewSellPrice${index}`]: null,
|
|
||||||
});
|
|
||||||
updatedTableData[index].NewSellPrice = null;
|
|
||||||
setTableData(updatedTableData);
|
|
||||||
const priceChangedProdList = [...priceChangedProducts];
|
|
||||||
const prodIndex = priceChangedProdList?.findIndex(prod => prod?.InwardDtlId === updatedTableData[index]?.InwardDtlId);
|
|
||||||
|
|
||||||
if (prodIndex !== -1) {
|
|
||||||
priceChangedProdList.splice(prodIndex, 1);
|
|
||||||
}
|
|
||||||
setPriceChangedProducts(priceChangedProdList);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!updatedTableData[index]?.NewMRP && updatedTableData[index]?.MRP) {
|
|
||||||
if (parseFloat(value) > parseFloat(updatedTableData[index]?.MRP)) {
|
|
||||||
setMessageType('error');
|
|
||||||
setMessageData('New Sell Price cannot be greater than MRP');
|
|
||||||
formRef.current.setFieldsValue({
|
|
||||||
[`NewSellPrice${index}`]: null,
|
|
||||||
});
|
|
||||||
updatedTableData[index].NewSellPrice = null;
|
|
||||||
setTableData(updatedTableData);
|
|
||||||
const priceChangedProdList = [...priceChangedProducts];
|
|
||||||
const prodIndex = priceChangedProdList?.findIndex(prod => prod?.InwardDtlId === updatedTableData[index]?.InwardDtlId);
|
|
||||||
|
|
||||||
if (prodIndex !== -1) {
|
|
||||||
priceChangedProdList.splice(prodIndex, 1);
|
|
||||||
}
|
|
||||||
setPriceChangedProducts(priceChangedProdList);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
updatedTableData[index].NewSellPrice = value;
|
|
||||||
setTableData(updatedTableData);
|
setTableData(updatedTableData);
|
||||||
formRef.current.setFieldsValue({
|
|
||||||
[`NewSellPrice${index}`]: value,
|
|
||||||
});
|
|
||||||
|
|
||||||
const priceChangedProdList = [...priceChangedProducts];
|
const priceChangedProdList = [...priceChangedProducts];
|
||||||
const prodIndex = priceChangedProdList?.findIndex(prod => prod?.InwardDtlId === updatedTableData[index]?.InwardDtlId);
|
const prodIndex = priceChangedProdList?.findIndex(
|
||||||
|
(prod) => prod?.InwardDtlId === updatedTableData[index]?.InwardDtlId
|
||||||
|
);
|
||||||
|
|
||||||
if (prodIndex !== -1) {
|
if (prodIndex !== -1) {
|
||||||
priceChangedProdList[prodIndex] = {
|
priceChangedProdList.splice(prodIndex, 1);
|
||||||
...priceChangedProdList[prodIndex],
|
|
||||||
SellPrice: String(value)
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
priceChangedProdList.push({
|
|
||||||
ProdId: updatedTableData[index]?.ProdId,
|
|
||||||
ProdName: updatedTableData[index]?.ProdName,
|
|
||||||
MRP: String(updatedTableData[index]?.NewMRP || updatedTableData[index]?.MRP),
|
|
||||||
SellPrice: String(value),
|
|
||||||
AdjComment: "string",
|
|
||||||
InwardDtlId: updatedTableData[index]?.InwardDtlId
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setPriceChangedProducts(priceChangedProdList);
|
setPriceChangedProducts(priceChangedProdList);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if (!updatedTableData[index]?.NewMRP && updatedTableData[index]?.MRP) {
|
||||||
|
if (parseFloat(value) > parseFloat(updatedTableData[index]?.MRP)) {
|
||||||
|
setMessageType('error');
|
||||||
|
setMessageData('New Sell Price cannot be greater than MRP');
|
||||||
|
formRef.current.setFieldsValue({
|
||||||
|
[`NewSellPrice${index}`]: null,
|
||||||
|
});
|
||||||
|
updatedTableData[index].NewSellPrice = null;
|
||||||
|
setTableData(updatedTableData);
|
||||||
|
const priceChangedProdList = [...priceChangedProducts];
|
||||||
|
const prodIndex = priceChangedProdList?.findIndex(
|
||||||
|
(prod) => prod?.InwardDtlId === updatedTableData[index]?.InwardDtlId
|
||||||
|
);
|
||||||
|
|
||||||
const edit = (record, index) => {
|
if (prodIndex !== -1) {
|
||||||
console.log("edit", record, index);
|
priceChangedProdList.splice(prodIndex, 1);
|
||||||
setEditingKey(index);
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleSubmit = async () => {
|
|
||||||
console.log("submit");
|
|
||||||
|
|
||||||
if (priceChangedProducts?.length > 0) {
|
|
||||||
console.log("priceChangedProducts", priceChangedProducts);
|
|
||||||
const validation = priceChangedProducts?.every((prod) => {
|
|
||||||
if (parseFloat(prod?.MRP) < parseFloat(prod?.SellPrice)) {
|
|
||||||
setMessageType('error');
|
|
||||||
setMessageData(`${prod?.ProdName}: MRP cannot be less than Sell Price`);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (!parseFloat(prod?.SellPrice) || !parseFloat(prod?.MRP)) {
|
|
||||||
setMessageType('error');
|
|
||||||
setMessageData(`${prod?.ProdName}: Please give Sell Price or MRP`);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
if (!validation) return;
|
|
||||||
|
|
||||||
const data = {
|
|
||||||
AppId: AppId,
|
|
||||||
CompId: CompId,
|
|
||||||
BranchId: BranchId,
|
|
||||||
ProductDetails: priceChangedProducts,
|
|
||||||
UpdatedBy: UserId,
|
|
||||||
}
|
|
||||||
|
|
||||||
const res = await dispatch(PutStockPrice(data))?.unwrap();
|
|
||||||
if (res?.data?.statusCode === 1) {
|
|
||||||
setMessageData('Price Changed Successfully');
|
|
||||||
setMessageType('success');
|
|
||||||
setPriceChangeModal(false);
|
|
||||||
setProductPriceChange(false);
|
|
||||||
setEditingKey(null);
|
|
||||||
setPriceChangedProducts([]);
|
|
||||||
setTableData([]);
|
|
||||||
dispatch(triggerProductCard())
|
|
||||||
setPriceChangeProduct(null);
|
|
||||||
formRef.current.resetFields();
|
|
||||||
} else {
|
|
||||||
setMessageData('Error Updating Product Price')
|
|
||||||
setMessageType('error');
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
setMessageType('error');
|
|
||||||
setMessageData('No changes made / No sell price entered');
|
|
||||||
}
|
}
|
||||||
|
setPriceChangedProducts(priceChangedProdList);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
updatedTableData[index].NewSellPrice = value;
|
||||||
|
setTableData(updatedTableData);
|
||||||
|
formRef.current.setFieldsValue({
|
||||||
|
[`NewSellPrice${index}`]: value,
|
||||||
|
});
|
||||||
|
|
||||||
|
const priceChangedProdList = [...priceChangedProducts];
|
||||||
|
const prodIndex = priceChangedProdList?.findIndex(
|
||||||
|
(prod) => prod?.InwardDtlId === updatedTableData[index]?.InwardDtlId
|
||||||
|
);
|
||||||
|
|
||||||
|
if (prodIndex !== -1) {
|
||||||
|
priceChangedProdList[prodIndex] = {
|
||||||
|
...priceChangedProdList[prodIndex],
|
||||||
|
SellPrice: String(value),
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
priceChangedProdList.push({
|
||||||
|
ProdId: updatedTableData[index]?.ProdId,
|
||||||
|
ProdName: updatedTableData[index]?.ProdName,
|
||||||
|
MRP: String(
|
||||||
|
updatedTableData[index]?.NewMRP || updatedTableData[index]?.MRP
|
||||||
|
),
|
||||||
|
SellPrice: String(value),
|
||||||
|
AdjComment: 'string',
|
||||||
|
InwardDtlId: updatedTableData[index]?.InwardDtlId,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const onComplete = useCallback(() => {
|
setPriceChangedProducts(priceChangedProdList);
|
||||||
setMessageData(null);
|
};
|
||||||
setMessageType(null);
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
return (
|
const edit = (record, index) => {
|
||||||
<>
|
console.log('edit', record, index);
|
||||||
|
setEditingKey(index);
|
||||||
|
};
|
||||||
|
|
||||||
<Messages messageData={messageData} messageType={messageType} onComplete={onComplete} />
|
const handleSubmit = async () => {
|
||||||
{showButton ? <Tooltip title="Price Change">
|
console.log('submit');
|
||||||
<button className="price-change-btn" type="button" onClick={() => {
|
|
||||||
if (comboSearch) {
|
if (priceChangedProducts?.length > 0) {
|
||||||
setMessageType('warning');
|
console.log('priceChangedProducts', priceChangedProducts);
|
||||||
setMessageData('Price change will not work for combo products');
|
const validation = priceChangedProducts?.every((prod) => {
|
||||||
return
|
if (parseFloat(prod?.MRP) < parseFloat(prod?.SellPrice)) {
|
||||||
}
|
setMessageType('error');
|
||||||
setPriceChangeModal(true)
|
setMessageData(
|
||||||
}}>
|
`${prod?.ProdName}: MRP cannot be less than Sell Price`
|
||||||
{/* <FaIndianRupeeSign size={35}/> */}
|
);
|
||||||
<img src={PriceChange} alt="" width={30} />
|
return false;
|
||||||
</button>
|
}
|
||||||
</Tooltip> : <></>}
|
if (!parseFloat(prod?.SellPrice) || !parseFloat(prod?.MRP)) {
|
||||||
<DefaultModal
|
setMessageType('error');
|
||||||
title="Price Change"
|
setMessageData(`${prod?.ProdName}: Please give Sell Price or MRP`);
|
||||||
className={'price-change-modal'}
|
return false;
|
||||||
open={priceChangeModal || productPriceChange}
|
}
|
||||||
footer={true}
|
return true;
|
||||||
width={800}
|
});
|
||||||
handleCancel={() => {
|
if (!validation) return;
|
||||||
setPriceChangeModal(false);
|
|
||||||
setProductPriceChange(false);
|
const data = {
|
||||||
setEditingKey(null);
|
AppId: AppId,
|
||||||
setPriceChangedProducts([]);
|
CompId: CompId,
|
||||||
formRef?.current?.resetFields();
|
BranchId: BranchId,
|
||||||
setPriceChangeProduct(null);
|
ProductDetails: priceChangedProducts,
|
||||||
}}
|
UpdatedBy: UserId,
|
||||||
handleSubmit={handleSubmit}
|
};
|
||||||
|
|
||||||
|
const res = await dispatch(PutStockPrice(data))?.unwrap();
|
||||||
|
if (res?.data?.statusCode === 1) {
|
||||||
|
setMessageData('Price Changed Successfully');
|
||||||
|
setMessageType('success');
|
||||||
|
setPriceChangeModal(false);
|
||||||
|
setProductPriceChange(false);
|
||||||
|
setEditingKey(null);
|
||||||
|
setPriceChangedProducts([]);
|
||||||
|
setTableData([]);
|
||||||
|
dispatch(triggerProductCard());
|
||||||
|
setPriceChangeProduct(null);
|
||||||
|
formRef.current.resetFields();
|
||||||
|
} else {
|
||||||
|
setMessageData('Error Updating Product Price');
|
||||||
|
setMessageType('error');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
setMessageType('error');
|
||||||
|
setMessageData('No changes made / No sell price entered');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const onComplete = useCallback(() => {
|
||||||
|
setMessageData(null);
|
||||||
|
setMessageType(null);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Messages
|
||||||
|
messageData={messageData}
|
||||||
|
messageType={messageType}
|
||||||
|
onComplete={onComplete}
|
||||||
|
/>
|
||||||
|
{showButton ? (
|
||||||
|
<Tooltip title="Price Change">
|
||||||
|
<button
|
||||||
|
className="price-change-btn"
|
||||||
|
type="button"
|
||||||
|
onClick={() => {
|
||||||
|
if (comboSearch) {
|
||||||
|
setMessageType('warning');
|
||||||
|
setMessageData('Price change will not work for combo products');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setPriceChangeModal(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{/* <FaIndianRupeeSign size={35}/> */}
|
||||||
|
<img src={PriceChange} alt="" width={30} />
|
||||||
|
</button>
|
||||||
|
</Tooltip>
|
||||||
|
) : (
|
||||||
|
<></>
|
||||||
|
)}
|
||||||
|
<DefaultModal
|
||||||
|
title="Price Change"
|
||||||
|
className={'price-change-modal'}
|
||||||
|
open={priceChangeModal || productPriceChange}
|
||||||
|
footer={true}
|
||||||
|
width={800}
|
||||||
|
handleCancel={() => {
|
||||||
|
setPriceChangeModal(false);
|
||||||
|
setProductPriceChange(false);
|
||||||
|
setEditingKey(null);
|
||||||
|
setPriceChangedProducts([]);
|
||||||
|
formRef?.current?.resetFields();
|
||||||
|
setPriceChangeProduct(null);
|
||||||
|
}}
|
||||||
|
handleSubmit={handleSubmit}
|
||||||
|
>
|
||||||
|
<div className="price-change-table">
|
||||||
|
{/* <div className="table-notes">Note : Click on a row to edit/modify</div> */}
|
||||||
|
<Form ref={formRef}>
|
||||||
|
<Tables
|
||||||
|
columns={priceChangeColumns}
|
||||||
|
data={tableData?.slice(
|
||||||
|
(currentPage - 1) * pageSize,
|
||||||
|
currentPage * pageSize
|
||||||
|
)}
|
||||||
|
onRow={(record, index) => ({
|
||||||
|
onClick: () => {
|
||||||
|
edit(record, index);
|
||||||
|
},
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: 'flex',
|
||||||
|
justifyContent: 'center',
|
||||||
|
margin: '20px 0',
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<div className="price-change-table">
|
<Pagination
|
||||||
{/* <div className="table-notes">Note : Click on a row to edit/modify</div> */}
|
current={currentPage}
|
||||||
<Form ref={formRef}>
|
pageSize={pageSize}
|
||||||
<Tables
|
total={tableData?.length}
|
||||||
columns={priceChangeColumns}
|
onChange={(page) => setCurrentPage(page)}
|
||||||
data={tableData?.slice((currentPage - 1) * pageSize, currentPage * pageSize)}
|
showSizeChanger={false}
|
||||||
onRow={(record, index) => ({
|
showTotal={(total, range) =>
|
||||||
onClick: () => {
|
`${range[0]}-${range[1]} of ${total} items`
|
||||||
edit(record, index);
|
}
|
||||||
},
|
/>
|
||||||
})}
|
</div>
|
||||||
/>
|
</Form>
|
||||||
<div style={{ display: 'flex', justifyContent: 'center', margin: '20px 0' }}>
|
</div>
|
||||||
<Pagination
|
</DefaultModal>
|
||||||
current={currentPage}
|
</>
|
||||||
pageSize={pageSize}
|
);
|
||||||
total={tableData?.length}
|
};
|
||||||
onChange={(page) => setCurrentPage(page)}
|
|
||||||
showSizeChanger={false}
|
|
||||||
showTotal={(total, range) => `${range[0]}-${range[1]} of ${total} items`}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</Form>
|
|
||||||
</div>
|
|
||||||
</DefaultModal>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default ProductPriceChange;
|
export default ProductPriceChange;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { Modal, List, Typography, Tooltip } from 'antd';
|
import { List, Typography, Tooltip } from 'antd';
|
||||||
import { FaKeyboard } from 'react-icons/fa';
|
import { FaKeyboard } from 'react-icons/fa';
|
||||||
|
import { DefaultModal } from '../../../../Components/Modal/DefaultModal';
|
||||||
|
|
||||||
const { Title, Text } = Typography;
|
const { Title, Text } = Typography;
|
||||||
|
|
||||||
|
|
@ -40,15 +41,15 @@ const ShortcutKeyHelper = ({}) => {
|
||||||
</div>
|
</div>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|
||||||
<Modal
|
<DefaultModal
|
||||||
title={
|
title={
|
||||||
<div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
|
<div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
|
||||||
<FaKeyboard />
|
<FaKeyboard />
|
||||||
<Title level={4} style={{ margin: 0 }}>Keyboard Shortcuts</Title>
|
Keyboard Shortcuts
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
open={isModalOpen}
|
open={isModalOpen}
|
||||||
onCancel={() => setIsModalOpen(false)}
|
handleCancel={() => setIsModalOpen(false)}
|
||||||
footer={null}
|
footer={null}
|
||||||
width={500}
|
width={500}
|
||||||
>
|
>
|
||||||
|
|
@ -65,7 +66,7 @@ const ShortcutKeyHelper = ({}) => {
|
||||||
</List.Item>
|
</List.Item>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
</Modal>
|
</DefaultModal>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,965 @@
|
||||||
|
import { Checkbox, Form, Modal, Row } from 'antd';
|
||||||
|
import { DropDowns } from '../../../../Components/Forms/DropDown';
|
||||||
|
import { InputField } from '../../../../Components/Forms/InputField';
|
||||||
|
import { validateSafeInput } from '../../../../Services/Others';
|
||||||
|
import { DefaultModal } from '../../../../Components/Modal/DefaultModal';
|
||||||
|
import { CloseOutlined, ArrowRightOutlined } from '@ant-design/icons';
|
||||||
|
import { IoMdAdd } from 'react-icons/io';
|
||||||
|
import { useCallback, useEffect, useState } from 'react';
|
||||||
|
import { SwatchesPicker } from 'react-color';
|
||||||
|
import { RadioGrpButton } from '../../../../Components/Forms/RadioGroup';
|
||||||
|
import { useSelector } from 'react-redux';
|
||||||
|
import {
|
||||||
|
getSalesTemplate,
|
||||||
|
getTemplate,
|
||||||
|
postColorData,
|
||||||
|
postTableFontData,
|
||||||
|
putSelectionComponentData,
|
||||||
|
StoredSessionData,
|
||||||
|
} from '../../../../Features/ThemeChange/ThemeChange';
|
||||||
|
import { useDispatch } from 'react-redux';
|
||||||
|
import Buttons from '../../../../Components/Forms/Buttons';
|
||||||
|
import { Messages } from '../../../../Components/Notifications/Messages';
|
||||||
|
import './AllSalesPageSettings.scss';
|
||||||
|
|
||||||
|
const TableHeadersetting = ({ setModalOpen }) => {
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
const SessionData = useSelector(StoredSessionData);
|
||||||
|
const AppId = SessionData?.AppId;
|
||||||
|
const CompId = SessionData?.CompId;
|
||||||
|
const BranchId = SessionData?.BranchId;
|
||||||
|
const UserId = SessionData?.UserId;
|
||||||
|
const UserType = SessionData?.UserType;
|
||||||
|
const [messageType, setMessageType] = useState(null);
|
||||||
|
const [messageData, setMessageData] = useState(null);
|
||||||
|
const [TemplateDetails, setTemplateDetails] = useState([]);
|
||||||
|
const [TableFontData, setTableFontData] = useState([
|
||||||
|
{ FontId: 1, SessionFont: 'Arial' },
|
||||||
|
{ FontId: 2, SessionFont: 'Roboto' },
|
||||||
|
{ FontId: 3, SessionFont: 'Open Sans' },
|
||||||
|
{ FontId: 4, SessionFont: 'Lato' },
|
||||||
|
{ FontId: 5, SessionFont: 'Montserrat' },
|
||||||
|
]);
|
||||||
|
const [selectedTableFont, setSelectedTableFont] = useState();
|
||||||
|
console.log(selectedTableFont, 'selectedTableFontselectedTableFont');
|
||||||
|
const [TableFontModelopen, setTableFontModelopen] = useState(false);
|
||||||
|
const [SelectedTableColor, setSelectedTableColor] = useState(null);
|
||||||
|
const [Tableform] = Form.useForm();
|
||||||
|
const [billingSettings, setBillingSettings] = useState();
|
||||||
|
console.log(billingSettings, 'billingSettingsbillingSettings');
|
||||||
|
const [SelectedBillTableCheckValues, setSelectedBillTableCheckValues] =
|
||||||
|
useState([]);
|
||||||
|
const backgroundOptionId = billingSettings?.ComponentOptionsDetails?.find(
|
||||||
|
(item) => item?.OptionName === 'Background'
|
||||||
|
)?.OptionId;
|
||||||
|
|
||||||
|
const hasBackground =
|
||||||
|
SelectedBillTableCheckValues?.includes(backgroundOptionId);
|
||||||
|
const OverallbackgroundOptionId =
|
||||||
|
billingSettings?.ComponentOptionsDetails?.find(
|
||||||
|
(item) => item?.OptionName === 'OverallBackground'
|
||||||
|
)?.OptionId;
|
||||||
|
|
||||||
|
const hasOverallBackground = SelectedBillTableCheckValues?.includes(
|
||||||
|
OverallbackgroundOptionId
|
||||||
|
);
|
||||||
|
// Hold and addcustomer OptionsDetails
|
||||||
|
const [HoldButton, setHoldButton] = useState(false);
|
||||||
|
const [AddCustomerButton, setAddCustomerButton] = useState(false);
|
||||||
|
const [DineInChecked, setDineInChecked] = useState(false);
|
||||||
|
console.log(billingSettings, 'billingSettingsbillingSettings');
|
||||||
|
const [TableBackgroundColorData, setTableBackgroundColorData] = useState([
|
||||||
|
{
|
||||||
|
ColorId: 4,
|
||||||
|
SessionId: 55,
|
||||||
|
OptionId: 108,
|
||||||
|
FontColor: '#000000',
|
||||||
|
BackgroundColor: '#f06292',
|
||||||
|
ThemeName: 'Theme 4',
|
||||||
|
ActiveStatus: 'A',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ColorId: 14,
|
||||||
|
SessionId: 55,
|
||||||
|
OptionId: 108,
|
||||||
|
FontColor: '#000000',
|
||||||
|
BackgroundColor: '#52C41A',
|
||||||
|
ThemeName: 'Theme 14',
|
||||||
|
ActiveStatus: 'A',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ColorId: 23,
|
||||||
|
SessionId: 55,
|
||||||
|
OptionId: 108,
|
||||||
|
FontColor: '#000000',
|
||||||
|
BackgroundColor: '#0d47a1',
|
||||||
|
ThemeName: 'Theme 23',
|
||||||
|
ActiveStatus: 'A',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ColorId: 25,
|
||||||
|
SessionId: 55,
|
||||||
|
OptionId: 108,
|
||||||
|
FontColor: '#000000',
|
||||||
|
BackgroundColor: '#f8bbd0',
|
||||||
|
ThemeName: 'Theme 25',
|
||||||
|
ActiveStatus: 'A',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ColorId: 29,
|
||||||
|
SessionId: 55,
|
||||||
|
OptionId: 108,
|
||||||
|
FontColor: '#000000',
|
||||||
|
BackgroundColor: '#ffcdd2',
|
||||||
|
ThemeName: 'Theme 29',
|
||||||
|
ActiveStatus: 'A',
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
const [BillingOverallColorsList, setBillingOverallColorsList] = useState();
|
||||||
|
const [BillUploadColor, setBillUploadColor] = useState(false);
|
||||||
|
const [TableColorType, setTableColorType] = useState('Y');
|
||||||
|
const [TablebackgroundColor, setTablebackgroundColor] = useState('#009b00');
|
||||||
|
const [tableBGHex, setTableBGHex] = useState(
|
||||||
|
TablebackgroundColor?.replace('#', '').trim()
|
||||||
|
);
|
||||||
|
const [TablefontColor, setTablefontColor] = useState('#000000');
|
||||||
|
const [tableFontHex, setTableFontHex] = useState(
|
||||||
|
TablefontColor?.replace('#', '').trim()
|
||||||
|
);
|
||||||
|
const [BillingUploadOverallColor, setBillingUploadOverallColor] =
|
||||||
|
useState(false);
|
||||||
|
const [BillingOverallColor, setBillingOverallColor] = useState('#000000');
|
||||||
|
const [billingOverallHex, setBillingOverallHex] = useState(
|
||||||
|
BillingOverallColor?.replace('#', '').trim()
|
||||||
|
);
|
||||||
|
const [selectOverallSelected, setSelectOverallSelected] = useState(true);
|
||||||
|
const [dropdownBillingOverallColor, setdropdownBillingOverallColor] =
|
||||||
|
useState(null);
|
||||||
|
const [FirstOnClick, setFirstOnClick] = useState(false);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
GetTemplatedetails();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const GetTemplatedetails = async () => {
|
||||||
|
let Data = {
|
||||||
|
CompId: CompId,
|
||||||
|
AppId: AppId,
|
||||||
|
BranchId: BranchId,
|
||||||
|
};
|
||||||
|
const templateresponse = await dispatch(getSalesTemplate(Data)).unwrap();
|
||||||
|
let AllDetails = templateresponse?.data?.data;
|
||||||
|
setTemplateDetails(AllDetails?.Templates);
|
||||||
|
let selectedBilling = AllDetails?.Templates?.[0]?.ComponentDetails?.find(
|
||||||
|
(item) => item?.SessionName === 'BookingBilling'
|
||||||
|
);
|
||||||
|
let selectedNavbar = AllDetails?.Templates?.[0]?.ComponentDetails?.find(
|
||||||
|
(item) => item?.SessionName === 'BookingNavbar'
|
||||||
|
);
|
||||||
|
let AllBillingdetails = AllDetails?.Components?.find(
|
||||||
|
(item) => item?.ComponentName === selectedBilling?.ComponentName
|
||||||
|
);
|
||||||
|
console.log(AllDetails, selectedNavbar, 'templateresponse');
|
||||||
|
setBillingSettings(AllBillingdetails);
|
||||||
|
const optionIds = selectedBilling?.FieldDetails?.map(
|
||||||
|
(item) => item?.OptionId
|
||||||
|
);
|
||||||
|
setSelectedBillTableCheckValues(optionIds);
|
||||||
|
|
||||||
|
let Allfontdata = AllDetails?.Fonts?.filter(
|
||||||
|
(item) => item.SessionId === selectedBilling?.SessionId
|
||||||
|
);
|
||||||
|
setTableFontData(Allfontdata);
|
||||||
|
let selectedFont = AllDetails?.Templates?.[0]?.FontDetail?.find(
|
||||||
|
(item) => item?.SessionId === selectedBilling?.SessionId
|
||||||
|
);
|
||||||
|
|
||||||
|
setSelectedTableFont(selectedFont?.FontId);
|
||||||
|
const hasHold = selectedNavbar?.FieldDetails?.some(
|
||||||
|
(item) => item.OptionName === 'Hold'
|
||||||
|
);
|
||||||
|
const hasAddcustomer = selectedNavbar?.FieldDetails?.some(
|
||||||
|
(item) => item.OptionName === 'AddCustomer'
|
||||||
|
);
|
||||||
|
const hasDinein = selectedNavbar?.FieldDetails?.some(
|
||||||
|
(item) => item.OptionName === 'DineIn'
|
||||||
|
);
|
||||||
|
setHoldButton(hasHold);
|
||||||
|
setAddCustomerButton(hasAddcustomer);
|
||||||
|
setDineInChecked(hasDinein);
|
||||||
|
let allcolordata = AllDetails?.Colors?.filter(
|
||||||
|
(item) =>
|
||||||
|
item.SessionId === selectedBilling?.SessionId &&
|
||||||
|
item.OptionName === 'OverallBackground'
|
||||||
|
);
|
||||||
|
setBillingOverallColorsList(allcolordata);
|
||||||
|
let allBackcolordata = AllDetails?.Colors?.filter(
|
||||||
|
(item) =>
|
||||||
|
item.SessionId === selectedBilling?.SessionId &&
|
||||||
|
item.OptionName === 'Background'
|
||||||
|
);
|
||||||
|
|
||||||
|
setTableBackgroundColorData(allBackcolordata);
|
||||||
|
let selectedcolors = AllDetails?.Templates?.[0]?.ColorDetail?.filter(
|
||||||
|
(item) => item?.SessionName === 'BookingBilling'
|
||||||
|
);
|
||||||
|
console.log(selectedcolors, 'selectedOverallBackgroudcolor');
|
||||||
|
selectedcolors?.forEach((item) => {
|
||||||
|
if (item?.['BackgroundColor']) {
|
||||||
|
setSelectedTableColor(item?.['ColorId']);
|
||||||
|
} else if (item?.['OverallBackgroundColor']) {
|
||||||
|
setdropdownBillingOverallColor(item?.['ColorId']);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// await setdropdownBillingOverallColor(selectedOverallBackgroudcolor);
|
||||||
|
// formRef.current?.setFieldsValue({ BillingOverallColor: value });
|
||||||
|
|
||||||
|
// setTableBackgroundColorData
|
||||||
|
console.log(Allfontdata, 'All table colors');
|
||||||
|
// BookingBilling templateData?.['BookingBilling']?.[0]
|
||||||
|
};
|
||||||
|
|
||||||
|
const BillTableSelectlistonChange = (checkedValues) => {
|
||||||
|
setSelectedBillTableCheckValues(checkedValues);
|
||||||
|
};
|
||||||
|
const handleChange = (itemId, checked) => {
|
||||||
|
setBillingSettings((prev) =>
|
||||||
|
prev.map((item) => (item.id === itemId ? { ...item, checked } : item))
|
||||||
|
);
|
||||||
|
};
|
||||||
|
const selectFont3 = (value) => {
|
||||||
|
setSelectedTableFont(value);
|
||||||
|
};
|
||||||
|
const TablehandleUploadFonts = () => {
|
||||||
|
setTableFontModelopen(true);
|
||||||
|
};
|
||||||
|
const TablehandleCancel = () => {
|
||||||
|
setTableFontModelopen(false);
|
||||||
|
Tableform.resetFields();
|
||||||
|
};
|
||||||
|
const selectTableColor = async (value) => {
|
||||||
|
await setSelectedTableColor(value);
|
||||||
|
// formRef.current?.setFieldsValue({ TableColor: value });
|
||||||
|
};
|
||||||
|
const BillhandleUploadColor = () => {
|
||||||
|
setBillUploadColor(true);
|
||||||
|
};
|
||||||
|
const handleColorChange4 = (color, event) => {
|
||||||
|
if (TableColorType == 'Y') {
|
||||||
|
setTablebackgroundColor(color['hex']);
|
||||||
|
setTableBGHex(color?.hex?.replace('#', '').trim());
|
||||||
|
}
|
||||||
|
if (TableColorType == 'N') {
|
||||||
|
setTablefontColor(color['hex']);
|
||||||
|
setTableFontHex(color?.hex?.replace('#', '').trim());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleBackgroundColorSubmit = async () => {
|
||||||
|
if (TablebackgroundColor !== TablefontColor) {
|
||||||
|
let response;
|
||||||
|
try {
|
||||||
|
let postData = {
|
||||||
|
BackgroundColor: TablebackgroundColor,
|
||||||
|
FontColor: TablefontColor,
|
||||||
|
CreatedBy: UserId,
|
||||||
|
SessionId: billingSettings?.SessionId,
|
||||||
|
OptionId: backgroundOptionId,
|
||||||
|
};
|
||||||
|
response = await dispatch(postColorData(postData)).unwrap();
|
||||||
|
} catch (err) {
|
||||||
|
if (err['message'] == 'Request failed with status code 422') {
|
||||||
|
response = {
|
||||||
|
data: {
|
||||||
|
statusCode: 0,
|
||||||
|
response: 'Color Not Added',
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (response?.data?.statusCode == 1) {
|
||||||
|
if (response?.data?.response == 'Color Already Exists') {
|
||||||
|
setMessageType('warning');
|
||||||
|
setMessageData(response?.data?.response);
|
||||||
|
} else {
|
||||||
|
setMessageType('success');
|
||||||
|
setMessageData(response?.data?.response);
|
||||||
|
// BillsetUploadColor(false);
|
||||||
|
}
|
||||||
|
GetTemplatedetails();
|
||||||
|
setBillUploadColor(false);
|
||||||
|
} else {
|
||||||
|
setMessageData(response?.data?.response);
|
||||||
|
setMessageType('error');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
setMessageData('Please select different color for background and font');
|
||||||
|
setMessageType('warning');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const TableonCancel4 = () => {
|
||||||
|
setBillUploadColor(false);
|
||||||
|
};
|
||||||
|
const handleTableHexChange = (e) => {
|
||||||
|
if (TableColorType?.toLowerCase() === 'y') {
|
||||||
|
setTableBGHex(e?.target?.value);
|
||||||
|
if (e?.target?.value === '' || !isHexColor(`#${e.target.value}`)) {
|
||||||
|
e.target.value = '009b00';
|
||||||
|
}
|
||||||
|
setTablebackgroundColor(`#${e.target.value}`);
|
||||||
|
}
|
||||||
|
if (TableColorType?.toLowerCase() === 'n') {
|
||||||
|
setTableFontHex(e?.target?.value);
|
||||||
|
if (e?.target?.value === '' || !isHexColor(`#${e.target.value}`)) {
|
||||||
|
e.target.value = '000000';
|
||||||
|
}
|
||||||
|
setTablefontColor(`#${e.target.value}`);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const handleBillingOverallHexCode = (e) => {
|
||||||
|
setBillingOverallHex(e?.target?.value);
|
||||||
|
if (e?.target?.value === '' || !isHexColor(`#${e.target.value}`)) {
|
||||||
|
e.target.value = '000000';
|
||||||
|
}
|
||||||
|
setBillingOverallColor(`#${e.target.value}`);
|
||||||
|
};
|
||||||
|
const handleBillingOverallColorChange = (color, event) => {
|
||||||
|
setBillingOverallColor(color['hex']);
|
||||||
|
setBillingOverallHex(color?.hex?.replace('#', '').trim());
|
||||||
|
};
|
||||||
|
const handleBillingOverallColorSubmit = async () => {
|
||||||
|
let response;
|
||||||
|
|
||||||
|
try {
|
||||||
|
let postData = {
|
||||||
|
BackgroundColor: BillingOverallColor,
|
||||||
|
FontColor: '#000000',
|
||||||
|
CreatedBy: UserId,
|
||||||
|
SessionId: billingSettings?.SessionId,
|
||||||
|
OptionId: OverallbackgroundOptionId,
|
||||||
|
};
|
||||||
|
response = await dispatch(postColorData(postData)).unwrap();
|
||||||
|
} catch (err) {
|
||||||
|
if (err['message'] == 'Request failed with status code 422') {
|
||||||
|
response = {
|
||||||
|
data: {
|
||||||
|
statusCode: 0,
|
||||||
|
response: 'Color Not Added',
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (response?.data?.statusCode == 1) {
|
||||||
|
if (response?.data?.response == 'Color Already Exists') {
|
||||||
|
setMessageType('warning');
|
||||||
|
setMessageData(response?.data?.response);
|
||||||
|
} else {
|
||||||
|
setMessageType('success');
|
||||||
|
setMessageData(response?.data?.response);
|
||||||
|
setBillingUploadOverallColor(false);
|
||||||
|
}
|
||||||
|
GetTemplatedetails();
|
||||||
|
BillingUploadOverallColor(false);
|
||||||
|
} else {
|
||||||
|
setMessageData(response?.data?.response);
|
||||||
|
setMessageType('error');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const selectBillingOverallColor = async (value) => {
|
||||||
|
await setdropdownBillingOverallColor(value);
|
||||||
|
// formRef.current?.setFieldsValue({ BillingOverallColor: value });
|
||||||
|
};
|
||||||
|
const openColour4 = (value) => {
|
||||||
|
setTableColorType(value);
|
||||||
|
};
|
||||||
|
const handleBillingUploadOverallColor = () => {
|
||||||
|
setBillingUploadOverallColor(true);
|
||||||
|
};
|
||||||
|
|
||||||
|
const TablehandleSubmit = async () => {
|
||||||
|
const values = await Tableform.validateFields();
|
||||||
|
validateFontsTable(values);
|
||||||
|
};
|
||||||
|
const validateFontsTable = async (values) => {
|
||||||
|
console.log(values, 'valuesvalues');
|
||||||
|
const apiUrl = `https://www.googleapis.com/webfonts/v1/webfonts?key=AIzaSyDP1HqNkLI53iIAH-SB9_mt_24QdkUZ_24`;
|
||||||
|
fetch(apiUrl)
|
||||||
|
.then((response) => response.json())
|
||||||
|
.then(async (data) => {
|
||||||
|
const fontNames = data?.items?.map((item) => item.family);
|
||||||
|
|
||||||
|
if (fontNames.includes(formatFontName(values['TableFont']))) {
|
||||||
|
let response;
|
||||||
|
try {
|
||||||
|
let postData = {
|
||||||
|
SessionFont: formatFontName(values['TableFont']),
|
||||||
|
CreatedBy: UserId,
|
||||||
|
SessionId: billingSettings?.SessionId,
|
||||||
|
};
|
||||||
|
response = await dispatch(postTableFontData(postData)).unwrap();
|
||||||
|
} catch (err) {
|
||||||
|
if (err['message'] == 'Request failed with status code 422') {
|
||||||
|
response = {
|
||||||
|
data: {
|
||||||
|
statusCode: 0,
|
||||||
|
response: 'Font Not Added',
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (response?.data?.statusCode == 1) {
|
||||||
|
setTableFontModelopen(false);
|
||||||
|
setMessageData(response?.data?.response);
|
||||||
|
if (response?.data?.response == 'Font Already Exists') {
|
||||||
|
setMessageType('warning');
|
||||||
|
} else {
|
||||||
|
setMessageType('success');
|
||||||
|
}
|
||||||
|
|
||||||
|
dispatch(getTableFonts(BillingTableData?.[0]?.SessionId)).unwrap;
|
||||||
|
GetTemplatedetails();
|
||||||
|
Tableform.resetFields();
|
||||||
|
} else {
|
||||||
|
setMessageData(response?.data?.response);
|
||||||
|
setMessageType('error');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
setMessageType('warning');
|
||||||
|
setMessageData('Please give the Correct google fonts Name!');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Error fetching fonts:', error);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
function formatFontName(input) {
|
||||||
|
return input
|
||||||
|
?.toLowerCase()
|
||||||
|
.split(/\s+/)
|
||||||
|
.map((word) => word.charAt(0).toUpperCase() + word.slice(1)) // Capitalize each word
|
||||||
|
.join(' ');
|
||||||
|
}
|
||||||
|
const HandleSubmit = async () => {
|
||||||
|
console.log(TemplateDetails, 'TemplateDetails.ColorDetail');
|
||||||
|
const result = {
|
||||||
|
AppId: AppId,
|
||||||
|
CompId: CompId,
|
||||||
|
UserId: UserId,
|
||||||
|
BranchId: BranchId,
|
||||||
|
ColorId: [
|
||||||
|
...(TemplateDetails?.[0]?.ColorDetail?.filter(
|
||||||
|
(c) => c.SessionName !== 'BookingBilling'
|
||||||
|
)?.map((c) => c.ColorId) || []),
|
||||||
|
|
||||||
|
SelectedTableColor,
|
||||||
|
dropdownBillingOverallColor,
|
||||||
|
],
|
||||||
|
FontId: TemplateDetails?.[0]?.FontDetail?.map((f) =>
|
||||||
|
f.SessionName === 'BookingBilling' ? selectedTableFont : f.FontId
|
||||||
|
),
|
||||||
|
CreatedBy: UserId,
|
||||||
|
TemplateDetails: TemplateDetails?.[0]?.ComponentDetails.map((comp) => ({
|
||||||
|
ComponentId: comp.ComponentId, // ✅ dynamic
|
||||||
|
ComponentDetails:
|
||||||
|
comp.SessionName === 'BookingBilling'
|
||||||
|
? SelectedBillTableCheckValues?.map((id) => ({ OptionId: id })) // ✅ NEW checked list
|
||||||
|
: comp.FieldDetails.map((field) => ({ OptionId: field.OptionId })), // existing
|
||||||
|
})),
|
||||||
|
};
|
||||||
|
console.log(result, 'final result to submit');
|
||||||
|
var response = await dispatch(putSelectionComponentData(result)).unwrap();
|
||||||
|
if (response?.data?.statusCode == 1) {
|
||||||
|
if (response?.data?.response === 'Application Template Already Exists') {
|
||||||
|
setMessageType('warning');
|
||||||
|
setMessageData('Application Template Already Exists');
|
||||||
|
setFirstOnClick(false);
|
||||||
|
} else {
|
||||||
|
setMessageType('success');
|
||||||
|
setMessageData('Template Details Added Successfully');
|
||||||
|
setFirstOnClick(false);
|
||||||
|
}
|
||||||
|
await dispatch(getTemplate({ CompId, BranchId, AppId })).unwrap();
|
||||||
|
setModalOpen(false);
|
||||||
|
} else {
|
||||||
|
setMessageType('error');
|
||||||
|
setMessageData(response?.data?.response);
|
||||||
|
setFirstOnClick(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const onComplete = useCallback(() => {
|
||||||
|
setMessageData(null);
|
||||||
|
setMessageType(null);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Messages
|
||||||
|
messageType={messageType}
|
||||||
|
messageData={messageData}
|
||||||
|
onComplete={onComplete}
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: 'flex',
|
||||||
|
flexWrap: 'wrap',
|
||||||
|
gap: '10px',
|
||||||
|
marginTop: '20px',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Checkbox.Group
|
||||||
|
style={{
|
||||||
|
width: '100%',
|
||||||
|
}}
|
||||||
|
onChange={BillTableSelectlistonChange}
|
||||||
|
value={SelectedBillTableCheckValues}
|
||||||
|
>
|
||||||
|
<Row>
|
||||||
|
{billingSettings?.ComponentOptionsDetails?.map((value, key) => (
|
||||||
|
<Checkbox
|
||||||
|
style={{ padding: '12px' }}
|
||||||
|
value={value?.OptionId}
|
||||||
|
// onClick={() => Navholdoption(value.OptionName)}
|
||||||
|
key={value?.OptionId}
|
||||||
|
disabled={
|
||||||
|
value.OptionName === 'Hold' && HoldButton
|
||||||
|
? true
|
||||||
|
: value.OptionName === 'AddCustomer' && AddCustomerButton
|
||||||
|
? true
|
||||||
|
: value.OptionName === 'Item'
|
||||||
|
? true
|
||||||
|
: value.OptionName === 'UnpaidBill' && !DineInChecked
|
||||||
|
? true
|
||||||
|
: false
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{value.OptionName}
|
||||||
|
</Checkbox>
|
||||||
|
))}
|
||||||
|
</Row>
|
||||||
|
</Checkbox.Group>
|
||||||
|
{/* {billingSettings?.ComponentOptionsDetails?.map((item) => (
|
||||||
|
<div key={item.id} style={{ flex: '0 0 48%' }}>
|
||||||
|
<Checkbox
|
||||||
|
checked={item.checked}
|
||||||
|
onChange={(e) => handleChange(item.id, e.target.checked)}
|
||||||
|
>
|
||||||
|
{item.label}
|
||||||
|
</Checkbox>
|
||||||
|
</div>
|
||||||
|
))} */}
|
||||||
|
</div>
|
||||||
|
<div className="selctfontBackInputMain">
|
||||||
|
<div className="selctfontBackInput">
|
||||||
|
<p className="SelectionComponentSubHeading">BillTable Font</p>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: 'flex',
|
||||||
|
flexDirection: 'row',
|
||||||
|
gap: '10px',
|
||||||
|
alignItems: 'center',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<DropDowns
|
||||||
|
options={TableFontData?.map((option) => ({
|
||||||
|
value: option.FontId,
|
||||||
|
label: option.SessionFont,
|
||||||
|
}))}
|
||||||
|
label="Font"
|
||||||
|
onChangeFunction={selectFont3}
|
||||||
|
className="settingsales-DropDown-Selection"
|
||||||
|
isOnchanges={!!selectedTableFont}
|
||||||
|
valueData={selectedTableFont}
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
className="settingaddNewSalesFiledBTN"
|
||||||
|
onClick={TablehandleUploadFonts}
|
||||||
|
>
|
||||||
|
Add
|
||||||
|
<IoMdAdd
|
||||||
|
// className="plusOutlinedIcon"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{hasBackground ? (
|
||||||
|
<div>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: 'flex',
|
||||||
|
gap: '10px',
|
||||||
|
flexWrap: 'nowrap',
|
||||||
|
alignItems: 'center',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div className="colorDropdown">
|
||||||
|
<Form.Item
|
||||||
|
name="TableColor"
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: 'Please Select Color',
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<p className="SelectionComponentSubHeading">
|
||||||
|
BillTable Background Color
|
||||||
|
</p>
|
||||||
|
<DropDowns
|
||||||
|
options={TableBackgroundColorData?.map((option) => ({
|
||||||
|
value: option.ColorId,
|
||||||
|
label: (
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: 'flex',
|
||||||
|
gap: '0.5rem',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
width: '27px',
|
||||||
|
height: '27px',
|
||||||
|
borderRadius: '25.774192810058594px',
|
||||||
|
backgroundColor: option.BackgroundColor,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
style={{
|
||||||
|
width: '27px',
|
||||||
|
height: '27px',
|
||||||
|
borderRadius: '50px',
|
||||||
|
marginLeft: '15px',
|
||||||
|
backgroundColor: option.FontColor,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div>{option.ThemeName}</div>
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
}))}
|
||||||
|
labelChange={true}
|
||||||
|
label="Color"
|
||||||
|
className="field-DropDown-Selection"
|
||||||
|
onChangeFunction={selectTableColor}
|
||||||
|
isOnchanges={SelectedTableColor ? true : false}
|
||||||
|
valueData={SelectedTableColor}
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
className="addNewSalesFiledBTN"
|
||||||
|
onClick={BillhandleUploadColor}
|
||||||
|
>
|
||||||
|
Add
|
||||||
|
<IoMdAdd className="plusOutlinedIcon" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
) : null}
|
||||||
|
|
||||||
|
{hasOverallBackground ? (
|
||||||
|
<div>
|
||||||
|
<Modal
|
||||||
|
open={BillingUploadOverallColor}
|
||||||
|
title="BillTable Overall Background Color"
|
||||||
|
closeIcon={
|
||||||
|
<CloseOutlined
|
||||||
|
onClick={() => {
|
||||||
|
setBillingUploadOverallColor(false);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
width={400}
|
||||||
|
footer={null}
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: 'flex',
|
||||||
|
align: 'center',
|
||||||
|
width: '60%',
|
||||||
|
gap: '0.5rem',
|
||||||
|
border: '1px solid black',
|
||||||
|
borderRadius: '10px',
|
||||||
|
padding: '10px',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<p style={{ fontSize: '14px', fontWeight: 700 }}>
|
||||||
|
Selected Color:{' '}
|
||||||
|
</p>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
width: '35px',
|
||||||
|
height: '23px',
|
||||||
|
borderRadius: '5px',
|
||||||
|
backgroundColor: BillingOverallColor
|
||||||
|
? BillingOverallColor
|
||||||
|
: null,
|
||||||
|
}}
|
||||||
|
></div>
|
||||||
|
</div>
|
||||||
|
<div className="hex-input">
|
||||||
|
<InputField
|
||||||
|
prefix="#"
|
||||||
|
value={billingOverallHex}
|
||||||
|
inputMode="numeric"
|
||||||
|
maxLength={8}
|
||||||
|
onChange={handleBillingOverallHexCode}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<SwatchesPicker onChange={handleBillingOverallColorChange} />
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<button
|
||||||
|
className="colorBtn"
|
||||||
|
onClick={handleBillingOverallColorSubmit}
|
||||||
|
>
|
||||||
|
SAVE
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</Modal>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: 'flex',
|
||||||
|
gap: '1rem',
|
||||||
|
flexWrap: 'nowrap',
|
||||||
|
alignItems: 'center',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div className="colorDropdown">
|
||||||
|
<Form.Item
|
||||||
|
name="BillingOverallColor"
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: 'Please Select Color',
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<p className="SelectionComponentSubHeading">
|
||||||
|
BillTable Overall-Background
|
||||||
|
</p>
|
||||||
|
<DropDowns
|
||||||
|
options={BillingOverallColorsList?.map((option) => ({
|
||||||
|
value: option.ColorId,
|
||||||
|
label: (
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: 'flex',
|
||||||
|
gap: '0.5rem',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
width: '27px',
|
||||||
|
height: '27px',
|
||||||
|
borderRadius: '25.774192810058594px',
|
||||||
|
backgroundColor: option.BackgroundColor,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
style={{
|
||||||
|
width: '27px',
|
||||||
|
height: '27px',
|
||||||
|
borderRadius: '50px',
|
||||||
|
marginLeft: '15px',
|
||||||
|
backgroundColor: option.FontColor,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div>{option.ThemeName}</div>
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
}))}
|
||||||
|
labelChange={true}
|
||||||
|
label={
|
||||||
|
<p style={{ fontSize: '11px' }}>Overall Background</p>
|
||||||
|
}
|
||||||
|
className="field-DropDown-Selection"
|
||||||
|
onChangeFunction={selectBillingOverallColor}
|
||||||
|
isOnchanges={dropdownBillingOverallColor ? true : false}
|
||||||
|
valueData={dropdownBillingOverallColor}
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
className="addNewSalesFiledBTN"
|
||||||
|
onClick={handleBillingUploadOverallColor}
|
||||||
|
>
|
||||||
|
Add
|
||||||
|
<IoMdAdd
|
||||||
|
className="plusOutlinedIcon"
|
||||||
|
onClick={handleBillingUploadOverallColor}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
) : null}
|
||||||
|
</div>
|
||||||
|
<DefaultModal
|
||||||
|
open={TableFontModelopen}
|
||||||
|
title="Fonts"
|
||||||
|
footer={true}
|
||||||
|
children={
|
||||||
|
<Form form={Tableform}>
|
||||||
|
<div className="fontInputs">
|
||||||
|
<div>
|
||||||
|
<Form.Item
|
||||||
|
name="TableFont"
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
pattern: /^(?!\s*$).+/,
|
||||||
|
message: 'Please Enter Font',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
validator: async (_, value) => {
|
||||||
|
await validateSafeInput(value); // To block HTML tags & SQL keywords
|
||||||
|
return Promise.resolve();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<InputField
|
||||||
|
field="TableFont"
|
||||||
|
label="Font"
|
||||||
|
className="Input"
|
||||||
|
fieldState={true}
|
||||||
|
fieldApi={true}
|
||||||
|
autoComplete="off"
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p style={{ color: 'red' }}>* Google Fonts Only</p>
|
||||||
|
</Form>
|
||||||
|
}
|
||||||
|
handleCancel={TablehandleCancel}
|
||||||
|
handleSubmit={TablehandleSubmit}
|
||||||
|
buttonText="SAVE"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Modal
|
||||||
|
open={BillUploadColor}
|
||||||
|
title="Colors"
|
||||||
|
closeIcon={<CloseOutlined onClick={TableonCancel4} />}
|
||||||
|
width={400}
|
||||||
|
footer={null}
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<div className="color-hex-select">
|
||||||
|
<RadioGrpButton
|
||||||
|
content={[
|
||||||
|
{ value: 'Y', label: 'Background' },
|
||||||
|
{ value: 'N', label: 'Font' },
|
||||||
|
]}
|
||||||
|
defaultSelect={TableColorType}
|
||||||
|
fieldState={true}
|
||||||
|
onSelectFuntion={(e) => openColour4(e)}
|
||||||
|
/>
|
||||||
|
<div className="hex-input">
|
||||||
|
<InputField
|
||||||
|
prefix="#"
|
||||||
|
value={
|
||||||
|
TableColorType?.toLowerCase() === 'y'
|
||||||
|
? tableBGHex
|
||||||
|
: TableColorType?.toLowerCase() === 'n'
|
||||||
|
? tableFontHex
|
||||||
|
: ''
|
||||||
|
}
|
||||||
|
inputMode="numeric"
|
||||||
|
maxLength={8}
|
||||||
|
onChange={handleTableHexChange}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: 'flex',
|
||||||
|
flexDirection: 'row',
|
||||||
|
gap: '1rem',
|
||||||
|
justifyContent: 'center',
|
||||||
|
marginTop: '10px',
|
||||||
|
borderRadius: '10px',
|
||||||
|
border: '1px solid #000',
|
||||||
|
padding: '10px',
|
||||||
|
width: '110%',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
gap: '0.5rem',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<p style={{ fontSize: '10px', fontWeight: 700 }}>
|
||||||
|
{' '}
|
||||||
|
Selected Background Color :{' '}
|
||||||
|
</p>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
width: '35px',
|
||||||
|
height: '23px',
|
||||||
|
borderRadius: '5px',
|
||||||
|
backgroundColor: TablebackgroundColor
|
||||||
|
? TablebackgroundColor
|
||||||
|
: null,
|
||||||
|
}}
|
||||||
|
></div>
|
||||||
|
<>|</>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
gap: '0.5rem',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<p style={{ fontSize: '10px', fontWeight: 700 }}>
|
||||||
|
{' '}
|
||||||
|
Selected Font Color :{' '}
|
||||||
|
</p>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
width: '35px',
|
||||||
|
height: '23px',
|
||||||
|
borderRadius: '5px',
|
||||||
|
backgroundColor: TablefontColor ? TablefontColor : null,
|
||||||
|
}}
|
||||||
|
></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<SwatchesPicker onChange={handleColorChange4} />
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<button className="colorBtn" onClick={handleBackgroundColorSubmit}>
|
||||||
|
SAVE
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</Modal>
|
||||||
|
<div className=" submitButtonDiv">
|
||||||
|
<Buttons
|
||||||
|
buttonText="SUBMIT"
|
||||||
|
color="901D77"
|
||||||
|
icon={<ArrowRightOutlined />}
|
||||||
|
htmlType={true}
|
||||||
|
handleSubmit={HandleSubmit}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
export default TableHeadersetting;
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -1,6 +1,9 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
import { GlobalPritdummyData } from '../../../../Features/ThemeChange/ThemeChange';
|
import {
|
||||||
|
GlobalPritdummyData,
|
||||||
|
GlobalSelectedPrintHeaderColor,
|
||||||
|
} from '../../../../Features/ThemeChange/ThemeChange';
|
||||||
import { isMobile } from 'react-device-detect';
|
import { isMobile } from 'react-device-detect';
|
||||||
import { extractLastNumberOrderId } from '../../../../Services/Others';
|
import { extractLastNumberOrderId } from '../../../../Services/Others';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
|
|
@ -29,6 +32,8 @@ const TaxInvoice = ({
|
||||||
)?.SettingValue === 'Y';
|
)?.SettingValue === 'Y';
|
||||||
let BillName = printDatas?.PrintHdrName;
|
let BillName = printDatas?.PrintHdrName;
|
||||||
let companyColour = printDatas?.PrintHdrColor ?? '#00000';
|
let companyColour = printDatas?.PrintHdrColor ?? '#00000';
|
||||||
|
|
||||||
|
const SelectedHeaderColor = useSelector(GlobalSelectedPrintHeaderColor);
|
||||||
// Function to convert number to words
|
// Function to convert number to words
|
||||||
const numberToWords = (num) => {
|
const numberToWords = (num) => {
|
||||||
const a = [
|
const a = [
|
||||||
|
|
@ -481,11 +486,12 @@ const TaxInvoice = ({
|
||||||
{invoiceData.customerMobile && (
|
{invoiceData.customerMobile && (
|
||||||
<div>Mobile: {invoiceData.customerMobile}</div>
|
<div>Mobile: {invoiceData.customerMobile}</div>
|
||||||
)}
|
)}
|
||||||
{(invoiceData.customerGSTIN && table2Data?.OrderType !== 'E') && (
|
{invoiceData.customerGSTIN &&
|
||||||
<div style={{ fontWeight: '700', fontSize: '15px' }}>
|
table2Data?.OrderType !== 'E' && (
|
||||||
GSTIN/UIN: {invoiceData.customerGSTIN}
|
<div style={{ fontWeight: '700', fontSize: '15px' }}>
|
||||||
</div>
|
GSTIN/UIN: {invoiceData.customerGSTIN}
|
||||||
)}
|
</div>
|
||||||
|
)}
|
||||||
{invoiceData.customerAddress.state && (
|
{invoiceData.customerAddress.state && (
|
||||||
<div>State Name: {invoiceData.customerAddress.state}</div>
|
<div>State Name: {invoiceData.customerAddress.state}</div>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ import {
|
||||||
GlobalprintLogo,
|
GlobalprintLogo,
|
||||||
GlobalprintCredit,
|
GlobalprintCredit,
|
||||||
GlobalprintTax,
|
GlobalprintTax,
|
||||||
|
GlobalSelectedPrintHeaderColor,
|
||||||
} from '../../../../Features/ThemeChange/ThemeChange';
|
} from '../../../../Features/ThemeChange/ThemeChange';
|
||||||
import '../../../../Styles/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle1.scss';
|
import '../../../../Styles/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle1.scss';
|
||||||
import QRCode from 'react-qr-code';
|
import QRCode from 'react-qr-code';
|
||||||
|
|
@ -95,6 +96,7 @@ const PrintStyle1 = ({
|
||||||
const GlobalCashierName = useSelector(GlobalprintCashierName);
|
const GlobalCashierName = useSelector(GlobalprintCashierName);
|
||||||
const GlobalLogo = useSelector(GlobalprintLogo);
|
const GlobalLogo = useSelector(GlobalprintLogo);
|
||||||
const GlobalCredit = useSelector(GlobalprintCredit);
|
const GlobalCredit = useSelector(GlobalprintCredit);
|
||||||
|
const SelectedHeaderColor = useSelector(GlobalSelectedPrintHeaderColor);
|
||||||
|
|
||||||
const GlobaltermsAndConditions = useSelector(GlobalprinttermsAndConditions);
|
const GlobaltermsAndConditions = useSelector(GlobalprinttermsAndConditions);
|
||||||
const GlobalSignatureImages = useSelector(GlobalSignatureImage);
|
const GlobalSignatureImages = useSelector(GlobalSignatureImage);
|
||||||
|
|
@ -236,9 +238,12 @@ const PrintStyle1 = ({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const hasMappedOffer = offers.some((offer) =>
|
const hasMappedOffer = offers.some((offer) =>
|
||||||
['ItemWiseOffers', 'BundleOffers', 'QuantityWiseOffers', 'MemberShip'].includes(
|
[
|
||||||
offer.TableName
|
'ItemWiseOffers',
|
||||||
)
|
'BundleOffers',
|
||||||
|
'QuantityWiseOffers',
|
||||||
|
'MemberShip',
|
||||||
|
].includes(offer.TableName)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (hasMappedOffer) {
|
if (hasMappedOffer) {
|
||||||
|
|
@ -447,6 +452,7 @@ const PrintStyle1 = ({
|
||||||
style={{
|
style={{
|
||||||
fontSize: 'clamp(2rem, 2.5vw, 2rem)',
|
fontSize: 'clamp(2rem, 2.5vw, 2rem)',
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
|
color: SelectedHeaderColor,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{' '}
|
{' '}
|
||||||
|
|
@ -3691,6 +3697,7 @@ const PrintStyle1 = ({
|
||||||
style={{
|
style={{
|
||||||
fontSize: 'clamp(2rem, 2.5vw, 2rem)',
|
fontSize: 'clamp(2rem, 2.5vw, 2rem)',
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
|
color: SelectedHeaderColor,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{' '}
|
{' '}
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ import {
|
||||||
GlobalprintLogo,
|
GlobalprintLogo,
|
||||||
GlobalprintCredit,
|
GlobalprintCredit,
|
||||||
GlobalprintTax,
|
GlobalprintTax,
|
||||||
|
GlobalSelectedPrintHeaderColor,
|
||||||
} from '../../../../Features/ThemeChange/ThemeChange';
|
} from '../../../../Features/ThemeChange/ThemeChange';
|
||||||
import {
|
import {
|
||||||
GlobalUpiIDprint,
|
GlobalUpiIDprint,
|
||||||
|
|
@ -121,6 +122,7 @@ const PrintStyle10 = ({
|
||||||
const paymentTypeUPI = PaymentStatus?.find(
|
const paymentTypeUPI = PaymentStatus?.find(
|
||||||
(ps) => ps.PaymentTypeName === 'UPI'
|
(ps) => ps.PaymentTypeName === 'UPI'
|
||||||
);
|
);
|
||||||
|
const SelectedHeaderColor = useSelector(GlobalSelectedPrintHeaderColor);
|
||||||
|
|
||||||
const isEditedBill = PaymentStatus?.some((payment) => {
|
const isEditedBill = PaymentStatus?.some((payment) => {
|
||||||
const type = payment?.AdjustmentType?.toLowerCase();
|
const type = payment?.AdjustmentType?.toLowerCase();
|
||||||
|
|
@ -419,7 +421,13 @@ const PrintStyle10 = ({
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="Address" style={{ fontWeight: '600' }}>
|
<div className="Address" style={{ fontWeight: '600' }}>
|
||||||
<div className="ShopName" style={{ fontWeight: '600' }}>
|
<div
|
||||||
|
className="ShopName"
|
||||||
|
style={{
|
||||||
|
fontWeight: '600',
|
||||||
|
color: SelectedHeaderColor,
|
||||||
|
}}
|
||||||
|
>
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? 'ABC Shop'
|
? 'ABC Shop'
|
||||||
: table2Data?.BrName}{' '}
|
: table2Data?.BrName}{' '}
|
||||||
|
|
@ -3078,7 +3086,10 @@ const PrintStyle10 = ({
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="Address" style={{ fontWeight: '600' }}>
|
<div className="Address" style={{ fontWeight: '600' }}>
|
||||||
<div className="ShopName" style={{ fontWeight: '600' }}>
|
<div
|
||||||
|
className="ShopName"
|
||||||
|
style={{ fontWeight: '600', color: SelectedHeaderColor }}
|
||||||
|
>
|
||||||
{GlobaldummyData ? 'ABC Shop' : table2Data?.BrName}{' '}
|
{GlobaldummyData ? 'ABC Shop' : table2Data?.BrName}{' '}
|
||||||
</div>
|
</div>
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ import {
|
||||||
GlobalprintLogo,
|
GlobalprintLogo,
|
||||||
GlobalprintCredit,
|
GlobalprintCredit,
|
||||||
GlobalprintTax,
|
GlobalprintTax,
|
||||||
|
GlobalSelectedPrintHeaderColor,
|
||||||
} from '../../../../Features/ThemeChange/ThemeChange';
|
} from '../../../../Features/ThemeChange/ThemeChange';
|
||||||
import {
|
import {
|
||||||
GlobalUpiIDprint,
|
GlobalUpiIDprint,
|
||||||
|
|
@ -405,6 +406,7 @@ const PrintStyle11 = ({
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
// fontFamily: "Lemon",
|
// fontFamily: "Lemon",
|
||||||
fontSize: 'clamp(1rem, 2.5vw, 2.5rem)',
|
fontSize: 'clamp(1rem, 2.5vw, 2.5rem)',
|
||||||
|
color: SelectedHeaderColor,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
|
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
|
||||||
|
|
@ -3051,6 +3053,7 @@ const PrintStyle11 = ({
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
// fontFamily: "Lemon",
|
// fontFamily: "Lemon",
|
||||||
fontSize: 'clamp(1rem, 2.5vw, 2.5rem)',
|
fontSize: 'clamp(1rem, 2.5vw, 2.5rem)',
|
||||||
|
color: SelectedHeaderColor,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
|
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
|
||||||
|
|
@ -3155,7 +3158,7 @@ const PrintStyle11 = ({
|
||||||
|
|
||||||
<table
|
<table
|
||||||
className="PrintStyle11-print-table"
|
className="PrintStyle11-print-table"
|
||||||
style={{ width: GlobaldummyData ? '100%' : '90%' }}
|
style={{ width: GlobaldummyData ? '100%' : '' }}
|
||||||
>
|
>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ import {
|
||||||
GlobalprintLogo,
|
GlobalprintLogo,
|
||||||
GlobalprintCredit,
|
GlobalprintCredit,
|
||||||
GlobalprintTax,
|
GlobalprintTax,
|
||||||
|
GlobalSelectedPrintHeaderColor,
|
||||||
} from '../../../../Features/ThemeChange/ThemeChange';
|
} from '../../../../Features/ThemeChange/ThemeChange';
|
||||||
import {
|
import {
|
||||||
GlobalUpiIDprint,
|
GlobalUpiIDprint,
|
||||||
|
|
@ -540,6 +541,7 @@ const Printstyle12 = ({
|
||||||
style={{
|
style={{
|
||||||
fontSize: 'clamp(0.75rem, 2.5vw, 1.8rem)',
|
fontSize: 'clamp(0.75rem, 2.5vw, 1.8rem)',
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
|
color: SelectedHeaderColor,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
|
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
|
||||||
|
|
@ -1427,7 +1429,6 @@ const Printstyle12 = ({
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{table2Data?.OrderType === 'E' ? (
|
{table2Data?.OrderType === 'E' ? (
|
||||||
''
|
''
|
||||||
) : (
|
) : (
|
||||||
|
|
@ -1756,7 +1757,6 @@ const Printstyle12 = ({
|
||||||
: 0}
|
: 0}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* <div style={{ display: "flex", justifyContent: "space-between" }}>
|
{/* <div style={{ display: "flex", justifyContent: "space-between" }}>
|
||||||
<div style={{ width: '45%' }}>
|
<div style={{ width: '45%' }}>
|
||||||
Recived Amt
|
Recived Amt
|
||||||
|
|
@ -2420,7 +2420,6 @@ const Printstyle12 = ({
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
|
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
|
||||||
''
|
''
|
||||||
) : (
|
) : (
|
||||||
|
|
@ -3217,6 +3216,7 @@ const Printstyle12 = ({
|
||||||
style={{
|
style={{
|
||||||
fontSize: 'clamp(0.75rem, 2.5vw, 1.8rem)',
|
fontSize: 'clamp(0.75rem, 2.5vw, 1.8rem)',
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
|
color: SelectedHeaderColor,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
|
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
|
||||||
|
|
@ -4000,7 +4000,6 @@ const Printstyle12 = ({
|
||||||
))}
|
))}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{table2Data?.OrderType === 'E' ? (
|
{table2Data?.OrderType === 'E' ? (
|
||||||
''
|
''
|
||||||
) : (
|
) : (
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ import {
|
||||||
GlobalprintLogo,
|
GlobalprintLogo,
|
||||||
GlobalprintCredit,
|
GlobalprintCredit,
|
||||||
GlobalprintTax,
|
GlobalprintTax,
|
||||||
|
GlobalSelectedPrintHeaderColor,
|
||||||
} from '../../../../Features/ThemeChange/ThemeChange';
|
} from '../../../../Features/ThemeChange/ThemeChange';
|
||||||
import Logo from '../../../../Images/Logo.jpg';
|
import Logo from '../../../../Images/Logo.jpg';
|
||||||
import QRCode from 'react-qr-code';
|
import QRCode from 'react-qr-code';
|
||||||
|
|
@ -93,6 +94,7 @@ const Printstyle2 = ({
|
||||||
const paymentTypeUPI = PaymentStatus?.find(
|
const paymentTypeUPI = PaymentStatus?.find(
|
||||||
(ps) => ps.PaymentTypeName === 'UPI'
|
(ps) => ps.PaymentTypeName === 'UPI'
|
||||||
);
|
);
|
||||||
|
const SelectedHeaderColor = useSelector(GlobalSelectedPrintHeaderColor);
|
||||||
console.log(Qrcodet, 'Qrcodet', paymentTypeUPI);
|
console.log(Qrcodet, 'Qrcodet', paymentTypeUPI);
|
||||||
const GlobalSignature = useSelector(GlobalprintSignature);
|
const GlobalSignature = useSelector(GlobalprintSignature);
|
||||||
const GlobaltermsAndConditions = useSelector(GlobalprinttermsAndConditions);
|
const GlobaltermsAndConditions = useSelector(GlobalprinttermsAndConditions);
|
||||||
|
|
@ -411,7 +413,13 @@ const Printstyle2 = ({
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div style={{ fontSize: '18px', fontWeight: '600' }}>
|
<div
|
||||||
|
style={{
|
||||||
|
fontSize: '18px',
|
||||||
|
fontWeight: '600',
|
||||||
|
color: SelectedHeaderColor,
|
||||||
|
}}
|
||||||
|
>
|
||||||
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
|
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -3029,7 +3037,13 @@ const Printstyle2 = ({
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div style={{ fontSize: '18px', fontWeight: '600' }}>
|
<div
|
||||||
|
style={{
|
||||||
|
fontSize: '18px',
|
||||||
|
fontWeight: '600',
|
||||||
|
color: SelectedHeaderColor,
|
||||||
|
}}
|
||||||
|
>
|
||||||
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
|
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,9 +28,13 @@ import {
|
||||||
GlobalprintLogo,
|
GlobalprintLogo,
|
||||||
GlobalprintCredit,
|
GlobalprintCredit,
|
||||||
GlobalprintTax,
|
GlobalprintTax,
|
||||||
|
GlobalSelectedPrintHeaderColor,
|
||||||
} from '../../../../Features/ThemeChange/ThemeChange';
|
} from '../../../../Features/ThemeChange/ThemeChange';
|
||||||
import '../../../../Styles/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle4.scss';
|
import '../../../../Styles/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle4.scss';
|
||||||
import { GlobalUpiIDprint, PreferenceData } from '../../../../Features/BookingScreen/BookingData/BookingData';
|
import {
|
||||||
|
GlobalUpiIDprint,
|
||||||
|
PreferenceData,
|
||||||
|
} from '../../../../Features/BookingScreen/BookingData/BookingData';
|
||||||
import QRCode from 'react-qr-code';
|
import QRCode from 'react-qr-code';
|
||||||
import signature from '../../../../Images/signatureimage.jpg';
|
import signature from '../../../../Images/signatureimage.jpg';
|
||||||
import { ApplicationPreferences } from '../../../../Features/BrachLogin/BranchLogin';
|
import { ApplicationPreferences } from '../../../../Features/BrachLogin/BranchLogin';
|
||||||
|
|
@ -131,6 +135,7 @@ const Printstyle4 = ({
|
||||||
const paymentTypeUPI = PaymentStatus?.find(
|
const paymentTypeUPI = PaymentStatus?.find(
|
||||||
(ps) => ps.PaymentTypeName === 'UPI'
|
(ps) => ps.PaymentTypeName === 'UPI'
|
||||||
);
|
);
|
||||||
|
const SelectedHeaderColor = useSelector(GlobalSelectedPrintHeaderColor);
|
||||||
|
|
||||||
console.log(GlobalDiscount, Discount, 'Discount');
|
console.log(GlobalDiscount, Discount, 'Discount');
|
||||||
|
|
||||||
|
|
@ -423,6 +428,7 @@ const Printstyle4 = ({
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
width: '100%',
|
width: '100%',
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
|
color: SelectedHeaderColor,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}{' '}
|
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}{' '}
|
||||||
|
|
@ -564,15 +570,15 @@ const Printstyle4 = ({
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: Quantity && (
|
: Quantity && (
|
||||||
<th
|
<th
|
||||||
style={{
|
style={{
|
||||||
width: '30px',
|
width: '30px',
|
||||||
textAlign: 'right',
|
textAlign: 'right',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{WeightasKg ? 'Qty/Kg' : 'Qty'}
|
{WeightasKg ? 'Qty/Kg' : 'Qty'}
|
||||||
</th>
|
</th>
|
||||||
)}
|
)}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalHsnCode && (
|
? GlobalHsnCode && (
|
||||||
<th
|
<th
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ import {
|
||||||
GlobalprintLogo,
|
GlobalprintLogo,
|
||||||
GlobalprintCredit,
|
GlobalprintCredit,
|
||||||
GlobalprintTax,
|
GlobalprintTax,
|
||||||
|
GlobalSelectedPrintHeaderColor,
|
||||||
} from '../../../../Features/ThemeChange/ThemeChange';
|
} from '../../../../Features/ThemeChange/ThemeChange';
|
||||||
import {
|
import {
|
||||||
GlobalUpiIDprint,
|
GlobalUpiIDprint,
|
||||||
|
|
@ -124,6 +125,8 @@ const PrintStyle5 = ({
|
||||||
(ps) => ps.PaymentTypeName === 'UPI'
|
(ps) => ps.PaymentTypeName === 'UPI'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const SelectedHeaderColor = useSelector(GlobalSelectedPrintHeaderColor);
|
||||||
|
|
||||||
console.log(GlobalDiscount, Discount, 'Discount');
|
console.log(GlobalDiscount, Discount, 'Discount');
|
||||||
|
|
||||||
let TermsAndConditions = printDatas?.TermsandConditions;
|
let TermsAndConditions = printDatas?.TermsandConditions;
|
||||||
|
|
@ -394,6 +397,7 @@ const PrintStyle5 = ({
|
||||||
style={{
|
style={{
|
||||||
fontSize: 'clamp(2rem, 2.5vw, 2rem)',
|
fontSize: 'clamp(2rem, 2.5vw, 2rem)',
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
|
color: SelectedHeaderColor,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
|
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
|
||||||
|
|
@ -2686,6 +2690,7 @@ const PrintStyle5 = ({
|
||||||
style={{
|
style={{
|
||||||
fontSize: 'clamp(2rem, 2.5vw, 2rem)',
|
fontSize: 'clamp(2rem, 2.5vw, 2rem)',
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
|
color: SelectedHeaderColor,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
|
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ import {
|
||||||
GlobalprintLogo,
|
GlobalprintLogo,
|
||||||
GlobalprintCredit,
|
GlobalprintCredit,
|
||||||
GlobalprintTax,
|
GlobalprintTax,
|
||||||
|
GlobalSelectedPrintHeaderColor,
|
||||||
} from '../../../../Features/ThemeChange/ThemeChange';
|
} from '../../../../Features/ThemeChange/ThemeChange';
|
||||||
import {
|
import {
|
||||||
GlobalUpiIDprint,
|
GlobalUpiIDprint,
|
||||||
|
|
@ -412,7 +413,9 @@ const Printstyle6 = ({
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
|
<div style={{ color: SelectedHeaderColor }}>
|
||||||
|
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style={{ fontSize: 'clamp(0.75rem, 2.5vw, 1rem)' }}>
|
<div style={{ fontSize: 'clamp(0.75rem, 2.5vw, 1rem)' }}>
|
||||||
|
|
@ -3264,7 +3267,9 @@ const Printstyle6 = ({
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
|
<div style={{ color: SelectedHeaderColor }}>
|
||||||
|
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style={{ fontSize: 'clamp(0.75rem, 2.5vw, 1rem)' }}>
|
<div style={{ fontSize: 'clamp(0.75rem, 2.5vw, 1rem)' }}>
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ import {
|
||||||
GlobalprintLogo,
|
GlobalprintLogo,
|
||||||
GlobalprintCredit,
|
GlobalprintCredit,
|
||||||
GlobalprintTax,
|
GlobalprintTax,
|
||||||
|
GlobalSelectedPrintHeaderColor,
|
||||||
} from '../../../../Features/ThemeChange/ThemeChange';
|
} from '../../../../Features/ThemeChange/ThemeChange';
|
||||||
import Logo from '../../../../Images/Logo.jpg';
|
import Logo from '../../../../Images/Logo.jpg';
|
||||||
import {
|
import {
|
||||||
|
|
@ -423,7 +424,13 @@ const PrintStyle7 = ({
|
||||||
width={100}
|
width={100}
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
<div style={{ fontSize: '16px', fontWeight: '600' }}>
|
<div
|
||||||
|
style={{
|
||||||
|
fontSize: '16px',
|
||||||
|
fontWeight: '600',
|
||||||
|
color: SelectedHeaderColor,
|
||||||
|
}}
|
||||||
|
>
|
||||||
{' '}
|
{' '}
|
||||||
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
|
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -1591,7 +1598,7 @@ const PrintStyle7 = ({
|
||||||
style={{
|
style={{
|
||||||
marginLeft: '13px',
|
marginLeft: '13px',
|
||||||
padding: 0,
|
padding: 0,
|
||||||
fontSize: '10px',
|
fontSize: '8px',
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
@ -1609,7 +1616,7 @@ const PrintStyle7 = ({
|
||||||
style={{
|
style={{
|
||||||
marginLeft: '13px',
|
marginLeft: '13px',
|
||||||
padding: 0,
|
padding: 0,
|
||||||
fontSize: '10px',
|
fontSize: '8px',
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
@ -2495,7 +2502,7 @@ const PrintStyle7 = ({
|
||||||
style={{
|
style={{
|
||||||
marginLeft: '13px',
|
marginLeft: '13px',
|
||||||
padding: 0,
|
padding: 0,
|
||||||
fontSize: '10px',
|
fontSize: '8px',
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
@ -2513,7 +2520,7 @@ const PrintStyle7 = ({
|
||||||
style={{
|
style={{
|
||||||
marginLeft: '13px',
|
marginLeft: '13px',
|
||||||
padding: 0,
|
padding: 0,
|
||||||
fontSize: '10px',
|
fontSize: '8px',
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
@ -2869,7 +2876,13 @@ const PrintStyle7 = ({
|
||||||
width={100}
|
width={100}
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
<div style={{ fontSize: '16px', fontWeight: '600' }}>
|
<div
|
||||||
|
style={{
|
||||||
|
fontSize: '16px',
|
||||||
|
fontWeight: '600',
|
||||||
|
color: SelectedHeaderColor,
|
||||||
|
}}
|
||||||
|
>
|
||||||
{' '}
|
{' '}
|
||||||
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
|
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -3964,7 +3977,7 @@ const PrintStyle7 = ({
|
||||||
style={{
|
style={{
|
||||||
marginLeft: '13px',
|
marginLeft: '13px',
|
||||||
padding: 0,
|
padding: 0,
|
||||||
fontSize: '10px',
|
fontSize: '8px',
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
@ -3982,7 +3995,7 @@ const PrintStyle7 = ({
|
||||||
style={{
|
style={{
|
||||||
marginLeft: '13px',
|
marginLeft: '13px',
|
||||||
padding: 0,
|
padding: 0,
|
||||||
fontSize: '10px',
|
fontSize: '8px',
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
@ -3996,7 +4009,7 @@ const PrintStyle7 = ({
|
||||||
style={{
|
style={{
|
||||||
marginLeft: '13px',
|
marginLeft: '13px',
|
||||||
padding: 0,
|
padding: 0,
|
||||||
fontSize: '10px',
|
fontSize: '8px',
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ import {
|
||||||
GlobalprintLogo,
|
GlobalprintLogo,
|
||||||
GlobalprintCredit,
|
GlobalprintCredit,
|
||||||
GlobalprintTax,
|
GlobalprintTax,
|
||||||
|
GlobalSelectedPrintHeaderColor,
|
||||||
} from '../../../../Features/ThemeChange/ThemeChange';
|
} from '../../../../Features/ThemeChange/ThemeChange';
|
||||||
import Logo from '../../../../Images/Logo.jpg';
|
import Logo from '../../../../Images/Logo.jpg';
|
||||||
import {
|
import {
|
||||||
|
|
@ -140,6 +141,10 @@ const Printstyle8 = ({
|
||||||
(ps) => ps.PaymentStatus === 'S' && ps?.LastOrderTran === 'Y'
|
(ps) => ps.PaymentStatus === 'S' && ps?.LastOrderTran === 'Y'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const SelectedHeaderColor = useSelector(GlobalSelectedPrintHeaderColor);
|
||||||
|
|
||||||
|
console.log(GlobalDiscount, Discount, 'Discount');
|
||||||
|
|
||||||
let TermsAndConditions = printDatas?.TermsandConditions;
|
let TermsAndConditions = printDatas?.TermsandConditions;
|
||||||
let SignatureImg = printDatas?.Signature;
|
let SignatureImg = printDatas?.Signature;
|
||||||
let Notestext = printDatas?.Notes;
|
let Notestext = printDatas?.Notes;
|
||||||
|
|
@ -436,6 +441,7 @@ const Printstyle8 = ({
|
||||||
style={{
|
style={{
|
||||||
fontSize: 'clamp(1.25rem, 2.5vw, 1.75rem)',
|
fontSize: 'clamp(1.25rem, 2.5vw, 1.75rem)',
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
|
color: SelectedHeaderColor,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
|
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
|
||||||
|
|
@ -1763,7 +1769,6 @@ const Printstyle8 = ({
|
||||||
padding: 0,
|
padding: 0,
|
||||||
fontSize: '15px',
|
fontSize: '15px',
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
textAlign: 'center',
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{PaymentStatusSuccess?.length === 1
|
{PaymentStatusSuccess?.length === 1
|
||||||
|
|
@ -1870,6 +1875,7 @@ const Printstyle8 = ({
|
||||||
{GlobaldummyData && GlobalCashierName && (
|
{GlobaldummyData && GlobalCashierName && (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
|
marginLeft: '14px',
|
||||||
padding: 0,
|
padding: 0,
|
||||||
fontSize: '12px',
|
fontSize: '12px',
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
|
|
@ -1886,6 +1892,7 @@ const Printstyle8 = ({
|
||||||
CashierNameField && (
|
CashierNameField && (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
|
marginLeft: '14px',
|
||||||
padding: 0,
|
padding: 0,
|
||||||
fontSize: '12px',
|
fontSize: '12px',
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
|
|
@ -2001,13 +2008,7 @@ const Printstyle8 = ({
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div style={{ fontSize: '10px' }}>
|
||||||
style={{
|
|
||||||
fontSize: '12px',
|
|
||||||
fontWeight: '600',
|
|
||||||
color: '#000',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Your Order No :
|
Your Order No :
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? '01'
|
? '01'
|
||||||
|
|
@ -2761,7 +2762,6 @@ const Printstyle8 = ({
|
||||||
padding: 0,
|
padding: 0,
|
||||||
fontSize: '15px',
|
fontSize: '15px',
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
textAlign: 'center',
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{PaymentStatusSuccess?.length === 1
|
{PaymentStatusSuccess?.length === 1
|
||||||
|
|
@ -2868,6 +2868,7 @@ const Printstyle8 = ({
|
||||||
{GlobaldummyData && GlobalCashierName && (
|
{GlobaldummyData && GlobalCashierName && (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
|
marginLeft: '14px',
|
||||||
padding: 0,
|
padding: 0,
|
||||||
fontSize: '12px',
|
fontSize: '12px',
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
|
|
@ -2884,6 +2885,7 @@ const Printstyle8 = ({
|
||||||
CashierNameField && (
|
CashierNameField && (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
|
marginLeft: '14px',
|
||||||
padding: 0,
|
padding: 0,
|
||||||
fontSize: '12px',
|
fontSize: '12px',
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
|
|
@ -2990,13 +2992,7 @@ const Printstyle8 = ({
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div style={{ fontSize: '10px' }}>
|
||||||
style={{
|
|
||||||
fontSize: '12px',
|
|
||||||
fontWeight: '600',
|
|
||||||
color: '#000',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Your Order No :
|
Your Order No :
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? '01'
|
? '01'
|
||||||
|
|
@ -3247,6 +3243,7 @@ const Printstyle8 = ({
|
||||||
style={{
|
style={{
|
||||||
fontSize: 'clamp(1.25rem, 2.5vw, 1.75rem)',
|
fontSize: 'clamp(1.25rem, 2.5vw, 1.75rem)',
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
|
color: SelectedHeaderColor,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
|
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
|
||||||
|
|
@ -4272,7 +4269,7 @@ const Printstyle8 = ({
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
|
|
@ -4351,7 +4348,6 @@ const Printstyle8 = ({
|
||||||
padding: 0,
|
padding: 0,
|
||||||
fontSize: '14px',
|
fontSize: '14px',
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
textAlign: 'center',
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{PaymentStatusSuccess?.length === 1
|
{PaymentStatusSuccess?.length === 1
|
||||||
|
|
@ -4442,6 +4438,7 @@ const Printstyle8 = ({
|
||||||
{GlobaldummyData && GlobalCashierName && (
|
{GlobaldummyData && GlobalCashierName && (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
|
marginLeft: '14px',
|
||||||
padding: 0,
|
padding: 0,
|
||||||
fontSize: '12px',
|
fontSize: '12px',
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
|
|
@ -4458,6 +4455,7 @@ const Printstyle8 = ({
|
||||||
CashierNameField && (
|
CashierNameField && (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
|
marginLeft: '14px',
|
||||||
padding: 0,
|
padding: 0,
|
||||||
fontSize: '12px',
|
fontSize: '12px',
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
|
|
@ -4563,7 +4561,7 @@ const Printstyle8 = ({
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style={{ fontSize: '12px', fontWeight: '600', color: '#000' }}>
|
<div style={{ fontSize: '10px' }}>
|
||||||
Your Order No :
|
Your Order No :
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? '01'
|
? '01'
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ import {
|
||||||
GlobalprintLogo,
|
GlobalprintLogo,
|
||||||
GlobalprintCredit,
|
GlobalprintCredit,
|
||||||
GlobalprintTax,
|
GlobalprintTax,
|
||||||
|
GlobalSelectedPrintHeaderColor,
|
||||||
} from '../../../../Features/ThemeChange/ThemeChange';
|
} from '../../../../Features/ThemeChange/ThemeChange';
|
||||||
import Logo from '../../../../Images/Logo.jpg';
|
import Logo from '../../../../Images/Logo.jpg';
|
||||||
import {
|
import {
|
||||||
|
|
@ -135,6 +136,7 @@ const PrintStyle9 = ({
|
||||||
(ps) => ps.PaymentStatus === 'S' && ps?.LastOrderTran === 'Y'
|
(ps) => ps.PaymentStatus === 'S' && ps?.LastOrderTran === 'Y'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const SelectedHeaderColor = useSelector(GlobalSelectedPrintHeaderColor);
|
||||||
let TermsAndConditions = printDatas?.TermsandConditions;
|
let TermsAndConditions = printDatas?.TermsandConditions;
|
||||||
let SignatureImg = printDatas?.Signature;
|
let SignatureImg = printDatas?.Signature;
|
||||||
let Notestext = printDatas?.Notes;
|
let Notestext = printDatas?.Notes;
|
||||||
|
|
@ -427,6 +429,7 @@ const PrintStyle9 = ({
|
||||||
style={{
|
style={{
|
||||||
fontSize: 'clamp(1.5rem, 2.5vw, 2rem)',
|
fontSize: 'clamp(1.5rem, 2.5vw, 2rem)',
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
|
color: SelectedHeaderColor,
|
||||||
}}
|
}}
|
||||||
className="PrintStyle9-Branch"
|
className="PrintStyle9-Branch"
|
||||||
>
|
>
|
||||||
|
|
@ -3164,6 +3167,7 @@ const PrintStyle9 = ({
|
||||||
style={{
|
style={{
|
||||||
fontSize: 'clamp(1.5rem, 2.5vw, 2rem)',
|
fontSize: 'clamp(1.5rem, 2.5vw, 2rem)',
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
|
color: SelectedHeaderColor,
|
||||||
}}
|
}}
|
||||||
className="PrintStyle9-Branch"
|
className="PrintStyle9-Branch"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,7 @@ import { GoPackageDependencies } from 'react-icons/go';
|
||||||
import { Messages } from '../../../../ownLib/my-ui-lib.js';
|
import { Messages } from '../../../../ownLib/my-ui-lib.js';
|
||||||
|
|
||||||
import ShortcutKeyHelper from '../Components/UtillComponents/ShortcutKeyHelper.jsx';
|
import ShortcutKeyHelper from '../Components/UtillComponents/ShortcutKeyHelper.jsx';
|
||||||
|
import AllSalesPageSettings from '../Components/UtillComponents/AllSalesPageSettings.jsx';
|
||||||
|
|
||||||
const SalesCountForStandard = ({
|
const SalesCountForStandard = ({
|
||||||
DineInAccess,
|
DineInAccess,
|
||||||
|
|
@ -830,6 +831,7 @@ const SalesCountForStandard = ({
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
{preferenceshortcutkey && <ShortcutKeyHelper />}
|
{preferenceshortcutkey && <ShortcutKeyHelper />}
|
||||||
|
<AllSalesPageSettings />
|
||||||
<div style={{ display: 'flex', alignItems: 'center' }}>
|
<div style={{ display: 'flex', alignItems: 'center' }}>
|
||||||
{Customisebillno && <CustomisedInvoiceChange />}
|
{Customisebillno && <CustomisedInvoiceChange />}
|
||||||
{SessionData?.FeatureAddonData?.FeatureDtls?.find(
|
{SessionData?.FeatureAddonData?.FeatureDtls?.find(
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ import { FaCreditCard } from 'react-icons/fa';
|
||||||
|
|
||||||
const subDirectory = import.meta.env.BASE_URL;
|
const subDirectory = import.meta.env.BASE_URL;
|
||||||
|
|
||||||
function PaymentOptions() {
|
function PaymentOptions({ setModalOpen }) {
|
||||||
const { SadminuserAccess } = useAuth();
|
const { SadminuserAccess } = useAuth();
|
||||||
let SAAccessCommonMaster = SadminuserAccess?.find(
|
let SAAccessCommonMaster = SadminuserAccess?.find(
|
||||||
(e) => e?.MenuName === 'Payment Options'
|
(e) => e?.MenuName === 'Payment Options'
|
||||||
|
|
@ -1356,6 +1356,7 @@ function PaymentOptions() {
|
||||||
: 'Data Updated Successfully'
|
: 'Data Updated Successfully'
|
||||||
);
|
);
|
||||||
await dispatch(changeSalesPaymentoption(false));
|
await dispatch(changeSalesPaymentoption(false));
|
||||||
|
setModalOpen(false)
|
||||||
// ✅ Call the function here to update global state
|
// ✅ Call the function here to update global state
|
||||||
try {
|
try {
|
||||||
await fetchAndSetPaymentOptions(dispatch, {
|
await fetchAndSetPaymentOptions(dispatch, {
|
||||||
|
|
|
||||||
|
|
@ -752,8 +752,7 @@ const PreferenceList = () => {
|
||||||
|
|
||||||
{renderCheckbox('scanlayout', 'Do you Want Scan Layout Page?')}
|
{renderCheckbox('scanlayout', 'Do you Want Scan Layout Page?')}
|
||||||
</div>
|
</div>
|
||||||
|
<div className="PreferencesBTN">
|
||||||
<div className="submitButton">
|
|
||||||
<Buttons
|
<Buttons
|
||||||
buttonText="Submit Preferences"
|
buttonText="Submit Preferences"
|
||||||
color="901D77"
|
color="901D77"
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
.preferences-list {
|
.preferences-list {
|
||||||
max-height: 84vh;
|
max-height: 75vh;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
scrollbar-width: thin;
|
scrollbar-width: thin;
|
||||||
scroll-behavior: smooth;
|
scroll-behavior: smooth;
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
padding-bottom: 4rem;
|
padding-bottom: 3rem;
|
||||||
|
|
||||||
.preference-headers {
|
.preference-headers {
|
||||||
font-size: 1.2rem;
|
font-size: 1.2rem;
|
||||||
|
|
@ -41,7 +41,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-form-item {
|
.ant-form-item {
|
||||||
margin-bottom: 1.2rem;
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-checkbox-wrapper,
|
.ant-checkbox-wrapper,
|
||||||
|
|
@ -49,11 +49,6 @@
|
||||||
margin-right: 1rem;
|
margin-right: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-btn {
|
|
||||||
margin-top: 2rem;
|
|
||||||
float: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Optional: Scrollbar for long modals
|
// Optional: Scrollbar for long modals
|
||||||
&::-webkit-scrollbar {
|
&::-webkit-scrollbar {
|
||||||
width: 6px;
|
width: 6px;
|
||||||
|
|
@ -89,7 +84,7 @@
|
||||||
padding: 10px 0;
|
padding: 10px 0;
|
||||||
|
|
||||||
> div {
|
> div {
|
||||||
font-family: 'Poppins';
|
font-family: "Poppins";
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
margin: 4px 0;
|
margin: 4px 0;
|
||||||
|
|
@ -154,3 +149,13 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.PreferencesBTN {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
justify-content: flex-end;
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 1rem;
|
||||||
|
.primary_Button {
|
||||||
|
width: 200px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -970,7 +970,7 @@ console.log('hi');
|
||||||
PostData['LocationType'] = Supplierdata?.find(
|
PostData['LocationType'] = Supplierdata?.find(
|
||||||
(find) => find.SuppId === selecPurSupplier
|
(find) => find.SuppId === selecPurSupplier
|
||||||
)?.Type;
|
)?.Type;
|
||||||
PostData['DeliveryAddressDetails'] = deliveryAddress;
|
PostData['DeliveryAddressDetails'] = [deliveryAddress];
|
||||||
let PostPurOrder = await dispatch(postPurcOrderData(PostData)).unwrap();
|
let PostPurOrder = await dispatch(postPurcOrderData(PostData)).unwrap();
|
||||||
if (PostPurOrder?.data?.statusCode === 1) {
|
if (PostPurOrder?.data?.statusCode === 1) {
|
||||||
setMessage({ type: 'success', data: PostPurOrder?.data?.response });
|
setMessage({ type: 'success', data: PostPurOrder?.data?.response });
|
||||||
|
|
@ -2371,7 +2371,7 @@ console.log('hi');
|
||||||
>
|
>
|
||||||
<InputField
|
<InputField
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
label={<label class="required">Address</label>}
|
label={<label class="required">Address 1</label>}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
|
|
@ -2392,7 +2392,7 @@ console.log('hi');
|
||||||
>
|
>
|
||||||
<InputField
|
<InputField
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
label={<label class="required">Address</label>}
|
label={<label class="required">Address 2</label>}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,10 @@
|
||||||
import React, { useState, useRef, useEffect, useContext, useCallback } from 'react';
|
import React, {
|
||||||
|
useState,
|
||||||
|
useRef,
|
||||||
|
useEffect,
|
||||||
|
useContext,
|
||||||
|
useCallback,
|
||||||
|
} from 'react';
|
||||||
import { useDispatch, useSelector } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
import { read, utils } from 'xlsx';
|
import { read, utils } from 'xlsx';
|
||||||
import ExcelJS from 'exceljs';
|
import ExcelJS from 'exceljs';
|
||||||
|
|
@ -19,12 +25,15 @@ import { MdOutlineAppRegistration } from 'react-icons/md';
|
||||||
import { DefaultModal } from '../../Components/Modal/DefaultModal.jsx';
|
import { DefaultModal } from '../../Components/Modal/DefaultModal.jsx';
|
||||||
import Buttons from '../../Components/Forms/Buttons.jsx';
|
import Buttons from '../../Components/Forms/Buttons.jsx';
|
||||||
import { IoClose } from 'react-icons/io5';
|
import { IoClose } from 'react-icons/io5';
|
||||||
import { ArrowRightOutlined } from '@ant-design/icons'
|
import { ArrowRightOutlined } from '@ant-design/icons';
|
||||||
import { ApplicationPreferences } from '../../Features/BrachLogin/BranchLogin.js';
|
import { ApplicationPreferences } from '../../Features/BrachLogin/BranchLogin.js';
|
||||||
import FormHeader from '../PageComponents/FormHeader.jsx';
|
import FormHeader from '../PageComponents/FormHeader.jsx';
|
||||||
import { DropDowns } from '../../Components/Forms/DropDown.jsx';
|
import { DropDowns } from '../../Components/Forms/DropDown.jsx';
|
||||||
import { getSession } from '../../Services/Others.js';
|
import { getSession } from '../../Services/Others.js';
|
||||||
import { getFieldSetupData, postFieldSetup } from '../../Features/ProductPage/ProductPage.js';
|
import {
|
||||||
|
getFieldSetupData,
|
||||||
|
postFieldSetup,
|
||||||
|
} from '../../Features/ProductPage/ProductPage.js';
|
||||||
import { Messages } from '../../Components/Notifications/Messages.jsx';
|
import { Messages } from '../../Components/Notifications/Messages.jsx';
|
||||||
import { getPurchaseSupplierAndWareHouseData } from '../../Features/PurchaseOrder/PurchaseOrder.js';
|
import { getPurchaseSupplierAndWareHouseData } from '../../Features/PurchaseOrder/PurchaseOrder.js';
|
||||||
import { getSupplaierIdwithTypeBasedProducts } from '../../Features/SupplierProductMapping/SupplierProductMapping.js';
|
import { getSupplaierIdwithTypeBasedProducts } from '../../Features/SupplierProductMapping/SupplierProductMapping.js';
|
||||||
|
|
@ -57,10 +66,10 @@ const StockExcel = ({
|
||||||
|
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
const AppId = getSession("AppId");
|
const AppId = getSession('AppId');
|
||||||
const CompId = getSession("CompId");
|
const CompId = getSession('CompId');
|
||||||
const BranchId = getSession("BranchId");
|
const BranchId = getSession('BranchId');
|
||||||
const UserId = getSession("UserId");
|
const UserId = getSession('UserId');
|
||||||
|
|
||||||
const formRef = useRef(null);
|
const formRef = useRef(null);
|
||||||
const fileInputRef = useRef(fileInputRefSelector);
|
const fileInputRef = useRef(fileInputRefSelector);
|
||||||
|
|
@ -70,14 +79,14 @@ const StockExcel = ({
|
||||||
const excelFileError = useSelector(excelFileErrorSelector);
|
const excelFileError = useSelector(excelFileErrorSelector);
|
||||||
const ApplicationPreferenceData = useSelector(ApplicationPreferences);
|
const ApplicationPreferenceData = useSelector(ApplicationPreferences);
|
||||||
const purchaseReceiptBulkUploadCatId = ApplicationPreferenceData?.find(
|
const purchaseReceiptBulkUploadCatId = ApplicationPreferenceData?.find(
|
||||||
p => p?.PreferredCatName?.toLowerCase() === "purchase receipt bulk"
|
(p) => p?.PreferredCatName?.toLowerCase() === 'purchase receipt bulk'
|
||||||
)?.PreferredCatId;
|
)?.PreferredCatId;
|
||||||
|
|
||||||
const [worksheet1, setWorksheet1] = useState(null);
|
const [worksheet1, setWorksheet1] = useState(null);
|
||||||
const [editdelete, seteditdelete] = useState('');
|
const [editdelete, seteditdelete] = useState('');
|
||||||
|
|
||||||
const [Datas, setDatas] = useState();
|
const [Datas, setDatas] = useState();
|
||||||
console.log(Datas, "Datas")
|
console.log(Datas, 'Datas');
|
||||||
const [showSupplierModal, setShowSupplierModal] = useState(false);
|
const [showSupplierModal, setShowSupplierModal] = useState(false);
|
||||||
const [suppliers, setSuppliers] = useState([]);
|
const [suppliers, setSuppliers] = useState([]);
|
||||||
const [selectedSupplier, setSelectedSupplier] = useState(null);
|
const [selectedSupplier, setSelectedSupplier] = useState(null);
|
||||||
|
|
@ -96,7 +105,7 @@ const StockExcel = ({
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getFieldSetup();
|
getFieldSetup();
|
||||||
}, [purchaseReceiptBulkUploadCatId])
|
}, [purchaseReceiptBulkUploadCatId]);
|
||||||
|
|
||||||
const onComplete = useCallback(() => {
|
const onComplete = useCallback(() => {
|
||||||
setMessageData(null);
|
setMessageData(null);
|
||||||
|
|
@ -105,19 +114,33 @@ const StockExcel = ({
|
||||||
|
|
||||||
const getFieldSetup = async () => {
|
const getFieldSetup = async () => {
|
||||||
try {
|
try {
|
||||||
const response = await dispatch(getFieldSetupData({ AppId, CompId, BranchId, categoryId: purchaseReceiptBulkUploadCatId, Type: 'EB' })).unwrap();
|
const response = await dispatch(
|
||||||
|
getFieldSetupData({
|
||||||
|
AppId,
|
||||||
|
CompId,
|
||||||
|
BranchId,
|
||||||
|
categoryId: purchaseReceiptBulkUploadCatId,
|
||||||
|
Type: 'EB',
|
||||||
|
})
|
||||||
|
).unwrap();
|
||||||
if (response?.data?.statusCode === 1) {
|
if (response?.data?.statusCode === 1) {
|
||||||
console.log(response?.data?.data?.[0]?.ConfigDtl, "Field Setup Data");
|
console.log(response?.data?.data?.[0]?.ConfigDtl, 'Field Setup Data');
|
||||||
setSelectedFields(response?.data?.data?.[0]?.ConfigDtl?.filter(c => c.ConfigId && c.Access === 'Y')?.map(c => c.ConfigId) || []);
|
setSelectedFields(
|
||||||
setTableFieldPreferences(response?.data?.data?.[0]?.ConfigDtl?.map(c => ({
|
response?.data?.data?.[0]?.ConfigDtl?.filter(
|
||||||
value: c.ConfigId,
|
(c) => c.ConfigId && c.Access === 'Y'
|
||||||
label: c.ConfigName,
|
)?.map((c) => c.ConfigId) || []
|
||||||
access: c.Access
|
);
|
||||||
})) || []);
|
setTableFieldPreferences(
|
||||||
|
response?.data?.data?.[0]?.ConfigDtl?.map((c) => ({
|
||||||
|
value: c.ConfigId,
|
||||||
|
label: c.ConfigName,
|
||||||
|
access: c.Access,
|
||||||
|
})) || []
|
||||||
|
);
|
||||||
setFieldValues(response?.data?.data?.[0]?.ConfigDtl);
|
setFieldValues(response?.data?.data?.[0]?.ConfigDtl);
|
||||||
} else {
|
} else {
|
||||||
setMessageType("error");
|
setMessageType('error');
|
||||||
setMessageData("Failed to fetch field setup");
|
setMessageData('Failed to fetch field setup');
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error fetching field setup:', error);
|
console.error('Error fetching field setup:', error);
|
||||||
|
|
@ -131,7 +154,7 @@ const StockExcel = ({
|
||||||
|
|
||||||
slicedData.forEach((item, index) => {
|
slicedData.forEach((item, index) => {
|
||||||
// Skip empty rows
|
// Skip empty rows
|
||||||
if (!item || Object.values(item).every(val => !val)) return;
|
if (!item || Object.values(item).every((val) => !val)) return;
|
||||||
|
|
||||||
const rowData = {
|
const rowData = {
|
||||||
key: index,
|
key: index,
|
||||||
|
|
@ -164,8 +187,10 @@ const StockExcel = ({
|
||||||
if (String(supplierValue).trim() === 'Self') {
|
if (String(supplierValue).trim() === 'Self') {
|
||||||
rowData.OwnWithPaid = item['2'];
|
rowData.OwnWithPaid = item['2'];
|
||||||
// Shift all subsequent columns by 1
|
// Shift all subsequent columns by 1
|
||||||
Object.keys(rowData).forEach(key => {
|
Object.keys(rowData).forEach((key) => {
|
||||||
if (!['key', 'InwardDate', 'Supplier', 'OwnWithPaid'].includes(key)) {
|
if (
|
||||||
|
!['key', 'InwardDate', 'Supplier', 'OwnWithPaid'].includes(key)
|
||||||
|
) {
|
||||||
const currentIndex = parseInt(Object.keys(rowData).indexOf(key));
|
const currentIndex = parseInt(Object.keys(rowData).indexOf(key));
|
||||||
rowData[key] = item[currentIndex.toString()];
|
rowData[key] = item[currentIndex.toString()];
|
||||||
}
|
}
|
||||||
|
|
@ -182,18 +207,26 @@ const StockExcel = ({
|
||||||
{ key: 'BatchNo', header: 'Batch No.' },
|
{ key: 'BatchNo', header: 'Batch No.' },
|
||||||
{ key: 'ModelNo', header: 'Model No.' },
|
{ key: 'ModelNo', header: 'Model No.' },
|
||||||
{ key: 'RejectedQty', header: 'Rejected Qty' },
|
{ key: 'RejectedQty', header: 'Rejected Qty' },
|
||||||
{ key: 'FreeQty', header: 'Free Qty' }
|
{ key: 'FreeQty', header: 'Free Qty' },
|
||||||
|
{ key: 'WholesalePrice', header: 'Wholesale Price' },
|
||||||
];
|
];
|
||||||
|
|
||||||
// Get headers from first row to determine which optional fields exist
|
// Get headers from first row to determine which optional fields exist
|
||||||
const headers = excelData[0];
|
const headers = excelData[0];
|
||||||
optionalFields.forEach(field => {
|
optionalFields.forEach((field) => {
|
||||||
if (headers.includes(field.header)) {
|
if (headers.includes(field.header)) {
|
||||||
rowData[field.key] = item[currentColIndex.toString()];
|
rowData[field.key] = item[currentColIndex.toString()];
|
||||||
currentColIndex++;
|
currentColIndex++;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (rowData?.Amount && rowData?.MRP && rowData?.SalesPrice && rowData?.ProductName && rowData?.PaymentAmount) {
|
if (
|
||||||
|
rowData?.PurchaseRate &&
|
||||||
|
rowData?.Amount &&
|
||||||
|
rowData?.MRP &&
|
||||||
|
rowData?.SalesPrice &&
|
||||||
|
rowData?.ProductName &&
|
||||||
|
rowData?.PaymentAmount
|
||||||
|
) {
|
||||||
ExcelToJsConversion.push(rowData);
|
ExcelToJsConversion.push(rowData);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -292,12 +325,17 @@ const StockExcel = ({
|
||||||
// ...existing code...
|
// ...existing code...
|
||||||
const handleDownload = async () => {
|
const handleDownload = async () => {
|
||||||
try {
|
try {
|
||||||
if (!supplierProducts || supplierProducts.length === 0 || !selectedSupplierData) {
|
if (
|
||||||
|
!supplierProducts ||
|
||||||
|
supplierProducts.length === 0 ||
|
||||||
|
!selectedSupplierData
|
||||||
|
) {
|
||||||
setMessageData('No products available to generate Excel.');
|
setMessageData('No products available to generate Excel.');
|
||||||
setMessageType('warning');
|
setMessageType('warning');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const supplierDisplayName = getSupplierDisplayName(selectedSupplierData) || 'Supplier';
|
const supplierDisplayName =
|
||||||
|
getSupplierDisplayName(selectedSupplierData) || 'Supplier';
|
||||||
// Fetch excelColumns config (optional fields access)
|
// Fetch excelColumns config (optional fields access)
|
||||||
let excelColumns = [];
|
let excelColumns = [];
|
||||||
try {
|
try {
|
||||||
|
|
@ -314,12 +352,17 @@ const StockExcel = ({
|
||||||
excelColumns = response?.data?.data?.[0]?.ConfigDtl || [];
|
excelColumns = response?.data?.data?.[0]?.ConfigDtl || [];
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.warn('Failed to fetch excelColumns config, proceeding with defaults', err);
|
console.warn(
|
||||||
|
'Failed to fetch excelColumns config, proceeding with defaults',
|
||||||
|
err
|
||||||
|
);
|
||||||
excelColumns = [];
|
excelColumns = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
const isOptionalFieldAllowed = (name) => {
|
const isOptionalFieldAllowed = (name) => {
|
||||||
const found = excelColumns.find((c) => String(c.ConfigName).trim() === String(name).trim());
|
const found = excelColumns.find(
|
||||||
|
(c) => String(c.ConfigName).trim() === String(name).trim()
|
||||||
|
);
|
||||||
return found ? found.Access === 'Y' : false;
|
return found ? found.Access === 'Y' : false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -331,7 +374,7 @@ const StockExcel = ({
|
||||||
allowBlank: allowBlank,
|
allowBlank: allowBlank,
|
||||||
showErrorMessage: true,
|
showErrorMessage: true,
|
||||||
errorTitle: 'Invalid Number',
|
errorTitle: 'Invalid Number',
|
||||||
error: 'Please enter a valid number'
|
error: 'Please enter a valid number',
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -374,12 +417,20 @@ const StockExcel = ({
|
||||||
pushCol('Amount Per Piece', 'AmountPerPiece', true);
|
pushCol('Amount Per Piece', 'AmountPerPiece', true);
|
||||||
pushCol('Number of Piece Inside', 'NumberofPieceInside', true);
|
pushCol('Number of Piece Inside', 'NumberofPieceInside', true);
|
||||||
|
|
||||||
if (isOptionalFieldAllowed('Manufacture Date')) pushCol('Manufacture Date', 'ManufDate', false);
|
if (isOptionalFieldAllowed('Manufacture Date'))
|
||||||
if (isOptionalFieldAllowed('Expire Date')) pushCol('Expire Date', 'ExpDate', false);
|
pushCol('Manufacture Date', 'ManufDate', false);
|
||||||
if (isOptionalFieldAllowed('Batch No.')) pushCol('Batch No.', 'BatchNo', false);
|
if (isOptionalFieldAllowed('Expire Date'))
|
||||||
if (isOptionalFieldAllowed('Model No.')) pushCol('Model No.', 'ModelNo', false);
|
pushCol('Expire Date', 'ExpDate', false);
|
||||||
if (isOptionalFieldAllowed('Rejected Qty')) pushCol('Rejected Qty', 'RejectedQty', false);
|
if (isOptionalFieldAllowed('Batch No.'))
|
||||||
if (isOptionalFieldAllowed('Free Qty')) pushCol('Free Qty', 'FreeQty', false);
|
pushCol('Batch No.', 'BatchNo', false);
|
||||||
|
if (isOptionalFieldAllowed('Model No.'))
|
||||||
|
pushCol('Model No.', 'ModelNo', false);
|
||||||
|
if (isOptionalFieldAllowed('Rejected Qty'))
|
||||||
|
pushCol('Rejected Qty', 'RejectedQty', false);
|
||||||
|
if (isOptionalFieldAllowed('Free Qty'))
|
||||||
|
pushCol('Free Qty', 'FreeQty', false);
|
||||||
|
if (isOptionalFieldAllowed('Wholesale Price'))
|
||||||
|
pushCol('Wholesale Price', 'WholesalePrice', false);
|
||||||
|
|
||||||
worksheet.columns = columns.map((c) => ({
|
worksheet.columns = columns.map((c) => ({
|
||||||
header: c.header,
|
header: c.header,
|
||||||
|
|
@ -388,7 +439,11 @@ const StockExcel = ({
|
||||||
c.key === 'ProdName' || c.key === 'VariantName'
|
c.key === 'ProdName' || c.key === 'VariantName'
|
||||||
? 40
|
? 40
|
||||||
: c.key === 'Quantity'
|
: c.key === 'Quantity'
|
||||||
? 10 : c.key === 'Supplier' || c.key === 'InvoiceDeliveryChallan' || c.key === 'SupplierInvoiceNumber' ? 30
|
? 10
|
||||||
|
: c.key === 'Supplier' ||
|
||||||
|
c.key === 'InvoiceDeliveryChallan' ||
|
||||||
|
c.key === 'SupplierInvoiceNumber'
|
||||||
|
? 30
|
||||||
: 20,
|
: 20,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
@ -410,12 +465,21 @@ const StockExcel = ({
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
hiddenSheet.addRow(['ProductName', 'VariantName', 'MRP', 'SellPrice', 'Number of Piece Inside', 'Amount Per Piece']);
|
hiddenSheet.addRow([
|
||||||
|
'ProductName',
|
||||||
|
'VariantName',
|
||||||
|
'MRP',
|
||||||
|
'SellPrice',
|
||||||
|
'Number of Piece Inside',
|
||||||
|
'Amount Per Piece',
|
||||||
|
]);
|
||||||
let currentRow = 2;
|
let currentRow = 2;
|
||||||
const productNames = supplierProducts.map((p) => p.ProdName);
|
const productNames = supplierProducts.map((p) => p.ProdName);
|
||||||
|
|
||||||
supplierProducts.forEach((product) => {
|
supplierProducts.forEach((product) => {
|
||||||
const activeVariants = (product.ProdVariantPriceDetails || []).filter(v => v.ActiveStatus === 'A');
|
const activeVariants = (product.ProdVariantPriceDetails || []).filter(
|
||||||
|
(v) => v.ActiveStatus === 'A'
|
||||||
|
);
|
||||||
const uniqueVariantsMap = new Map();
|
const uniqueVariantsMap = new Map();
|
||||||
activeVariants.forEach((variant) => {
|
activeVariants.forEach((variant) => {
|
||||||
const variantName = variant.ProdVariantName;
|
const variantName = variant.ProdVariantName;
|
||||||
|
|
@ -442,7 +506,8 @@ const StockExcel = ({
|
||||||
.trim()
|
.trim()
|
||||||
.replace(/[^A-Za-z0-9_]/g, '_')
|
.replace(/[^A-Za-z0-9_]/g, '_')
|
||||||
.replace(/^(\d)/, '_$1');
|
.replace(/^(\d)/, '_$1');
|
||||||
if (!safeName) safeName = `Product_${Math.random().toString(36).slice(2, 8)}`;
|
if (!safeName)
|
||||||
|
safeName = `Product_${Math.random().toString(36).slice(2, 8)}`;
|
||||||
const rangeRef = `ProductVariantMap!$B$${startRow}:$B$${endRow}`;
|
const rangeRef = `ProductVariantMap!$B$${startRow}:$B$${endRow}`;
|
||||||
try {
|
try {
|
||||||
workbook.definedNames.add(rangeRef, safeName);
|
workbook.definedNames.add(rangeRef, safeName);
|
||||||
|
|
@ -452,10 +517,41 @@ const StockExcel = ({
|
||||||
});
|
});
|
||||||
|
|
||||||
const startDataRow = 2;
|
const startDataRow = 2;
|
||||||
const numberOfRows = 50;
|
const today = new Date();
|
||||||
for (let i = 0; i < numberOfRows; i++) {
|
|
||||||
worksheet.addRow({});
|
// Pre-populate all products and variants as rows
|
||||||
}
|
supplierProducts.forEach((product) => {
|
||||||
|
const activeVariants = (product.ProdVariantPriceDetails || []).filter(
|
||||||
|
(v) => v.ActiveStatus === 'A'
|
||||||
|
);
|
||||||
|
const uniqueVariantsMap = new Map();
|
||||||
|
activeVariants.forEach((variant) => {
|
||||||
|
const variantName = variant.ProdVariantName;
|
||||||
|
if (!uniqueVariantsMap.has(variantName)) {
|
||||||
|
uniqueVariantsMap.set(variantName, variant);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const uniqueVariants = Array.from(uniqueVariantsMap.values());
|
||||||
|
|
||||||
|
uniqueVariants.forEach((variant) => {
|
||||||
|
const rowData = {
|
||||||
|
InwardDate: today,
|
||||||
|
Supplier: supplierDisplayName,
|
||||||
|
ProdName: product.ProdName,
|
||||||
|
VariantName: variant.ProdVariantName,
|
||||||
|
MRP: variant.MRP || 0,
|
||||||
|
SalesPrice: variant.SellPrice || 0,
|
||||||
|
NumberofPieceInside: variant.NoOfPcs || 0,
|
||||||
|
AmountPerPiece: variant.OnePcsPrice || 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
if (String(selectedSupplierData?.SuppName).trim() === 'Self') {
|
||||||
|
rowData.OwnWithPaid = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
worksheet.addRow(rowData);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
const colKeyToIndex = {};
|
const colKeyToIndex = {};
|
||||||
worksheet.columns.forEach((c, idx) => {
|
worksheet.columns.forEach((c, idx) => {
|
||||||
|
|
@ -473,47 +569,19 @@ const StockExcel = ({
|
||||||
return s;
|
return s;
|
||||||
};
|
};
|
||||||
|
|
||||||
const today = new Date();
|
|
||||||
const inwardDateCol = colIndex('InwardDate');
|
const inwardDateCol = colIndex('InwardDate');
|
||||||
if (inwardDateCol) {
|
const numberOfRows = worksheet.rowCount;
|
||||||
const cell = worksheet.getCell(`${colLetter(inwardDateCol)}${startDataRow}`);
|
|
||||||
cell.value = today;
|
|
||||||
cell.numFmt = 'yyyy-mm-dd';
|
|
||||||
}
|
|
||||||
|
|
||||||
const supplierName = selectedSupplierData?.SuppName || '';
|
for (let r = startDataRow; r <= numberOfRows; r++) {
|
||||||
const productNamesLiteral = productNames.join(',');
|
|
||||||
|
|
||||||
for (let r = startDataRow; r < startDataRow + numberOfRows; r++) {
|
|
||||||
if (colIndex('ProdName')) {
|
if (colIndex('ProdName')) {
|
||||||
const cIdx = colIndex('ProdName');
|
const cIdx = colIndex('ProdName');
|
||||||
const letter = colLetter(cIdx);
|
const cell = worksheet.getCell(r, cIdx);
|
||||||
const prodCellRef = `${letter}${r}`;
|
cell.protection = { locked: true };
|
||||||
const cell = worksheet.getCell(prodCellRef);
|
|
||||||
cell.dataValidation = {
|
|
||||||
type: 'list',
|
|
||||||
allowBlank: false,
|
|
||||||
formulae: [`"${productNamesLiteral}"`],
|
|
||||||
};
|
|
||||||
cell.protection = { locked: false };
|
|
||||||
}
|
}
|
||||||
if (colIndex('VariantName')) {
|
if (colIndex('VariantName')) {
|
||||||
const cIdx = colIndex('VariantName');
|
const cIdx = colIndex('VariantName');
|
||||||
const letter = colLetter(cIdx);
|
const cell = worksheet.getCell(r, cIdx);
|
||||||
const varCellRef = `${letter}${r}`;
|
cell.protection = { locked: true };
|
||||||
const productColLetter = colLetter(colIndex('ProdName'));
|
|
||||||
const productCellRef = `${productColLetter}${r}`;
|
|
||||||
const formula = `INDIRECT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(${productCellRef}," ","_"),"-","_"),"&","_"),"/","_"),".","_"),"(","_"),")","_"),"[","_"),"]","_"),",","_"))`;
|
|
||||||
const cell = worksheet.getCell(varCellRef);
|
|
||||||
cell.dataValidation = {
|
|
||||||
type: 'list',
|
|
||||||
allowBlank: true,
|
|
||||||
formulae: [formula],
|
|
||||||
showErrorMessage: true,
|
|
||||||
errorTitle: 'Invalid Variant',
|
|
||||||
error: 'Please select a variant from the dropdown'
|
|
||||||
};
|
|
||||||
cell.protection = { locked: false };
|
|
||||||
}
|
}
|
||||||
if (colIndex('Quantity')) {
|
if (colIndex('Quantity')) {
|
||||||
const cIdx = colIndex('Quantity');
|
const cIdx = colIndex('Quantity');
|
||||||
|
|
@ -544,7 +612,8 @@ const StockExcel = ({
|
||||||
error: 'Must be a valid number and less than total quantity',
|
error: 'Must be a valid number and less than total quantity',
|
||||||
showInputMessage: true,
|
showInputMessage: true,
|
||||||
promptTitle: 'Rejected Qty',
|
promptTitle: 'Rejected Qty',
|
||||||
prompt: 'Enter rejected quantity (must be less than total quantity)'
|
prompt:
|
||||||
|
'Enter rejected quantity (must be less than total quantity)',
|
||||||
};
|
};
|
||||||
rejCell.protection = { locked: false };
|
rejCell.protection = { locked: false };
|
||||||
}
|
}
|
||||||
|
|
@ -565,31 +634,55 @@ const StockExcel = ({
|
||||||
formulae: [new Date(1900, 0, 1)],
|
formulae: [new Date(1900, 0, 1)],
|
||||||
showErrorMessage: true,
|
showErrorMessage: true,
|
||||||
errorTitle: 'Invalid Date',
|
errorTitle: 'Invalid Date',
|
||||||
error: 'Please enter a valid date'
|
error: 'Please enter a valid date',
|
||||||
};
|
};
|
||||||
dCell.protection = { locked: false };
|
dCell.protection = { locked: false };
|
||||||
}
|
}
|
||||||
if (colIndex('Supplier')) {
|
if (colIndex('Supplier')) {
|
||||||
const cIdx = colIndex('Supplier');
|
const cIdx = colIndex('Supplier');
|
||||||
const cell = worksheet.getCell(r, cIdx);
|
const cell = worksheet.getCell(r, cIdx);
|
||||||
cell.dataValidation = { type: 'list', formulae: [`"${supplierDisplayName}"`] };
|
cell.protection = { locked: true };
|
||||||
cell.value = supplierDisplayName;
|
|
||||||
cell.protection = { locked: false };
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (colIndex('OwnWithPaid')) {
|
if (colIndex('OwnWithPaid')) {
|
||||||
const cIdx = colIndex('OwnWithPaid');
|
const cIdx = colIndex('OwnWithPaid');
|
||||||
const cell = worksheet.getCell(r, cIdx);
|
const cell = worksheet.getCell(r, cIdx);
|
||||||
cell.dataValidation = { type: 'list', formulae: ['"Own,With Paid"'] };
|
|
||||||
|
cell.dataValidation = {
|
||||||
|
type: 'list',
|
||||||
|
formulae: ['"Own,With Paid"'],
|
||||||
|
allowBlank: true
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!cell.value) {
|
||||||
|
cell.value = 'Own';
|
||||||
|
}
|
||||||
|
|
||||||
cell.protection = { locked: false };
|
cell.protection = { locked: false };
|
||||||
}
|
}
|
||||||
|
|
||||||
if (colIndex('InvoiceDeliveryChallan')) {
|
if (colIndex('InvoiceDeliveryChallan')) {
|
||||||
const cIdx = colIndex('InvoiceDeliveryChallan');
|
const cIdx = colIndex('InvoiceDeliveryChallan');
|
||||||
const cell = worksheet.getCell(r, cIdx);
|
const cell = worksheet.getCell(r, cIdx);
|
||||||
cell.dataValidation = { type: 'list', formulae: ['"Invoice,Delivery Challan"'] };
|
|
||||||
|
cell.dataValidation = {
|
||||||
|
type: 'list',
|
||||||
|
formulae: ['"Invoice,Delivery Challan"'],
|
||||||
|
allowBlank: true,
|
||||||
|
};
|
||||||
|
|
||||||
|
// ✅ Default value
|
||||||
|
if (!cell.value) {
|
||||||
|
cell.value = 'Invoice';
|
||||||
|
}
|
||||||
|
|
||||||
cell.protection = { locked: false };
|
cell.protection = { locked: false };
|
||||||
}
|
}
|
||||||
|
|
||||||
if (colIndex('SupplierInvoiceNumber')) {
|
if (colIndex('SupplierInvoiceNumber')) {
|
||||||
worksheet.getCell(r, colIndex('SupplierInvoiceNumber')).protection = { locked: false };
|
worksheet.getCell(r, colIndex('SupplierInvoiceNumber')).protection = {
|
||||||
|
locked: false,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
if (colIndex('SupplierInvoiceDate')) {
|
if (colIndex('SupplierInvoiceDate')) {
|
||||||
const cell = worksheet.getCell(r, colIndex('SupplierInvoiceDate'));
|
const cell = worksheet.getCell(r, colIndex('SupplierInvoiceDate'));
|
||||||
|
|
@ -601,12 +694,14 @@ const StockExcel = ({
|
||||||
formulae: [new Date(1900, 0, 1)],
|
formulae: [new Date(1900, 0, 1)],
|
||||||
showErrorMessage: true,
|
showErrorMessage: true,
|
||||||
errorTitle: 'Invalid Date',
|
errorTitle: 'Invalid Date',
|
||||||
error: 'Please enter a valid date'
|
error: 'Please enter a valid date',
|
||||||
};
|
};
|
||||||
cell.protection = { locked: false };
|
cell.protection = { locked: false };
|
||||||
}
|
}
|
||||||
if (colIndex('DeliveryChallanNo')) {
|
if (colIndex('DeliveryChallanNo')) {
|
||||||
worksheet.getCell(r, colIndex('DeliveryChallanNo')).protection = { locked: false };
|
worksheet.getCell(r, colIndex('DeliveryChallanNo')).protection = {
|
||||||
|
locked: false,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
if (colIndex('DeliveryInvoiceDate')) {
|
if (colIndex('DeliveryInvoiceDate')) {
|
||||||
const cell = worksheet.getCell(r, colIndex('DeliveryInvoiceDate'));
|
const cell = worksheet.getCell(r, colIndex('DeliveryInvoiceDate'));
|
||||||
|
|
@ -618,63 +713,33 @@ const StockExcel = ({
|
||||||
formulae: [new Date(1900, 0, 1)],
|
formulae: [new Date(1900, 0, 1)],
|
||||||
showErrorMessage: true,
|
showErrorMessage: true,
|
||||||
errorTitle: 'Invalid Date',
|
errorTitle: 'Invalid Date',
|
||||||
error: 'Please enter a valid date'
|
error: 'Please enter a valid date',
|
||||||
};
|
};
|
||||||
cell.protection = { locked: false };
|
cell.protection = { locked: false };
|
||||||
}
|
}
|
||||||
if (colIndex('MRP')) {
|
if (colIndex('MRP')) {
|
||||||
const mrpCol = colIndex('MRP');
|
const mrpCol = colIndex('MRP');
|
||||||
const prodCol = colIndex('ProdName');
|
|
||||||
const varCol = colIndex('VariantName');
|
|
||||||
const mrpCell = worksheet.getCell(r, mrpCol);
|
const mrpCell = worksheet.getCell(r, mrpCol);
|
||||||
const prodLetter = colLetter(prodCol);
|
|
||||||
const varLetter = colLetter(varCol);
|
|
||||||
mrpCell.value = {
|
|
||||||
formula: `IF(OR(${prodLetter}${r}="",${varLetter}${r}=""),"",SUMPRODUCT((ProductVariantMap!$A$2:$A$1000=${prodLetter}${r})*(ProductVariantMap!$B$2:$B$1000=${varLetter}${r})*ProductVariantMap!$C$2:$C$1000))`
|
|
||||||
};
|
|
||||||
mrpCell.numFmt = '#,##0.00';
|
mrpCell.numFmt = '#,##0.00';
|
||||||
mrpCell.protection = { locked: false };
|
mrpCell.protection = { locked: false };
|
||||||
addNumberValidation(mrpCell, true, 0);
|
|
||||||
}
|
}
|
||||||
if (colIndex('SalesPrice')) {
|
if (colIndex('SalesPrice')) {
|
||||||
const spCol = colIndex('SalesPrice');
|
const spCol = colIndex('SalesPrice');
|
||||||
const prodCol = colIndex('ProdName');
|
|
||||||
const varCol = colIndex('VariantName');
|
|
||||||
const spCell = worksheet.getCell(r, spCol);
|
const spCell = worksheet.getCell(r, spCol);
|
||||||
const prodLetter = colLetter(prodCol);
|
|
||||||
const varLetter = colLetter(varCol);
|
|
||||||
spCell.value = {
|
|
||||||
formula: `IF(OR(${prodLetter}${r}="",${varLetter}${r}=""),"",SUMPRODUCT((ProductVariantMap!$A$2:$A$1000=${prodLetter}${r})*(ProductVariantMap!$B$2:$B$1000=${varLetter}${r})*ProductVariantMap!$D$2:$D$1000))`
|
|
||||||
};
|
|
||||||
spCell.numFmt = '#,##0.00';
|
spCell.numFmt = '#,##0.00';
|
||||||
spCell.protection = { locked: false };
|
spCell.protection = { locked: false };
|
||||||
addNumberValidation(spCell, true, 0);
|
|
||||||
}
|
}
|
||||||
if (colIndex('NumberofPieceInside')) {
|
if (colIndex('NumberofPieceInside')) {
|
||||||
const nopCol = colIndex('NumberofPieceInside');
|
const nopCol = colIndex('NumberofPieceInside');
|
||||||
const prodCol = colIndex('ProdName');
|
|
||||||
const varCol = colIndex('VariantName');
|
|
||||||
const nopCell = worksheet.getCell(r, nopCol);
|
const nopCell = worksheet.getCell(r, nopCol);
|
||||||
const prodLetter = colLetter(prodCol);
|
|
||||||
const varLetter = colLetter(varCol);
|
|
||||||
nopCell.value = {
|
|
||||||
formula: `IF(OR(${prodLetter}${r}="",${varLetter}${r}=""),"",SUMPRODUCT((ProductVariantMap!$A$2:$A$1000=${prodLetter}${r})*(ProductVariantMap!$B$2:$B$1000=${varLetter}${r})*ProductVariantMap!$E$2:$E$1000))`
|
|
||||||
};
|
|
||||||
nopCell.numFmt = '#,##0';
|
nopCell.numFmt = '#,##0';
|
||||||
addNumberValidation(nopCell, true, 0);
|
nopCell.protection = { locked: false };
|
||||||
}
|
}
|
||||||
if (colIndex('AmountPerPiece')) {
|
if (colIndex('AmountPerPiece')) {
|
||||||
const appCol = colIndex('AmountPerPiece');
|
const appCol = colIndex('AmountPerPiece');
|
||||||
const prodCol = colIndex('ProdName');
|
|
||||||
const varCol = colIndex('VariantName');
|
|
||||||
const appCell = worksheet.getCell(r, appCol);
|
const appCell = worksheet.getCell(r, appCol);
|
||||||
const prodLetter = colLetter(prodCol);
|
|
||||||
const varLetter = colLetter(varCol);
|
|
||||||
appCell.value = {
|
|
||||||
formula: `IF(OR(${prodLetter}${r}="",${varLetter}${r}=""),"",SUMPRODUCT((ProductVariantMap!$A$2:$A$1000=${prodLetter}${r})*(ProductVariantMap!$B$2:$B$1000=${varLetter}${r})*ProductVariantMap!$F$2:$F$1000))`
|
|
||||||
};
|
|
||||||
appCell.numFmt = '#,##0.00';
|
appCell.numFmt = '#,##0.00';
|
||||||
addNumberValidation(appCell, true, 0);
|
appCell.protection = { locked: false };
|
||||||
}
|
}
|
||||||
if (colIndex('PaymentType')) {
|
if (colIndex('PaymentType')) {
|
||||||
const cIdx = colIndex('PaymentType');
|
const cIdx = colIndex('PaymentType');
|
||||||
|
|
@ -708,13 +773,16 @@ const StockExcel = ({
|
||||||
pmCell.dataValidation = {
|
pmCell.dataValidation = {
|
||||||
type: 'list',
|
type: 'list',
|
||||||
allowBlank: true,
|
allowBlank: true,
|
||||||
formulae: [`IF(${paymentTypeLetter}${r}="Paid",ValidationHelper!$A$1:$A$3,"")`],
|
formulae: [
|
||||||
|
`IF(${paymentTypeLetter}${r}="Paid",ValidationHelper!$A$1:$A$3,"")`,
|
||||||
|
],
|
||||||
showErrorMessage: true,
|
showErrorMessage: true,
|
||||||
errorTitle: 'Invalid Payment Mode',
|
errorTitle: 'Invalid Payment Mode',
|
||||||
error: 'Select Cash, Credit, or UPI when Payment Type is Paid',
|
error: 'Select Cash, Credit, or UPI when Payment Type is Paid',
|
||||||
showInputMessage: true,
|
showInputMessage: true,
|
||||||
promptTitle: 'Payment Mode',
|
promptTitle: 'Payment Mode',
|
||||||
prompt: 'If Payment Type is Credit, leave empty. If Paid, select: Cash, Credit, or UPI'
|
prompt:
|
||||||
|
'If Payment Type is Credit, leave empty. If Paid, select: Cash, Credit, or UPI',
|
||||||
};
|
};
|
||||||
pmCell.protection = { locked: false };
|
pmCell.protection = { locked: false };
|
||||||
}
|
}
|
||||||
|
|
@ -729,7 +797,7 @@ const StockExcel = ({
|
||||||
formulae: [new Date(1900, 0, 1)],
|
formulae: [new Date(1900, 0, 1)],
|
||||||
showErrorMessage: true,
|
showErrorMessage: true,
|
||||||
errorTitle: 'Invalid Date',
|
errorTitle: 'Invalid Date',
|
||||||
error: 'Please enter a valid date'
|
error: 'Please enter a valid date',
|
||||||
};
|
};
|
||||||
dueCell.protection = { locked: false };
|
dueCell.protection = { locked: false };
|
||||||
}
|
}
|
||||||
|
|
@ -744,7 +812,7 @@ const StockExcel = ({
|
||||||
formulae: [new Date(1900, 0, 1)],
|
formulae: [new Date(1900, 0, 1)],
|
||||||
showErrorMessage: true,
|
showErrorMessage: true,
|
||||||
errorTitle: 'Invalid Date',
|
errorTitle: 'Invalid Date',
|
||||||
error: 'Please enter a valid date'
|
error: 'Please enter a valid date',
|
||||||
};
|
};
|
||||||
manufCell.protection = { locked: false };
|
manufCell.protection = { locked: false };
|
||||||
}
|
}
|
||||||
|
|
@ -759,7 +827,7 @@ const StockExcel = ({
|
||||||
formulae: [new Date(1900, 0, 1)],
|
formulae: [new Date(1900, 0, 1)],
|
||||||
showErrorMessage: true,
|
showErrorMessage: true,
|
||||||
errorTitle: 'Invalid Date',
|
errorTitle: 'Invalid Date',
|
||||||
error: 'Please enter a valid date'
|
error: 'Please enter a valid date',
|
||||||
};
|
};
|
||||||
expCell.protection = { locked: false };
|
expCell.protection = { locked: false };
|
||||||
}
|
}
|
||||||
|
|
@ -769,7 +837,9 @@ const StockExcel = ({
|
||||||
const rLetter = colLetter(rIdx);
|
const rLetter = colLetter(rIdx);
|
||||||
const qLetter = colLetter(qIdx);
|
const qLetter = colLetter(qIdx);
|
||||||
const recCell = worksheet.getCell(`${rLetter}${r}`);
|
const recCell = worksheet.getCell(`${rLetter}${r}`);
|
||||||
recCell.value = { formula: `IF(${qLetter}${r}="","",${qLetter}${r})` };
|
recCell.value = {
|
||||||
|
formula: `IF(${qLetter}${r}="","",${qLetter}${r})`,
|
||||||
|
};
|
||||||
addNumberValidation(recCell, true, 0);
|
addNumberValidation(recCell, true, 0);
|
||||||
}
|
}
|
||||||
if (colIndex('AcceptedQty') && colIndex('Quantity')) {
|
if (colIndex('AcceptedQty') && colIndex('Quantity')) {
|
||||||
|
|
@ -782,15 +852,21 @@ const StockExcel = ({
|
||||||
const formulaCell = worksheet.getCell(`${aLetter}${r}`);
|
const formulaCell = worksheet.getCell(`${aLetter}${r}`);
|
||||||
if (rejLetter) {
|
if (rejLetter) {
|
||||||
formulaCell.value = {
|
formulaCell.value = {
|
||||||
formula: `IF(${qLetter}${r}="","",MAX(0,${qLetter}${r}-IF(${rejLetter}${r}="",0,${rejLetter}${r})))`
|
formula: `IF(${qLetter}${r}="","",MAX(0,${qLetter}${r}-IF(${rejLetter}${r}="",0,${rejLetter}${r})))`,
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
formulaCell.value = { formula: `IF(${qLetter}${r}="","",${qLetter}${r})` };
|
formulaCell.value = {
|
||||||
|
formula: `IF(${qLetter}${r}="","",${qLetter}${r})`,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
addNumberValidation(formulaCell, true, 0);
|
addNumberValidation(formulaCell, true, 0);
|
||||||
formulaCell.protection = { locked: true };
|
formulaCell.protection = { locked: true };
|
||||||
}
|
}
|
||||||
if (colIndex('PaymentAmount') && colIndex('Quantity') && colIndex('PurchaseRate')) {
|
if (
|
||||||
|
colIndex('PaymentAmount') &&
|
||||||
|
colIndex('Quantity') &&
|
||||||
|
colIndex('PurchaseRate')
|
||||||
|
) {
|
||||||
const payIdx = colIndex('PaymentAmount');
|
const payIdx = colIndex('PaymentAmount');
|
||||||
const qIdx = colIndex('Quantity');
|
const qIdx = colIndex('Quantity');
|
||||||
const pIdx = colIndex('PurchaseRate');
|
const pIdx = colIndex('PurchaseRate');
|
||||||
|
|
@ -812,7 +888,11 @@ const StockExcel = ({
|
||||||
formulaCell.numFmt = '#,##0.00';
|
formulaCell.numFmt = '#,##0.00';
|
||||||
addNumberValidation(formulaCell, true, 0);
|
addNumberValidation(formulaCell, true, 0);
|
||||||
}
|
}
|
||||||
if (colIndex('Amount') && colIndex('Quantity') && colIndex('PurchaseRate')) {
|
if (
|
||||||
|
colIndex('Amount') &&
|
||||||
|
colIndex('Quantity') &&
|
||||||
|
colIndex('PurchaseRate')
|
||||||
|
) {
|
||||||
const amtIdx = colIndex('Amount');
|
const amtIdx = colIndex('Amount');
|
||||||
const qIdx = colIndex('Quantity');
|
const qIdx = colIndex('Quantity');
|
||||||
const pIdx = colIndex('PurchaseRate');
|
const pIdx = colIndex('PurchaseRate');
|
||||||
|
|
@ -827,11 +907,21 @@ const StockExcel = ({
|
||||||
formula: `IF(${qLetter}${r}="","",IF(${rejLetter}${r}="",(${qLetter}${r})*${pLetter}${r},(${qLetter}${r}-${rejLetter}${r})*${pLetter}${r}))`,
|
formula: `IF(${qLetter}${r}="","",IF(${rejLetter}${r}="",(${qLetter}${r})*${pLetter}${r},(${qLetter}${r}-${rejLetter}${r})*${pLetter}${r}))`,
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
amtCell.value = { formula: `IF(${qLetter}${r}="","",(${qLetter}${r})*${pLetter}${r})` };
|
amtCell.value = {
|
||||||
|
formula: `IF(${qLetter}${r}="","",(${qLetter}${r})*${pLetter}${r})`,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
amtCell.numFmt = '#,##0.00';
|
amtCell.numFmt = '#,##0.00';
|
||||||
addNumberValidation(amtCell, true, 0);
|
addNumberValidation(amtCell, true, 0);
|
||||||
}
|
}
|
||||||
|
if (colIndex('WholesalePrice')) {
|
||||||
|
const cIdx = colIndex('WholesalePrice');
|
||||||
|
const letter = colLetter(cIdx);
|
||||||
|
const cell = worksheet.getCell(`${letter}${r}`);
|
||||||
|
cell.protection = { locked: false };
|
||||||
|
cell.numFmt = '#,##0.00';
|
||||||
|
addNumberValidation(cell, true, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await worksheet.protect('', {
|
await worksheet.protect('', {
|
||||||
|
|
@ -1070,6 +1160,12 @@ const StockExcel = ({
|
||||||
key: 'FreeQty',
|
key: 'FreeQty',
|
||||||
editable: true,
|
editable: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: 'Wholesale Price',
|
||||||
|
dataIndex: 'WholesalePrice',
|
||||||
|
key: 'WholesalePrice',
|
||||||
|
editable: true,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const column = columns?.map((col) => {
|
const column = columns?.map((col) => {
|
||||||
|
|
@ -1205,7 +1301,7 @@ const StockExcel = ({
|
||||||
RetailPrice: row?.RetailPrice,
|
RetailPrice: row?.RetailPrice,
|
||||||
AmountperPiece: row?.AmountperPiece,
|
AmountperPiece: row?.AmountperPiece,
|
||||||
NumberofPieceInside: row?.NumberofPieceInside,
|
NumberofPieceInside: row?.NumberofPieceInside,
|
||||||
WholeSale: row?.WholeSale,
|
WholesalePrice: row?.WholesalePrice,
|
||||||
Offer: row?.Offer,
|
Offer: row?.Offer,
|
||||||
SplPrice: row?.SplPrice,
|
SplPrice: row?.SplPrice,
|
||||||
ReceivedQuantity: row?.ReceivedQuantity,
|
ReceivedQuantity: row?.ReceivedQuantity,
|
||||||
|
|
@ -1245,31 +1341,31 @@ const StockExcel = ({
|
||||||
|
|
||||||
const handleFieldSetupSubmit = async () => {
|
const handleFieldSetupSubmit = async () => {
|
||||||
const postData = {
|
const postData = {
|
||||||
"AppId": AppId,
|
AppId: AppId,
|
||||||
"CompId": CompId,
|
CompId: CompId,
|
||||||
"BranchId": BranchId,
|
BranchId: BranchId,
|
||||||
"Type": "EB",
|
Type: 'EB',
|
||||||
"FormType": "PurchaseEntry",
|
FormType: 'PurchaseEntry',
|
||||||
"TypeId": purchaseReceiptBulkUploadCatId,
|
TypeId: purchaseReceiptBulkUploadCatId,
|
||||||
"ConfigDtl": selectedFields?.map((field) => ({
|
ConfigDtl: selectedFields?.map((field) => ({
|
||||||
"ConfigId": field,
|
ConfigId: field,
|
||||||
"Access": 'Y',
|
Access: 'Y',
|
||||||
})),
|
})),
|
||||||
"CreatedBy": UserId
|
CreatedBy: UserId,
|
||||||
}
|
};
|
||||||
|
|
||||||
const response = await dispatch(postFieldSetup(postData))?.unwrap();
|
const response = await dispatch(postFieldSetup(postData))?.unwrap();
|
||||||
|
|
||||||
if (response?.data?.statusCode === 1) {
|
if (response?.data?.statusCode === 1) {
|
||||||
setMessageType("success");
|
setMessageType('success');
|
||||||
setMessageData(response?.data?.response);
|
setMessageData(response?.data?.response);
|
||||||
setFieldSetup(false);
|
setFieldSetup(false);
|
||||||
await getFieldSetup();
|
await getFieldSetup();
|
||||||
} else {
|
} else {
|
||||||
setMessageType("error");
|
setMessageType('error');
|
||||||
setMessageData("Failed to set up fields");
|
setMessageData('Failed to set up fields');
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
const handleFieldSelect = (value) => {
|
const handleFieldSelect = (value) => {
|
||||||
setSelectedFields((prev) => {
|
setSelectedFields((prev) => {
|
||||||
|
|
@ -1320,7 +1416,7 @@ const StockExcel = ({
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error fetching suppliers:', error);
|
console.error('Error fetching suppliers:', error);
|
||||||
setMessageData('Failed to fetch suppliers.');
|
setMessageData('Failed to fetch suppliers.');
|
||||||
setMessageType('error')
|
setMessageType('error');
|
||||||
}
|
}
|
||||||
}, [CompId, AppId, BranchId, dispatch]);
|
}, [CompId, AppId, BranchId, dispatch]);
|
||||||
|
|
||||||
|
|
@ -1331,14 +1427,22 @@ const StockExcel = ({
|
||||||
|
|
||||||
const type = supplierData.Type;
|
const type = supplierData.Type;
|
||||||
const LocationType =
|
const LocationType =
|
||||||
type === 'Supplier' ? 'S' : type === 'Branch' ? 'B' : type === 'WareHouse' ? 'W' : '';
|
type === 'Supplier'
|
||||||
|
? 'S'
|
||||||
|
: type === 'Branch'
|
||||||
|
? 'B'
|
||||||
|
: type === 'WareHouse'
|
||||||
|
? 'W'
|
||||||
|
: '';
|
||||||
|
|
||||||
const response = await dispatch(
|
const response = await dispatch(
|
||||||
getSupplaierIdwithTypeBasedProducts({
|
getSupplaierIdwithTypeBasedProducts({
|
||||||
CompId: LocationType === 'S' ? CompId : supplierData?.SuppCompId,
|
CompId: LocationType === 'S' ? CompId : supplierData?.SuppCompId,
|
||||||
AppId: LocationType === 'S' ? AppId : supplierData?.SuppAppId,
|
AppId: LocationType === 'S' ? AppId : supplierData?.SuppAppId,
|
||||||
BranchId: LocationType === 'S' ? BranchId : supplierData?.SuppBranchId,
|
BranchId:
|
||||||
SuppId: LocationType === 'S' ? supplierId : supplierData?.SuppBranchId,
|
LocationType === 'S' ? BranchId : supplierData?.SuppBranchId,
|
||||||
|
SuppId:
|
||||||
|
LocationType === 'S' ? supplierId : supplierData?.SuppBranchId,
|
||||||
LocationType,
|
LocationType,
|
||||||
})
|
})
|
||||||
)?.unwrap();
|
)?.unwrap();
|
||||||
|
|
@ -1349,25 +1453,24 @@ const StockExcel = ({
|
||||||
} else {
|
} else {
|
||||||
setSupplierProducts([]);
|
setSupplierProducts([]);
|
||||||
setMessageData('No products are mapped to this supplier.');
|
setMessageData('No products are mapped to this supplier.');
|
||||||
setMessageType('warning')
|
setMessageType('warning');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setSupplierProducts([]);
|
setSupplierProducts([]);
|
||||||
setMessageData('Failed to fetch supplier products.');
|
setMessageData('Failed to fetch supplier products.');
|
||||||
setMessageType('error')
|
setMessageType('error');
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error fetching supplier products:', error);
|
console.error('Error fetching supplier products:', error);
|
||||||
setMessageData('An error occurred while fetching products.');
|
setMessageData('An error occurred while fetching products.');
|
||||||
setMessageType('error')
|
setMessageType('error');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const handleSupplierBasedProducts = useCallback(async () => {
|
const handleSupplierBasedProducts = useCallback(async () => {
|
||||||
if (!selectedSupplier) {
|
if (!selectedSupplier) {
|
||||||
setMessageData('Please select a supplier.');
|
setMessageData('Please select a supplier.');
|
||||||
setMessageType('warning')
|
setMessageType('warning');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1400,19 +1503,25 @@ const StockExcel = ({
|
||||||
onSubmit={handleFileSubmit}
|
onSubmit={handleFileSubmit}
|
||||||
>
|
>
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
||||||
<div className='upload-excel-header'>
|
<div className="upload-excel-header">
|
||||||
<h3>UPLOAD YOUR EXCEL</h3>
|
<h3>UPLOAD YOUR EXCEL</h3>
|
||||||
<Tooltip title="Field Setup">
|
<Tooltip title="Field Setup">
|
||||||
<div className="btn btn--info" style={{
|
<div
|
||||||
background: "#00694aff",
|
className="btn btn--info"
|
||||||
color: "#fff",
|
style={{
|
||||||
display: "flex",
|
background: '#00694aff',
|
||||||
alignItems: "center",
|
color: '#fff',
|
||||||
justifyContent: "center",
|
display: 'flex',
|
||||||
padding: "5px 12px",
|
alignItems: 'center',
|
||||||
borderRadius: "4px",
|
justifyContent: 'center',
|
||||||
cursor: 'pointer'
|
padding: '5px 12px',
|
||||||
}} onClick={handleFieldSetup}><MdOutlineAppRegistration size={19} /></div>
|
borderRadius: '4px',
|
||||||
|
cursor: 'pointer',
|
||||||
|
}}
|
||||||
|
onClick={handleFieldSetup}
|
||||||
|
>
|
||||||
|
<MdOutlineAppRegistration size={19} />
|
||||||
|
</div>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -1549,7 +1658,9 @@ const StockExcel = ({
|
||||||
children={
|
children={
|
||||||
<div className="field-setup-container">
|
<div className="field-setup-container">
|
||||||
<div className="field-setup-header">
|
<div className="field-setup-header">
|
||||||
<FormHeader title={'Select the fields you want to include in the table'} />
|
<FormHeader
|
||||||
|
title={'Select the fields you want to include in the table'}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="field-setup-content">
|
<div className="field-setup-content">
|
||||||
<Form onFinish={handleFieldSetupSubmit} ref={formRef}>
|
<Form onFinish={handleFieldSetupSubmit} ref={formRef}>
|
||||||
|
|
@ -1558,11 +1669,16 @@ const StockExcel = ({
|
||||||
label="Select fields"
|
label="Select fields"
|
||||||
// valueData={selectedFields}
|
// valueData={selectedFields}
|
||||||
onChangeFunction={handleFieldSelect}
|
onChangeFunction={handleFieldSelect}
|
||||||
options={tableFieldPreferences?.filter(p => !selectedFields?.some(s => s === p.value))} />
|
options={tableFieldPreferences?.filter(
|
||||||
|
(p) => !selectedFields?.some((s) => s === p.value)
|
||||||
|
)}
|
||||||
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<div className="field-setup-selected-fields">
|
<div className="field-setup-selected-fields">
|
||||||
{selectedFields
|
{selectedFields
|
||||||
?.map((id) => tableFieldPreferences?.find((p) => p.value === id))
|
?.map((id) =>
|
||||||
|
tableFieldPreferences?.find((p) => p.value === id)
|
||||||
|
)
|
||||||
.filter(Boolean)
|
.filter(Boolean)
|
||||||
.map((field) => (
|
.map((field) => (
|
||||||
<div className="selected-field" key={field.value}>
|
<div className="selected-field" key={field.value}>
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -11,7 +11,11 @@ import { Tables } from '../../Components/Tables/Table';
|
||||||
import FormHeader from '../PageComponents/FormHeader.jsx';
|
import FormHeader from '../PageComponents/FormHeader.jsx';
|
||||||
import Search from '../../Components/Forms/Search.jsx';
|
import Search from '../../Components/Forms/Search.jsx';
|
||||||
import Buttons from '../../Components/Forms/Buttons';
|
import Buttons from '../../Components/Forms/Buttons';
|
||||||
import { getSession, dateFormatChange, ExtractDateFormate } from '../../Services/Others';
|
import {
|
||||||
|
getSession,
|
||||||
|
dateFormatChange,
|
||||||
|
ExtractDateFormate,
|
||||||
|
} from '../../Services/Others';
|
||||||
import { Messages } from '../../Components/Notifications/Messages';
|
import { Messages } from '../../Components/Notifications/Messages';
|
||||||
import {
|
import {
|
||||||
getStockData,
|
getStockData,
|
||||||
|
|
@ -175,12 +179,16 @@ const StockList = () => {
|
||||||
};
|
};
|
||||||
const getPreference = async () => {
|
const getPreference = async () => {
|
||||||
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId };
|
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId };
|
||||||
const { data: res } = await dispatch(getPreferenceData(data)).unwrap()
|
const { data: res } = await dispatch(getPreferenceData(data)).unwrap();
|
||||||
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find((setting) => setting?.SettingIdName?.toLowerCase() === "decimal" && setting?.SettingValue === 'Y');
|
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find(
|
||||||
|
(setting) =>
|
||||||
|
setting?.SettingIdName?.toLowerCase() === 'decimal' &&
|
||||||
|
setting?.SettingValue === 'Y'
|
||||||
|
);
|
||||||
if (decimalSetting) {
|
if (decimalSetting) {
|
||||||
setAllowDecimal(true)
|
setAllowDecimal(true);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
const actionsFormatter = async (row, rowIndex) => {
|
const actionsFormatter = async (row, rowIndex) => {
|
||||||
navigate(
|
navigate(
|
||||||
`${subDirectory}setting/purchase-entry/update`,
|
`${subDirectory}setting/purchase-entry/update`,
|
||||||
|
|
@ -200,11 +208,15 @@ const StockList = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const handlePrevImage = () => {
|
const handlePrevImage = () => {
|
||||||
setCurrentImageIndex(prev => prev > 0 ? prev - 1 : productImageDetails.length - 1);
|
setCurrentImageIndex((prev) =>
|
||||||
|
prev > 0 ? prev - 1 : productImageDetails.length - 1
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleNextImage = () => {
|
const handleNextImage = () => {
|
||||||
setCurrentImageIndex(prev => prev < productImageDetails.length - 1 ? prev + 1 : 0);
|
setCurrentImageIndex((prev) =>
|
||||||
|
prev < productImageDetails.length - 1 ? prev + 1 : 0
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleProductmodalCancel = () => {
|
const handleProductmodalCancel = () => {
|
||||||
|
|
@ -218,7 +230,7 @@ const StockList = () => {
|
||||||
setImageModal(false);
|
setImageModal(false);
|
||||||
setProductImageDetails([]);
|
setProductImageDetails([]);
|
||||||
setCurrentImageIndex(0);
|
setCurrentImageIndex(0);
|
||||||
}
|
};
|
||||||
// WRITED BY SREE
|
// WRITED BY SREE
|
||||||
function safeRound(amountStr) {
|
function safeRound(amountStr) {
|
||||||
if (amountStr == null) return allowDecimal ? '0.00' : '0';
|
if (amountStr == null) return allowDecimal ? '0.00' : '0';
|
||||||
|
|
@ -254,7 +266,8 @@ const StockList = () => {
|
||||||
),
|
),
|
||||||
filteredValue: [searchedText],
|
filteredValue: [searchedText],
|
||||||
onFilter: (value, record) => {
|
onFilter: (value, record) => {
|
||||||
return extractLastNumberOrderId(record.InvoiceNo, record?.FYStatus)?.toString()
|
return extractLastNumberOrderId(record.InvoiceNo, record?.FYStatus)
|
||||||
|
?.toString()
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.includes(value.toLowerCase());
|
.includes(value.toLowerCase());
|
||||||
},
|
},
|
||||||
|
|
@ -273,11 +286,8 @@ const StockList = () => {
|
||||||
key: 'CustSuppName',
|
key: 'CustSuppName',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
render: (text, row) => (
|
render: (text, row) => (
|
||||||
<a style={{ color: 'black' }}>
|
<a style={{ color: 'black' }}>{row?.CustSuppName || '-'}</a>
|
||||||
{row?.CustSuppName || '-'}
|
|
||||||
</a>
|
|
||||||
),
|
),
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Supp Invoice No',
|
title: 'Supp Invoice No',
|
||||||
|
|
@ -285,11 +295,8 @@ const StockList = () => {
|
||||||
key: 'SuppInvoiceNo',
|
key: 'SuppInvoiceNo',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
render: (text, row) => (
|
render: (text, row) => (
|
||||||
<a style={{ color: 'black' }}>
|
<a style={{ color: 'black' }}>{row?.SuppInvoiceNo || '-'}</a>
|
||||||
{row?.SuppInvoiceNo || '-'}
|
|
||||||
</a>
|
|
||||||
),
|
),
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
@ -323,17 +330,17 @@ const StockList = () => {
|
||||||
align: 'center',
|
align: 'center',
|
||||||
render: (data, record) => {
|
render: (data, record) => {
|
||||||
if (data?.length > 0) {
|
if (data?.length > 0) {
|
||||||
return <IoEye
|
return (
|
||||||
style={{ color: '#1292EE', fontSize: '25px', cursor: 'pointer' }}
|
<IoEye
|
||||||
onClick={() => viewImages(data)}
|
style={{ color: '#1292EE', fontSize: '25px', cursor: 'pointer' }}
|
||||||
/>
|
onClick={() => viewImages(data)}
|
||||||
|
/>
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
return <p>-</p>
|
return <p>-</p>;
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
},
|
||||||
,
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
const Proddetailcolumns = [
|
const Proddetailcolumns = [
|
||||||
{
|
{
|
||||||
|
|
@ -529,9 +536,11 @@ const StockList = () => {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let updatedExceldatasubmit = Exceldatasubmit?.map((excelItem) => {
|
let updatedExceldatasubmit = Exceldatasubmit?.map((excelItem) => {
|
||||||
|
const [productName, sizeAndUom] =
|
||||||
const [productName, sizeAndUom] = (excelItem?.ProductName?.split(' (')) || [];
|
excelItem?.ProductName?.split(' (') || [];
|
||||||
const [size, uomName] = (sizeAndUom ? sizeAndUom.slice(0, -1).split(' ') : []);
|
const [size, uomName] = sizeAndUom
|
||||||
|
? sizeAndUom.slice(0, -1).split(' ')
|
||||||
|
: [];
|
||||||
|
|
||||||
const matchingProduct = Productdata?.find(
|
const matchingProduct = Productdata?.find(
|
||||||
(product) =>
|
(product) =>
|
||||||
|
|
@ -584,17 +593,17 @@ const StockList = () => {
|
||||||
|
|
||||||
// Helper function to check if product already exists in ProdDetails
|
// Helper function to check if product already exists in ProdDetails
|
||||||
const isDuplicateProduct = (prodDetails, newItem) => {
|
const isDuplicateProduct = (prodDetails, newItem) => {
|
||||||
return prodDetails.some(item =>
|
return prodDetails.some(
|
||||||
item.ProdName === newItem.ProdName &&
|
(item) =>
|
||||||
item.VariantName === newItem.VariantName &&
|
item.ProdName === newItem.ProdName &&
|
||||||
item.MRP === newItem.MRP &&
|
item.VariantName === newItem.VariantName &&
|
||||||
item.SalesPrice === newItem.SalesPrice &&
|
item.MRP === newItem.MRP &&
|
||||||
item.Quantity === newItem.Quantity &&
|
item.SalesPrice === newItem.SalesPrice &&
|
||||||
item.RejectedQty === newItem.RejectedQty
|
item.Quantity === newItem.Quantity &&
|
||||||
|
item.RejectedQty === newItem.RejectedQty
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const handleSubmit = async () => {
|
const handleSubmit = async () => {
|
||||||
let FilterData = Exceldatasubmit?.filter((a) => a['ProductName'] != '');
|
let FilterData = Exceldatasubmit?.filter((a) => a['ProductName'] != '');
|
||||||
if (FilterData && FilterData.length > 0) {
|
if (FilterData && FilterData.length > 0) {
|
||||||
|
|
@ -618,7 +627,7 @@ const StockList = () => {
|
||||||
DeliveryInvoiceDate: data.DeliveryInvoiceDate,
|
DeliveryInvoiceDate: data.DeliveryInvoiceDate,
|
||||||
DueDate: data.DueDate,
|
DueDate: data.DueDate,
|
||||||
},
|
},
|
||||||
products: []
|
products: [],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -636,7 +645,6 @@ const StockList = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const formattedData = Object.values(groupedData).map((group) => {
|
const formattedData = Object.values(groupedData).map((group) => {
|
||||||
|
|
||||||
const { groupInfo, products } = group;
|
const { groupInfo, products } = group;
|
||||||
|
|
||||||
// Calculate totals based on products
|
// Calculate totals based on products
|
||||||
|
|
@ -666,25 +674,33 @@ const StockList = () => {
|
||||||
PaymentMode: groupInfo.PaymentMode,
|
PaymentMode: groupInfo.PaymentMode,
|
||||||
PaymentAmount: PaymentAmount.toFixed(2),
|
PaymentAmount: PaymentAmount.toFixed(2),
|
||||||
InvoiceDate: groupInfo.InwardDate
|
InvoiceDate: groupInfo.InwardDate
|
||||||
? moment(groupInfo.InwardDate, 'YYYY-MM-DD').format('YYYY-MM-DDTHH:mm:ss')
|
? moment(groupInfo.InwardDate, 'YYYY-MM-DD').format(
|
||||||
|
'YYYY-MM-DDTHH:mm:ss'
|
||||||
|
)
|
||||||
: null,
|
: null,
|
||||||
SuppInvoiceNo: groupInfo.SupplierInvoiceNumber,
|
SuppInvoiceNo: groupInfo.SupplierInvoiceNumber,
|
||||||
SuppInvoiceDate: groupInfo.SupplierInvoiceDate
|
SuppInvoiceDate: groupInfo.SupplierInvoiceDate
|
||||||
? moment(groupInfo.SupplierInvoiceDate, 'YYYY-MM-DD').format('YYYY-MM-DDTHH:mm:ss')
|
? moment(groupInfo.SupplierInvoiceDate, 'YYYY-MM-DD').format(
|
||||||
|
'YYYY-MM-DDTHH:mm:ss'
|
||||||
|
)
|
||||||
: null,
|
: null,
|
||||||
DeliveryChallanNo: groupInfo.DeliveryChallanNo,
|
DeliveryChallanNo: groupInfo.DeliveryChallanNo,
|
||||||
DeliveryInvoiceDate: groupInfo.DeliveryInvoiceDate
|
DeliveryInvoiceDate: groupInfo.DeliveryInvoiceDate
|
||||||
? moment(groupInfo.DeliveryInvoiceDate, 'YYYY-MM-DD').format('YYYY-MM-DDTHH:mm:ss')
|
? moment(groupInfo.DeliveryInvoiceDate, 'YYYY-MM-DD').format(
|
||||||
|
'YYYY-MM-DDTHH:mm:ss'
|
||||||
|
)
|
||||||
: null,
|
: null,
|
||||||
DueDate: groupInfo.DueDate
|
DueDate: groupInfo.DueDate
|
||||||
? moment(groupInfo.DueDate, 'YYYY-MM-DD').format('YYYY-MM-DDTHH:mm:ss')
|
? moment(groupInfo.DueDate, 'YYYY-MM-DD').format(
|
||||||
|
'YYYY-MM-DDTHH:mm:ss'
|
||||||
|
)
|
||||||
: null,
|
: null,
|
||||||
InvoiceAmount: Totalamount.toFixed(2),
|
InvoiceAmount: Totalamount.toFixed(2),
|
||||||
TaxAmount: Totaltax.toFixed(2),
|
TaxAmount: Totaltax.toFixed(2),
|
||||||
TotalAmount: Totalamount.toFixed(2),
|
TotalAmount: Totalamount.toFixed(2),
|
||||||
BillAmount: Billamount.toFixed(2),
|
BillAmount: Billamount.toFixed(2),
|
||||||
PaymentStatus: "S",
|
PaymentStatus: 'S',
|
||||||
PurOrderStatus: "P",
|
PurOrderStatus: 'P',
|
||||||
ProdDetails: products.map((item) => ({
|
ProdDetails: products.map((item) => ({
|
||||||
ProdName: item.ProductName,
|
ProdName: item.ProductName,
|
||||||
ProdVariantName: item.VariantName,
|
ProdVariantName: item.VariantName,
|
||||||
|
|
@ -694,10 +710,14 @@ const StockList = () => {
|
||||||
AcceptedQty: item.AcceptedQty,
|
AcceptedQty: item.AcceptedQty,
|
||||||
FreeQty: item.FreeQty,
|
FreeQty: item.FreeQty,
|
||||||
ManufDate: item.ManufactureDate
|
ManufDate: item.ManufactureDate
|
||||||
? moment(item.ManufactureDate, 'YYYY-MM-DD').format('YYYY-MM-DDTHH:mm:ss')
|
? moment(item.ManufactureDate, 'YYYY-MM-DD').format(
|
||||||
|
'YYYY-MM-DDTHH:mm:ss'
|
||||||
|
)
|
||||||
: null,
|
: null,
|
||||||
ExpDate: item.ExpireDate
|
ExpDate: item.ExpireDate
|
||||||
? moment(item.ExpireDate, 'YYYY-MM-DD').format('YYYY-MM-DDTHH:mm:ss')
|
? moment(item.ExpireDate, 'YYYY-MM-DD').format(
|
||||||
|
'YYYY-MM-DDTHH:mm:ss'
|
||||||
|
)
|
||||||
: null,
|
: null,
|
||||||
BatchNo: item.BatchNo,
|
BatchNo: item.BatchNo,
|
||||||
ModelNo: item.ModelNo,
|
ModelNo: item.ModelNo,
|
||||||
|
|
@ -707,6 +727,7 @@ const StockList = () => {
|
||||||
SellPrice: item.SalesPrice,
|
SellPrice: item.SalesPrice,
|
||||||
OnePcsPrice: item.AmountPerPiece,
|
OnePcsPrice: item.AmountPerPiece,
|
||||||
NoOfPcs: item.NumberofPieceInside,
|
NoOfPcs: item.NumberofPieceInside,
|
||||||
|
WhSalePrice: item.WholesalePrice
|
||||||
})),
|
})),
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
@ -905,31 +926,35 @@ const StockList = () => {
|
||||||
width={600}
|
width={600}
|
||||||
className={'padding-less-modal'}
|
className={'padding-less-modal'}
|
||||||
children={
|
children={
|
||||||
<div >
|
<div>
|
||||||
{productImageDetails?.length > 0 && (
|
{productImageDetails?.length > 0 && (
|
||||||
<div className='image-preview'>
|
<div className="image-preview">
|
||||||
{productImageDetails.length > 1 && (
|
{productImageDetails.length > 1 && (
|
||||||
<>
|
<>
|
||||||
<button
|
<button
|
||||||
onClick={handlePrevImage}
|
onClick={handlePrevImage}
|
||||||
className='image-preview__nav-btn'
|
className="image-preview__nav-btn"
|
||||||
>
|
>
|
||||||
<FaAngleLeft />
|
<FaAngleLeft />
|
||||||
</button>
|
</button>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
<div className='image-preview__content'>
|
<div className="image-preview__content">
|
||||||
<Image
|
<Image
|
||||||
src={productImageDetails[currentImageIndex]?.ImageUrl}
|
src={productImageDetails[currentImageIndex]?.ImageUrl}
|
||||||
alt="Preview"
|
alt="Preview"
|
||||||
style={{ maxWidth: '100%', maxHeight: '400px', objectFit: 'contain' }}
|
style={{
|
||||||
|
maxWidth: '100%',
|
||||||
|
maxHeight: '400px',
|
||||||
|
objectFit: 'contain',
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{productImageDetails.length > 1 && (
|
{productImageDetails.length > 1 && (
|
||||||
<>
|
<>
|
||||||
<button
|
<button
|
||||||
onClick={handleNextImage}
|
onClick={handleNextImage}
|
||||||
className='image-preview__nav-btn'
|
className="image-preview__nav-btn"
|
||||||
>
|
>
|
||||||
<FaAngleRight />
|
<FaAngleRight />
|
||||||
</button>
|
</button>
|
||||||
|
|
@ -937,7 +962,14 @@ const StockList = () => {
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div style={{ marginTop: '10px', color: '#666', textAlign: 'center', fontFamily: 'Poppins' }}>
|
<div
|
||||||
|
style={{
|
||||||
|
marginTop: '10px',
|
||||||
|
color: '#666',
|
||||||
|
textAlign: 'center',
|
||||||
|
fontFamily: 'Poppins',
|
||||||
|
}}
|
||||||
|
>
|
||||||
{currentImageIndex + 1} of {productImageDetails.length}
|
{currentImageIndex + 1} of {productImageDetails.length}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -42,22 +42,30 @@
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
}
|
}
|
||||||
.grid-container {
|
.gridEQcontainer {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: auto auto auto;
|
grid-template-columns: auto auto auto;
|
||||||
padding: 5px;
|
padding: 12px;
|
||||||
|
border-radius: 6px;
|
||||||
background: #e1eef1;
|
background: #e1eef1;
|
||||||
margin: 5px;
|
margin: 5px;
|
||||||
}
|
}
|
||||||
.grid-item {
|
.gridEQitem {
|
||||||
background-color: rgba(255, 255, 255, 0.8);
|
background-color: rgba(255, 255, 255, 0.8);
|
||||||
// border: 1px solid rgba(0, 0, 0, 0.8);
|
// border: 1px solid rgba(0, 0, 0, 0.8);
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
font-size: 30px;
|
font-size: 30px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
border-radius: 25px;
|
border-radius: 30px;
|
||||||
margin: 6px;
|
margin: 5px;
|
||||||
// margin-left: 10px;
|
height: 60px;
|
||||||
|
width: 90%;
|
||||||
|
cursor: pointer;
|
||||||
|
font-family: "Poppins";
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-weight: 400;
|
||||||
}
|
}
|
||||||
.grid-item-add {
|
.grid-item-add {
|
||||||
background-color: var(--SELECTED_COLOR);
|
background-color: var(--SELECTED_COLOR);
|
||||||
|
|
@ -90,14 +98,27 @@
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
column-gap: 0.5rem;
|
column-gap: 0.5rem;
|
||||||
font-family: 'Poppins';
|
font-family: "Poppins", sans-serif;
|
||||||
}
|
}
|
||||||
.EditQuantity-Quantitybox {
|
.EditQuantity-Quantitybox {
|
||||||
width: 5rem;
|
width: 5rem;
|
||||||
height: 2rem;
|
height: 2rem;
|
||||||
border: none;
|
border: none;
|
||||||
background-color: #eff3f3;
|
background-color: #eff3f3;
|
||||||
|
border: 1px solid #e4e4e4;
|
||||||
padding-left: 5px;
|
padding-left: 5px;
|
||||||
|
border-radius: 4px;
|
||||||
|
font-family: "Poppins", sans-serif;
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 400;
|
||||||
|
letter-spacing: 0.3px;
|
||||||
|
outline: none !important;
|
||||||
|
&:focus {
|
||||||
|
border-color: #a6daff;
|
||||||
|
}
|
||||||
|
&:active {
|
||||||
|
border-color: #a6daff;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.EditQuantity-Pricebox {
|
.EditQuantity-Pricebox {
|
||||||
width: 5rem;
|
width: 5rem;
|
||||||
|
|
@ -110,6 +131,14 @@
|
||||||
height: 2rem;
|
height: 2rem;
|
||||||
width: 2rem;
|
width: 2rem;
|
||||||
border: none;
|
border: none;
|
||||||
|
border: 1px solid #ffdfdf;
|
||||||
|
border-radius: 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
background-color: #ffeded;
|
||||||
|
color: #c21919;
|
||||||
}
|
}
|
||||||
.EditQuantity-PriceChange {
|
.EditQuantity-PriceChange {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
||||||
|
|
@ -41,10 +41,10 @@ $white: #ffffff;
|
||||||
.packing-container {
|
.packing-container {
|
||||||
max-width: 50rem;
|
max-width: 50rem;
|
||||||
// margin: 0 auto;
|
// margin: 0 auto;
|
||||||
padding: 1.5rem;
|
margin: 1rem 0;
|
||||||
@include gradient-bg(#eff6ff, #e0e7ff);
|
padding: 1rem;
|
||||||
|
@include gradient-bg(#e6f1ff, #dfe7ff);
|
||||||
border-radius: 1rem;
|
border-radius: 1rem;
|
||||||
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
|
|
||||||
|
|
||||||
// Header section
|
// Header section
|
||||||
.header {
|
.header {
|
||||||
|
|
@ -119,15 +119,15 @@ $white: #ffffff;
|
||||||
.rows-header {
|
.rows-header {
|
||||||
display: grid;
|
display: grid;
|
||||||
// grid-template-columns: 120px 120px 120px 120px 100px; // Type, Qty, Count, Total, Action
|
// grid-template-columns: 120px 120px 120px 120px 100px; // Type, Qty, Count, Total, Action
|
||||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr ;
|
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
|
||||||
background: $gray-100;
|
background: $gray-100;
|
||||||
padding: 0.75rem 1rem;
|
padding: 0.5rem 0.5rem;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
font-size: 0.875rem;
|
font-size: 0.875rem;
|
||||||
color: $gray-700;
|
color: $gray-700;
|
||||||
border-radius: 0.5rem;
|
border-radius: 0.5rem;
|
||||||
border: 1px solid $gray-200;
|
border: 1px solid $gray-200;
|
||||||
margin-bottom: 0.50rem;
|
margin-bottom: 0.5rem;
|
||||||
|
|
||||||
.header-cell {
|
.header-cell {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
@ -279,9 +279,8 @@ $white: #ffffff;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
|
|
||||||
.action-button {
|
.action-button {
|
||||||
|
width: 2rem;
|
||||||
width: 2.0rem;
|
height: 2rem;
|
||||||
height: 2.0rem;
|
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
border: none;
|
border: none;
|
||||||
color: $white;
|
color: $white;
|
||||||
|
|
@ -311,7 +310,7 @@ $white: #ffffff;
|
||||||
min-width: 2rem;
|
min-width: 2rem;
|
||||||
|
|
||||||
.total-display {
|
.total-display {
|
||||||
padding: 0.25rem 0.70rem;
|
padding: 0.25rem 0.7rem;
|
||||||
background: $gray-50;
|
background: $gray-50;
|
||||||
// border: 1px solid $gray-200;
|
// border: 1px solid $gray-200;
|
||||||
// border-radius: 0.5rem;
|
// border-radius: 0.5rem;
|
||||||
|
|
@ -338,8 +337,7 @@ $white: #ffffff;
|
||||||
background: $white;
|
background: $white;
|
||||||
border-radius: 0.75rem;
|
border-radius: 0.75rem;
|
||||||
padding: 1.5rem;
|
padding: 1.5rem;
|
||||||
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
|
border: 2px solid #d6e1ff;
|
||||||
border: 2px solid $gray-100;
|
|
||||||
|
|
||||||
.summary-content {
|
.summary-content {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
||||||
|
|
@ -325,7 +325,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.CategoryHorizontalNew {
|
.CategoryHorizontalNew {
|
||||||
padding: 1rem 1rem;
|
padding: 10px 10px;
|
||||||
font-family: 'Inter', sans-serif;
|
font-family: 'Inter', sans-serif;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
|
||||||
|
|
@ -116,7 +116,7 @@
|
||||||
.CustomerActions {
|
.CustomerActions {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 0.1rem;
|
gap: 0.3rem;
|
||||||
|
|
||||||
.RiVerifiedBadgeFill {
|
.RiVerifiedBadgeFill {
|
||||||
transition: all 0.2s ease-in-out;
|
transition: all 0.2s ease-in-out;
|
||||||
|
|
|
||||||
|
|
@ -338,7 +338,7 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 7px;
|
gap: 7px;
|
||||||
padding: 10px 16px;
|
padding: 8px 16px;
|
||||||
background-color: #0bad77;
|
background-color: #0bad77;
|
||||||
border-radius: 7px;
|
border-radius: 7px;
|
||||||
color: white;
|
color: white;
|
||||||
|
|
@ -346,7 +346,7 @@
|
||||||
font-family: 'Poppins';
|
font-family: 'Poppins';
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
font-size: 14px;
|
font-size: 13.5px;
|
||||||
transition: all 0.2s;
|
transition: all 0.2s;
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: #069666;
|
background-color: #069666;
|
||||||
|
|
@ -356,15 +356,15 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 7px;
|
gap: 7px;
|
||||||
padding: 10px 16px;
|
padding: 8px 16px;
|
||||||
background-color: #0ea5e9;
|
background-color: #1292ee;
|
||||||
border-radius: 7px;
|
border-radius: 7px;
|
||||||
color: white;
|
color: white;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font-family: 'Poppins';
|
font-family: "Poppins";
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
font-size: 14px;
|
font-size: 13.5px;
|
||||||
transition: all 0.2s;
|
transition: all 0.2s;
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: #0985be;
|
background-color: #0985be;
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@
|
||||||
.kot-date {
|
.kot-date {
|
||||||
display: flex;
|
display: flex;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-family: 'Gilroy';
|
font-family: "Gilroy";
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
color: #212529 !important;
|
color: #212529 !important;
|
||||||
|
|
@ -122,7 +122,7 @@
|
||||||
right: 0;
|
right: 0;
|
||||||
}
|
}
|
||||||
.ant-segmented-item-label {
|
.ant-segmented-item-label {
|
||||||
font-family: 'Poppins';
|
font-family: "Poppins";
|
||||||
font-size: 12px !important;
|
font-size: 12px !important;
|
||||||
}
|
}
|
||||||
.ant-segmented-item-selected {
|
.ant-segmented-item-selected {
|
||||||
|
|
@ -134,9 +134,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.kot-search-dev
|
.kot-search-dev :where(.css-dev-only-do-not-override-2i2tap).ant-segmented .ant-segmented-group {
|
||||||
:where(.css-dev-only-do-not-override-2i2tap).ant-segmented
|
|
||||||
.ant-segmented-group {
|
|
||||||
position: relative;
|
position: relative;
|
||||||
display: flex;
|
display: flex;
|
||||||
//srinath
|
//srinath
|
||||||
|
|
@ -149,9 +147,7 @@
|
||||||
rgba(0, 0, 0, 0.3) 0px 3px 7px -3px;
|
rgba(0, 0, 0, 0.3) 0px 3px 7px -3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.kot-search-dev
|
.kot-search-dev :where(.css-dev-only-do-not-override-2i2tap).ant-segmented .ant-segmented-item-selected {
|
||||||
:where(.css-dev-only-do-not-override-2i2tap).ant-segmented
|
|
||||||
.ant-segmented-item-selected {
|
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
box-shadow:
|
box-shadow:
|
||||||
0 1px 2px 0 rgba(0, 0, 0, 0.03),
|
0 1px 2px 0 rgba(0, 0, 0, 0.03),
|
||||||
|
|
@ -168,6 +164,13 @@
|
||||||
margin: 12px 0 12px 0;
|
margin: 12px 0 12px 0;
|
||||||
height: 70vh;
|
height: 70vh;
|
||||||
overflow: scroll;
|
overflow: scroll;
|
||||||
|
|
||||||
|
.ant-table-thead {
|
||||||
|
background-color: #2c88ee !important;
|
||||||
|
}
|
||||||
|
.ant-table-cell {
|
||||||
|
padding: 6px !important;
|
||||||
|
}
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
height: 60vh;
|
height: 60vh;
|
||||||
scrollbar-width: thin;
|
scrollbar-width: thin;
|
||||||
|
|
@ -179,7 +182,7 @@
|
||||||
}
|
}
|
||||||
table {
|
table {
|
||||||
tbody {
|
tbody {
|
||||||
font-family: 'Poppins';
|
font-family: "Poppins";
|
||||||
> tr:nth-child(even) {
|
> tr:nth-child(even) {
|
||||||
background-color: #b4b4b4;
|
background-color: #b4b4b4;
|
||||||
}
|
}
|
||||||
|
|
@ -221,7 +224,7 @@
|
||||||
transition: all 0.2s ease;
|
transition: all 0.2s ease;
|
||||||
min-width: 70px;
|
min-width: 70px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-family: 'Poppins', sans-serif;
|
font-family: "Poppins", sans-serif;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
-webkit-text-stroke-width: 0.1px;
|
-webkit-text-stroke-width: 0.1px;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,13 +36,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.Product-table {
|
.Product-table {
|
||||||
|
|
||||||
table {
|
table {
|
||||||
border-spacing: unset;
|
border-spacing: unset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.Product-table .ant-input {
|
.Product-table .ant-input {
|
||||||
width: 5rem !important;
|
width: 4rem !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.Product-table .ant-picker {
|
.Product-table .ant-picker {
|
||||||
|
|
@ -87,7 +88,7 @@
|
||||||
width: 180px !important;
|
width: 180px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
> div:nth-child(2) {
|
>div:nth-child(2) {
|
||||||
p {
|
p {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
@ -145,7 +146,7 @@
|
||||||
max-width: 130px !important;
|
max-width: 130px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
> td:nth-child(3) {
|
>td:nth-child(3) {
|
||||||
.ant-input {
|
.ant-input {
|
||||||
width: max-content !important;
|
width: max-content !important;
|
||||||
max-width: 70px !important;
|
max-width: 70px !important;
|
||||||
|
|
@ -153,7 +154,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
> td:nth-child(5) {
|
>td:nth-child(5) {
|
||||||
.ant-input {
|
.ant-input {
|
||||||
width: max-content !important;
|
width: max-content !important;
|
||||||
max-width: 100px !important;
|
max-width: 100px !important;
|
||||||
|
|
@ -202,6 +203,8 @@
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
gap: 1.5rem;
|
gap: 1.5rem;
|
||||||
padding-top: 0.5rem;
|
padding-top: 0.5rem;
|
||||||
|
justify-content: space-between;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
& .field-DropDown {
|
& .field-DropDown {
|
||||||
width: 200px !important;
|
width: 200px !important;
|
||||||
|
|
@ -299,8 +302,8 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.inputForm .ant-table-content {
|
.inputFormSTOCKFORM .ant-table-content {
|
||||||
width: 70vw;
|
width: 100% !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pe-inward-date {
|
.pe-inward-date {
|
||||||
|
|
@ -322,24 +325,22 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.purchase-status {
|
.purchase-status {
|
||||||
> div:nth-child(1) {
|
>div:nth-child(1) {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
|
|
||||||
> p {
|
>p {
|
||||||
padding-bottom: 0 !important;
|
padding-bottom: 0 !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.purchase-status-data {
|
.purchase-status-data {
|
||||||
margin-top: 10px;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 30px;
|
gap: 30px;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
padding: 1rem 3rem;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -447,7 +448,7 @@
|
||||||
|
|
||||||
.invoice-date {
|
.invoice-date {
|
||||||
.ant-form-item-control-input-content {
|
.ant-form-item-control-input-content {
|
||||||
> label {
|
>label {
|
||||||
font-family: 'Poppins';
|
font-family: 'Poppins';
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
@ -473,7 +474,7 @@
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
|
|
||||||
> button {
|
>button {
|
||||||
font-family: 'Poppins';
|
font-family: 'Poppins';
|
||||||
background-color: #ef4444;
|
background-color: #ef4444;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
|
@ -481,8 +482,8 @@
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
.ant-btn-icon {
|
.ant-btn-icon {
|
||||||
> span {
|
>span {
|
||||||
> svg {
|
>svg {
|
||||||
width: 13px;
|
width: 13px;
|
||||||
height: 13px;
|
height: 13px;
|
||||||
}
|
}
|
||||||
|
|
@ -516,6 +517,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.stockformTabele {
|
.stockformTabele {
|
||||||
|
width: 80vw;
|
||||||
|
|
||||||
.float-label,
|
.float-label,
|
||||||
.ant-select {
|
.ant-select {
|
||||||
width: 60px !important;
|
width: 60px !important;
|
||||||
|
|
@ -563,9 +566,7 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.inputForm .ant-table-content {
|
|
||||||
width: 100vw;
|
|
||||||
}
|
|
||||||
|
|
||||||
.stock-input {
|
.stock-input {
|
||||||
// width: 100vw;
|
// width: 100vw;
|
||||||
|
|
@ -607,13 +608,12 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.inputForm .ant-table-content {
|
|
||||||
width: 100vw;
|
|
||||||
}
|
|
||||||
|
|
||||||
.stock-input {
|
.stock-input {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tipsForUpload {
|
.tipsForUpload {
|
||||||
ul li {
|
ul li {
|
||||||
font-size: 10px !important;
|
font-size: 10px !important;
|
||||||
|
|
@ -689,14 +689,17 @@
|
||||||
top: 0;
|
top: 0;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
50% {
|
50% {
|
||||||
opacity: 0.8;
|
opacity: 0.8;
|
||||||
}
|
}
|
||||||
|
|
||||||
100% {
|
100% {
|
||||||
top: calc(100% - 3px);
|
top: calc(100% - 3px);
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.preview-text-data {
|
.preview-text-data {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
@ -724,6 +727,7 @@
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.loading-overlay {
|
.loading-overlay {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
|
@ -761,12 +765,66 @@
|
||||||
0% {
|
0% {
|
||||||
transform: rotate(0deg);
|
transform: rotate(0deg);
|
||||||
}
|
}
|
||||||
|
|
||||||
100% {
|
100% {
|
||||||
transform: rotate(360deg);
|
transform: rotate(360deg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.purchase-receipt-table {
|
.purchase-receipt-table {
|
||||||
.ant-input {
|
.ant-input {
|
||||||
padding-top: 6px !important;
|
padding-top: 6px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ant-table-cell {
|
||||||
|
padding: 5px !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.addallProductTBN {
|
||||||
|
border: none;
|
||||||
|
outline: none;
|
||||||
|
padding: 8px 16px;
|
||||||
|
width: max-content;
|
||||||
|
font-family: "Poppins";
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 14px;
|
||||||
|
cursor: pointer;
|
||||||
|
background-color: #1292ee;
|
||||||
|
height: max-content;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.productSearchRecipt {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
flex-direction: row-reverse;
|
||||||
|
gap: 1rem;
|
||||||
|
|
||||||
|
.ant-input-affix-wrapper {
|
||||||
|
width: 250px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-input {
|
||||||
|
padding: 3px 14px 6px 11px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.finalSubmitPRBTN {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
|
gap: 1rem;
|
||||||
|
margin-top: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.imeiSNTable {
|
||||||
|
|
||||||
|
.ant-input {
|
||||||
|
padding: 4px 4px !important;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue