Implement dynamic header and table color functionality

This commit is contained in:
Srinath 2026-03-04 16:32:45 +05:30
parent 47745687ee
commit 7245aa95b4
1 changed files with 200 additions and 80 deletions

View File

@ -30,6 +30,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 { import {
GlobalUpiIDprint, GlobalUpiIDprint,
@ -105,6 +115,22 @@ const PrintStyle11 = ({
const GlobalLogo = useSelector(GlobalprintLogo); const GlobalLogo = useSelector(GlobalprintLogo);
const GlobalCredit = useSelector(GlobalprintCredit); const GlobalCredit = useSelector(GlobalprintCredit);
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;
const UomPrint = SettingData?.[0]?.SettingDtlDetails?.filter( const UomPrint = SettingData?.[0]?.SettingDtlDetails?.filter(
(i) => i.SettingIdName === 'PrintUom' (i) => i.SettingIdName === 'PrintUom'
)?.[0]; )?.[0];
@ -333,7 +359,51 @@ const PrintStyle11 = ({
? paginatedChunks[paginatedChunks.length - 1].length ? paginatedChunks[paginatedChunks.length - 1].length
: 0; : 0;
const shouldFooterBeOnNewPage = lastChunkRows > (PageSize == 'A5' ? 5 : 10); const shouldFooterBeOnNewPage = lastChunkRows > (PageSize == 'A5' ? 5 : 10);
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 ? (
@ -391,8 +461,8 @@ const PrintStyle11 = ({
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( {!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
'' ''
) : ( ) : (
<div> <div style={{ ...headerStyle }}>
<div className="PrintStyle11-print"> <div className="PrintStyle11-print" style={{ ...headerStyle }}>
{GlobalLogo && GlobaldummyData ? ( {GlobalLogo && GlobaldummyData ? (
<img <img
className="PrintStyle2-BrandImage" className="PrintStyle2-BrandImage"
@ -531,25 +601,25 @@ const PrintStyle11 = ({
<tr> <tr>
{GlobaldummyData {GlobaldummyData
? GlobalSlNo && ( ? GlobalSlNo && (
<th style={{ width: '10px' }}>S.N</th> <th style={{ ...tableHeaderStyle, width: '10px' }}>S.N</th>
) )
: SLNO && <th style={{ width: '10px' }}>S.N</th>} : SLNO && <th style={{ ...tableHeaderStyle, width: '10px' }}>S.N</th>}
{GlobaldummyData {GlobaldummyData
? GlobalItem && ( ? GlobalItem && (
<th style={{ width: '10px' }}>Item</th> <th style={{ ...tableHeaderStyle, width: '10px' }}>Item</th>
) )
: Item && <th style={{ width: '10px' }}>Item</th>} : Item && <th style={{ ...tableHeaderStyle, width: '10px' }}>Item</th>}
{GlobaldummyData {GlobaldummyData
? GlobalQuantity && ( ? GlobalQuantity && (
<th <th
style={{ width: '10px', textAlign: 'right' }} style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
> >
Qty Qty
</th> </th>
) )
: Quantity && ( : Quantity && (
<th <th
style={{ width: '10px', textAlign: 'right' }} style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
> >
{' '} {' '}
{WeightasKg ? 'Qty/Kg' : 'Qty'} {WeightasKg ? 'Qty/Kg' : 'Qty'}
@ -558,14 +628,14 @@ const PrintStyle11 = ({
{GlobaldummyData {GlobaldummyData
? GlobalHsnCode && ( ? GlobalHsnCode && (
<th <th
style={{ width: '10px', textAlign: 'right' }} style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
> >
HSN HSN
</th> </th>
) )
: HsnCode && ( : HsnCode && (
<th <th
style={{ width: '10px', textAlign: 'right' }} style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
> >
HSN HSN
</th> </th>
@ -573,14 +643,14 @@ const PrintStyle11 = ({
{GlobaldummyData {GlobaldummyData
? GlobalMRP && ( ? GlobalMRP && (
<th <th
style={{ width: '10px', textAlign: 'right' }} style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
> >
MRP MRP
</th> </th>
) )
: MRP && ( : MRP && (
<th <th
style={{ width: '10px', textAlign: 'right' }} style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
> >
MRP MRP
</th> </th>
@ -588,14 +658,14 @@ const PrintStyle11 = ({
{GlobaldummyData {GlobaldummyData
? GlobalDiscount && ( ? GlobalDiscount && (
<th <th
style={{ width: '10px', textAlign: 'right' }} style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
> >
Dis{' '} Dis{' '}
</th> </th>
) )
: Discount && ( : Discount && (
<th <th
style={{ width: '10px', textAlign: 'right' }} style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
> >
Dis{' '} Dis{' '}
</th> </th>
@ -603,7 +673,7 @@ const PrintStyle11 = ({
{GlobaldummyData {GlobaldummyData
? GlobalTax && ( ? GlobalTax && (
<th <th
style={{ width: '10px', textAlign: 'right' }} style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
> >
Tax %{' '} Tax %{' '}
</th> </th>
@ -611,7 +681,7 @@ const PrintStyle11 = ({
: Tax && : Tax &&
table2Data?.OrderType !== 'E' && ( table2Data?.OrderType !== 'E' && (
<th <th
style={{ width: '10px', textAlign: 'right' }} style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
> >
Tax %{' '} Tax %{' '}
</th> </th>
@ -619,14 +689,14 @@ const PrintStyle11 = ({
{GlobaldummyData {GlobaldummyData
? GlobalRate && ( ? GlobalRate && (
<th <th
style={{ width: '10px', textAlign: 'right' }} style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
> >
Rate Rate
</th> </th>
) )
: Rate && ( : Rate && (
<th <th
style={{ width: '10px', textAlign: 'right' }} style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
> >
Rate Rate
</th> </th>
@ -634,14 +704,14 @@ const PrintStyle11 = ({
{GlobaldummyData {GlobaldummyData
? GlobalAmount && ( ? GlobalAmount && (
<th <th
style={{ width: '10px', textAlign: 'right' }} style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
> >
Amt Amt
</th> </th>
) )
: Amount && ( : Amount && (
<th <th
style={{ width: '10px', textAlign: 'right' }} style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
> >
Amt Amt
</th> </th>
@ -651,7 +721,18 @@ const PrintStyle11 = ({
<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 && (
@ -856,25 +937,25 @@ const PrintStyle11 = ({
<tr> <tr>
{GlobaldummyData {GlobaldummyData
? GlobalSlNo && ( ? GlobalSlNo && (
<th style={{ width: '10px' }}>S.N</th> <th style={{...tableHeaderStyle, width: '10px' }}>S.N</th>
) )
: SLNO && <th style={{ width: '10px' }}>S.N</th>} : SLNO && <th style={{...tableHeaderStyle, width: '10px' }}>S.N</th>}
{GlobaldummyData {GlobaldummyData
? GlobalItem && ( ? GlobalItem && (
<th style={{ width: '10px' }}>Item</th> <th style={{...tableHeaderStyle, width: '10px' }}>Item</th>
) )
: Item && <th style={{ width: '10px' }}>Item</th>} : Item && <th style={{...tableHeaderStyle, width: '10px' }}>Item</th>}
{GlobaldummyData {GlobaldummyData
? GlobalQuantity && ( ? GlobalQuantity && (
<th <th
style={{ width: '10px', textAlign: 'right' }} style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}
> >
Qty Qty
</th> </th>
) )
: Quantity && ( : Quantity && (
<th <th
style={{ width: '10px', textAlign: 'right' }} style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}
> >
{' '} {' '}
{WeightasKg ? 'Qty/Kg' : 'Qty'} {WeightasKg ? 'Qty/Kg' : 'Qty'}
@ -883,14 +964,14 @@ const PrintStyle11 = ({
{GlobaldummyData {GlobaldummyData
? GlobalHsnCode && ( ? GlobalHsnCode && (
<th <th
style={{ width: '10px', textAlign: 'right' }} style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}
> >
HSN HSN
</th> </th>
) )
: HsnCode && ( : HsnCode && (
<th <th
style={{ width: '10px', textAlign: 'right' }} style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}
> >
HSN HSN
</th> </th>
@ -898,14 +979,14 @@ const PrintStyle11 = ({
{GlobaldummyData {GlobaldummyData
? GlobalMRP && ( ? GlobalMRP && (
<th <th
style={{ width: '10px', textAlign: 'right' }} style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}
> >
MRP MRP
</th> </th>
) )
: MRP && ( : MRP && (
<th <th
style={{ width: '10px', textAlign: 'right' }} style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}
> >
MRP MRP
</th> </th>
@ -913,14 +994,14 @@ const PrintStyle11 = ({
{GlobaldummyData {GlobaldummyData
? GlobalDiscount && ( ? GlobalDiscount && (
<th <th
style={{ width: '10px', textAlign: 'right' }} style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}
> >
Dis{' '} Dis{' '}
</th> </th>
) )
: Discount && ( : Discount && (
<th <th
style={{ width: '10px', textAlign: 'right' }} style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}
> >
Dis{' '} Dis{' '}
</th> </th>
@ -928,7 +1009,7 @@ const PrintStyle11 = ({
{GlobaldummyData {GlobaldummyData
? GlobalTax && ( ? GlobalTax && (
<th <th
style={{ width: '10px', textAlign: 'right' }} style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}
> >
Tax %{' '} Tax %{' '}
</th> </th>
@ -936,7 +1017,7 @@ const PrintStyle11 = ({
: Tax && : Tax &&
table2Data?.OrderType !== 'E' && ( table2Data?.OrderType !== 'E' && (
<th <th
style={{ width: '10px', textAlign: 'right' }} style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}
> >
Tax %{' '} Tax %{' '}
</th> </th>
@ -944,14 +1025,14 @@ const PrintStyle11 = ({
{GlobaldummyData {GlobaldummyData
? GlobalRate && ( ? GlobalRate && (
<th <th
style={{ width: '10px', textAlign: 'right' }} style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}
> >
Rate Rate
</th> </th>
) )
: Rate && ( : Rate && (
<th <th
style={{ width: '10px', textAlign: 'right' }} style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}
> >
Rate Rate
</th> </th>
@ -959,14 +1040,14 @@ const PrintStyle11 = ({
{GlobaldummyData {GlobaldummyData
? GlobalAmount && ( ? GlobalAmount && (
<th <th
style={{ width: '10px', textAlign: 'right' }} style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}
> >
Amt Amt
</th> </th>
) )
: Amount && ( : Amount && (
<th <th
style={{ width: '10px', textAlign: 'right' }} style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}
> >
Amt Amt
</th> </th>
@ -976,7 +1057,18 @@ const PrintStyle11 = ({
<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 && (
@ -1191,6 +1283,7 @@ const PrintStyle11 = ({
textAlign: 'right', textAlign: 'right',
fontWeight: '600', fontWeight: '600',
fontSize: '18px', fontSize: '18px',
...netAmountStyle
}} }}
> >
Amount : Amount :
@ -1859,6 +1952,7 @@ const PrintStyle11 = ({
pageBreakBefore: 'avoid', pageBreakBefore: 'avoid',
pageBreakInside: 'avoid', pageBreakInside: 'avoid',
minHeight: 'auto', minHeight: 'auto',
...footerColorStyle
}} }}
> >
{GlobaldummyData {GlobaldummyData
@ -2161,6 +2255,7 @@ const PrintStyle11 = ({
textAlign: 'right', textAlign: 'right',
fontWeight: '600', fontWeight: '600',
fontSize: '18px', fontSize: '18px',
...netAmountStyle
}} }}
> >
Amount : Amount :
@ -2812,6 +2907,7 @@ const PrintStyle11 = ({
pageBreakBefore: 'avoid', pageBreakBefore: 'avoid',
pageBreakInside: 'avoid', pageBreakInside: 'avoid',
minHeight: 'auto', minHeight: 'auto',
...footerColorStyle
}} }}
> >
{GlobaldummyData {GlobaldummyData
@ -3016,8 +3112,8 @@ const PrintStyle11 = ({
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( {!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
'' ''
) : ( ) : (
<div> <div style={{ ...headerStyle }}>
<div className="PrintStyle11-print"> <div className="PrintStyle11-print" style={{ ...headerStyle }} >
{GlobalLogo && GlobaldummyData ? ( {GlobalLogo && GlobaldummyData ? (
<img <img
className="PrintStyle2-BrandImage" className="PrintStyle2-BrandImage"
@ -3155,87 +3251,87 @@ const PrintStyle11 = ({
<thead> <thead>
<tr> <tr>
{GlobaldummyData {GlobaldummyData
? GlobalSlNo && <th style={{ width: '10px' }}>S.N</th> ? GlobalSlNo && <th style={{ ...tableHeaderStyle, width: '10px' }}>S.N</th>
: SLNO && <th style={{ width: '10px' }}>S.N</th>} : SLNO && <th style={{ ...tableHeaderStyle, width: '10px' }}>S.N</th>}
{GlobaldummyData {GlobaldummyData
? GlobalItem && <th style={{ width: '10px' }}>Item</th> ? GlobalItem && <th style={{ ...tableHeaderStyle, width: '10px' }}>Item</th>
: Item && <th style={{ width: '10px' }}>Item</th>} : Item && <th style={{ ...tableHeaderStyle, width: '10px' }}>Item</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
? 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>
)} )}
@ -3245,7 +3341,18 @@ const PrintStyle11 = ({
{(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>}
@ -3466,87 +3573,87 @@ const PrintStyle11 = ({
<thead> <thead>
<tr> <tr>
{GlobaldummyData {GlobaldummyData
? GlobalSlNo && <th style={{ width: '10px' }}>S.N</th> ? GlobalSlNo && <th style={{ ...tableHeaderStyle, width: '10px' }}>S.N</th>
: SLNO && <th style={{ width: '10px' }}>S.N</th>} : SLNO && <th style={{ ...tableHeaderStyle, width: '10px' }}>S.N</th>}
{GlobaldummyData {GlobaldummyData
? GlobalItem && <th style={{ width: '10px' }}>Item</th> ? GlobalItem && <th style={{ ...tableHeaderStyle, width: '10px' }}>Item</th>
: Item && <th style={{ width: '10px' }}>Item</th>} : Item && <th style={{ ...tableHeaderStyle, width: '10px' }}>Item</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
? 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>
)} )}
@ -3556,7 +3663,18 @@ const PrintStyle11 = ({
{(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>}
@ -3752,6 +3870,7 @@ const PrintStyle11 = ({
textAlign: 'right', textAlign: 'right',
fontWeight: '600', fontWeight: '600',
fontSize: '18px', fontSize: '18px',
...netAmountStyle
}} }}
> >
Amount : Amount :
@ -4323,6 +4442,7 @@ const PrintStyle11 = ({
pageBreakBefore: 'avoid', pageBreakBefore: 'avoid',
pageBreakInside: 'avoid', pageBreakInside: 'avoid',
minHeight: 'auto', minHeight: 'auto',
...footerColorStyle
}} }}
> >
{GlobaldummyData {GlobaldummyData