Implement dynamic header and table color functionality

This commit is contained in:
Srinath 2026-03-04 16:31:11 +05:30
parent 1c5da0e201
commit d9b2fbcbf9
1 changed files with 194 additions and 54 deletions

View File

@ -29,7 +29,17 @@ import {
GlobalprintLogo, GlobalprintLogo,
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 { import {
GlobalUpiIDprint, GlobalUpiIDprint,
@ -103,7 +113,17 @@ const Printstyle6 = ({
const GlobalLogo = useSelector(GlobalprintLogo); const GlobalLogo = useSelector(GlobalprintLogo);
const GlobalCredit = useSelector(GlobalprintCredit); const GlobalCredit = useSelector(GlobalprintCredit);
const SettingData = useSelector(PreferenceData); const SettingData = useSelector(PreferenceData);
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);
console.log(CashierNameField, "GlobaldummyData") console.log(CashierNameField, "GlobaldummyData")
const UomPrint = SettingData?.[0]?.SettingDtlDetails?.filter( const UomPrint = SettingData?.[0]?.SettingDtlDetails?.filter(
(i) => i.SettingIdName === 'PrintUom' (i) => i.SettingIdName === 'PrintUom'
@ -146,7 +166,12 @@ const Printstyle6 = ({
(ps) => ps.PaymentStatus === 'S' && ps?.LastOrderTran === 'Y' (ps) => ps.PaymentStatus === 'S' && ps?.LastOrderTran === 'Y'
) )
console.log(GlobalDiscount, Discount, 'Discount'); 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;
let TermsAndConditions = printDatas?.TermsandConditions; let TermsAndConditions = printDatas?.TermsandConditions;
let SignatureImg = printDatas?.Signature; let SignatureImg = printDatas?.Signature;
@ -331,7 +356,51 @@ const Printstyle6 = ({
? 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 ? (
@ -389,7 +458,7 @@ const Printstyle6 = ({
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( {!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
'' ''
) : ( ) : (
<div className="PrintStyle6-firstDiv"> <div className="PrintStyle6-firstDiv" style={{...headerStyle}}>
<div <div
className="P6HdBrnchName" className="P6HdBrnchName"
style={{ style={{
@ -422,7 +491,7 @@ const Printstyle6 = ({
/> />
) : null} ) : null}
</div> </div>
<div style={{ color: SelectedHeaderColor }}> <div>
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName} {GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
</div> </div>
</div> </div>
@ -551,12 +620,12 @@ const Printstyle6 = ({
<tr> <tr>
{GlobaldummyData {GlobaldummyData
? GlobalSlNo && ( ? GlobalSlNo && (
<th style={{ width: '10px' }}>S.No</th> <th style={{...tableHeaderStyle, width: '10px' }}>S.No</th>
) )
: SLNO && <th style={{ width: '10px' }}>S.No</th>} : SLNO && <th style={{...tableHeaderStyle, width: '10px' }}>S.No</th>}
{GlobaldummyData ? ( {GlobaldummyData ? (
(GlobalItem || GlobalQuantity) && ( (GlobalItem || GlobalQuantity) && (
<th style={{ width: '10px' }}> <th style={{...tableHeaderStyle, width: '10px' }}>
{GlobaldummyData {GlobaldummyData
? GlobalItem && 'ITEM /DES/' ? GlobalItem && 'ITEM /DES/'
: 'ITEM /DES/'}{' '} : 'ITEM /DES/'}{' '}
@ -566,7 +635,7 @@ const Printstyle6 = ({
</th> </th>
) )
) : ( ) : (
<th style={{ width: '10px' }}> <th style={{...tableHeaderStyle, width: '10px' }}>
{GlobaldummyData {GlobaldummyData
? GlobalItem && 'ITEM /DES/' ? GlobalItem && 'ITEM /DES/'
: Item && 'ITEM /DES/'}{' '} : Item && 'ITEM /DES/'}{' '}
@ -579,6 +648,7 @@ const Printstyle6 = ({
? GlobalHsnCode && ( ? GlobalHsnCode && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -589,6 +659,7 @@ const Printstyle6 = ({
: HsnCode && ( : HsnCode && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -600,6 +671,7 @@ const Printstyle6 = ({
? GlobalMRP && ( ? GlobalMRP && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -610,6 +682,7 @@ const Printstyle6 = ({
: MRP && ( : MRP && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -621,6 +694,7 @@ const Printstyle6 = ({
? GlobalDiscount && ( ? GlobalDiscount && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -631,6 +705,7 @@ const Printstyle6 = ({
: Discount && ( : Discount && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -642,6 +717,7 @@ const Printstyle6 = ({
? GlobalTax && ( ? GlobalTax && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -653,6 +729,7 @@ const Printstyle6 = ({
table2Data?.OrderType !== 'E' && ( table2Data?.OrderType !== 'E' && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -664,6 +741,7 @@ const Printstyle6 = ({
? GlobalRate && ( ? GlobalRate && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -674,6 +752,7 @@ const Printstyle6 = ({
: Rate && ( : Rate && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -685,6 +764,7 @@ const Printstyle6 = ({
? GlobalAmount && ( ? GlobalAmount && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -695,6 +775,7 @@ const Printstyle6 = ({
: Amount && ( : Amount && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -707,7 +788,18 @@ const Printstyle6 = ({
<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 && <td>{index + 1}</td> ? GlobalSlNo && <td>{index + 1}</td>
: SLNO && ( : SLNO && (
@ -946,12 +1038,12 @@ const Printstyle6 = ({
<tr> <tr>
{GlobaldummyData {GlobaldummyData
? GlobalSlNo && ( ? GlobalSlNo && (
<th style={{ width: '10px' }}>S.No</th> <th style={{...tableHeaderStyle, width: '10px' }}>S.No</th>
) )
: SLNO && <th style={{ width: '10px' }}>S.No</th>} : SLNO && <th style={{...tableHeaderStyle, width: '10px' }}>S.No</th>}
{GlobaldummyData ? ( {GlobaldummyData ? (
(GlobalItem || GlobalQuantity) && ( (GlobalItem || GlobalQuantity) && (
<th style={{ width: '10px' }}> <th style={{...tableHeaderStyle, width: '10px' }}>
{GlobaldummyData {GlobaldummyData
? GlobalItem && 'ITEM /DES/' ? GlobalItem && 'ITEM /DES/'
: 'ITEM /DES/'}{' '} : 'ITEM /DES/'}{' '}
@ -961,7 +1053,7 @@ const Printstyle6 = ({
</th> </th>
) )
) : ( ) : (
<th style={{ width: '10px' }}> <th style={{...tableHeaderStyle, width: '10px' }}>
{GlobaldummyData {GlobaldummyData
? GlobalItem && 'ITEM /DES/' ? GlobalItem && 'ITEM /DES/'
: Item && 'ITEM /DES/'}{' '} : Item && 'ITEM /DES/'}{' '}
@ -974,6 +1066,7 @@ const Printstyle6 = ({
? GlobalHsnCode && ( ? GlobalHsnCode && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -984,6 +1077,7 @@ const Printstyle6 = ({
: HsnCode && ( : HsnCode && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -995,6 +1089,7 @@ const Printstyle6 = ({
? GlobalMRP && ( ? GlobalMRP && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -1005,6 +1100,7 @@ const Printstyle6 = ({
: MRP && ( : MRP && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -1016,6 +1112,7 @@ const Printstyle6 = ({
? GlobalDiscount && ( ? GlobalDiscount && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -1026,6 +1123,7 @@ const Printstyle6 = ({
: Discount && ( : Discount && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -1037,6 +1135,7 @@ const Printstyle6 = ({
? GlobalTax && ( ? GlobalTax && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -1048,6 +1147,7 @@ const Printstyle6 = ({
table2Data?.OrderType !== 'E' && ( table2Data?.OrderType !== 'E' && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -1059,6 +1159,7 @@ const Printstyle6 = ({
? GlobalRate && ( ? GlobalRate && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -1069,6 +1170,7 @@ const Printstyle6 = ({
: Rate && ( : Rate && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -1080,6 +1182,7 @@ const Printstyle6 = ({
? GlobalAmount && ( ? GlobalAmount && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -1090,6 +1193,7 @@ const Printstyle6 = ({
: Amount && ( : Amount && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -1102,7 +1206,18 @@ const Printstyle6 = ({
<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 && <td>{index + 1}</td> ? GlobalSlNo && <td>{index + 1}</td>
: SLNO && ( : SLNO && (
@ -1682,7 +1797,7 @@ const Printstyle6 = ({
</div> </div>
</div> </div>
)} )}
<div className="PrintStyle6-secondDiv"> <div className="PrintStyle6-secondDiv" style={{...netAmountStyle}}>
<div <div
style={{ style={{
textAlign: 'left', textAlign: 'left',
@ -2082,6 +2197,7 @@ const Printstyle6 = ({
pageBreakBefore: 'avoid', pageBreakBefore: 'avoid',
pageBreakInside: 'avoid', pageBreakInside: 'avoid',
minHeight: 'auto', minHeight: 'auto',
...footerColorStyle
}} }}
> >
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( {!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
@ -2683,7 +2799,7 @@ const Printstyle6 = ({
</div> </div>
</div> </div>
)} )}
<div className="PrintStyle6-secondDiv"> <div className="PrintStyle6-secondDiv" style={{...netAmountStyle}}>
<div <div
style={{ style={{
textAlign: 'left', textAlign: 'left',
@ -3077,6 +3193,7 @@ const Printstyle6 = ({
pageBreakBefore: 'avoid', pageBreakBefore: 'avoid',
pageBreakInside: 'avoid', pageBreakInside: 'avoid',
minHeight: 'auto', minHeight: 'auto',
...footerColorStyle
}} }}
> >
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( {!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
@ -3283,7 +3400,7 @@ const Printstyle6 = ({
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( {!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
'' ''
) : ( ) : (
<div className="PrintStyle6-firstDiv"> <div className="PrintStyle6-firstDiv" style={{...headerStyle}}>
<div <div
className="P6HdBrnchName" className="P6HdBrnchName"
style={{ style={{
@ -3311,7 +3428,7 @@ const Printstyle6 = ({
/> />
) : null} ) : null}
</div> </div>
<div style={{ color: SelectedHeaderColor }}> <div >
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName} {GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
</div> </div>
</div> </div>
@ -3436,11 +3553,11 @@ const Printstyle6 = ({
<thead> <thead>
<tr> <tr>
{GlobaldummyData {GlobaldummyData
? GlobalSlNo && <th style={{ width: '10px' }}>S.No</th> ? GlobalSlNo && <th style={{...tableHeaderStyle, width: '10px' }}>S.No</th>
: SLNO && <th style={{ width: '10px' }}>S.No</th>} : SLNO && <th style={{...tableHeaderStyle, width: '10px' }}>S.No</th>}
{GlobaldummyData ? ( {GlobaldummyData ? (
(GlobalItem || GlobalQuantity) && ( (GlobalItem || GlobalQuantity) && (
<th style={{ width: '10px' }}> <th style={{...tableHeaderStyle, width: '10px' }}>
{GlobaldummyData {GlobaldummyData
? GlobalItem && 'ITEM /DES/' ? GlobalItem && 'ITEM /DES/'
: 'ITEM /DES/'}{' '} : 'ITEM /DES/'}{' '}
@ -3448,7 +3565,7 @@ const Printstyle6 = ({
</th> </th>
) )
) : ( ) : (
<th style={{ width: '10px' }}> <th style={{...tableHeaderStyle, width: '10px' }}>
{GlobaldummyData {GlobaldummyData
? GlobalItem && 'ITEM /DES/' ? GlobalItem && 'ITEM /DES/'
: Item && 'ITEM /DES/'}{' '} : Item && 'ITEM /DES/'}{' '}
@ -3459,68 +3576,68 @@ const Printstyle6 = ({
)} )}
{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
? GlobalDiscount && ( ? GlobalDiscount && (
<th style={{ width: '10px', textAlign: 'right' }}> <th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
Dis{' '} Dis{' '}
</th> </th>
) )
: Discount && ( : Discount && (
<th style={{ width: '10px', textAlign: 'right' }}> <th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
Dis{' '} Dis{' '}
</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
? 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' }}>
Rate Rate
</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>
)} )}
@ -3530,7 +3647,18 @@ const Printstyle6 = ({
{(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 && <td>{index + 1}</td> ? GlobalSlNo && <td>{index + 1}</td>
: SLNO && <td>{index + 1}</td>} : SLNO && <td>{index + 1}</td>}
@ -3727,11 +3855,11 @@ const Printstyle6 = ({
<thead> <thead>
<tr> <tr>
{GlobaldummyData {GlobaldummyData
? GlobalSlNo && <th style={{ width: '10px' }}>S.No</th> ? GlobalSlNo && <th style={{...tableHeaderStyle, width: '10px' }}>S.No</th>
: SLNO && <th style={{ width: '10px' }}>S.No</th>} : SLNO && <th style={{...tableHeaderStyle, width: '10px' }}>S.No</th>}
{GlobaldummyData ? ( {GlobaldummyData ? (
(GlobalItem || GlobalQuantity) && ( (GlobalItem || GlobalQuantity) && (
<th style={{ width: '10px' }}> <th style={{...tableHeaderStyle, width: '10px' }}>
{GlobaldummyData {GlobaldummyData
? GlobalItem && 'ITEM /DES/' ? GlobalItem && 'ITEM /DES/'
: 'ITEM /DES/'}{' '} : 'ITEM /DES/'}{' '}
@ -3739,7 +3867,7 @@ const Printstyle6 = ({
</th> </th>
) )
) : ( ) : (
<th style={{ width: '10px' }}> <th style={{...tableHeaderStyle, width: '10px' }}>
{GlobaldummyData {GlobaldummyData
? GlobalItem && 'ITEM /DES/' ? GlobalItem && 'ITEM /DES/'
: Item && 'ITEM /DES/'}{' '} : Item && 'ITEM /DES/'}{' '}
@ -3750,68 +3878,68 @@ const Printstyle6 = ({
)} )}
{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
? GlobalDiscount && ( ? GlobalDiscount && (
<th style={{ width: '10px', textAlign: 'right' }}> <th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
Dis{' '} Dis{' '}
</th> </th>
) )
: Discount && ( : Discount && (
<th style={{ width: '10px', textAlign: 'right' }}> <th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
Dis{' '} Dis{' '}
</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
? 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' }}>
Rate Rate
</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>
)} )}
@ -3821,7 +3949,18 @@ const Printstyle6 = ({
{(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 && <td>{index + 1}</td> ? GlobalSlNo && <td>{index + 1}</td>
: SLNO && <td>{index + 1}</td>} : SLNO && <td>{index + 1}</td>}
@ -4380,7 +4519,7 @@ const Printstyle6 = ({
</div> </div>
</div> </div>
)} )}
<div className="PrintStyle6-secondDiv"> <div className="PrintStyle6-secondDiv" style={{...netAmountStyle}}>
<div <div
style={{ style={{
textAlign: 'left', textAlign: 'left',
@ -4757,6 +4896,7 @@ const Printstyle6 = ({
pageBreakBefore: 'avoid', pageBreakBefore: 'avoid',
pageBreakInside: 'avoid', pageBreakInside: 'avoid',
minHeight: 'auto', minHeight: 'auto',
...footerColorStyle
}} }}
> >
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( {!estimatePrintHeader && table2Data?.OrderType === 'E' ? (