Implement dynamic header and table color functionality
This commit is contained in:
parent
1c5da0e201
commit
d9b2fbcbf9
|
|
@ -29,7 +29,17 @@ import {
|
|||
GlobalprintLogo,
|
||||
GlobalprintCredit,
|
||||
GlobalprintTax,
|
||||
GlobalSelectedPrintHeaderColor,
|
||||
GlobalSelectedPrintHeaderColor,
|
||||
GlobalSelectedPrintHeaderFontColor,
|
||||
GlobalSelectedTableHeaderColor,
|
||||
GlobalSelectedTableHeaderFontColor,
|
||||
GlobalSelectedTableBodyFontColor,
|
||||
GlobalSelectedTableBodyColor,
|
||||
GlobalRowType,
|
||||
GlobalSelectedFooterColor,
|
||||
GlobalSelectedFooterFontColor,
|
||||
GlobalSelectedNetAmountColor,
|
||||
GlobalSelectedNetAmountFontColor,
|
||||
} from '../../../../Features/ThemeChange/ThemeChange';
|
||||
import {
|
||||
GlobalUpiIDprint,
|
||||
|
|
@ -103,7 +113,17 @@ const Printstyle6 = ({
|
|||
const GlobalLogo = useSelector(GlobalprintLogo);
|
||||
const GlobalCredit = useSelector(GlobalprintCredit);
|
||||
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")
|
||||
const UomPrint = SettingData?.[0]?.SettingDtlDetails?.filter(
|
||||
(i) => i.SettingIdName === 'PrintUom'
|
||||
|
|
@ -146,7 +166,12 @@ const Printstyle6 = ({
|
|||
(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 SignatureImg = printDatas?.Signature;
|
||||
|
|
@ -331,7 +356,51 @@ const Printstyle6 = ({
|
|||
? paginatedChunks[paginatedChunks.length - 1].length
|
||||
: 0;
|
||||
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 (
|
||||
<>
|
||||
{FormatTheme ? (
|
||||
|
|
@ -389,7 +458,7 @@ const Printstyle6 = ({
|
|||
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
|
||||
''
|
||||
) : (
|
||||
<div className="PrintStyle6-firstDiv">
|
||||
<div className="PrintStyle6-firstDiv" style={{...headerStyle}}>
|
||||
<div
|
||||
className="P6HdBrnchName"
|
||||
style={{
|
||||
|
|
@ -422,7 +491,7 @@ const Printstyle6 = ({
|
|||
/>
|
||||
) : null}
|
||||
</div>
|
||||
<div style={{ color: SelectedHeaderColor }}>
|
||||
<div>
|
||||
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -551,12 +620,12 @@ const Printstyle6 = ({
|
|||
<tr>
|
||||
{GlobaldummyData
|
||||
? 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 ? (
|
||||
(GlobalItem || GlobalQuantity) && (
|
||||
<th style={{ width: '10px' }}>
|
||||
<th style={{...tableHeaderStyle, width: '10px' }}>
|
||||
{GlobaldummyData
|
||||
? GlobalItem && 'ITEM /DES/'
|
||||
: 'ITEM /DES/'}{' '}
|
||||
|
|
@ -566,7 +635,7 @@ const Printstyle6 = ({
|
|||
</th>
|
||||
)
|
||||
) : (
|
||||
<th style={{ width: '10px' }}>
|
||||
<th style={{...tableHeaderStyle, width: '10px' }}>
|
||||
{GlobaldummyData
|
||||
? GlobalItem && 'ITEM /DES/'
|
||||
: Item && 'ITEM /DES/'}{' '}
|
||||
|
|
@ -579,6 +648,7 @@ const Printstyle6 = ({
|
|||
? GlobalHsnCode && (
|
||||
<th
|
||||
style={{
|
||||
...tableHeaderStyle,
|
||||
width: '10px',
|
||||
textAlign: 'right',
|
||||
}}
|
||||
|
|
@ -589,6 +659,7 @@ const Printstyle6 = ({
|
|||
: HsnCode && (
|
||||
<th
|
||||
style={{
|
||||
...tableHeaderStyle,
|
||||
width: '10px',
|
||||
textAlign: 'right',
|
||||
}}
|
||||
|
|
@ -600,6 +671,7 @@ const Printstyle6 = ({
|
|||
? GlobalMRP && (
|
||||
<th
|
||||
style={{
|
||||
...tableHeaderStyle,
|
||||
width: '10px',
|
||||
textAlign: 'right',
|
||||
}}
|
||||
|
|
@ -610,6 +682,7 @@ const Printstyle6 = ({
|
|||
: MRP && (
|
||||
<th
|
||||
style={{
|
||||
...tableHeaderStyle,
|
||||
width: '10px',
|
||||
textAlign: 'right',
|
||||
}}
|
||||
|
|
@ -621,6 +694,7 @@ const Printstyle6 = ({
|
|||
? GlobalDiscount && (
|
||||
<th
|
||||
style={{
|
||||
...tableHeaderStyle,
|
||||
width: '10px',
|
||||
textAlign: 'right',
|
||||
}}
|
||||
|
|
@ -631,6 +705,7 @@ const Printstyle6 = ({
|
|||
: Discount && (
|
||||
<th
|
||||
style={{
|
||||
...tableHeaderStyle,
|
||||
width: '10px',
|
||||
textAlign: 'right',
|
||||
}}
|
||||
|
|
@ -642,6 +717,7 @@ const Printstyle6 = ({
|
|||
? GlobalTax && (
|
||||
<th
|
||||
style={{
|
||||
...tableHeaderStyle,
|
||||
width: '10px',
|
||||
textAlign: 'right',
|
||||
}}
|
||||
|
|
@ -653,6 +729,7 @@ const Printstyle6 = ({
|
|||
table2Data?.OrderType !== 'E' && (
|
||||
<th
|
||||
style={{
|
||||
...tableHeaderStyle,
|
||||
width: '10px',
|
||||
textAlign: 'right',
|
||||
}}
|
||||
|
|
@ -664,6 +741,7 @@ const Printstyle6 = ({
|
|||
? GlobalRate && (
|
||||
<th
|
||||
style={{
|
||||
...tableHeaderStyle,
|
||||
width: '10px',
|
||||
textAlign: 'right',
|
||||
}}
|
||||
|
|
@ -674,6 +752,7 @@ const Printstyle6 = ({
|
|||
: Rate && (
|
||||
<th
|
||||
style={{
|
||||
...tableHeaderStyle,
|
||||
width: '10px',
|
||||
textAlign: 'right',
|
||||
}}
|
||||
|
|
@ -685,6 +764,7 @@ const Printstyle6 = ({
|
|||
? GlobalAmount && (
|
||||
<th
|
||||
style={{
|
||||
...tableHeaderStyle,
|
||||
width: '10px',
|
||||
textAlign: 'right',
|
||||
}}
|
||||
|
|
@ -695,6 +775,7 @@ const Printstyle6 = ({
|
|||
: Amount && (
|
||||
<th
|
||||
style={{
|
||||
...tableHeaderStyle,
|
||||
width: '10px',
|
||||
textAlign: 'right',
|
||||
}}
|
||||
|
|
@ -707,7 +788,18 @@ const Printstyle6 = ({
|
|||
<tbody>
|
||||
{dataChunk?.map((item, index) => {
|
||||
return (
|
||||
<tr key={index}>
|
||||
<tr key={index}
|
||||
style={
|
||||
index % 2 !== 1 && rowtypeStyle === "even"
|
||||
? {
|
||||
...tableBodyStyle
|
||||
}
|
||||
: index % 2 === 1 && rowtypeStyle === "odd"
|
||||
? {
|
||||
...tableBodyStyle
|
||||
}
|
||||
: {}
|
||||
}>
|
||||
{GlobaldummyData
|
||||
? GlobalSlNo && <td>{index + 1}</td>
|
||||
: SLNO && (
|
||||
|
|
@ -946,12 +1038,12 @@ const Printstyle6 = ({
|
|||
<tr>
|
||||
{GlobaldummyData
|
||||
? 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 ? (
|
||||
(GlobalItem || GlobalQuantity) && (
|
||||
<th style={{ width: '10px' }}>
|
||||
<th style={{...tableHeaderStyle, width: '10px' }}>
|
||||
{GlobaldummyData
|
||||
? GlobalItem && 'ITEM /DES/'
|
||||
: 'ITEM /DES/'}{' '}
|
||||
|
|
@ -961,7 +1053,7 @@ const Printstyle6 = ({
|
|||
</th>
|
||||
)
|
||||
) : (
|
||||
<th style={{ width: '10px' }}>
|
||||
<th style={{...tableHeaderStyle, width: '10px' }}>
|
||||
{GlobaldummyData
|
||||
? GlobalItem && 'ITEM /DES/'
|
||||
: Item && 'ITEM /DES/'}{' '}
|
||||
|
|
@ -974,6 +1066,7 @@ const Printstyle6 = ({
|
|||
? GlobalHsnCode && (
|
||||
<th
|
||||
style={{
|
||||
...tableHeaderStyle,
|
||||
width: '10px',
|
||||
textAlign: 'right',
|
||||
}}
|
||||
|
|
@ -984,6 +1077,7 @@ const Printstyle6 = ({
|
|||
: HsnCode && (
|
||||
<th
|
||||
style={{
|
||||
...tableHeaderStyle,
|
||||
width: '10px',
|
||||
textAlign: 'right',
|
||||
}}
|
||||
|
|
@ -995,6 +1089,7 @@ const Printstyle6 = ({
|
|||
? GlobalMRP && (
|
||||
<th
|
||||
style={{
|
||||
...tableHeaderStyle,
|
||||
width: '10px',
|
||||
textAlign: 'right',
|
||||
}}
|
||||
|
|
@ -1005,6 +1100,7 @@ const Printstyle6 = ({
|
|||
: MRP && (
|
||||
<th
|
||||
style={{
|
||||
...tableHeaderStyle,
|
||||
width: '10px',
|
||||
textAlign: 'right',
|
||||
}}
|
||||
|
|
@ -1016,6 +1112,7 @@ const Printstyle6 = ({
|
|||
? GlobalDiscount && (
|
||||
<th
|
||||
style={{
|
||||
...tableHeaderStyle,
|
||||
width: '10px',
|
||||
textAlign: 'right',
|
||||
}}
|
||||
|
|
@ -1026,6 +1123,7 @@ const Printstyle6 = ({
|
|||
: Discount && (
|
||||
<th
|
||||
style={{
|
||||
...tableHeaderStyle,
|
||||
width: '10px',
|
||||
textAlign: 'right',
|
||||
}}
|
||||
|
|
@ -1037,6 +1135,7 @@ const Printstyle6 = ({
|
|||
? GlobalTax && (
|
||||
<th
|
||||
style={{
|
||||
...tableHeaderStyle,
|
||||
width: '10px',
|
||||
textAlign: 'right',
|
||||
}}
|
||||
|
|
@ -1048,6 +1147,7 @@ const Printstyle6 = ({
|
|||
table2Data?.OrderType !== 'E' && (
|
||||
<th
|
||||
style={{
|
||||
...tableHeaderStyle,
|
||||
width: '10px',
|
||||
textAlign: 'right',
|
||||
}}
|
||||
|
|
@ -1059,6 +1159,7 @@ const Printstyle6 = ({
|
|||
? GlobalRate && (
|
||||
<th
|
||||
style={{
|
||||
...tableHeaderStyle,
|
||||
width: '10px',
|
||||
textAlign: 'right',
|
||||
}}
|
||||
|
|
@ -1069,6 +1170,7 @@ const Printstyle6 = ({
|
|||
: Rate && (
|
||||
<th
|
||||
style={{
|
||||
...tableHeaderStyle,
|
||||
width: '10px',
|
||||
textAlign: 'right',
|
||||
}}
|
||||
|
|
@ -1080,6 +1182,7 @@ const Printstyle6 = ({
|
|||
? GlobalAmount && (
|
||||
<th
|
||||
style={{
|
||||
...tableHeaderStyle,
|
||||
width: '10px',
|
||||
textAlign: 'right',
|
||||
}}
|
||||
|
|
@ -1090,6 +1193,7 @@ const Printstyle6 = ({
|
|||
: Amount && (
|
||||
<th
|
||||
style={{
|
||||
...tableHeaderStyle,
|
||||
width: '10px',
|
||||
textAlign: 'right',
|
||||
}}
|
||||
|
|
@ -1102,7 +1206,18 @@ const Printstyle6 = ({
|
|||
<tbody>
|
||||
{dataChunk?.map((item, index) => {
|
||||
return (
|
||||
<tr key={index}>
|
||||
<tr key={index}
|
||||
style={
|
||||
index % 2 !== 1 && rowtypeStyle === "even"
|
||||
? {
|
||||
...tableBodyStyle
|
||||
}
|
||||
: index % 2 === 1 && rowtypeStyle === "odd"
|
||||
? {
|
||||
...tableBodyStyle
|
||||
}
|
||||
: {}
|
||||
}>
|
||||
{GlobaldummyData
|
||||
? GlobalSlNo && <td>{index + 1}</td>
|
||||
: SLNO && (
|
||||
|
|
@ -1682,7 +1797,7 @@ const Printstyle6 = ({
|
|||
</div>
|
||||
</div>
|
||||
)}
|
||||
<div className="PrintStyle6-secondDiv">
|
||||
<div className="PrintStyle6-secondDiv" style={{...netAmountStyle}}>
|
||||
<div
|
||||
style={{
|
||||
textAlign: 'left',
|
||||
|
|
@ -2082,6 +2197,7 @@ const Printstyle6 = ({
|
|||
pageBreakBefore: 'avoid',
|
||||
pageBreakInside: 'avoid',
|
||||
minHeight: 'auto',
|
||||
...footerColorStyle
|
||||
}}
|
||||
>
|
||||
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
|
||||
|
|
@ -2683,7 +2799,7 @@ const Printstyle6 = ({
|
|||
</div>
|
||||
</div>
|
||||
)}
|
||||
<div className="PrintStyle6-secondDiv">
|
||||
<div className="PrintStyle6-secondDiv" style={{...netAmountStyle}}>
|
||||
<div
|
||||
style={{
|
||||
textAlign: 'left',
|
||||
|
|
@ -3077,6 +3193,7 @@ const Printstyle6 = ({
|
|||
pageBreakBefore: 'avoid',
|
||||
pageBreakInside: 'avoid',
|
||||
minHeight: 'auto',
|
||||
...footerColorStyle
|
||||
}}
|
||||
>
|
||||
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
|
||||
|
|
@ -3283,7 +3400,7 @@ const Printstyle6 = ({
|
|||
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
|
||||
''
|
||||
) : (
|
||||
<div className="PrintStyle6-firstDiv">
|
||||
<div className="PrintStyle6-firstDiv" style={{...headerStyle}}>
|
||||
<div
|
||||
className="P6HdBrnchName"
|
||||
style={{
|
||||
|
|
@ -3311,7 +3428,7 @@ const Printstyle6 = ({
|
|||
/>
|
||||
) : null}
|
||||
</div>
|
||||
<div style={{ color: SelectedHeaderColor }}>
|
||||
<div >
|
||||
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -3436,11 +3553,11 @@ const Printstyle6 = ({
|
|||
<thead>
|
||||
<tr>
|
||||
{GlobaldummyData
|
||||
? GlobalSlNo && <th style={{ width: '10px' }}>S.No</th>
|
||||
: SLNO && <th style={{ width: '10px' }}>S.No</th>}
|
||||
? GlobalSlNo && <th style={{...tableHeaderStyle, width: '10px' }}>S.No</th>
|
||||
: SLNO && <th style={{...tableHeaderStyle, width: '10px' }}>S.No</th>}
|
||||
{GlobaldummyData ? (
|
||||
(GlobalItem || GlobalQuantity) && (
|
||||
<th style={{ width: '10px' }}>
|
||||
<th style={{...tableHeaderStyle, width: '10px' }}>
|
||||
{GlobaldummyData
|
||||
? GlobalItem && 'ITEM /DES/'
|
||||
: 'ITEM /DES/'}{' '}
|
||||
|
|
@ -3448,7 +3565,7 @@ const Printstyle6 = ({
|
|||
</th>
|
||||
)
|
||||
) : (
|
||||
<th style={{ width: '10px' }}>
|
||||
<th style={{...tableHeaderStyle, width: '10px' }}>
|
||||
{GlobaldummyData
|
||||
? GlobalItem && 'ITEM /DES/'
|
||||
: Item && 'ITEM /DES/'}{' '}
|
||||
|
|
@ -3459,68 +3576,68 @@ const Printstyle6 = ({
|
|||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalHsnCode && (
|
||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
||||
<th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||
HSN
|
||||
</th>
|
||||
)
|
||||
: HsnCode && (
|
||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
||||
<th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||
HSN
|
||||
</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalMRP && (
|
||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
||||
<th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||
MRP
|
||||
</th>
|
||||
)
|
||||
: MRP && (
|
||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
||||
<th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||
MRP
|
||||
</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalDiscount && (
|
||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
||||
<th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||
Dis{' '}
|
||||
</th>
|
||||
)
|
||||
: Discount && (
|
||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
||||
<th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||
Dis{' '}
|
||||
</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalTax && (
|
||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
||||
<th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||
Tax %
|
||||
</th>
|
||||
)
|
||||
: Tax &&
|
||||
table2Data?.OrderType !== 'E' && (
|
||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
||||
<th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||
Tax %
|
||||
</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalRate && (
|
||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
||||
<th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||
Rate
|
||||
</th>
|
||||
)
|
||||
: Rate && (
|
||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
||||
<th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||
Rate
|
||||
</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalAmount && (
|
||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
||||
<th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||
AMt
|
||||
</th>
|
||||
)
|
||||
: Amount && (
|
||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
||||
<th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||
Amt
|
||||
</th>
|
||||
)}
|
||||
|
|
@ -3530,7 +3647,18 @@ const Printstyle6 = ({
|
|||
{(GlobaldummyData ? products : TakeawayData)?.map(
|
||||
(item, index) => {
|
||||
return (
|
||||
<tr key={index}>
|
||||
<tr key={index}
|
||||
style={
|
||||
index % 2 !== 1 && rowtypeStyle === "even"
|
||||
? {
|
||||
...tableBodyStyle
|
||||
}
|
||||
: index % 2 === 1 && rowtypeStyle === "odd"
|
||||
? {
|
||||
...tableBodyStyle
|
||||
}
|
||||
: {}
|
||||
}>
|
||||
{GlobaldummyData
|
||||
? GlobalSlNo && <td>{index + 1}</td>
|
||||
: SLNO && <td>{index + 1}</td>}
|
||||
|
|
@ -3727,11 +3855,11 @@ const Printstyle6 = ({
|
|||
<thead>
|
||||
<tr>
|
||||
{GlobaldummyData
|
||||
? GlobalSlNo && <th style={{ width: '10px' }}>S.No</th>
|
||||
: SLNO && <th style={{ width: '10px' }}>S.No</th>}
|
||||
? GlobalSlNo && <th style={{...tableHeaderStyle, width: '10px' }}>S.No</th>
|
||||
: SLNO && <th style={{...tableHeaderStyle, width: '10px' }}>S.No</th>}
|
||||
{GlobaldummyData ? (
|
||||
(GlobalItem || GlobalQuantity) && (
|
||||
<th style={{ width: '10px' }}>
|
||||
<th style={{...tableHeaderStyle, width: '10px' }}>
|
||||
{GlobaldummyData
|
||||
? GlobalItem && 'ITEM /DES/'
|
||||
: 'ITEM /DES/'}{' '}
|
||||
|
|
@ -3739,7 +3867,7 @@ const Printstyle6 = ({
|
|||
</th>
|
||||
)
|
||||
) : (
|
||||
<th style={{ width: '10px' }}>
|
||||
<th style={{...tableHeaderStyle, width: '10px' }}>
|
||||
{GlobaldummyData
|
||||
? GlobalItem && 'ITEM /DES/'
|
||||
: Item && 'ITEM /DES/'}{' '}
|
||||
|
|
@ -3750,68 +3878,68 @@ const Printstyle6 = ({
|
|||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalHsnCode && (
|
||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
||||
<th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||
HSN
|
||||
</th>
|
||||
)
|
||||
: HsnCode && (
|
||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
||||
<th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||
HSN
|
||||
</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalMRP && (
|
||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
||||
<th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||
MRP
|
||||
</th>
|
||||
)
|
||||
: MRP && (
|
||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
||||
<th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||
MRP
|
||||
</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalDiscount && (
|
||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
||||
<th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||
Dis{' '}
|
||||
</th>
|
||||
)
|
||||
: Discount && (
|
||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
||||
<th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||
Dis{' '}
|
||||
</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalTax && (
|
||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
||||
<th style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||
Tax %
|
||||
</th>
|
||||
)
|
||||
: Tax &&
|
||||
table2Data?.OrderType !== 'E' && (
|
||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
||||
<th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||
Tax %
|
||||
</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalRate && (
|
||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
||||
<th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||
Rate
|
||||
</th>
|
||||
)
|
||||
: Rate && (
|
||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
||||
<th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||
Rate
|
||||
</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalAmount && (
|
||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
||||
<th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||
AMt
|
||||
</th>
|
||||
)
|
||||
: Amount && (
|
||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
||||
<th style={{...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||
Amt
|
||||
</th>
|
||||
)}
|
||||
|
|
@ -3821,7 +3949,18 @@ const Printstyle6 = ({
|
|||
{(GlobaldummyData ? products : DineInData)?.map(
|
||||
(item, index) => {
|
||||
return (
|
||||
<tr key={index}>
|
||||
<tr key={index}
|
||||
style={
|
||||
index % 2 !== 1 && rowtypeStyle === "even"
|
||||
? {
|
||||
...tableBodyStyle
|
||||
}
|
||||
: index % 2 === 1 && rowtypeStyle === "odd"
|
||||
? {
|
||||
...tableBodyStyle
|
||||
}
|
||||
: {}
|
||||
}>
|
||||
{GlobaldummyData
|
||||
? GlobalSlNo && <td>{index + 1}</td>
|
||||
: SLNO && <td>{index + 1}</td>}
|
||||
|
|
@ -4380,7 +4519,7 @@ const Printstyle6 = ({
|
|||
</div>
|
||||
</div>
|
||||
)}
|
||||
<div className="PrintStyle6-secondDiv">
|
||||
<div className="PrintStyle6-secondDiv" style={{...netAmountStyle}}>
|
||||
<div
|
||||
style={{
|
||||
textAlign: 'left',
|
||||
|
|
@ -4757,6 +4896,7 @@ const Printstyle6 = ({
|
|||
pageBreakBefore: 'avoid',
|
||||
pageBreakInside: 'avoid',
|
||||
minHeight: 'auto',
|
||||
...footerColorStyle
|
||||
}}
|
||||
>
|
||||
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
|
||||
|
|
|
|||
Loading…
Reference in New Issue