After Lazy Loading Design Solved

This commit is contained in:
Your Name 2026-02-11 11:35:57 +05:30
parent 7536be8bb9
commit 01b77af722
27 changed files with 1702 additions and 759 deletions

View File

@ -564,7 +564,7 @@ Button[disabled] {
.ant-table-cell {
background: #fafafa7a;
//vicky
padding: 1px 8px !important;
padding: 6px 6px !important;
border: 0.5px solid rgb(235, 235, 235);
}

View File

@ -20,6 +20,7 @@ import { DefaultModal } from "../../Components/Modal/DefaultModal";
import { FaRegEye } from "react-icons/fa";
import { render } from "react-dom";
import { useAuth } from "../../AuthContext";
import "./AutomatedReorder.scss";
const subDirectory = import.meta.env.BASE_URL;

View File

@ -1,436 +1,488 @@
import { Switch, Tooltip } from "antd"
import { useDispatch } from "react-redux";
import { changeBillName, changeNotes, changeSelectedAmount, changeSelectedDiscount, changeSelectedHsnCode, changeSelectedItem, changeSelectedMRP, changeSelectedprintStyle, changeSelectedQrcode, changeSelectedQuantity, changeSelectedRate, changeSelectedSignature, changeSelectedSlNo, changeSelectedtermsAndConditions, changeSignatureImage, changethemeFormat, getPrintSelectionComponentData, putPrintSelectionComponentData, changeSelectedPrintdummyData } from "../../../../Features/ThemeChange/ThemeChange";
import { useEffect, useState, useMemo, useCallback } from "react";
import { InfoCircleOutlined, UploadOutlined, PlusOutlined, MinusCircleOutlined, ArrowRightOutlined, EditFilled, DeleteFilled } from '@ant-design/icons';
import { getSession } from "../../../../Services/Others";
import Buttons from "../../../../Components/Forms/Buttons";
import { Messages } from "../../../../Components/Notifications/Messages";
import { Switch, Tooltip } from 'antd';
import { useDispatch } from 'react-redux';
import {
changeBillName,
changeNotes,
changeSelectedAmount,
changeSelectedDiscount,
changeSelectedHsnCode,
changeSelectedItem,
changeSelectedMRP,
changeSelectedprintStyle,
changeSelectedQrcode,
changeSelectedQuantity,
changeSelectedRate,
changeSelectedSignature,
changeSelectedSlNo,
changeSelectedtermsAndConditions,
changeSignatureImage,
changethemeFormat,
getPrintSelectionComponentData,
putPrintSelectionComponentData,
changeSelectedPrintdummyData,
} from '../../../../Features/ThemeChange/ThemeChange';
import { useEffect, useState, useMemo, useCallback } from 'react';
import {
InfoCircleOutlined,
UploadOutlined,
PlusOutlined,
MinusCircleOutlined,
ArrowRightOutlined,
EditFilled,
DeleteFilled,
} from '@ant-design/icons';
import { getSession } from '../../../../Services/Others';
import Buttons from '../../../../Components/Forms/Buttons';
import { Messages } from '../../../../Components/Notifications/Messages';
const SalesPrintSize = ({ onSettingsChange, closeModel }) => {
const CompId = getSession("CompId")
const BranchId = getSession("BranchId")
const AppId = getSession("AppId")
const UserId = getSession('UserId');
const dispatch = useDispatch()
const CompId = getSession('CompId');
const BranchId = getSession('BranchId');
const AppId = getSession('AppId');
const UserId = getSession('UserId');
const dispatch = useDispatch();
const [PrintType, setPrintType] = useState(false);
const [PageSize, setPageSize] = useState(false);
// const [PrintTemplates, setPrintTemplates] = useState([])
const [SizeOptionData, setSizeOptionData] = useState([])
const [selectedTemplate, setSelectedTemplate] = useState(null)
const [messageType, setMessageType] = useState('')
const [messageData, setMessageData] = useState('')
console.log(selectedTemplate, 'selectedTemplate');
const [PrintType, setPrintType] = useState(false);
const [PageSize, setPageSize] = useState(false);
// const [PrintTemplates, setPrintTemplates] = useState([])
const [SizeOptionData, setSizeOptionData] = useState([]);
const [selectedTemplate, setSelectedTemplate] = useState(null);
const [messageType, setMessageType] = useState('');
const [messageData, setMessageData] = useState('');
console.log(selectedTemplate, 'selectedTemplate');
// Memoized values for better performance
const currentPrintType = useMemo(() => {
if (selectedTemplate) {
return selectedTemplate.PrintType === 'S' ? true : false;
}
return PrintType;
}, [selectedTemplate, PrintType]);
// Memoized values for better performance
const currentPrintType = useMemo(() => {
if (selectedTemplate) {
return selectedTemplate.PrintType === 'S' ? true : false;
}
return PrintType;
}, [selectedTemplate, PrintType]);
const currentPageSize = useMemo(() => {
if (selectedTemplate) {
return selectedTemplate.PageSize === 'A5' ? true : false;
}
return PageSize;
}, [selectedTemplate, PageSize]);
const currentPageSize = useMemo(() => {
if (selectedTemplate) {
return selectedTemplate.PageSize === 'A5' ? true : false;
}
return PageSize;
}, [selectedTemplate, PageSize]);
// Get the actual values to pass to parent component
const getPrintTypeValue = () => {
if (selectedTemplate) {
return selectedTemplate.PrintType;
}
return PrintType ? 'S' : 'C';
};
// Get the actual values to pass to parent component
const getPrintTypeValue = () => {
if (selectedTemplate) {
return selectedTemplate.PrintType;
}
return PrintType ? 'S' : 'C';
};
const getPageSizeValue = () => {
if (selectedTemplate) {
return selectedTemplate.PageSize;
}
return PageSize ? 'A5' : 'A4';
};
const getPageSizeValue = () => {
if (selectedTemplate) {
return selectedTemplate.PageSize;
}
return PageSize ? 'A5' : 'A4';
};
useEffect(() => {
printsyleget();
}, []);
useEffect(() => {
printsyleget()
}, [])
// Auto-select default template when data loads
useEffect(() => {
if (SizeOptionData.length > 0) {
const defaultTemplate = SizeOptionData.find(
(template) => template.SetasDefault === 'Y'
);
if (defaultTemplate) {
handleTemplateSelect(defaultTemplate);
}
}
}, [SizeOptionData]);
// Auto-select default template when data loads
useEffect(() => {
if (SizeOptionData.length > 0) {
const defaultTemplate = SizeOptionData.find(template => template.SetasDefault === "Y");
if (defaultTemplate) {
handleTemplateSelect(defaultTemplate);
}
}
}, [SizeOptionData]);
const handleTemplateSelect = (template) => {
setSelectedTemplate(template);
setPrintType(template.PrintType === 'S');
setPageSize(template.PageSize === 'A5');
stylePreview(template);
const handleTemplateSelect = (template) => {
setSelectedTemplate(template);
setPrintType(template.PrintType === 'S');
setPageSize(template.PageSize === 'A5');
stylePreview(template);
// Immediately pass the template settings
if (onSettingsChange && typeof onSettingsChange === 'function') {
const currentSettings = {
PrintType: template.PrintType,
PageSize: template.PageSize,
selectedTemplate: template,
};
console.log('Template Selected - Settings:', currentSettings);
onSettingsChange(currentSettings);
}
};
// Immediately pass the template settings
if (onSettingsChange && typeof onSettingsChange === 'function') {
const currentSettings = {
PrintType: template.PrintType,
PageSize: template.PageSize,
selectedTemplate: template
};
console.log('Template Selected - Settings:', currentSettings);
onSettingsChange(currentSettings);
}
};
const onChangeToggle = async (e) => {
setPrintType(e);
await dispatch(changethemeFormat(e));
const onChangeToggle = async (e) => {
setPrintType(e);
await dispatch(changethemeFormat(e));
// If a template is selected, update it
if (selectedTemplate) {
const updatedTemplate = {
...selectedTemplate,
PrintType: e ? 'S' : 'C',
};
setSelectedTemplate(updatedTemplate);
// If a template is selected, update it
if (selectedTemplate) {
const updatedTemplate = {
...selectedTemplate,
PrintType: e ? 'S' : 'C'
};
setSelectedTemplate(updatedTemplate);
// Immediately pass updated settings
if (onSettingsChange && typeof onSettingsChange === 'function') {
const currentSettings = {
PrintType: updatedTemplate.PrintType,
PageSize: updatedTemplate.PageSize,
selectedTemplate: updatedTemplate
};
onSettingsChange(currentSettings);
}
}
};
const onChangepageSize = async (e) => {
setPageSize(e);
// If a template is selected, update it
if (selectedTemplate) {
const updatedTemplate = {
...selectedTemplate,
PageSize: e ? 'A5' : 'A4'
};
setSelectedTemplate(updatedTemplate);
if (onSettingsChange && typeof onSettingsChange === 'function') {
const currentSettings = {
PrintType: updatedTemplate.PrintType,
PageSize: updatedTemplate.PageSize,
selectedTemplate: updatedTemplate
};
onSettingsChange(currentSettings);
}
}
};
const stylePreview = async (template) => {
if (!template) return;
const { StyleId, StyleName, PrintType: printType, PageSize, Notes, PrintHdrName, Signature, TermsandConditions, OptionDetails } = template;
const helperFunction = (param) => {
return OptionDetails.some(
(item) => item.ConfigName === param
)
}
dispatch(changeSelectedSlNo(helperFunction('Sl.No')));
dispatch(changeSelectedItem(helperFunction('Item')));
dispatch(changeSelectedMRP(helperFunction('MRP')));
dispatch(changeSelectedDiscount(helperFunction('Discount')));
dispatch(changeSelectedQuantity(helperFunction('Quantity')));
dispatch(changeSelectedRate(helperFunction('Rate')));
dispatch(changeSelectedAmount(helperFunction('Amount')));
dispatch(changeSelectedHsnCode(helperFunction('HsnCode')));
dispatch(changeSelectedQrcode(helperFunction('Qrcode')));
dispatch(changeSelectedSignature(helperFunction('signature')));
dispatch(changeSelectedtermsAndConditions(helperFunction('terms&conditions')));
dispatch(changeNotes(helperFunction('Notes')));
dispatch(changeSignatureImage(Signature));
dispatch(changeBillName(PrintHdrName));
dispatch(changeSelectedprintStyle({
ConfigId: StyleId,
ConfigName: StyleName,
}));
};
const printsyleget = async () => {
try {
const Data = { AppId, CompId, BranchId };
let response = await dispatch(getPrintSelectionComponentData(Data)).unwrap();
if (response?.data?.statusCode === 1) {
// const salesTemplates = response.data.data?.flatMap(template =>
// (template.ComponentDetails || []).filter(comp => comp.PrintTypeName === "Sales" && comp.SetasDefault === "Y")
// );
// setPrintTemplates(salesTemplates);
let TableData = response?.data?.data?.[0]?.ComponentDetails.map(
(item) => ({
ActiveStatus: 'A',
OptionDetails: item.FieldDetails,
StyleId: item.StyleId,
SetasDefault: item.SetasDefault,
SetasDefaultInvoice: item.SetasDefaultInvoice,
StyleName: item.StyleName,
Signature: item.Signature,
PrintType: item.PrintType,
PrintHdrName: item.PrintHdrName,
Notes: item?.Notes,
PageSize: item?.PageSize,
PrintTypeId: item?.PrintTypeId,
TermsandConditions: (item?.TermsandConditions
? item?.TermsandConditions
: []
)?.map((tc) => tc?.TermsandConditions),
})
)?.sort((a, b) => {
if ((a.StyleName || '') === 'A4Standard') return 1;
if ((b.StyleName || '') === 'A4Standard') return -1;
const isA4orA5 = (name) => /A4|A5/i.test(name);
const nameA = a.StyleName || '';
const nameB = b.StyleName || '';
if (isA4orA5(nameA) && !isA4orA5(nameB)) return 1;
if (!isA4orA5(nameA) && isA4orA5(nameB)) return -1;
const numA = parseInt(nameA.match(/\d+/)?.[0]) || 0;
const numB = parseInt(nameB.match(/\d+/)?.[0]) || 0;
return numA - numB;
});
setSizeOptionData(TableData);
}
} catch (error) {
console.error('Error fetching print styles:', error);
}
};
// Log current values for debugging
console.log('Current PrintType:', getPrintTypeValue());
console.log('Current PageSize:', getPageSizeValue());
console.log('Selected Template:', selectedTemplate);
useEffect(() => {
// Immediately pass updated settings
if (onSettingsChange && typeof onSettingsChange === 'function') {
const currentSettings = {
PrintType: getPrintTypeValue(),
PageSize: getPageSizeValue(),
selectedTemplate
PrintType: updatedTemplate.PrintType,
PageSize: updatedTemplate.PageSize,
selectedTemplate: updatedTemplate,
};
console.log('Current Print Settings:', currentSettings);
onSettingsChange(currentSettings);
}
}
};
// Call the callback if provided
if (onSettingsChange && typeof onSettingsChange === 'function') {
onSettingsChange(currentSettings);
}
}, [selectedTemplate, PrintType, PageSize]); // Removed onSettingsChange from dependencies
const onChangepageSize = async (e) => {
setPageSize(e);
// Also pass data when component mounts and when selectedTemplate changes
useEffect(() => {
if (selectedTemplate && onSettingsChange && typeof onSettingsChange === 'function') {
const currentSettings = {
PrintType: selectedTemplate.PrintType,
PageSize: selectedTemplate.PageSize,
selectedTemplate
};
console.log('Template-based Print Settings:', currentSettings);
onSettingsChange(currentSettings);
}
}, [selectedTemplate]);
// If a template is selected, update it
if (selectedTemplate) {
const updatedTemplate = {
...selectedTemplate,
PageSize: e ? 'A5' : 'A4',
};
setSelectedTemplate(updatedTemplate);
if (onSettingsChange && typeof onSettingsChange === 'function') {
const currentSettings = {
PrintType: updatedTemplate.PrintType,
PageSize: updatedTemplate.PageSize,
selectedTemplate: updatedTemplate,
};
onSettingsChange(currentSettings);
}
}
};
const onfinish = async (values) => {
try {
if (!SizeOptionData || SizeOptionData.length === 0) {
setMessageType('error');
setMessageData('Please Setup the Screen');
return;
}
const stylePreview = async (template) => {
if (!template) return;
if (!selectedTemplate) {
setMessageType('error');
setMessageData('Please select a template first');
return;
}
const {
StyleId,
StyleName,
PrintType: printType,
PageSize,
Notes,
PrintHdrName,
Signature,
TermsandConditions,
OptionDetails,
} = template;
const currentPrintType = getPrintTypeValue(); // 'S' or 'C'
const currentPageSize = getPageSizeValue(); // 'A4' or 'A5'
// Only one "Sales" style should have SetasDefault: "Y"
const updatedTemplates = SizeOptionData.map((item) => {
if (
(item.PrintType === "Sales" || item.PrintType === "S")
) {
return {
...item,
SetasDefault:
item.StyleId === selectedTemplate.StyleId ? "Y" : "N",
};
}
return item;
});
let TemplateDetails = updatedTemplates.map((item) => {
const isSelectedTemplate = item.StyleId === selectedTemplate.StyleId;
return {
SizeId: null,
StyleId: item.StyleId,
SetasDefault: item.SetasDefault,
SetasDefaultInvoice: item.SetasDefaultInvoice,
PrintTypeId: item?.PrintTypeId,
SizeDetails: item.OptionDetails.map((opt) => ({
OptionId: opt.ConfigId,
})),
...(item?.TermsandConditions?.length > 0
? {
PrintTermsandConditions: (item?.TermsandConditions
? item?.TermsandConditions
: []
)?.map((tc) => ({
TermsandConditions: tc,
})),
}
: {}),
...(item?.Notes ? { Notes: item.Notes } : {}),
PageSize: isSelectedTemplate ? currentPageSize : item?.PageSize,
...(item?.PrintHdrName ? { PrintHdrName: item.PrintHdrName } : {}),
...(item?.Signature ? { Signature: item?.Signature } : {}),
PrintType: isSelectedTemplate ? currentPrintType : item?.PrintType,
};
});
const Data = {
CompId: CompId,
BranchId: BranchId,
AppId: AppId,
TemplateDetails: TemplateDetails,
CreatedBy: UserId,
};
// console.log('API Request Data:', Data);
const response = await dispatch(
putPrintSelectionComponentData(Data)
).unwrap();
if (response?.data?.statusCode === 1) {
dispatch(changeSelectedPrintdummyData(false));
await printsyleget();
setMessageType('success');
setMessageData(response?.data?.response);
if (closeModel) {
closeModel();
}
}
} catch (error) {
console.error('Error setting default template:', error);
setMessageType('error');
setMessageData('Failed to set default template');
}
const helperFunction = (param) => {
return OptionDetails.some((item) => item.ConfigName === param);
};
const onComplete = useCallback(() => {
setMessageData(null);
setMessageType(null);
}, []);
dispatch(changeSelectedSlNo(helperFunction('Sl.No')));
dispatch(changeSelectedItem(helperFunction('Item')));
dispatch(changeSelectedMRP(helperFunction('MRP')));
dispatch(changeSelectedDiscount(helperFunction('Discount')));
dispatch(changeSelectedQuantity(helperFunction('Quantity')));
dispatch(changeSelectedRate(helperFunction('Rate')));
dispatch(changeSelectedAmount(helperFunction('Amount')));
dispatch(changeSelectedHsnCode(helperFunction('HsnCode')));
dispatch(changeSelectedQrcode(helperFunction('Qrcode')));
dispatch(changeSelectedSignature(helperFunction('signature')));
dispatch(
changeSelectedtermsAndConditions(helperFunction('terms&conditions'))
);
dispatch(changeNotes(helperFunction('Notes')));
dispatch(changeSignatureImage(Signature));
dispatch(changeBillName(PrintHdrName));
dispatch(
changeSelectedprintStyle({
ConfigId: StyleId,
ConfigName: StyleName,
})
);
};
return (
<div style={{ display: 'flex', flexDirection: 'column', gap: '1rem' }}>
<Messages
messageType={messageType}
messageData={messageData}
onComplete={onComplete}
/>
<div style={{ textAlign: 'center' }}>
<p> Print : {selectedTemplate?.StyleName}</p>
</div>
<div style={{ display: 'flex', gap: '1rem' }}>
<div>
{(
<div
style={{
display: 'flex',
alignItems: 'center',
gap: '1rem',
backgroundColor: '#f5f5f5',
padding: '0.75rem 1rem',
borderRadius: '12px',
boxShadow: '0 2px 8px rgba(0, 0, 0, 0.1)',
maxWidth: 'fit-content',
margin: '1rem 0 0 0',
}}
>
<span style={{ fontWeight: '500', color: '#555' }}>
Customized
<Tooltip title="Print will stop when the content finishes. It won't waste paper.">
<InfoCircleOutlined
style={{
color: '#1890ff',
cursor: 'pointer',
marginLeft: '5px',
}}
/>
</Tooltip>
</span>
<Switch checked={currentPrintType} onChange={onChangeToggle} />
<span style={{ fontWeight: '500', color: '#555' }}>
Standard
<Tooltip title=" Print will take full paper, even if there's less content.">
<InfoCircleOutlined
style={{
color: '#1890ff',
cursor: 'pointer',
marginLeft: '5px',
}}
/>
</Tooltip>
</span>
</div>
)}
</div>
<div>
{currentPrintType && (
<div
style={{
display: 'flex',
alignItems: 'center',
gap: '1rem',
backgroundColor: '#f5f5f5',
padding: '0.75rem 1rem',
borderRadius: '12px',
boxShadow: '0 2px 8px rgba(0, 0, 0, 0.1)',
maxWidth: 'fit-content',
margin: '1rem 0 0 0',
}}
>
<span style={{ fontWeight: '500', color: '#555' }}>A4</span>
<Switch checked={currentPageSize} onChange={onChangepageSize} />
<span style={{ fontWeight: '500', color: '#555' }}>A5</span>
</div>
)}
</div>
</div>
<div style={{ display: 'flex', justifyContent: 'flex-end', width: '100%' }}>
<Buttons
buttonText="Save"
color="901D77"
icon={<ArrowRightOutlined />}
htmlType={true}
handleSubmit={onfinish}
/>
const printsyleget = async () => {
try {
const Data = { AppId, CompId, BranchId };
let response = await dispatch(
getPrintSelectionComponentData(Data)
).unwrap();
if (response?.data?.statusCode === 1) {
// const salesTemplates = response.data.data?.flatMap(template =>
// (template.ComponentDetails || []).filter(comp => comp.PrintTypeName === "Sales" && comp.SetasDefault === "Y")
// );
// setPrintTemplates(salesTemplates);
let TableData = response?.data?.data?.[0]?.ComponentDetails.map(
(item) => ({
ActiveStatus: 'A',
OptionDetails: item.FieldDetails,
StyleId: item.StyleId,
SetasDefault: item.SetasDefault,
SetasDefaultInvoice: item.SetasDefaultInvoice,
StyleName: item.StyleName,
Signature: item.Signature,
PrintType: item.PrintType,
PrintHdrName: item.PrintHdrName,
Notes: item?.Notes,
PageSize: item?.PageSize,
PrintTypeId: item?.PrintTypeId,
TermsandConditions: (item?.TermsandConditions
? item?.TermsandConditions
: []
)?.map((tc) => tc?.TermsandConditions),
})
)?.sort((a, b) => {
if ((a.StyleName || '') === 'A4Standard') return 1;
if ((b.StyleName || '') === 'A4Standard') return -1;
const isA4orA5 = (name) => /A4|A5/i.test(name);
const nameA = a.StyleName || '';
const nameB = b.StyleName || '';
if (isA4orA5(nameA) && !isA4orA5(nameB)) return 1;
if (!isA4orA5(nameA) && isA4orA5(nameB)) return -1;
const numA = parseInt(nameA.match(/\d+/)?.[0]) || 0;
const numB = parseInt(nameB.match(/\d+/)?.[0]) || 0;
return numA - numB;
});
setSizeOptionData(TableData);
}
} catch (error) {
console.error('Error fetching print styles:', error);
}
};
// Log current values for debugging
console.log('Current PrintType:', getPrintTypeValue());
console.log('Current PageSize:', getPageSizeValue());
console.log('Selected Template:', selectedTemplate);
useEffect(() => {
const currentSettings = {
PrintType: getPrintTypeValue(),
PageSize: getPageSizeValue(),
selectedTemplate,
};
console.log('Current Print Settings:', currentSettings);
// Call the callback if provided
if (onSettingsChange && typeof onSettingsChange === 'function') {
onSettingsChange(currentSettings);
}
}, [selectedTemplate, PrintType, PageSize]); // Removed onSettingsChange from dependencies
// Also pass data when component mounts and when selectedTemplate changes
useEffect(() => {
if (
selectedTemplate &&
onSettingsChange &&
typeof onSettingsChange === 'function'
) {
const currentSettings = {
PrintType: selectedTemplate.PrintType,
PageSize: selectedTemplate.PageSize,
selectedTemplate,
};
console.log('Template-based Print Settings:', currentSettings);
onSettingsChange(currentSettings);
}
}, [selectedTemplate]);
const onfinish = async (values) => {
try {
if (!SizeOptionData || SizeOptionData.length === 0) {
setMessageType('error');
setMessageData('Please Setup the Screen');
return;
}
if (!selectedTemplate) {
setMessageType('error');
setMessageData('Please select a template first');
return;
}
const currentPrintType = getPrintTypeValue(); // 'S' or 'C'
const currentPageSize = getPageSizeValue(); // 'A4' or 'A5'
// Only one "Sales" style should have SetasDefault: "Y"
const updatedTemplates = SizeOptionData.map((item) => {
if (item.PrintType === 'Sales' || item.PrintType === 'S') {
return {
...item,
SetasDefault: item.StyleId === selectedTemplate.StyleId ? 'Y' : 'N',
};
}
return item;
});
let TemplateDetails = updatedTemplates.map((item) => {
const isSelectedTemplate = item.StyleId === selectedTemplate.StyleId;
return {
SizeId: null,
StyleId: item.StyleId,
SetasDefault: item.SetasDefault,
SetasDefaultInvoice: item.SetasDefaultInvoice,
PrintTypeId: item?.PrintTypeId,
SizeDetails: item.OptionDetails.map((opt) => ({
OptionId: opt.ConfigId,
})),
...(item?.TermsandConditions?.length > 0
? {
PrintTermsandConditions: (item?.TermsandConditions
? item?.TermsandConditions
: []
)?.map((tc) => ({
TermsandConditions: tc,
})),
}
: {}),
...(item?.Notes ? { Notes: item.Notes } : {}),
PageSize: isSelectedTemplate ? currentPageSize : item?.PageSize,
...(item?.PrintHdrName ? { PrintHdrName: item.PrintHdrName } : {}),
...(item?.Signature ? { Signature: item?.Signature } : {}),
PrintType: isSelectedTemplate ? currentPrintType : item?.PrintType,
};
});
const Data = {
CompId: CompId,
BranchId: BranchId,
AppId: AppId,
TemplateDetails: TemplateDetails,
CreatedBy: UserId,
};
// console.log('API Request Data:', Data);
const response = await dispatch(
putPrintSelectionComponentData(Data)
).unwrap();
if (response?.data?.statusCode === 1) {
dispatch(changeSelectedPrintdummyData(false));
await printsyleget();
setMessageType('success');
setMessageData(response?.data?.response);
if (closeModel) {
closeModel();
}
}
} catch (error) {
console.error('Error setting default template:', error);
setMessageType('error');
setMessageData('Failed to set default template');
}
};
const onComplete = useCallback(() => {
setMessageData(null);
setMessageType(null);
}, []);
return (
<div
style={{
display: 'flex',
flexDirection: 'column',
gap: '1rem',
alignItems: 'center',
justifyContent: 'center',
}}
>
<Messages
messageType={messageType}
messageData={messageData}
onComplete={onComplete}
/>
<div style={{ textAlign: 'center' }}>
<p> Print : {selectedTemplate?.StyleName}</p>
</div>
<div style={{ display: 'flex', gap: '1rem' }}>
<div>
{
<div
style={{
display: 'flex',
alignItems: 'center',
gap: '1rem',
backgroundColor: '#f5f5f5',
padding: '0.75rem 1rem',
borderRadius: '12px',
boxShadow: '0 2px 8px rgba(0, 0, 0, 0.1)',
maxWidth: 'fit-content',
margin: '1rem 0 0 0',
}}
>
<span style={{ fontWeight: '500', color: '#555' }}>
Customized
<Tooltip title="Print will stop when the content finishes. It won't waste paper.">
<InfoCircleOutlined
style={{
color: '#1890ff',
cursor: 'pointer',
marginLeft: '5px',
}}
/>
</Tooltip>
</span>
<Switch checked={currentPrintType} onChange={onChangeToggle} />
<span style={{ fontWeight: '500', color: '#555' }}>
Standard
<Tooltip title=" Print will take full paper, even if there's less content.">
<InfoCircleOutlined
style={{
color: '#1890ff',
cursor: 'pointer',
marginLeft: '5px',
}}
/>
</Tooltip>
</span>
</div>
}
</div>
)
}
export default SalesPrintSize
<div>
{currentPrintType && (
<div
style={{
display: 'flex',
alignItems: 'center',
gap: '1rem',
backgroundColor: '#f5f5f5',
padding: '0.75rem 1rem',
borderRadius: '12px',
boxShadow: '0 2px 8px rgba(0, 0, 0, 0.1)',
maxWidth: 'fit-content',
margin: '1rem 0 0 0',
}}
>
<span style={{ fontWeight: '500', color: '#555' }}>A4</span>
<Switch checked={currentPageSize} onChange={onChangepageSize} />
<span style={{ fontWeight: '500', color: '#555' }}>A5</span>
</div>
)}
</div>
</div>
<div
style={{ display: 'flex', justifyContent: 'flex-end', width: '100%' }}
>
<Buttons
buttonText="Save"
color="901D77"
icon={<ArrowRightOutlined />}
htmlType={true}
handleSubmit={onfinish}
/>
</div>
</div>
);
};
export default SalesPrintSize;

View File

@ -1,215 +1,215 @@
import { ArrowRightOutlined } from "@ant-design/icons";
import Buttons from "../../../../Components/Forms/Buttons";
import { gettableData, postPreferenceAppNames } from "../../../../Features/PreferenceMaster/PreferenceMaster";
import { getSession } from "../../../../Services/Others";
import { useDispatch } from "react-redux";
import { useEffect, useState } from "react";
import { getPreferenceData } from "../../../../Features/BookingScreen/BookingData/BookingData";
import { Messages } from "../../../../Components/Notifications/Messages";
import { changeSelectedPrintdummyData } from "../../../../Features/ThemeChange/ThemeChange";
import { ArrowRightOutlined } from '@ant-design/icons';
import Buttons from '../../../../Components/Forms/Buttons';
import {
gettableData,
postPreferenceAppNames,
} from '../../../../Features/PreferenceMaster/PreferenceMaster';
import { getSession } from '../../../../Services/Others';
import { useDispatch } from 'react-redux';
import { useEffect, useState } from 'react';
import { getPreferenceData } from '../../../../Features/BookingScreen/BookingData/BookingData';
import { Messages } from '../../../../Components/Notifications/Messages';
import { changeSelectedPrintdummyData } from '../../../../Features/ThemeChange/ThemeChange';
const SelectPrintMode = ({ closeModel }) => {
const CompId = getSession("CompId");
const BranchId = getSession("BranchId");
const AppId = getSession("AppId");
const UserId = getSession("UserId");
const dispatch = useDispatch();
const CompId = getSession('CompId');
const BranchId = getSession('BranchId');
const AppId = getSession('AppId');
const UserId = getSession('UserId');
const dispatch = useDispatch();
const [modes, setModes] = useState([]);
const [selected, setSelected] = useState({
whatsapp: false,
sms: false,
print: false,
email: false
const [modes, setModes] = useState([]);
const [selected, setSelected] = useState({
whatsapp: false,
sms: false,
print: false,
email: false,
});
const [messageType, setMessageType] = useState('');
const [messageData, setMessageData] = useState('');
console.log(selected, 'selected');
useEffect(() => {
fetchTableData();
}, []);
const fetchTableData = async () => {
const response = await dispatch(
gettableData({ CompId, BranchId, AppId })
).unwrap();
const data = response?.data?.data?.[0]?.SettingDtlDetails || [];
console.log(data, 'datadata');
setModes(data);
// Pre-fill checkboxes from API data
setSelected({
whatsapp: !!data.find(
(i) =>
i.SettingIdName?.trim()?.toLowerCase() === 'whatsapp' &&
i.SettingValue === 'Y'
),
sms: !!data.find(
(i) =>
i.SettingIdName?.trim()?.toLowerCase() === 'sms' &&
i.SettingValue === 'Y'
),
print: !!data.find(
(i) =>
i.SettingIdName?.trim()?.toLowerCase() === 'print' &&
i.SettingValue === 'Y'
),
email: !!data.find(
(i) =>
i.SettingIdName?.trim()?.toLowerCase() === 'email' &&
i.SettingValue === 'Y'
),
});
const [messageType, setMessageType] = useState("");
const [messageData, setMessageData] = useState("");
};
console.log(selected, 'selected');
const handleChange = (key) => {
setSelected((prev) => ({
...prev,
[key]: !prev[key],
}));
};
const handleSave = async () => {
const allowed = ['whatsapp', 'sms', 'print', 'email'];
useEffect(() => {
fetchTableData();
}, []);
const updatedSettings = modes.map((item) => {
const name = item.SettingIdName?.trim()?.toLowerCase();
const fetchTableData = async () => {
const response = await dispatch(
gettableData({ CompId, BranchId, AppId })
).unwrap();
const data = response?.data?.data?.[0]?.SettingDtlDetails || [];
console.log(data, 'datadata');
setModes(data);
// Pre-fill checkboxes from API data
setSelected({
whatsapp: !!data.find(
(i) =>
i.SettingIdName?.trim()?.toLowerCase() === "whatsapp" &&
i.SettingValue === "Y"
),
sms: !!data.find(
(i) =>
i.SettingIdName?.trim()?.toLowerCase() === "sms" &&
i.SettingValue === "Y"
),
print: !!data.find(
(i) =>
i.SettingIdName?.trim()?.toLowerCase() === "print" &&
i.SettingValue === "Y"
),
email: !!data.find(
(i) =>
i.SettingIdName?.trim()?.toLowerCase() === "email" &&
i.SettingValue === "Y"
)
});
};
const handleChange = (key) => {
setSelected((prev) => ({
...prev,
[key]: !prev[key]
}));
};
const handleSave = async () => {
const allowed = ["whatsapp", "sms", "print", "email"];
const updatedSettings = modes.map((item) => {
const name = item.SettingIdName?.trim()?.toLowerCase();
if (allowed?.includes(name)) {
return {
...item,
SettingValue: selected[name] ? "Y" : "N"
};
}
return item;
});
const payload = {
CompId,
BranchId,
CreatedBy: UserId,
AppId,
SettingDtlDetails: updatedSettings
if (allowed?.includes(name)) {
return {
...item,
SettingValue: selected[name] ? 'Y' : 'N',
};
}
console.log(payload, "payload to send");
return item;
});
try {
const response = await dispatch(postPreferenceAppNames(payload)).unwrap();
if (response?.data?.statusCode === 1) {
setMessageType("success");
setMessageData("Printer settings saved successfully.");
dispatch(changeSelectedPrintdummyData(false));
await updatePreference();
closeModel()
} else {
setMessageType("error");
setMessageData(response?.data?.message || "Failed to save printer settings.");
}
} catch (error) {
console.error("Error while saving:", error);
}
const payload = {
CompId,
BranchId,
CreatedBy: UserId,
AppId,
SettingDtlDetails: updatedSettings,
};
const updatePreference = async () => {
await dispatch(getPreferenceData({ CompId, BranchId, AppId }));
console.log(payload, 'payload to send');
try {
const response = await dispatch(postPreferenceAppNames(payload)).unwrap();
if (response?.data?.statusCode === 1) {
setMessageType('success');
setMessageData('Printer settings saved successfully.');
dispatch(changeSelectedPrintdummyData(false));
await updatePreference();
closeModel();
} else {
setMessageType('error');
setMessageData(
response?.data?.message || 'Failed to save printer settings.'
);
}
} catch (error) {
console.error('Error while saving:', error);
}
};
return (
<div
style={{
display: "flex",
flexDirection: "column",
alignItems: "center",
justifyContent: "center",
}}
>
<Messages
messageType={messageType}
messageData={messageData}
onComplete={() => {
setMessageData(null);
setMessageType(null);
}}
/>
<p style={{ fontSize: "18px", marginBottom: "10px" }}>
Select Print Mode
</p>
const updatePreference = async () => {
await dispatch(getPreferenceData({ CompId, BranchId, AppId }));
};
<div style={{ display: "flex", gap: "1rem", padding: "10px" }}>
<label>
<input
type="checkbox"
style={{ marginRight: "0.5rem" }}
checked={selected.whatsapp}
onChange={() => handleChange("whatsapp")}
/>
WhatsApp
</label>
return (
<div
style={{
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
backgroundColor:"#c4c4c4",
padding:"16px",
borderRadius:"8px"
}}
>
<Messages
messageType={messageType}
messageData={messageData}
onComplete={() => {
setMessageData(null);
setMessageType(null);
}}
/>
<p style={{ fontSize: '18px', marginBottom: '10px' }}>
Select Print Mode
</p>
<label>
<input
type="checkbox"
style={{ marginRight: "0.5rem" }}
checked={selected.sms}
onChange={() => handleChange("sms")}
/>
SMS
</label>
<div style={{ display: 'flex', gap: '1rem', padding: '10px' }}>
<label>
<input
type="checkbox"
style={{ marginRight: '0.5rem' }}
checked={selected.whatsapp}
onChange={() => handleChange('whatsapp')}
/>
WhatsApp
</label>
<label>
<input
type="checkbox"
style={{ marginRight: "0.5rem" }}
checked={selected.print}
onChange={() => handleChange("print")}
/>
Print
</label>
<label>
<input
type="checkbox"
style={{ marginRight: '0.5rem' }}
checked={selected.sms}
onChange={() => handleChange('sms')}
/>
SMS
</label>
<label>
<input
type="checkbox"
style={{ marginRight: "0.5rem" }}
checked={selected.email}
onChange={() => handleChange("email")}
/>
Email
</label>
</div>
<label>
<input
type="checkbox"
style={{ marginRight: '0.5rem' }}
checked={selected.print}
onChange={() => handleChange('print')}
/>
Print
</label>
<label>
<input
type="checkbox"
style={{ marginRight: '0.5rem' }}
checked={selected.email}
onChange={() => handleChange('email')}
/>
Email
</label>
</div>
<div
style={{
width: "100%",
display: "flex",
justifyContent: "flex-end",
marginTop: 24,
}}
>
<Buttons
buttonText="Save"
color="901D77"
icon={<ArrowRightOutlined />}
htmlType={true}
handleSubmit={handleSave}
/>
</div>
</div>
);
<div
style={{
width: '100%',
display: 'flex',
justifyContent: 'flex-end',
marginTop: 24,
}}
>
<Buttons
buttonText="Save"
color="901D77"
icon={<ArrowRightOutlined />}
htmlType={true}
handleSubmit={handleSave}
/>
</div>
</div>
);
};
export default SelectPrintMode;

View File

@ -4,7 +4,7 @@
flex-wrap: wrap;
gap: 1rem;
.ant-input-affix-wrapper>input.ant-input {
.ant-input-affix-wrapper > input.ant-input {
padding: 4px 1px !important;
padding-top: 1rem !important;
}
@ -61,6 +61,10 @@
.DeliveryChallan-inputForm .ant-table-content {
width: 70vw;
}
.DeliveryChallan-inputForm .ant-table-thead tr {
background-color: #2c88ee !important;
}
.DeliveryChallan-inputForm {
display: flex;
@ -107,8 +111,8 @@
// right: 100px;
}
.ant-table-wrapper .ant-table-tbody>tr.ant-table-row:hover>td,
.ant-table-wrapper .ant-table-tbody>tr>th.ant-table-cell-row-hover>td.ant-table-cell-row-hover {
.ant-table-wrapper .ant-table-tbody > tr.ant-table-row:hover > td,
.ant-table-wrapper .ant-table-tbody > tr > th.ant-table-cell-row-hover > td.ant-table-cell-row-hover {
background: rgb(224, 223, 223) !important;
font-size: unset !important;
transition-duration: 0.4s !important;
@ -129,7 +133,6 @@
}
.Deliverychallan-table {
// width: 70px;
.ant-table table {
border-spacing: 0px;
@ -138,4 +141,8 @@
.ant-table-wrapper table {
width: 84% !important;
}
}
.product-scan .sales-quotation{
display: flex;
}

View File

@ -61,6 +61,7 @@ import { useSelector } from 'react-redux';
import { getPrintSelectionComponentData } from '../../Features/ThemeChange/ThemeChange.js';
import { DCPDFMobilePrint } from './DCPDFMobilePrint.js';
import { isMobile } from 'react-device-detect';
const DeliveryChellanForm = () => {
const { SadminuserAccess } = useAuth();

View File

@ -24,6 +24,9 @@
vertical-align: middle;
height: 35px;
}
.ant-table-thead tr {
background-color: #2c88ee !important;
}
}
.dc-to-invoice-payment-mode {
@ -46,4 +49,16 @@
margin: 0px 2rem;
gap: 10px;
padding-top: 0;
}
}
.delivery-challan-to-invoice-form {
width: 100%;
}
.DCformDivAnt {
display: flex;
align-items: flex-start;
gap: 1rem;
justify-content: flex-start;
flex-direction: column;
}

View File

@ -342,7 +342,7 @@ const DeliveryChallanToInvoiceForm = () => {
<Form
ref={formRef}
initialValues={editstate}
className="formDivAnt"
className="DCformDivAnt"
onFinish={onFinish}
>
<Form.Item
@ -409,7 +409,7 @@ const DeliveryChallanToInvoiceForm = () => {
/>
</Form.Item>
</>}
<div className="submitButton">
<Form.Item>
<Buttons
buttonText="SUBMIT"
@ -442,7 +442,7 @@ const DeliveryChallanToInvoiceForm = () => {
</div>
</div>
)}
</div>
</Form>

View File

@ -1,9 +1,9 @@
.OfferList-Master {
padding: 20px;
padding: 0;
background: #fff;
min-height: 100vh;
width: 100%;
margin: 0 0 1rem 1rem;
margin: 0 0 0 0;
overflow: auto;
margin-bottom: 2rem;
border-radius: 12px;
@ -477,6 +477,12 @@
font-size: 14px;
color: #878787;
}
.ant-input-affix-wrapper {
width: 250px !important;
}
.ant-input {
padding: 3px 14px 9px 11px !important;
}
}
// Table Styles

View File

@ -1156,6 +1156,7 @@ const PaymentDetailsList = () => {
flexWrap: 'wrap',
alignItems: 'flex-start',
gap: '1rem',
display: 'flex',
}}
>
<Tooltip

View File

@ -71,21 +71,7 @@
font-size: 12px !important;
}
// .custom-table tbody tr {
// >td:nth-child(6) {
// display: flex;
// flex-direction: column;
// width: 100%;
// gap: 2rem;
// }
// >td:nth-child(7) {
// display: flex;
// flex-direction: column;
// width: 100%;
// gap: 2rem;
// }
// }
.custom-table tbody tr td {
text-align: left;
@ -138,11 +124,7 @@
}
}
.summaryContent2 {
.centerDivList {
// width: 50%;
}
}
.custom-table {
Button:disabled,

View File

@ -4419,6 +4419,7 @@
}
.CustomerForm-Master {
width: 100%;
.inputForm {
width: 50% !important;
}

View File

@ -5,8 +5,9 @@ import { Modal } from "antd";
import { getProductStockDetails } from "../../../Features/PurchaseOrder/PurchaseOrder";
import { dateFormatChange, ExtractDateFormate, getSession } from "../../../Services/Others";
import { useDispatch } from "react-redux";
import { changeBreadCrumb } from "../../../Features/AppPage/CenterPage";
// import "./PurchaseOrderReport.css";
import { changeBreadCrumb } from "../../../Features/AppPage/CenterPage";
import "./PurchaseOrderReport.scss";
const subDirectory = import.meta.env.BASE_URL;
const PurchaseOrderReport = () => {
const dispatch = useDispatch();

View File

@ -0,0 +1,646 @@
.ItemWiseReport-table .ant-table table {
// height:60vh;
// overflow:scroll;
overflow: scroll;
// height: clamp(30vh , 85vh,95vh);
border-spacing: 0 0.3rem;
}
.ItemWiseReport-table .ant-table-thead {
position: sticky;
top: 0 !important;
background-color: #bad4f9;
z-index: 1;
border-spacing: 0 0 !important;
}
.ItemWiseReport-table .ant-table-wrapper .ant-table-thead > tr > th,
.ant-table-wrapper .ant-table-thead > tr > td {
color: #000000;
font-size: 12px;
font-weight: 600;
border-spacing: 0 0.3rem;
}
.ItemWiseReport-table .ant-table-row > td {
color: black !important;
font-weight: 500 !important;
font-size: 16px;
}
.ItemWiseReport-search {
display: flex;
justify-content: end;
column-gap: 1rem;
margin-bottom: 10px;
}
.ItemWiseReport-search-button {
border: none;
background-color: #e167ff;
padding: 1rem 1.5rem;
border-radius: 6px;
}
.ItemWiseReport-Date-from-heading {
width: 7rem;
}
.ItemWiseReport-container {
display: flex;
flex-direction: column;
row-gap: 0.5rem;
// padding: 10px 15px;
height: 88vh;
// overflow: hidden;
overflow: auto;
width: 100%;
flex-wrap: wrap;
background-color: #fff;
border-radius: 12px;
}
.ItemWiseReport-table .ant-pagination {
position: sticky;
bottom: 0;
margin: 0 !important;
padding: 0.5rem;
background-color: #fafafa;
}
.ItemWiseReport-header {
display: flex;
gap: 10px;
justify-content: space-between;
flex-wrap: wrap;
align-items: center;
margin-top: 10px;
}
.ItemWiseReport-heading {
font-size: 20px;
font-weight: 500;
}
.search-purchase {
input,
.ant-input {
border-start-end-radius: 6px !important;
border-end-end-radius: 6px !important;
padding-top: 6px !important;
}
.ant-input {
height: 40px;
}
.searchDiv {
height: 42px;
}
}
.ItemWiseReport-submit-btn-container {
display: flex;
flex-direction: column;
justify-content: center;
width: max-content;
margin-left: 20px;
}
.ItemWiseReport-PrinttAndSubmit {
display: flex;
column-gap: 3vw;
align-items: center;
// width: 100%;
justify-content: space-between;
margin-left: 30px;
}
.ItemWiseReport-dateaAnd-buttons {
display: flex;
column-gap: 2rem;
row-gap: 1rem;
// align-items: center;
// flex-wrap: wrap;
}
.ItemWiseReport-Date-picker {
display: flex;
flex-wrap: wrap;
align-items: center;
column-gap: 2rem;
// row-gap: 1rem;
.ant-form-item {
margin-bottom: 0 !important;
}
}
.ItemWiseReport-Date .ant-picker {
width: 20rem;
}
.ItemWiseReport-submit-btn {
padding: 0.6rem 1rem;
border: none;
background-color: var(--PRIMARY_BUTTON_BG_COLOR) !important;
margin-bottom: 2px;
font-size: 16px;
font-family: "Gilroy";
color: #ffffff;
border-radius: 5px;
cursor: pointer;
}
// .ItemWiseReport-submit-btn:hover {
// background-color: #a8a8a8;
// }
.ItemWiseReport-PrinterIcon-Container {
cursor: pointer;
// position: absolute;
// top: 6rem;
// right: 5rem;
}
.ItemWiseReport-printerIcon {
font-size: 25px;
cursor: pointer;
}
.ItemWiseReport-printerIcon:hover {
color: #414141;
}
.ItemWiseReport-Date {
display: flex;
column-gap: 1rem;
align-items: center;
}
.ItemWiseReport-Details-container {
display: flex;
justify-content: space-between;
align-items: center;
margin-right: 2rem;
column-gap: 1rem;
flex-wrap: wrap;
}
.ItemWiseReport-Details {
margin-left: 0.7rem;
display: flex;
column-gap: 1rem;
row-gap: 0.5rem;
flex-wrap: wrap;
}
.ItemWiseReport-Details-buttons {
border: none;
padding: 0.6rem 1rem;
width: max-content;
background-color: #006aff;
border-radius: 5px;
color: #fff;
cursor: pointer;
}
.ItemWiseReport-printerIcon {
font-size: 30px;
}
.ItemWiseReport-table-container {
margin: 1rem 1rem;
}
.ItemWiseReport-Date p {
font-size: 11px;
color: #5a5a5a;
margin-left: 5px;
margin-top: 2px;
}
.ItemWiseReport-table {
overflow: auto;
height: clamp(50vh, 30vh, 95vh);
scrollbar-width: thin;
tr:nth-child(even) {
background-color: #e9e8e8 !important;
border: none;
}
//dhana
// height: clamp(30vh, 50vh, 95vh);
}
// writed by sree
.ItemWiseReport-table1 {
overflow: auto;
height: clamp(40vh, 30vh, 95vh);
width: 79vw !important;
}
.ItemWiseReport-table .ant-table-thead tr .ant-table-cell {
font-size: 25px;
font-weight: 800;
}
.ItemWiseReport-Amount-Collected-table {
display: flex;
justify-content: flex-end;
}
.ItemWiseReport-netAmount {
display: flex;
justify-content: flex-end;
padding-top: 10px;
}
.ItemWiseReport-search .ant-input {
border-radius: 10px !important;
padding: 0.35rem 0.5rem !important;
}
.BSitemwise-Search-icon {
font-size: 25px;
color: #1292ee;
}
.dropDownandsumit {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
.ant-form-item {
margin-bottom: 0 !important;
}
}
.Submit_Print {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
}
@media only screen and (max-width: 950px) {
.ItemWiseReport-PrinttAndSubmit {
display: flex;
column-gap: 3vw;
align-items: center;
justify-content: space-between;
// margin-left: 30px;
// margin-bottom: 23px;
}
.ItemWiseReport-PrinterIcon-Container {
margin-left: 30px;
cursor: pointer;
// position: absolute;
// top: 5rem;
// right: 1rem;
}
.ItemWiseReport-table {
overflow: scroll;
height: 40vh;
}
.ItemWiseReport-container {
padding: 15px 15px;
}
.ItemWiseReport-dateaAnd-buttons {
column-gap: 0.5rem;
}
.ItemWiseReport-netAmount {
justify-content: flex-start !important;
padding-top: 10px;
}
.dropdownUserid {
margin-top: 0 !important;
}
// .ItemWiseReport-dateaAnd-buttons {
// // flex-wrap: wrap;
// }
.ItemWiseReport-submit-btn-container {
margin-left: 4.5rem;
justify-content: flex-start !important;
flex-direction: row;
column-gap: 0.5rem;
margin-bottom: 24px;
width: 83px;
}
.ItemWiseReport-Date p {
padding: 0;
}
.ItemWiseReport-table .ant-table-wrapper .ant-table-thead > tr > th,
.ant-table-wrapper .ant-table-thead > tr > td {
font-size: 10px !important;
}
}
@media only screen and (max-width: 768px) {
.ItemWiseReport-submit-btn-container {
margin-left: 5px;
}
.ItemWiseReport-table {
width: 80vw;
}
}
@media only screen and (max-width: 499px) {
.ItemWiseReport-submit-btn-container {
font-size: 12px !important;
}
.centerPageSub {
margin: 0;
}
.ItemWiseReport-table {
overflow-x: scroll;
height: 26vh;
}
}
@media only screen and (max-width: 280px) {
// .ItemWiseReport-PrinttAndSubmit {
// position: absolute !important;
// top: 18rem !important;
// }
.ItemWiseReport-PrinterIcon-Container {
position: absolute;
top: 290px !important;
left: 200px !important;
}
.Submit_Print {
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-around;
margin-left: 20px;
}
.ItemWiseReport-Date {
width: 3rem !important;
}
.ItemWiseReport-Date p {
font-size: 12px !important;
}
.dropDownandsumit {
margin-top: 30px !important;
height: 160px;
}
.ItemWiseReport-search {
display: flex;
justify-content: start;
column-gap: 1rem;
width: 4rem !important;
}
.ItemWiseReport-heading {
font-size: 13px;
font-weight: 500;
}
.ItemWiseReport-submit-btn-container {
margin-top: 20px;
}
.ItemWiseReport-dateaAnd-buttons {
column-gap: 0.5rem;
width: 75vw !important;
overflow: auto !important;
}
.ItemWiseReport-table {
overflow: scroll;
height: 30vh;
}
}
.ItemWiseReport-table .ant-table-thead th.ant-table-column-has-sorters:hover {
background-color: #bad4f9;
}
.ItemWiseReport-table .ant-table-wrapper .ant-table-thead > tr > th,
.ant-table-wrapper .ant-table-thead > tr > td {
background-color: #bad4f9;
}
.ItemWiseReport-printerIcon-disabled {
opacity: 0.5;
/* You can adjust the opacity to visually indicate it's disabled */
pointer-events: none;
/* Disable pointer events so it won't respond to clicks */
cursor: not-allowed;
/* Change cursor to indicate it's not clickable */
font-size: 30px;
}
.dropdownUserid {
margin-top: 10px;
}
.itemwiseDropdown {
width: 9rem !important;
}
.ItemWiseReport-Date {
width: 8rem;
}
.ItemWiseReport-table .ant-table-content table {
table-layout: unset !important;
}
.toggle {
display: flex;
width: inherit;
height: 2vw;
flex-direction: row-reverse;
z-index: 1;
// padding-right: 93px;
padding-bottom: 25px;
}
// .ant-switch:hover:not(.ant-switch-disabled) {
// background:var(--SELECTED_COLOR) ;
// }
//nk
@media only screen and (max-width: 499px) {
.ItemWiseReport-Amount-Collected-table tr {
justify-content: flex-start;
column-gap: 5rem;
}
.ItemWiseReport-border-dashed {
width: 10rem;
}
.ItemWiseReport-Amount-Collected-table {
justify-content: flex-start;
}
.centerPageSub {
margin: 0 !important;
}
.ItemWiseReport-border-dashed {
font-size: 15px;
}
.ItemWiseReport-border-dashed {
width: 10rem;
}
}
@media only screen and (max-width: 768px) {
.overalTotal {
width: 7rem;
font-size: 20px;
}
}
.ItemWiseReport-Amount-Collected-table {
display: flex;
justify-content: flex-end;
}
.ItemWiseReport-Amount-Collected-table tr {
display: flex;
// width: 15rem;
justify-content: space-between;
}
.ItemWiseReport-border-dashed {
border-bottom: 1px dashed rgb(46, 46, 46);
width: 17rem;
}
.ItemWiseReport-border-dashed {
font-size: 23px;
font-weight: 600;
}
.custom-table {
width: 100%;
border-collapse: collapse;
border: 1px solid #909090;
font-family: "Poppins", sans-serif;
> thead {
position: sticky;
top: -1px;
}
}
.custom-table th {
background-color: #a4c5f4;
color: #1e1e1e;
padding: 6px;
text-align: left;
border: 1px solid #909090;
-webkit-text-stroke-width: 0.2px;
font-size: 12px;
font-weight: 500;
font-family: VAR(--HEADING_FONT_FAMILY);
// text-transform: uppercase;
text-transform: capitalize;
letter-spacing: 0.2px;
}
.centerDivList {
display: flex;
flex-direction: column;
gap: 4px;
// width: 100%;
// height: 43vh;
overflow: scroll;
padding-bottom: 2rem;
}
.custom-table td {
padding: 4px 6px;
border: 1px solid #909090;
text-align: left;
font-size: 12px !important;
}
.custom-table tbody tr td {
text-align: left;
.ant-select.ant-select-in-form-item {
width: 190px !important;
}
}
.custom-table tbody tr td[colspan="7"] {
padding: 20px;
}
.custom-table tbody tr.additionalCharges-selected {
background-color: #dddddd;
}
.custom-table tbody tr.setAsDefault-selected {
background-color: #cceaf0;
}
.custom-table {
.ant-form-item {
margin-bottom: 0 !important;
}
.float-label {
margin-bottom: 8px !important;
}
}
.ChargesAddAndCancel {
display: flex;
justify-content: flex-end;
gap: 1rem;
> div {
border-radius: 6px;
padding: 5px 10px;
color: #fff;
font-weight: 600 !important;
cursor: pointer;
}
> div:nth-child(1) {
background-color: #28aa3a;
}
> div:nth-child(2) {
background-color: #ff0000;
}
}
.custom-table {
Button:disabled,
Button[disabled] {
width: unset !important;
height: unset !important;
border-radius: 50px !important;
}
}

View File

@ -21,7 +21,8 @@ import { getSession, validateSafeInput } from '../../Services/Others';
import { postshift, putshift } from '../../Features/ShiftMaster/ShiftMaster.js';
import './ShiftMaster.scss';
import { FaPlus } from 'react-icons/fa6';
import "../../Styles/OverAllStyle/OverAllStyle.scss";
const subDirectory = import.meta.env.BASE_URL;
const ShiftForm = ({ formType }) => {

View File

@ -254,8 +254,128 @@
.stockAdjustListMaster {
.primary_Button {
width: 290px !important;
.custom-table {
width: 100%;
border-collapse: collapse;
border: 1px solid #909090;
font-family: 'Poppins', sans-serif;
> thead {
position: sticky;
top: -1px;
}
}
.custom-table th {
background-color: #a4c5f4;
color: #1e1e1e;
padding: 6px;
text-align: left;
border: 1px solid #909090;
-webkit-text-stroke-width: 0.2px;
font-size: 12px;
font-weight: 500;
font-family: VAR(--HEADING_FONT_FAMILY);
// text-transform: uppercase;
text-transform: capitalize;
letter-spacing: 0.2px;
}
.centerDivList {
display: flex;
flex-direction: column;
gap: 4px;
// width: 100%;
// height: 43vh;
overflow: scroll;
padding-bottom: 2rem;
}
.custom-table td {
padding: 4px 6px;
border: 1px solid #909090;
text-align: left;
font-size: 12px !important;
}
.custom-table tbody tr td {
text-align: left;
.ant-select.ant-select-in-form-item {
width: 190px !important;
}
}
.custom-table tbody tr td[colspan='7'] {
padding: 20px;
}
.custom-table tbody tr.additionalCharges-selected {
background-color: #dddddd;
}
.custom-table tbody tr.setAsDefault-selected {
background-color: #cceaf0;
}
.custom-table {
.ant-form-item {
margin-bottom: 0 !important;
}
.float-label {
margin-bottom: 8px !important;
}
}
.ChargesAddAndCancel {
display: flex;
justify-content: flex-end;
gap: 1rem;
> div {
border-radius: 6px;
padding: 5px 10px;
color: #fff;
font-weight: 600 !important;
cursor: pointer;
}
> div:nth-child(1) {
background-color: #28aa3a;
}
> div:nth-child(2) {
background-color: #ff0000;
}
}
.custom-table {
Button:disabled,
Button[disabled] {
width: unset !important;
height: unset !important;
border-radius: 50px !important;
}
}
.openingStock-ignoreProductBTN {
width: max-content;
white-space: nowrap;
height: max-content;
padding: 10px 16px;
color: #fff;
border-radius: 8px;
cursor: pointer;
border: none;
background-color: #e42006;
font-size: 14px;
font-weight: 400;
font-family: "Poppins";
margin-left: 6px;
}

View File

@ -203,7 +203,7 @@ const StockadjustmentList = () => {
<div>
<FormHeader title={'Stock Adjustment'} />
</div>
<div className="searchAddDiv">
<div className="formSearch">
<Search
placeholder="Search"
@ -211,7 +211,7 @@ const StockadjustmentList = () => {
onSearchChange={onSearchChange}
/>
</div>
</div>
<Buttons
buttonText={'Stock Adjustment'}
handleSubmit={() => handelAddButton()}

View File

@ -106,7 +106,7 @@ const KitechenFinishform = ({ formType }) => {
useEffect(() => {
Proddatas();
dispatch(changeBreadCrumb({ items: items }));
getPreference()
getPreference();
}, []);
const Empchanges = async (e) => {
@ -982,12 +982,16 @@ const KitechenFinishform = ({ formType }) => {
const getPreference = async () => {
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId };
const { data: res } = await dispatch(getPreferenceData(data)).unwrap()
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find((setting) => setting?.SettingIdName?.toLowerCase() === "decimal" && setting?.SettingValue === 'Y');
const { data: res } = await dispatch(getPreferenceData(data)).unwrap();
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find(
(setting) =>
setting?.SettingIdName?.toLowerCase() === 'decimal' &&
setting?.SettingValue === 'Y'
);
if (decimalSetting) {
setAllowDecimal(true)
setAllowDecimal(true);
}
}
};
function safeRound(amountStr) {
if (amountStr == null) return allowDecimal ? '0.00' : '0';

View File

@ -274,4 +274,27 @@
margin-bottom: 10px;
color: #1292ee;
text-decoration: underline;
}
}
.purchase-entry-fh {
@media (max-width: 600px) {
padding-top: 0;
}
.formName {
display: flex;
}
// .formHeader {
// width: -webkit-fill-available;
// }
.header-buttons {
display: flex;
align-items: center;
justify-content: flex-end;
flex-direction: row;
width: 100%;
gap: 10px;
}
}

View File

@ -168,6 +168,7 @@
flex-direction: row;
row-gap: 0.5rem;
gap: 2rem;
padding-bottom: 4px;
// flex-wrap: wrap;
@media (max-width: 768px) {
flex-wrap: wrap;
@ -458,3 +459,8 @@
background-color: #2c88ee1c !important;
font-weight: unset;
}
.ant-table-thead tr {
background-color: #2c88ee !important;
}

View File

@ -46,7 +46,7 @@
padding: 5px;
gap: 5px;
align-items: center;
font-family: 'Poppins', sans-serif;
font-family: "Poppins", sans-serif;
float: right;
background-color: #000;
font-size: x-small;
@ -178,6 +178,9 @@
height: 70vh;
overflow: scroll;
scrollbar-width: thin;
.ant-table-thead tr {
background-color: #2c88ee !important;
}
.ant-table-cell {
padding: 8px 8px !important;
@ -190,8 +193,8 @@
padding: 0.5rem;
background-color: #fafafa;
}
.ant-table-content{
font-family: 'Poppins';
.ant-table-content {
font-family: "Poppins";
}
}
@ -208,7 +211,7 @@
}
.bsreprintmodaltable-search input {
font-family: 'Poppins';
font-family: "Poppins";
width: 250px;
padding: 4px 14px;
border: 1px solid #ccc;

View File

@ -1,9 +1,8 @@
.receipt-reprint {
font-family: 'Poppins';
font-family: "Poppins";
.ant-table {
font-family: 'Poppins', sans-serif !important;
font-family: "Poppins", sans-serif !important;
font-weight: 400 !important;
}
@ -12,24 +11,27 @@
align-items: center;
// justify-content: space-between;
gap: 10px;
margin-bottom: 16px;
margin-bottom: 16px;
}
.receipt-reprint-body {
height: 70vh;
.ant-table-thead tr {
background-color: #2c88ee !important;
}
table {
tbody {
>tr {
> tr {
box-shadow: unset !important;
border-bottom: unset !important;
}
>tr:nth-child(even) {
> tr:nth-child(even) {
background-color: #4b4b4b49 !important;
}
>tr:nth-child(odd) {
> tr:nth-child(odd) {
background-color: #ffffff00 !important;
}
}
@ -38,29 +40,23 @@
.search-input {
width: 280px !important;
padding: 4px 12px;
padding: 5px 12px;
border: 1px solid rgb(204, 204, 204) !important;
border-radius: 6px;
font-size: 14px;
outline: none;
transition: 0.2s;
font-family: 'Poppins';
font-family: "Poppins";
&:focus {
border: 1px solid #1677ff !important;
}
}
.reprint-reason-header {
font-size: 3rem !important;
}
@media (max-width: 567px) {
.search-input {
width: unset !important;
@ -73,20 +69,18 @@
scrollbar-width: thin;
}
}
}
.reprint-reason-modal {
font-family: 'Poppins' !important;
font-family: "Poppins" !important;
.ant-table-cell {
font-weight: 400 !important;
font-family: 'Poppins' !important;
font-family: "Poppins" !important;
font-size: 14px !important;
>div {
font-family: 'Poppins' !important;
> div {
font-family: "Poppins" !important;
}
}
@ -96,10 +90,9 @@
}
.original-duplicate-switch {
.ant-switch-inner-checked,
.ant-switch-inner-unchecked {
font-family: 'Poppins';
font-family: "Poppins";
font-weight: 500;
}
@ -118,7 +111,6 @@
.ant-select-arrow {
top: 75%;
}
}
.action-icons-reprint {
@ -151,12 +143,10 @@
}
.icon-email {
background-color: #f59e0b;
}
.icon-whatsapp {
background-color: #076e26ff;
}
}
}

View File

@ -158,3 +158,9 @@
flex-wrap: wrap;
margin-bottom: 10px;
}
.stockAdjustListMaster {
.primary_Button {
width: max-content !important;
}
}

View File

@ -10,7 +10,7 @@
.productListBrowseImageButton2 {
width: 65px;
background-color: #dbd1d1;
border: 0.5px solid gray;
border: 0.5px solid #808080;
border-radius: 3px;
font-size: 10px;
font-weight: 600;
@ -74,7 +74,7 @@
.samplereportTableButton {
justify-content: flex-end;
margin: 1rem 0;
margin: 10px 0;
align-items: center;
display: flex;
width: 100%;
@ -754,6 +754,7 @@
.StorekitchenlistTable {
scrollbar-width: thin;
padding-right: 8px;
margin-top: 10px;
@media (max-width: 600px) {
}
@ -1538,6 +1539,9 @@ table {
padding: 3px 14px 4px 11px !important;
text-align: center;
}
.ant-table-thead tr {
background-color: #2c88ee !important;
}
}
.PriChangeUpper {
display: flex;
@ -1561,3 +1565,44 @@ table {
}
}
}
.pruchaseCatBTN {
display: flex;
align-items: center;
gap: 7px;
padding: 8px 16px;
background-color: #0bad77;
border-radius: 7px;
color: white;
cursor: pointer;
font-family: "Poppins";
font-weight: 400;
white-space: nowrap;
font-size: 13.5px;
transition: all 0.2s;
&:hover {
background-color: #069666;
}
}
.scan-receipt-btn {
display: flex;
align-items: center;
gap: 7px;
padding: 8px 16px;
background-color: #1292ee;
border-radius: 7px;
color: white;
cursor: pointer;
font-family: "Poppins";
font-weight: 400;
white-space: nowrap;
font-size: 13.5px;
transition: all 0.2s;
&:hover {
background-color: #0985be;
}
}
.CustomerForm-Master {
width: 100%;
}

View File

@ -4,7 +4,7 @@
flex-wrap: wrap;
gap: 1rem;
.ant-input-affix-wrapper>input.ant-input {
.ant-input-affix-wrapper > input.ant-input {
padding-top: 1.7rem;
}
}
@ -18,6 +18,9 @@
overflow: auto !important;
scrollbar-width: thin;
}
.ant-table-thead tr {
background-color: #2c88ee !important;
}
}
.purchaseQuoaDetails {
@ -86,8 +89,8 @@
// right: 100px;
}
.ant-table-wrapper .ant-table-tbody>tr.ant-table-row:hover>td,
.ant-table-wrapper .ant-table-tbody>tr>th.ant-table-cell-row-hover>td.ant-table-cell-row-hover {
.ant-table-wrapper .ant-table-tbody > tr.ant-table-row:hover > td,
.ant-table-wrapper .ant-table-tbody > tr > th.ant-table-cell-row-hover > td.ant-table-cell-row-hover {
background: rgb(224, 223, 223) !important;
font-size: unset !important;
transition-duration: 0.4s !important;
@ -102,7 +105,6 @@
}
.Quotation-table {
// width: 70px;
.ant-table table {
border-spacing: 0px;
@ -122,7 +124,7 @@
border-radius: 8px;
font-size: 14px;
font-weight: 500;
font-family: 'Poppins', sans-serif;
font-family: "Poppins", sans-serif;
padding: 6px 12px;
border: 1px solid #d1d1d1;
}
@ -146,4 +148,4 @@
input {
padding: 6px 25px 6px 12px !important;
}
}
}

View File

@ -146,7 +146,7 @@
background-color: var(--PRIMARY_BUTTON_BG_COLOR) !important;
margin-bottom: 2px;
font-size: 16px;
font-family: 'Gilroy';
font-family: "Gilroy";
color: #ffffff;
border-radius: 5px;
cursor: pointer;
@ -436,51 +436,6 @@
}
}
// @media screen and (max-width: 620px) {
// .ItemWiseReport-table{
// height: 41vh !important;
// }
// .ItemWiseReport-dateaAnd-buttons{
// display: flex;
// flex-direction: column;
// column-gap: 0.5rem;
// row-gap: 0.5rem;
// // align-items: center;
// flex-wrap: wrap;
// }
// .ItemWiseReport-Date-picker {
// display: flex;
// // flex-wrap: wrap;
// column-gap: 0.3rem;
// row-gap: 0rem;
// }
// .dropdownUserid{
// .ant-select-single:not(.ant-select-customize-input) .ant-select-selector
// {
// width: 10rem;
// }
// }
// .ItemWiseReport-netAmount {
// display: flex;
// justify-content: flex-start;
// }
// }
// @media only screen and (min-width: 450px) and (max-width: 640px){
// .ItemWiseReport-table{
// width: 500px;
// }
// .ItemWiseReport-dateaAnd-buttons{
// display: flex;
// column-gap: 1rem;
// row-gap: 1rem;
// align-items: center;
// flex-wrap: wrap;
// justify-content: space-between;
// }
// }
.ItemWiseReport-table .ant-table-thead th.ant-table-column-has-sorters:hover {
background-color: #bad4f9;
}
@ -585,29 +540,107 @@
font-weight: 600;
}
// .ItemWiseReport-table {
// overflow-y: auto;
// scrollbar-width: unset;
// scrollbar-color: #c1c1c1 transparent;
// }
.custom-table {
width: 100%;
border-collapse: collapse;
border: 1px solid #909090;
font-family: "Poppins", sans-serif;
// .ItemWiseReport-table::-webkit-scrollbar {
// width: 25px;
// }
> thead {
position: sticky;
top: -1px;
}
}
// .ItemWiseReport-table::-webkit-scrollbar-track {
// background: #f0f0f0;
// border-radius: 10px;
// }
.custom-table th {
background-color: #a4c5f4;
color: #1e1e1e;
padding: 6px;
text-align: left;
border: 1px solid #909090;
-webkit-text-stroke-width: 0.2px;
font-size: 12px;
font-weight: 500;
font-family: VAR(--HEADING_FONT_FAMILY);
// text-transform: uppercase;
text-transform: capitalize;
letter-spacing: 0.2px;
}
// .ItemWiseReport-table::-webkit-scrollbar-thumb {
// background-color: #c1c1c1;
// border-radius: 10px;
// border: 6px solid transparent;
// background-clip: content-box;
// transition: background-color 0.3s ease;
// }
.centerDivList {
display: flex;
flex-direction: column;
gap: 4px;
// width: 100%;
// height: 43vh;
overflow: scroll;
padding-bottom: 2rem;
}
// .ItemWiseReport-table::-webkit-scrollbar-thumb:hover {
// background-color: #a0a0a0;
// }
.custom-table td {
padding: 4px 6px;
border: 1px solid #909090;
text-align: left;
font-size: 12px !important;
}
.custom-table tbody tr td {
text-align: left;
.ant-select.ant-select-in-form-item {
width: 190px !important;
}
}
.custom-table tbody tr td[colspan="7"] {
padding: 20px;
}
.custom-table tbody tr.additionalCharges-selected {
background-color: #dddddd;
}
.custom-table tbody tr.setAsDefault-selected {
background-color: #cceaf0;
}
.custom-table {
.ant-form-item {
margin-bottom: 0 !important;
}
.float-label {
margin-bottom: 8px !important;
}
}
.ChargesAddAndCancel {
display: flex;
justify-content: flex-end;
gap: 1rem;
> div {
border-radius: 6px;
padding: 5px 10px;
color: #fff;
font-weight: 600 !important;
cursor: pointer;
}
> div:nth-child(1) {
background-color: #28aa3a;
}
> div:nth-child(2) {
background-color: #ff0000;
}
}
.custom-table {
Button:disabled,
Button[disabled] {
width: unset !important;
height: unset !important;
border-radius: 50px !important;
}
}

View File

@ -101,11 +101,6 @@ a {
background: #999999;
}
/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
/* background: #8F1E78; */
}
.samplereportTable {
overflow: auto;
width: 80vw;
@ -178,8 +173,6 @@ a {
/* Position the tooltip */
position: absolute;
z-index: 1;
}
.navbar-top {
@ -331,3 +324,7 @@ a {
.ant-table table {
border-spacing: 0 0 !important;
}
.ant-table-tbody .ant-table-cell {
font-family: 'Poppins' !important;
}