Implement dynamic header and table color functionality

This commit is contained in:
Srinath 2026-03-04 16:31:29 +05:30
parent d9b2fbcbf9
commit 4a27698a59
1 changed files with 210 additions and 88 deletions

View File

@ -26,6 +26,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 {
@ -99,7 +109,23 @@ const PrintStyle7 = ({
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);
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];
@ -349,7 +375,51 @@ const PrintStyle7 = ({
? 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 ? (
@ -408,7 +478,7 @@ const PrintStyle7 = ({
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( {!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
'' ''
) : ( ) : (
<div className="PrintStyle7-print"> <div className="PrintStyle7-print" style={{...headerStyle}}>
{/* <div style={{ fontSize: '16px', fontWeight: '600' }}> {GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}</div> */} {/* <div style={{ fontSize: '16px', fontWeight: '600' }}> {GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}</div> */}
<div <div
style={{ style={{
@ -437,7 +507,6 @@ const PrintStyle7 = ({
style={{ style={{
fontSize: '16px', fontSize: '16px',
fontWeight: '600', fontWeight: '600',
color: SelectedHeaderColor,
}} }}
> >
{' '} {' '}
@ -575,63 +644,64 @@ const PrintStyle7 = ({
<tr> <tr>
{GlobaldummyData {GlobaldummyData
? GlobalSlNo && ( ? GlobalSlNo && (
<th style={{ width: '10px' }}>S</th> <th style={{...tableHeaderStyle, width: '10px' }}>S</th>
) )
: SLNO == true && ( : SLNO == true && (
<th style={{ width: '10px' }}>S</th> <th style={{...tableHeaderStyle, width: '10px' }}>S</th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalItem && <th>Item</th> ? GlobalItem && <th style={{...tableHeaderStyle,}}>Item</th>
: Item == true && <th>Item</th>} : Item == true && <th style={{...tableHeaderStyle,}}>Item</th>}
{GlobaldummyData {GlobaldummyData
? GlobalHsnCode && ( ? GlobalHsnCode && (
<th style={{ width: '10px' }}>HSN</th> <th style={{...tableHeaderStyle, width: '10px' }}>HSN</th>
) )
: HsnCode == true && ( : HsnCode == true && (
<th style={{ width: '10px' }}>HSN</th> <th style={{...tableHeaderStyle, width: '10px' }}>HSN</th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalQuantity && ( ? GlobalQuantity && (
<th style={{ width: '10px' }}>Qty</th> <th style={{...tableHeaderStyle, width: '10px' }}>Qty</th>
) )
: Quantity == true && ( : Quantity == true && (
<th style={{ width: '10px' }}> <th style={{...tableHeaderStyle, width: '10px' }}>
{WeightasKg ? 'Qty/Kg' : 'Qty'} {WeightasKg ? 'Qty/Kg' : 'Qty'}
</th> </th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalMRP && ( ? GlobalMRP && (
<th style={{ width: '10px' }}>MRP</th> <th style={{...tableHeaderStyle, width: '10px' }}>MRP</th>
) )
: MRP == true && ( : MRP == true && (
<th style={{ width: '10px' }}>MRP</th> <th style={{...tableHeaderStyle, width: '10px' }}>MRP</th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalRate && ( ? GlobalRate && (
<th style={{ width: '10px' }}>Rate</th> <th style={{...tableHeaderStyle, width: '10px' }}>Rate</th>
) )
: Rate == true && ( : Rate == true && (
<th style={{ width: '10px' }}>Rate</th> <th style={{...tableHeaderStyle, width: '10px' }}>Rate</th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalDiscount && ( ? GlobalDiscount && (
<th style={{ width: '10px' }}>Dis </th> <th style={{...tableHeaderStyle, width: '10px' }}>Dis </th>
) )
: Discount == true && ( : Discount == true && (
<th style={{ width: '10px' }}>Dis </th> <th style={{...tableHeaderStyle, width: '10px' }}>Dis </th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalTax && ( ? GlobalTax && (
<th style={{ width: '10px' }}>Tax % </th> <th style={{...tableHeaderStyle, width: '10px' }}>Tax % </th>
) )
: Tax && : Tax &&
table2Data?.OrderType !== 'E' && ( table2Data?.OrderType !== 'E' && (
<th style={{ width: '10px' }}>Tax % </th> <th style={{...tableHeaderStyle, width: '10px' }}>Tax % </th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalAmount && ( ? GlobalAmount && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -642,6 +712,7 @@ const PrintStyle7 = ({
: Amount == true && ( : Amount == true && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -653,7 +724,18 @@ const PrintStyle7 = ({
</thead> </thead>
<tbody> <tbody>
{dataChunk?.map((item, index) => ( {dataChunk?.map((item, index) => (
<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' }}>
@ -719,11 +801,11 @@ const PrintStyle7 = ({
{(item?.ProductIdentifierDtls ?? []) {(item?.ProductIdentifierDtls ?? [])
.find(items => items.SerialNumber || items.IMEI1 || items.IMEI2)?.Description && ( .find(items => items.SerialNumber || items.IMEI1 || items.IMEI2)?.Description && (
<div> <div>
{(item?.ProductIdentifierDtls ?? []) {(item?.ProductIdentifierDtls ?? [])
.find(items => items.SerialNumber || items.IMEI1 || items.IMEI2).Description} .find(items => items.SerialNumber || items.IMEI1 || items.IMEI2).Description}
</div> </div>
)} )}
</div> </div>
</td> </td>
)} )}
@ -836,63 +918,64 @@ const PrintStyle7 = ({
<tr> <tr>
{GlobaldummyData {GlobaldummyData
? GlobalSlNo && ( ? GlobalSlNo && (
<th style={{ width: '10px' }}>S.No</th> <th style={{...tableHeaderStyle, width: '10px' }}>S.No</th>
) )
: SLNO == true && ( : SLNO == true && (
<th style={{ width: '10px' }}>S.NO</th> <th style={{...tableHeaderStyle, width: '10px' }}>S.NO</th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalItem && <th>Item</th> ? GlobalItem && <th style={{...tableHeaderStyle,}}>Item</th>
: Item == true && <th>Item</th>} : Item == true && <th style={{...tableHeaderStyle,}}>Item</th>}
{GlobaldummyData {GlobaldummyData
? GlobalHsnCode && ( ? GlobalHsnCode && (
<th style={{ width: '10px' }}>HSN</th> <th style={{...tableHeaderStyle, width: '10px' }}>HSN</th>
) )
: HsnCode == true && ( : HsnCode == true && (
<th style={{ width: '10px' }}>HSN</th> <th style={{...tableHeaderStyle, width: '10px' }}>HSN</th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalQuantity && ( ? GlobalQuantity && (
<th style={{ width: '10px' }}>Qty</th> <th style={{...tableHeaderStyle, width: '10px' }}>Qty</th>
) )
: Quantity == true && ( : Quantity == true && (
<th style={{ width: '10px' }}> <th style={{ ...tableHeaderStyle,width: '10px' }}>
{WeightasKg ? 'Qty/Kg' : 'Qty'} {WeightasKg ? 'Qty/Kg' : 'Qty'}
</th> </th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalMRP && ( ? GlobalMRP && (
<th style={{ width: '10px' }}>MRP</th> <th style={{...tableHeaderStyle, width: '10px' }}>MRP</th>
) )
: MRP == true && ( : MRP == true && (
<th style={{ width: '10px' }}>MRP</th> <th style={{...tableHeaderStyle, width: '10px' }}>MRP</th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalRate && ( ? GlobalRate && (
<th style={{ width: '10px' }}>Rate</th> <th style={{...tableHeaderStyle, width: '10px' }}>Rate</th>
) )
: Rate == true && ( : Rate == true && (
<th style={{ width: '10px' }}>Rate</th> <th style={{...tableHeaderStyle, width: '10px' }}>Rate</th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalDiscount && ( ? GlobalDiscount && (
<th style={{ width: '10px' }}>Dis </th> <th style={{...tableHeaderStyle, width: '10px' }}>Dis </th>
) )
: Discount == true && ( : Discount == true && (
<th style={{ width: '10px' }}>Dis </th> <th style={{...tableHeaderStyle, width: '10px' }}>Dis </th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalTax && ( ? GlobalTax && (
<th style={{ width: '10px' }}>Tax % </th> <th style={{...tableHeaderStyle, width: '10px' }}>Tax % </th>
) )
: Tax && : Tax &&
table2Data?.OrderType !== 'E' && ( table2Data?.OrderType !== 'E' && (
<th style={{ width: '10px' }}>Tax % </th> <th style={{...tableHeaderStyle, width: '10px' }}>Tax % </th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalAmount && ( ? GlobalAmount && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -903,6 +986,7 @@ const PrintStyle7 = ({
: Amount == true && ( : Amount == true && (
<th <th
style={{ style={{
...tableHeaderStyle,
width: '10px', width: '10px',
textAlign: 'right', textAlign: 'right',
}} }}
@ -914,7 +998,18 @@ const PrintStyle7 = ({
</thead> </thead>
<tbody> <tbody>
{dataChunk?.map((item, index) => ( {dataChunk?.map((item, index) => (
<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' }}>
@ -1436,6 +1531,7 @@ const PrintStyle7 = ({
justifyContent: 'center', justifyContent: 'center',
fontSize: '16px', fontSize: '16px',
fontWeight: '600', fontWeight: '600',
...netAmountStyle
}} }}
> >
Amount : Amount :
@ -1771,6 +1867,7 @@ const PrintStyle7 = ({
pageBreakBefore: 'avoid', pageBreakBefore: 'avoid',
pageBreakInside: 'avoid', pageBreakInside: 'avoid',
minHeight: 'auto', minHeight: 'auto',
...footerColorStyle
}} }}
> >
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( {!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
@ -2343,6 +2440,7 @@ const PrintStyle7 = ({
justifyContent: 'center', justifyContent: 'center',
fontSize: '16px', fontSize: '16px',
fontWeight: '600', fontWeight: '600',
...netAmountStyle
}} }}
> >
Amount : Amount :
@ -2676,6 +2774,7 @@ const PrintStyle7 = ({
pageBreakBefore: 'avoid', pageBreakBefore: 'avoid',
pageBreakInside: 'avoid', pageBreakInside: 'avoid',
minHeight: 'auto', minHeight: 'auto',
...footerColorStyle
}} }}
> >
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( {!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
@ -2885,7 +2984,7 @@ const PrintStyle7 = ({
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( {!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
'' ''
) : ( ) : (
<div className="PrintStyle7-print"> <div className="PrintStyle7-print" style={{...headerStyle}}>
<div <div
style={{ style={{
display: 'flex', display: 'flex',
@ -2913,7 +3012,6 @@ const PrintStyle7 = ({
style={{ style={{
fontSize: '16px', fontSize: '16px',
fontWeight: '600', fontWeight: '600',
color: SelectedHeaderColor,
}} }}
> >
{' '} {' '}
@ -3052,58 +3150,58 @@ const PrintStyle7 = ({
<thead> <thead>
<tr> <tr>
{GlobaldummyData {GlobaldummyData
? GlobalSlNo && <th style={{ width: '10%' }}>S.No</th> ? GlobalSlNo && <th style={{...tableHeaderStyle, width: '10%' }}>S.No</th>
: SLNO == true && ( : SLNO == true && (
<th style={{ width: '10px' }}>S.No</th> <th style={{...tableHeaderStyle, width: '10px' }}>S.No</th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalItem && ( ? GlobalItem && (
<th style={{ width: '30%', textAlign: 'left' }}> <th style={{...tableHeaderStyle, width: '30%', textAlign: 'left' }}>
Item Item
</th> </th>
) )
: Item == true && <th>Item</th>} : Item == true && <th style={{...tableHeaderStyle}}>Item</th>}
{GlobaldummyData {GlobaldummyData
? GlobalHsnCode && <th style={{}}>HSN</th> ? GlobalHsnCode && <th style={{...tableHeaderStyle}}>HSN</th>
: HsnCode == true && ( : HsnCode == true && (
<th style={{ width: '10px' }}>HSN</th> <th style={{...tableHeaderStyle, width: '10px' }}>HSN</th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalQuantity && <th style={{}}>Qty</th> ? GlobalQuantity && <th style={{...tableHeaderStyle}}>Qty</th>
: Quantity == true && ( : Quantity == true && (
<th style={{ width: '10px' }}> <th style={{...tableHeaderStyle, width: '10px' }}>
{WeightasKg ? 'Qty/Kg' : 'Qty'} {WeightasKg ? 'Qty/Kg' : 'Qty'}
</th> </th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalMRP && <th style={{}}>MRP</th> ? GlobalMRP && <th style={{...tableHeaderStyle}}>MRP</th>
: MRP == true && ( : MRP == true && (
<th style={{ width: '10px' }}>MRP</th> <th style={{...tableHeaderStyle, width: '10px' }}>MRP</th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalRate && <th style={{}}>Rate</th> ? GlobalRate && <th style={{...tableHeaderStyle}}>Rate</th>
: Rate == true && ( : Rate == true && (
<th style={{ width: '10px' }}>Rate</th> <th style={{...tableHeaderStyle, width: '10px' }}>Rate</th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalDiscount && <th style={{}}>Dis </th> ? GlobalDiscount && <th style={{...tableHeaderStyle,}}>Dis </th>
: Discount == true && ( : Discount == true && (
<th style={{ width: '10px' }}>Dis </th> <th style={{...tableHeaderStyle, width: '10px' }}>Dis </th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalTax && ( ? GlobalTax && (
<th style={{ width: '10px' }}>Tax % </th> <th style={{...tableHeaderStyle, width: '10px' }}>Tax % </th>
) )
: Tax && : Tax &&
table2Data?.OrderType !== 'E' && ( table2Data?.OrderType !== 'E' && (
<th style={{ width: '10px' }}>Tax % </th> <th style={{...tableHeaderStyle, width: '10px' }}>Tax % </th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalAmount && ( ? GlobalAmount && (
<th style={{ textAlign: 'right' }}>Amt</th> <th style={{...tableHeaderStyle, textAlign: 'right' }}>Amt</th>
) )
: Amount == true && ( : Amount == true && (
<th style={{ width: '10px', textAlign: 'right' }}> <th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
Amt Amt
</th> </th>
)} )}
@ -3112,7 +3210,18 @@ const PrintStyle7 = ({
<tbody> <tbody>
{(GlobaldummyData ? products : TakeawayData)?.map( {(GlobaldummyData ? products : TakeawayData)?.map(
(item, index) => ( (item, index) => (
<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' }}>
@ -3176,12 +3285,12 @@ const PrintStyle7 = ({
{(item?.ProductIdentifierDtls ?? []).find( {(item?.ProductIdentifierDtls ?? []).find(
items => items.SerialNumber || items.IMEI1 || items.IMEI2 items => items.SerialNumber || items.IMEI1 || items.IMEI2
)?.Description && ( )?.Description && (
<div> <div>
{(item?.ProductIdentifierDtls ?? []).find( {(item?.ProductIdentifierDtls ?? []).find(
items => items.SerialNumber || items.IMEI1 || items.IMEI2 items => items.SerialNumber || items.IMEI1 || items.IMEI2
).Description} ).Description}
</div> </div>
)} )}
</div> </div>
</td> </td>
)} )}
@ -3293,64 +3402,64 @@ const PrintStyle7 = ({
<thead> <thead>
<tr> <tr>
{GlobaldummyData {GlobaldummyData
? GlobalSlNo && <th style={{ width: '10px' }}>S</th> ? GlobalSlNo && <th style={{...tableHeaderStyle, width: '10px' }}>S</th>
: SLNO == true && ( : SLNO == true && (
<th style={{ width: '10px' }}>S</th> <th style={{...tableHeaderStyle, width: '10px' }}>S</th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalItem && <th>Item</th> ? GlobalItem && <th style={{...tableHeaderStyle}}>Item</th>
: Item == true && <th>Item</th>} : Item == true && <th style={{...tableHeaderStyle}}>Item</th>}
{GlobaldummyData {GlobaldummyData
? GlobalHsnCode && ( ? GlobalHsnCode && (
<th style={{ width: '10px' }}>HSN</th> <th style={{...tableHeaderStyle, width: '10px' }}>HSN</th>
) )
: HsnCode == true && ( : HsnCode == true && (
<th style={{ width: '10px' }}>HSN</th> <th style={{...tableHeaderStyle, width: '10px' }}>HSN</th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalQuantity && ( ? GlobalQuantity && (
<th style={{ width: '10px' }}>Qty</th> <th style={{...tableHeaderStyle, width: '10px' }}>Qty</th>
) )
: Quantity == true && ( : Quantity == true && (
<th style={{ width: '10px' }}> <th style={{...tableHeaderStyle, width: '10px' }}>
{WeightasKg ? 'Qty/Kg' : 'Qty'} {WeightasKg ? 'Qty/Kg' : 'Qty'}
</th> </th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalMRP && <th style={{ width: '10px' }}>MRP</th> ? GlobalMRP && <th style={{...tableHeaderStyle, width: '10px' }}>MRP</th>
: MRP == true && ( : MRP == true && (
<th style={{ width: '10px' }}>MRP</th> <th style={{...tableHeaderStyle, width: '10px' }}>MRP</th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalRate && ( ? GlobalRate && (
<th style={{ width: '10px' }}>Rate</th> <th style={{...tableHeaderStyle, width: '10px' }}>Rate</th>
) )
: Rate == true && ( : Rate == true && (
<th style={{ width: '10px' }}>Rate</th> <th style={{...tableHeaderStyle, width: '10px' }}>Rate</th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalDiscount && ( ? GlobalDiscount && (
<th style={{ width: '10px' }}>Dis </th> <th style={{...tableHeaderStyle, width: '10px' }}>Dis </th>
) )
: Discount == true && ( : Discount == true && (
<th style={{ width: '10px' }}>Dis </th> <th style={{...tableHeaderStyle, width: '10px' }}>Dis </th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalTax && ( ? GlobalTax && (
<th style={{ width: '10px' }}>Tax % </th> <th style={{...tableHeaderStyle, width: '10px' }}>Tax % </th>
) )
: Tax && : Tax &&
table2Data?.OrderType !== 'E' && ( table2Data?.OrderType !== 'E' && (
<th style={{ width: '10px' }}>Tax % </th> <th style={{...tableHeaderStyle, width: '10px' }}>Tax % </th>
)} )}
{GlobaldummyData {GlobaldummyData
? GlobalAmount && ( ? GlobalAmount && (
<th style={{ width: '10px', textAlign: 'right' }}> <th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
Amt Amt
</th> </th>
) )
: Amount == true && ( : Amount == true && (
<th style={{ width: '10px', textAlign: 'right' }}> <th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
Amt Amt
</th> </th>
)} )}
@ -3359,7 +3468,18 @@ const PrintStyle7 = ({
<tbody> <tbody>
{(GlobaldummyData ? products : DineInData)?.map( {(GlobaldummyData ? products : DineInData)?.map(
(item, index) => ( (item, index) => (
<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' }}>
@ -3848,6 +3968,7 @@ const PrintStyle7 = ({
justifyContent: 'center', justifyContent: 'center',
fontSize: '16px', fontSize: '16px',
fontWeight: '600', fontWeight: '600',
...netAmountStyle
}} }}
> >
Amount : Amount :
@ -4162,6 +4283,7 @@ const PrintStyle7 = ({
pageBreakBefore: 'avoid', pageBreakBefore: 'avoid',
pageBreakInside: 'avoid', pageBreakInside: 'avoid',
minHeight: 'auto', minHeight: 'auto',
...footerColorStyle
}} }}
> >
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( {!estimatePrintHeader && table2Data?.OrderType === 'E' ? (