Implement dynamic header and table color functionality

This commit is contained in:
Srinath 2026-03-04 16:31:47 +05:30
parent 4a27698a59
commit d4a94da912
1 changed files with 198 additions and 51 deletions

View File

@ -29,6 +29,16 @@ import {
GlobalprintCredit, GlobalprintCredit,
GlobalprintTax, GlobalprintTax,
GlobalSelectedPrintHeaderColor, GlobalSelectedPrintHeaderColor,
GlobalSelectedPrintHeaderFontColor,
GlobalSelectedTableHeaderColor,
GlobalSelectedTableHeaderFontColor,
GlobalSelectedTableBodyFontColor,
GlobalSelectedTableBodyColor,
GlobalRowType,
GlobalSelectedFooterColor,
GlobalSelectedFooterFontColor,
GlobalSelectedNetAmountColor,
GlobalSelectedNetAmountFontColor,
} from '../../../../Features/ThemeChange/ThemeChange'; } from '../../../../Features/ThemeChange/ThemeChange';
import Logo from '../../../../Images/Logo.jpg'; import Logo from '../../../../Images/Logo.jpg';
import { import {
@ -150,6 +160,22 @@ const Printstyle8 = ({
); );
const SelectedHeaderColor = useSelector(GlobalSelectedPrintHeaderColor); const SelectedHeaderColor = useSelector(GlobalSelectedPrintHeaderColor);
const SelectedHeaderFontColor = useSelector(GlobalSelectedPrintHeaderFontColor);
const SelectedTableHeaderColor = useSelector(GlobalSelectedTableHeaderColor);
const SelectedTableHeaderFontColor = useSelector(GlobalSelectedTableHeaderFontColor);
const SelectedTableBodyColor = useSelector(GlobalSelectedTableBodyColor);
const SelectedTableBodyFontColor = useSelector(GlobalSelectedTableBodyFontColor);
const SelectedRowType = useSelector(GlobalRowType);
const SelectedTableFooterColor = useSelector(GlobalSelectedFooterColor);
const SelectedTableFooterFontColor = useSelector(GlobalSelectedFooterFontColor);
const SelectedNetAmountColor = useSelector(GlobalSelectedNetAmountColor);
const SelectedNetAmountFontColor = useSelector(GlobalSelectedNetAmountFontColor);
let printColors = printDatas?.PrintColors;
const headerColor = printColors?.find(obj => obj.headerColor)?.headerColor;
const tableHeaderColor = printColors?.find(obj => obj.tableHeaderColor)?.tableHeaderColor;
const tableBodyColor = printColors?.find(obj => obj.tableBodyColor)?.tableBodyColor;
const footerColor = printColors?.find(obj => obj.footerColor)?.footerColor;
const netAmtColor = printColors?.find(obj => obj.netAmtColor)?.netAmtColor;
console.log(GlobalDiscount, Discount, 'Discount'); console.log(GlobalDiscount, Discount, 'Discount');
@ -361,7 +387,51 @@ const Printstyle8 = ({
? paginatedChunks[paginatedChunks.length - 1].length ? paginatedChunks[paginatedChunks.length - 1].length
: 0; : 0;
const shouldFooterBeOnNewPage = lastChunkRows > (PageSize == 'A5' ? 5 : 13); const shouldFooterBeOnNewPage = lastChunkRows > (PageSize == 'A5' ? 5 : 13);
const headerStyle = {
backgroundColor: GlobaldummyData
? SelectedHeaderColor
: headerColor?.background,
color: GlobaldummyData
? SelectedHeaderFontColor
: headerColor?.font,
}
const tableHeaderStyle = {
backgroundColor: GlobaldummyData
? SelectedTableHeaderColor
: tableHeaderColor?.background,
color: GlobaldummyData
? SelectedTableHeaderFontColor
: tableHeaderColor?.font,
}
const tableBodyStyle = {
backgroundColor: GlobaldummyData
? SelectedTableBodyColor
: tableBodyColor?.background,
color: GlobaldummyData
? SelectedTableBodyFontColor
: tableBodyColor?.font,
}
const rowtypeStyle = GlobaldummyData ? SelectedRowType : tableBodyColor?.rowType;
const footerColorStyle = {
backgroundColor: GlobaldummyData
? SelectedTableFooterColor
: footerColor?.background,
color: GlobaldummyData
? SelectedTableFooterFontColor
: footerColor?.font,
}
const netAmountStyle = {
backgroundColor: GlobaldummyData
? SelectedNetAmountColor
: netAmtColor?.background,
color: GlobaldummyData
? SelectedNetAmountFontColor
: netAmtColor?.font,
}
return ( return (
<> <>
{FormatTheme ? ( {FormatTheme ? (
@ -419,7 +489,7 @@ const Printstyle8 = ({
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( {!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
'' ''
) : ( ) : (
<div className="PrintStyle8-fistDiv" style={{}}> <div className="PrintStyle8-fistDiv" style={{...headerStyle}}>
{/* <h3>{table2Data?.BrName}</h3> */} {/* <h3>{table2Data?.BrName}</h3> */}
<div <div
@ -449,7 +519,6 @@ 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}
@ -562,6 +631,7 @@ const Printstyle8 = ({
? GlobalSlNo && ( ? GlobalSlNo && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'center', textAlign: 'center',
}} }}
@ -572,6 +642,7 @@ const Printstyle8 = ({
: SLNO && ( : SLNO && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'center', textAlign: 'center',
}} }}
@ -580,12 +651,13 @@ const Printstyle8 = ({
</th> </th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalItem && <th>Dis</th> ? GlobalItem && <th style={{...tableHeaderStyle,}}>Dis</th>
: Item && <th>Des</th>} : Item && <th style={{...tableHeaderStyle,}}>Des</th>}
{GlobaldummyData {GlobaldummyData
? GlobalHsnCode && ( ? GlobalHsnCode && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -596,6 +668,7 @@ const Printstyle8 = ({
: HsnCode && ( : HsnCode && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -607,6 +680,7 @@ const Printstyle8 = ({
? GlobalMRP && ( ? GlobalMRP && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -617,6 +691,7 @@ const Printstyle8 = ({
: MRP && ( : MRP && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -628,6 +703,7 @@ const Printstyle8 = ({
? GlobalRate && ( ? GlobalRate && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -638,6 +714,7 @@ const Printstyle8 = ({
: Rate && ( : Rate && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -649,6 +726,7 @@ const Printstyle8 = ({
? GlobalDiscount && ( ? GlobalDiscount && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -659,6 +737,7 @@ const Printstyle8 = ({
: Discount && ( : Discount && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -670,6 +749,7 @@ const Printstyle8 = ({
? GlobalTax && ( ? GlobalTax && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -681,6 +761,7 @@ const Printstyle8 = ({
table2Data?.OrderType !== 'E' && ( table2Data?.OrderType !== 'E' && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -692,6 +773,7 @@ const Printstyle8 = ({
? GlobalQuantity && ( ? GlobalQuantity && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -702,6 +784,7 @@ const Printstyle8 = ({
: Quantity && ( : Quantity && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -713,6 +796,7 @@ const Printstyle8 = ({
? GlobalAmount && ( ? GlobalAmount && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -723,6 +807,7 @@ const Printstyle8 = ({
: Amount && ( : Amount && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -735,7 +820,18 @@ const Printstyle8 = ({
<tbody> <tbody>
{dataChunk?.map((item, index) => { {dataChunk?.map((item, index) => {
return ( return (
<tr key={index}> <tr key={index}
style={
index % 2 !== 1 && rowtypeStyle === "even"
? {
...tableBodyStyle
}
: index % 2 === 1 && rowtypeStyle === "odd"
? {
...tableBodyStyle
}
: {}
}>
{GlobaldummyData {GlobaldummyData
? GlobalSlNo && ( ? GlobalSlNo && (
<td style={{ textAlign: 'center' }}> <td style={{ textAlign: 'center' }}>
@ -931,6 +1027,7 @@ const Printstyle8 = ({
? GlobalSlNo && ( ? GlobalSlNo && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'center', textAlign: 'center',
}} }}
@ -941,6 +1038,7 @@ const Printstyle8 = ({
: SLNO && ( : SLNO && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'center', textAlign: 'center',
}} }}
@ -949,12 +1047,13 @@ const Printstyle8 = ({
</th> </th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalItem && <th>Dis</th> ? GlobalItem && <th style={{...tableHeaderStyle,}}>Dis</th>
: Item && <th>Des</th>} : Item && <th style={{...tableHeaderStyle,}}>Des</th>}
{GlobaldummyData {GlobaldummyData
? GlobalHsnCode && ( ? GlobalHsnCode && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -965,6 +1064,7 @@ const Printstyle8 = ({
: HsnCode && ( : HsnCode && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -976,6 +1076,7 @@ const Printstyle8 = ({
? GlobalMRP && ( ? GlobalMRP && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -986,6 +1087,7 @@ const Printstyle8 = ({
: MRP && ( : MRP && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -997,6 +1099,7 @@ const Printstyle8 = ({
? GlobalRate && ( ? GlobalRate && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -1007,6 +1110,7 @@ const Printstyle8 = ({
: Rate && ( : Rate && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -1018,6 +1122,7 @@ const Printstyle8 = ({
? GlobalDiscount && ( ? GlobalDiscount && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -1028,6 +1133,7 @@ const Printstyle8 = ({
: Discount && ( : Discount && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -1039,6 +1145,7 @@ const Printstyle8 = ({
? GlobalTax && ( ? GlobalTax && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -1050,6 +1157,7 @@ const Printstyle8 = ({
table2Data?.OrderType !== 'E' && ( table2Data?.OrderType !== 'E' && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -1061,6 +1169,7 @@ const Printstyle8 = ({
? GlobalQuantity && ( ? GlobalQuantity && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -1071,6 +1180,7 @@ const Printstyle8 = ({
: Quantity && ( : Quantity && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -1082,6 +1192,7 @@ const Printstyle8 = ({
? GlobalAmount && ( ? GlobalAmount && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -1092,6 +1203,7 @@ const Printstyle8 = ({
: Amount && ( : Amount && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -1104,7 +1216,18 @@ const Printstyle8 = ({
<tbody> <tbody>
{dataChunk?.map((item, index) => { {dataChunk?.map((item, index) => {
return ( return (
<tr key={index}> <tr key={index}
style={
index % 2 !== 1 && rowtypeStyle === "even"
? {
...tableBodyStyle
}
: index % 2 === 1 && rowtypeStyle === "odd"
? {
...tableBodyStyle
}
: {}
}>
{GlobaldummyData {GlobaldummyData
? GlobalSlNo && ( ? GlobalSlNo && (
<td style={{ textAlign: 'center' }}> <td style={{ textAlign: 'center' }}>
@ -1256,7 +1379,7 @@ const Printstyle8 = ({
FormatTheme && ( FormatTheme && (
<> <>
<hr className="PrintStyle8-print-dottline" /> <hr className="PrintStyle8-print-dottline" />
<div style={{ fontSize: '12px' }}> <div style={{ fontSize: '12px',...netAmountStyle }}>
<div <div
style={{ style={{
display: 'flex', display: 'flex',
@ -2051,6 +2174,7 @@ const Printstyle8 = ({
pageBreakBefore: 'avoid', pageBreakBefore: 'avoid',
pageBreakInside: 'avoid', pageBreakInside: 'avoid',
minHeight: 'auto', minHeight: 'auto',
...footerColorStyle
}} }}
> >
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( {!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
@ -2262,7 +2386,7 @@ const Printstyle8 = ({
> >
<> <>
<hr className="PrintStyle8-print-dottline" /> <hr className="PrintStyle8-print-dottline" />
<div style={{ fontSize: '12px' }}> <div style={{ fontSize: '12px',...netAmountStyle }}>
<div <div
style={{ style={{
display: 'flex', display: 'flex',
@ -3036,6 +3160,7 @@ const Printstyle8 = ({
pageBreakBefore: 'avoid', pageBreakBefore: 'avoid',
pageBreakInside: 'avoid', pageBreakInside: 'avoid',
minHeight: 'auto', minHeight: 'auto',
...footerColorStyle
}} }}
> >
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( {!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
@ -3234,7 +3359,7 @@ const Printstyle8 = ({
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( {!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
'' ''
) : ( ) : (
<div className="PrintStyle8-fistDiv" style={{}}> <div className="PrintStyle8-fistDiv" style={{...headerStyle}}>
{/* <h3>{table2Data?.BrName}</h3> */} {/* <h3>{table2Data?.BrName}</h3> */}
<div <div
style={{ style={{
@ -3263,7 +3388,6 @@ 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}
@ -3370,95 +3494,95 @@ const Printstyle8 = ({
<tr> <tr>
{GlobaldummyData {GlobaldummyData
? GlobalSlNo && ( ? GlobalSlNo && (
<th style={{ width: '10px', textAlign: 'center' }}> <th style={{...tableHeaderStyle, width: '10px', textAlign: 'center' }}>
S.No S.No
</th> </th>
) )
: SLNO && ( : SLNO && (
<th style={{ width: '10px', textAlign: 'center' }}> <th style={{...tableHeaderStyle, width: '10px', textAlign: 'center' }}>
S.No S.No
</th> </th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalItem && ( ? GlobalItem && (
<th style={{ textAlign: 'left' }}>Dis</th> <th style={{...tableHeaderStyle, textAlign: 'left' }}>Dis</th>
) )
: Item && <th>Des</th>} : Item && <th style={{...tableHeaderStyle,}}>Des</th>}
{GlobaldummyData {GlobaldummyData
? GlobalHsnCode && ( ? GlobalHsnCode && (
<th style={{ width: '10px', textAlign: 'right' }}> <th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
HSN HSN
</th> </th>
) )
: HsnCode && ( : HsnCode && (
<th style={{ width: '10px', textAlign: 'right' }}> <th style={{ ...tableHeaderStyle,width: '10px', textAlign: 'right' }}>
HSN HSN
</th> </th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalMRP && ( ? GlobalMRP && (
<th style={{ width: '10px', textAlign: 'right' }}> <th style={{ ...tableHeaderStyle,width: '10px', textAlign: 'right' }}>
MRP MRP
</th> </th>
) )
: MRP && ( : MRP && (
<th style={{ width: '10px', textAlign: 'right' }}> <th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
MRP MRP
</th> </th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalRate && ( ? GlobalRate && (
<th style={{ width: '10px', textAlign: 'right' }}> <th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
Rate Rate
</th> </th>
) )
: Rate && ( : Rate && (
<th style={{ width: '10px', textAlign: 'right' }}> <th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
Rt Rt
</th> </th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalDiscount && ( ? GlobalDiscount && (
<th style={{ width: '10px', textAlign: 'right' }}> <th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
(%) (%)
</th> </th>
) )
: Discount && ( : Discount && (
<th style={{ width: '10px', textAlign: 'right' }}> <th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
(%) (%)
</th> </th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalTax && ( ? GlobalTax && (
<th style={{ width: '10px', textAlign: 'right' }}> <th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
Tax % Tax %
</th> </th>
) )
: Tax && : Tax &&
table2Data?.OrderType !== 'E' && ( table2Data?.OrderType !== 'E' && (
<th style={{ width: '10px', textAlign: 'right' }}> <th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
Tax % Tax %
</th> </th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalQuantity && ( ? GlobalQuantity && (
<th style={{ width: '10px', textAlign: 'right' }}> <th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
Qty Qty
</th> </th>
) )
: Quantity && ( : Quantity && (
<th style={{ width: '10px', textAlign: 'right' }}> <th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
{WeightasKg ? 'Qty/Kg' : 'Qty'} {WeightasKg ? 'Qty/Kg' : 'Qty'}
</th> </th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalAmount && ( ? GlobalAmount && (
<th style={{ width: '10px', textAlign: 'right' }}> <th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
Amt Amt
</th> </th>
) )
: Amount && ( : Amount && (
<th style={{ width: '10px', textAlign: 'right' }}> <th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
Amt Amt
</th> </th>
)} )}
@ -3468,7 +3592,18 @@ const Printstyle8 = ({
{(GlobaldummyData ? products : TakeawayData)?.map( {(GlobaldummyData ? products : TakeawayData)?.map(
(item, index) => { (item, index) => {
return ( return (
<tr key={index}> <tr key={index}
style={
index % 2 !== 1 && rowtypeStyle === "even"
? {
...tableBodyStyle
}
: index % 2 === 1 && rowtypeStyle === "odd"
? {
...tableBodyStyle
}
: {}
}>
{GlobaldummyData {GlobaldummyData
? GlobalSlNo && ( ? GlobalSlNo && (
<td style={{ textAlign: 'center' }}> <td style={{ textAlign: 'center' }}>
@ -3632,93 +3767,93 @@ const Printstyle8 = ({
<tr> <tr>
{GlobaldummyData {GlobaldummyData
? GlobalSlNo && ( ? GlobalSlNo && (
<th style={{ width: '10px', textAlign: 'center' }}> <th style={{...tableHeaderStyle, width: '10px', textAlign: 'center' }}>
S.No S.No
</th> </th>
) )
: SLNO && ( : SLNO && (
<th style={{ width: '10px', textAlign: 'center' }}> <th style={{...tableHeaderStyle, width: '10px', textAlign: 'center' }}>
S.No S.No
</th> </th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalItem && <th>Dis</th> ? GlobalItem && <th style={{...tableHeaderStyle,}}>Dis</th>
: Item && <th>Des</th>} : Item && <th style={{...tableHeaderStyle,}}>Des</th>}
{GlobaldummyData {GlobaldummyData
? GlobalHsnCode && ( ? GlobalHsnCode && (
<th style={{ width: '10px', textAlign: 'right' }}> <th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
HSN HSN
</th> </th>
) )
: HsnCode && ( : HsnCode && (
<th style={{ width: '10px', textAlign: 'right' }}> <th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
HSN HSN
</th> </th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalMRP && ( ? GlobalMRP && (
<th style={{ width: '10px', textAlign: 'right' }}> <th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
MRP MRP
</th> </th>
) )
: MRP && ( : MRP && (
<th style={{ width: '10px', textAlign: 'right' }}> <th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
MRP MRP
</th> </th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalRate && ( ? GlobalRate && (
<th style={{ width: '10px', textAlign: 'right' }}> <th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
Rate Rate
</th> </th>
) )
: Rate && ( : Rate && (
<th style={{ width: '10px', textAlign: 'right' }}> <th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
Rt Rt
</th> </th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalDiscount && ( ? GlobalDiscount && (
<th style={{ width: '10px', textAlign: 'right' }}> <th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
(%) (%)
</th> </th>
) )
: Discount && ( : Discount && (
<th style={{ width: '10px', textAlign: 'right' }}> <th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
(%) (%)
</th> </th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalTax && ( ? GlobalTax && (
<th style={{ width: '10px', textAlign: 'right' }}> <th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
Tax % Tax %
</th> </th>
) )
: Tax && : Tax &&
table2Data?.OrderType !== 'E' && ( table2Data?.OrderType !== 'E' && (
<th style={{ width: '10px', textAlign: 'right' }}> <th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
Tax % Tax %
</th> </th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalQuantity && ( ? GlobalQuantity && (
<th style={{ width: '10px', textAlign: 'right' }}> <th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
Qty Qty
</th> </th>
) )
: Quantity && ( : Quantity && (
<th style={{ width: '10px', textAlign: 'right' }}> <th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
{WeightasKg ? 'Qty/Kg' : 'Qty'} {WeightasKg ? 'Qty/Kg' : 'Qty'}
</th> </th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalAmount && ( ? GlobalAmount && (
<th style={{ width: '10px', textAlign: 'right' }}> <th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
Amt Amt
</th> </th>
) )
: Amount && ( : Amount && (
<th style={{ width: '10px', textAlign: 'right' }}> <th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
Amt Amt
</th> </th>
)} )}
@ -3728,7 +3863,18 @@ const Printstyle8 = ({
{(GlobaldummyData ? products : DineInData)?.map( {(GlobaldummyData ? products : DineInData)?.map(
(item, index) => { (item, index) => {
return ( return (
<tr key={index}> <tr key={index}
style={
index % 2 !== 1 && rowtypeStyle === "even"
? {
...tableBodyStyle
}
: index % 2 === 1 && rowtypeStyle === "odd"
? {
...tableBodyStyle
}
: {}
}>
{GlobaldummyData {GlobaldummyData
? GlobalSlNo && ( ? GlobalSlNo && (
<td style={{ textAlign: 'center' }}> <td style={{ textAlign: 'center' }}>
@ -3878,7 +4024,7 @@ const Printstyle8 = ({
</> </>
)} )}
<hr className="PrintStyle8-print-dottline" /> <hr className="PrintStyle8-print-dottline" />
<div style={{ fontSize: '12px' }}> <div style={{ fontSize: '12px',...netAmountStyle }}>
<div style={{ display: 'flex', justifyContent: 'space-between' }}> <div style={{ display: 'flex', justifyContent: 'space-between' }}>
<div style={{ width: '40%' }}>Items </div> <div style={{ width: '40%' }}>Items </div>
<div> : </div> <div> : </div>
@ -4590,6 +4736,7 @@ const Printstyle8 = ({
pageBreakBefore: 'avoid', pageBreakBefore: 'avoid',
pageBreakInside: 'avoid', pageBreakInside: 'avoid',
minHeight: 'auto', minHeight: 'auto',
...footerColorStyle
}} }}
> >
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( {!estimatePrintHeader && table2Data?.OrderType === 'E' ? (