Implement dynamic header and table color functionality

This commit is contained in:
Srinath 2026-03-04 16:32:06 +05:30
parent d4a94da912
commit 5470f019f3
1 changed files with 199 additions and 83 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 {
@ -144,7 +154,23 @@ const PrintStyle9 = ({
(ps) => ps.PaymentStatus === 'S' && ps?.LastOrderTran === 'Y' (ps) => ps.PaymentStatus === 'S' && ps?.LastOrderTran === 'Y'
); );
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;
let TermsAndConditions = printDatas?.TermsandConditions; let TermsAndConditions = printDatas?.TermsandConditions;
let SignatureImg = printDatas?.Signature; let SignatureImg = printDatas?.Signature;
let Notestext = printDatas?.Notes; let Notestext = printDatas?.Notes;
@ -351,7 +377,51 @@ const PrintStyle9 = ({
? 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 ? (
@ -409,7 +479,7 @@ const PrintStyle9 = ({
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( {!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
'' ''
) : ( ) : (
<div className="PrintStyle9-print"> <div className="PrintStyle9-print" style={{...headerStyle}}>
<div <div
style={{ style={{
display: 'flex', display: 'flex',
@ -437,7 +507,6 @@ const PrintStyle9 = ({
style={{ style={{
fontSize: 'clamp(1.5rem, 2.5vw, 2rem)', fontSize: 'clamp(1.5rem, 2.5vw, 2rem)',
fontWeight: '600', fontWeight: '600',
color: SelectedHeaderColor,
}} }}
className="PrintStyle9-Branch" className="PrintStyle9-Branch"
> >
@ -582,25 +651,25 @@ const PrintStyle9 = ({
<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 && ( ? 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'}
</th> </th>
@ -608,14 +677,14 @@ const PrintStyle9 = ({
{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>
@ -623,14 +692,14 @@ const PrintStyle9 = ({
{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>
@ -638,14 +707,14 @@ const PrintStyle9 = ({
{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>
@ -653,7 +722,7 @@ const PrintStyle9 = ({
{GlobaldummyData {GlobaldummyData
? GlobalTax && ( ? GlobalTax && (
<th <th
style={{ width: '10px', textAlign: 'right' }} style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}
> >
Tax % Tax %
</th> </th>
@ -661,7 +730,7 @@ const PrintStyle9 = ({
: 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>
@ -669,14 +738,14 @@ const PrintStyle9 = ({
{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>
@ -684,14 +753,14 @@ const PrintStyle9 = ({
{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>
@ -701,7 +770,18 @@ const PrintStyle9 = ({
<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 && (
@ -895,25 +975,25 @@ const PrintStyle9 = ({
<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 && ( ? 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'}
</th> </th>
@ -921,14 +1001,14 @@ const PrintStyle9 = ({
{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>
@ -936,14 +1016,14 @@ const PrintStyle9 = ({
{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>
@ -951,14 +1031,14 @@ const PrintStyle9 = ({
{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>
@ -966,7 +1046,7 @@ const PrintStyle9 = ({
{GlobaldummyData {GlobaldummyData
? GlobalTax && ( ? GlobalTax && (
<th <th
style={{ width: '10px', textAlign: 'right' }} style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}
> >
Tax % Tax %
</th> </th>
@ -974,7 +1054,7 @@ const PrintStyle9 = ({
: 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>
@ -982,14 +1062,14 @@ const PrintStyle9 = ({
{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>
@ -997,14 +1077,14 @@ const PrintStyle9 = ({
{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>
@ -1014,7 +1094,18 @@ const PrintStyle9 = ({
<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 && (
@ -1242,6 +1333,7 @@ const PrintStyle9 = ({
style={{ style={{
display: 'flex', display: 'flex',
justifyContent: 'space-between', justifyContent: 'space-between',
...netAmountStyle
}} }}
> >
<div style={{ fontWeight: '700' }}>Net Amount:</div> <div style={{ fontWeight: '700' }}>Net Amount:</div>
@ -1922,6 +2014,7 @@ const PrintStyle9 = ({
pageBreakBefore: 'avoid', pageBreakBefore: 'avoid',
pageBreakInside: 'avoid', pageBreakInside: 'avoid',
minHeight: 'auto', minHeight: 'auto',
...footerColorStyle
}} }}
> >
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( {!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
@ -2245,7 +2338,7 @@ const PrintStyle9 = ({
<hr className="PrintStyle9-print-dottline" /> <hr className="PrintStyle9-print-dottline" />
<div <div
style={{ display: 'flex', justifyContent: 'space-between' }} style={{ display: 'flex', justifyContent: 'space-between',...netAmountStyle }}
> >
<div style={{ fontWeight: '700' }}>Net Amount:</div> <div style={{ fontWeight: '700' }}>Net Amount:</div>
<div style={{ fontWeight: '700', marginRight: '0.5rem' }}> <div style={{ fontWeight: '700', marginRight: '0.5rem' }}>
@ -2903,6 +2996,7 @@ const PrintStyle9 = ({
pageBreakBefore: 'avoid', pageBreakBefore: 'avoid',
pageBreakInside: 'avoid', pageBreakInside: 'avoid',
minHeight: 'auto', minHeight: 'auto',
...footerColorStyle
}} }}
> >
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( {!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
@ -3118,7 +3212,7 @@ const PrintStyle9 = ({
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( {!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
'' ''
) : ( ) : (
<div className="PrintStyle9-print"> <div className="PrintStyle9-print" style={{...headerStyle}}>
<div <div
style={{ style={{
display: 'flex', display: 'flex',
@ -3146,7 +3240,6 @@ const PrintStyle9 = ({
style={{ style={{
fontSize: 'clamp(1.5rem, 2.5vw, 2rem)', fontSize: 'clamp(1.5rem, 2.5vw, 2rem)',
fontWeight: '600', fontWeight: '600',
color: SelectedHeaderColor,
}} }}
className="PrintStyle9-Branch" className="PrintStyle9-Branch"
> >
@ -3296,89 +3389,89 @@ const PrintStyle9 = ({
<tr> <tr>
{GlobaldummyData {GlobaldummyData
? GlobalSlNo && ( ? GlobalSlNo && (
<th style={{ width: '10px', textAlign: 'left' }}> <th style={{...tableHeaderStyle, width: '10px', textAlign: 'left' }}>
S.No S.No
</th> </th>
) )
: SLNO && <th style={{ width: '10px' }}>S.No</th>} : SLNO && <th style={{...tableHeaderStyle, width: '10px' }}>S.No</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>
)} )}
@ -3388,7 +3481,18 @@ const PrintStyle9 = ({
{(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>}
@ -3546,86 +3650,86 @@ const PrintStyle9 = ({
<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 && <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>
)} )}
@ -3635,7 +3739,18 @@ const PrintStyle9 = ({
{(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>}
@ -3846,7 +3961,7 @@ const PrintStyle9 = ({
<hr className="PrintStyle9-print-dottline" /> <hr className="PrintStyle9-print-dottline" />
<div style={{ display: 'flex', justifyContent: 'space-between' }}> <div style={{ display: 'flex', justifyContent: 'space-between',...netAmountStyle }}>
<div style={{ fontWeight: '700' }}>Net Amount:</div> <div style={{ fontWeight: '700' }}>Net Amount:</div>
<div style={{ fontWeight: '700', marginRight: '0.5rem' }}> <div style={{ fontWeight: '700', marginRight: '0.5rem' }}>
{GlobaldummyData {GlobaldummyData
@ -4483,6 +4598,7 @@ const PrintStyle9 = ({
pageBreakBefore: 'avoid', pageBreakBefore: 'avoid',
pageBreakInside: 'avoid', pageBreakInside: 'avoid',
minHeight: 'auto', minHeight: 'auto',
...footerColorStyle
}} }}
> >
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? ( {!estimatePrintHeader && table2Data?.OrderType === 'E' ? (