Implement dynamic header and table color functionality
This commit is contained in:
parent
74e7def89b
commit
71a37dfd41
|
|
@ -29,6 +29,16 @@ import {
|
||||||
GlobalprintCredit,
|
GlobalprintCredit,
|
||||||
GlobalprintTax,
|
GlobalprintTax,
|
||||||
GlobalSelectedPrintHeaderColor,
|
GlobalSelectedPrintHeaderColor,
|
||||||
|
GlobalSelectedPrintHeaderFontColor,
|
||||||
|
GlobalSelectedTableHeaderColor,
|
||||||
|
GlobalSelectedTableHeaderFontColor,
|
||||||
|
GlobalSelectedTableBodyColor,
|
||||||
|
GlobalSelectedTableBodyFontColor,
|
||||||
|
GlobalSelectedFooterColor,
|
||||||
|
GlobalSelectedFooterFontColor,
|
||||||
|
GlobalRowType,
|
||||||
|
GlobalSelectedNetAmountColor,
|
||||||
|
GlobalSelectedNetAmountFontColor,
|
||||||
} from '../../../../Features/ThemeChange/ThemeChange';
|
} from '../../../../Features/ThemeChange/ThemeChange';
|
||||||
import Logo from '../../../../Images/Logo.jpg';
|
import Logo from '../../../../Images/Logo.jpg';
|
||||||
import QRCode from 'react-qr-code';
|
import QRCode from 'react-qr-code';
|
||||||
|
|
@ -95,7 +105,16 @@ const Printstyle2 = ({
|
||||||
(ps) => ps.PaymentTypeName === 'UPI'
|
(ps) => ps.PaymentTypeName === 'UPI'
|
||||||
);
|
);
|
||||||
const SelectedHeaderColor = useSelector(GlobalSelectedPrintHeaderColor);
|
const SelectedHeaderColor = useSelector(GlobalSelectedPrintHeaderColor);
|
||||||
console.log(Qrcodet, 'Qrcodet', paymentTypeUPI);
|
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);
|
||||||
const GlobalSignature = useSelector(GlobalprintSignature);
|
const GlobalSignature = useSelector(GlobalprintSignature);
|
||||||
const GlobaltermsAndConditions = useSelector(GlobalprinttermsAndConditions);
|
const GlobaltermsAndConditions = useSelector(GlobalprinttermsAndConditions);
|
||||||
const GlobalSignatureImages = useSelector(GlobalSignatureImage);
|
const GlobalSignatureImages = useSelector(GlobalSignatureImage);
|
||||||
|
|
@ -140,6 +159,12 @@ const Printstyle2 = ({
|
||||||
let BillName = printDatas?.PrintHdrName;
|
let BillName = printDatas?.PrintHdrName;
|
||||||
let FormatTheme = printDatas?.PrintType == 'S' ? true : false;
|
let FormatTheme = printDatas?.PrintType == 'S' ? true : false;
|
||||||
let PageSize = printDatas?.PageSize;
|
let PageSize = printDatas?.PageSize;
|
||||||
|
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 Signature = FieldDetails?.['signature'];
|
const Signature = FieldDetails?.['signature'];
|
||||||
const TermsnAdCondition = FieldDetails?.['terms&conditions'];
|
const TermsnAdCondition = FieldDetails?.['terms&conditions'];
|
||||||
|
|
||||||
|
|
@ -339,7 +364,51 @@ const Printstyle2 = ({
|
||||||
: 0;
|
: 0;
|
||||||
|
|
||||||
const shouldFooterBeOnNewPage = lastChunkRows > (PageSize == 'A5' ? 5 : 13);
|
const shouldFooterBeOnNewPage = lastChunkRows > (PageSize == 'A5' ? 5 : 13);
|
||||||
|
const headerStyle ={
|
||||||
|
backgroundColor: GlobaldummyData
|
||||||
|
? SelectedHeaderColor
|
||||||
|
: headerColor?.background,
|
||||||
|
|
||||||
|
color: GlobaldummyData
|
||||||
|
? SelectedHeaderFontColor
|
||||||
|
: headerColor?.font,
|
||||||
|
}
|
||||||
|
const tableHeaderStyle ={
|
||||||
|
backgroundColor: GlobaldummyData
|
||||||
|
? SelectedTableHeaderColor
|
||||||
|
: tableHeaderColor?.background,
|
||||||
|
|
||||||
|
color: GlobaldummyData
|
||||||
|
? SelectedTableHeaderFontColor
|
||||||
|
: tableHeaderColor?.font,
|
||||||
|
}
|
||||||
|
const tableBodyStyle ={
|
||||||
|
backgroundColor: GlobaldummyData
|
||||||
|
? SelectedTableBodyColor
|
||||||
|
: tableBodyColor?.background,
|
||||||
|
color: GlobaldummyData
|
||||||
|
? SelectedTableBodyFontColor
|
||||||
|
: tableBodyColor?.font,
|
||||||
|
}
|
||||||
|
const rowtypeStyle = GlobaldummyData? SelectedRowType: tableBodyColor?.rowType;
|
||||||
|
const footerColorStyle ={
|
||||||
|
backgroundColor: GlobaldummyData
|
||||||
|
? SelectedTableFooterColor
|
||||||
|
: footerColor?.background,
|
||||||
|
|
||||||
|
color: GlobaldummyData
|
||||||
|
? SelectedTableFooterFontColor
|
||||||
|
: footerColor?.font,
|
||||||
|
}
|
||||||
|
const netAmountStyle ={
|
||||||
|
backgroundColor: GlobaldummyData
|
||||||
|
? SelectedNetAmountColor
|
||||||
|
: netAmtColor?.background,
|
||||||
|
|
||||||
|
color: GlobaldummyData
|
||||||
|
? SelectedNetAmountFontColor
|
||||||
|
: netAmtColor?.font,
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{FormatTheme ? (
|
{FormatTheme ? (
|
||||||
|
|
@ -392,7 +461,7 @@ const Printstyle2 = ({
|
||||||
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
|
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
|
||||||
''
|
''
|
||||||
) : (
|
) : (
|
||||||
<div className="PrintStyle2-fistDiv">
|
<div className="PrintStyle2-fistDiv" style={{...headerStyle }}>
|
||||||
<div style={{ display: 'flex', flexDirection: 'row' }}>
|
<div style={{ display: 'flex', flexDirection: 'row' }}>
|
||||||
{GlobaldummyData ? (
|
{GlobaldummyData ? (
|
||||||
GlobalLogo && (
|
GlobalLogo && (
|
||||||
|
|
@ -425,7 +494,7 @@ const Printstyle2 = ({
|
||||||
style={{
|
style={{
|
||||||
fontSize: '18px',
|
fontSize: '18px',
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
color: SelectedHeaderColor,
|
// color: SelectedHeaderColor,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
|
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
|
||||||
|
|
@ -546,23 +615,23 @@ const Printstyle2 = ({
|
||||||
<tr>
|
<tr>
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalSlNo && (
|
? GlobalSlNo && (
|
||||||
<th style={{ width: '8px' }}>S.No</th>
|
<th style={{...tableHeaderStyle, width: '8px' }}>S.No</th>
|
||||||
)
|
)
|
||||||
: SLNO && <th style={{ width: '8px' }}>S.No</th>}
|
: SLNO && <th style={{...tableHeaderStyle, width: '8px' }}>S.No</th>}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalItem && <th>Item</th>
|
? GlobalItem && <th style={{...tableHeaderStyle}}>Item</th>
|
||||||
: Item && <th>Item</th>}
|
: Item && <th style={{...tableHeaderStyle}}>Item</th>}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalHsnCode && (
|
? GlobalHsnCode && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '8px', textAlign: 'right' }}
|
style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
HSN
|
HSN
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: HsnCode && (
|
: HsnCode && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '8px', textAlign: 'right' }}
|
style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
HSN
|
HSN
|
||||||
</th>
|
</th>
|
||||||
|
|
@ -570,14 +639,14 @@ const Printstyle2 = ({
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalQuantity && (
|
? GlobalQuantity && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '8px', textAlign: 'right' }}
|
style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
Qty
|
Qty
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: Quantity && (
|
: Quantity && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '8px', textAlign: 'right' }}
|
style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
{WeightasKg ? 'Qty/Kg' : 'Qty'}
|
{WeightasKg ? 'Qty/Kg' : 'Qty'}
|
||||||
</th>
|
</th>
|
||||||
|
|
@ -585,14 +654,14 @@ const Printstyle2 = ({
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalMRP && (
|
? GlobalMRP && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '8px', textAlign: 'right' }}
|
style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
MRP
|
MRP
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: MRP && (
|
: MRP && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '8px', textAlign: 'right' }}
|
style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
MRP
|
MRP
|
||||||
</th>
|
</th>
|
||||||
|
|
@ -600,14 +669,14 @@ const Printstyle2 = ({
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalAmount && (
|
? GlobalAmount && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '8px', textAlign: 'right' }}
|
style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
Amt
|
Amt
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: Amount && (
|
: Amount && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '8px', textAlign: 'right' }}
|
style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
Amt
|
Amt
|
||||||
</th>
|
</th>
|
||||||
|
|
@ -615,14 +684,14 @@ const Printstyle2 = ({
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalDiscount && (
|
? GlobalDiscount && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '8px', textAlign: 'right' }}
|
style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
Dis{' '}
|
Dis{' '}
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: Discount && (
|
: Discount && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '8px', textAlign: 'right' }}
|
style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
Dis{' '}
|
Dis{' '}
|
||||||
</th>
|
</th>
|
||||||
|
|
@ -633,6 +702,7 @@ const Printstyle2 = ({
|
||||||
style={{
|
style={{
|
||||||
width: '10px',
|
width: '10px',
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
|
...tableHeaderStyle,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Tax %
|
Tax %
|
||||||
|
|
@ -644,6 +714,7 @@ const Printstyle2 = ({
|
||||||
style={{
|
style={{
|
||||||
width: '10px',
|
width: '10px',
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
|
...tableHeaderStyle,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Tax %
|
Tax %
|
||||||
|
|
@ -652,14 +723,14 @@ const Printstyle2 = ({
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalRate && (
|
? GlobalRate && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '8px', textAlign: 'right' }}
|
style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
Rate
|
Rate
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: Rate && (
|
: Rate && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '8px', textAlign: 'right' }}
|
style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
Rate
|
Rate
|
||||||
</th>
|
</th>
|
||||||
|
|
@ -669,7 +740,18 @@ const Printstyle2 = ({
|
||||||
<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 && (
|
? GlobalSlNo && (
|
||||||
<td className="Re-print-body-Rate">
|
<td className="Re-print-body-Rate">
|
||||||
|
|
@ -918,23 +1000,23 @@ const Printstyle2 = ({
|
||||||
<tr>
|
<tr>
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalSlNo && (
|
? GlobalSlNo && (
|
||||||
<th style={{ width: '8px' }}>S.No</th>
|
<th style={{...tableHeaderStyle, width: '8px' }}>S.No</th>
|
||||||
)
|
)
|
||||||
: SLNO && <th style={{ width: '8px' }}>S.No</th>}
|
: SLNO && <th style={{ ...tableHeaderStyle,width: '8px' }}>S.No</th>}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalItem && <th>Item</th>
|
? GlobalItem && <th style={{...tableHeaderStyle}}>Item</th>
|
||||||
: Item && <th>Item</th>}
|
: Item && <th style={{...tableHeaderStyle}}>Item</th>}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalHsnCode && (
|
? GlobalHsnCode && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '8px', textAlign: 'right' }}
|
style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
HSN
|
HSN
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: HsnCode && (
|
: HsnCode && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '8px', textAlign: 'right' }}
|
style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
HSN
|
HSN
|
||||||
</th>
|
</th>
|
||||||
|
|
@ -942,14 +1024,14 @@ const Printstyle2 = ({
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalQuantity && (
|
? GlobalQuantity && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '8px', textAlign: 'right' }}
|
style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
Qty
|
Qty
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: Quantity && (
|
: Quantity && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '8px', textAlign: 'right' }}
|
style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
{WeightasKg ? 'Qty/Kg' : 'Qty'}
|
{WeightasKg ? 'Qty/Kg' : 'Qty'}
|
||||||
</th>
|
</th>
|
||||||
|
|
@ -957,14 +1039,14 @@ const Printstyle2 = ({
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalMRP && (
|
? GlobalMRP && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '8px', textAlign: 'right' }}
|
style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
MRP
|
MRP
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: MRP && (
|
: MRP && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '8px', textAlign: 'right' }}
|
style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
MRP
|
MRP
|
||||||
</th>
|
</th>
|
||||||
|
|
@ -972,14 +1054,14 @@ const Printstyle2 = ({
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalAmount && (
|
? GlobalAmount && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '8px', textAlign: 'right' }}
|
style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
Amt
|
Amt
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: Amount && (
|
: Amount && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '8px', textAlign: 'right' }}
|
style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
Amt
|
Amt
|
||||||
</th>
|
</th>
|
||||||
|
|
@ -987,14 +1069,14 @@ const Printstyle2 = ({
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalDiscount && (
|
? GlobalDiscount && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '8px', textAlign: 'right' }}
|
style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
Dis{' '}
|
Dis{' '}
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: Discount && (
|
: Discount && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '8px', textAlign: 'right' }}
|
style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
Dis{' '}
|
Dis{' '}
|
||||||
</th>
|
</th>
|
||||||
|
|
@ -1002,9 +1084,7 @@ const Printstyle2 = ({
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalTax && (
|
? GlobalTax && (
|
||||||
<th
|
<th
|
||||||
style={{
|
style={{ width: '10px',textAlign: 'center',...tableHeaderStyle,
|
||||||
width: '10px',
|
|
||||||
textAlign: 'center',
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Tax %
|
Tax %
|
||||||
|
|
@ -1013,10 +1093,7 @@ const Printstyle2 = ({
|
||||||
: Tax == true &&
|
: Tax == true &&
|
||||||
table2Data?.OrderType !== 'E' && (
|
table2Data?.OrderType !== 'E' && (
|
||||||
<th
|
<th
|
||||||
style={{
|
style={{...tableHeaderStyle, width: '10px', textAlign: 'center',}}
|
||||||
width: '10px',
|
|
||||||
textAlign: 'center',
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
Tax %
|
Tax %
|
||||||
</th>
|
</th>
|
||||||
|
|
@ -1024,14 +1101,14 @@ const Printstyle2 = ({
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalRate && (
|
? GlobalRate && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '8px', textAlign: 'right' }}
|
style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
Rate
|
Rate
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: Rate && (
|
: Rate && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '8px', textAlign: 'right' }}
|
style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
Rate
|
Rate
|
||||||
</th>
|
</th>
|
||||||
|
|
@ -1041,7 +1118,18 @@ const Printstyle2 = ({
|
||||||
<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 && (
|
? GlobalSlNo && (
|
||||||
<td className="Re-print-body-Rate">
|
<td className="Re-print-body-Rate">
|
||||||
|
|
@ -1305,7 +1393,7 @@ const Printstyle2 = ({
|
||||||
!shouldFooterBeOnNewPage &&
|
!shouldFooterBeOnNewPage &&
|
||||||
FormatTheme && (
|
FormatTheme && (
|
||||||
<>
|
<>
|
||||||
<div className="PrintStyle2-ThirdDivMaster">
|
<div className="PrintStyle2-ThirdDivMaster" style={{...netAmountStyle}}>
|
||||||
<div className="PrintStyle2-ThirdP">
|
<div className="PrintStyle2-ThirdP">
|
||||||
<div>
|
<div>
|
||||||
<div style={{ textAlign: 'left', fontWeight: '600' }}>
|
<div style={{ textAlign: 'left', fontWeight: '600' }}>
|
||||||
|
|
@ -1973,6 +2061,7 @@ const Printstyle2 = ({
|
||||||
pageBreakBefore: 'avoid',
|
pageBreakBefore: 'avoid',
|
||||||
pageBreakInside: 'avoid',
|
pageBreakInside: 'avoid',
|
||||||
minHeight: 'auto',
|
minHeight: 'auto',
|
||||||
|
...footerColorStyle
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
|
|
@ -2185,10 +2274,11 @@ const Printstyle2 = ({
|
||||||
pageBreakBefore: 'avoid',
|
pageBreakBefore: 'avoid',
|
||||||
pageBreakInside: 'avoid',
|
pageBreakInside: 'avoid',
|
||||||
minHeight: 'auto',
|
minHeight: 'auto',
|
||||||
|
...footerColorStyle
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<>
|
<>
|
||||||
<div className="PrintStyle2-ThirdDivMaster">
|
<div className="PrintStyle2-ThirdDivMaster" style={{...netAmountStyle}}>
|
||||||
<div className="PrintStyle2-ThirdP">
|
<div className="PrintStyle2-ThirdP">
|
||||||
<div>
|
<div>
|
||||||
<div style={{ textAlign: 'left', fontWeight: '600' }}>
|
<div style={{ textAlign: 'left', fontWeight: '600' }}>
|
||||||
|
|
@ -2842,6 +2932,7 @@ const Printstyle2 = ({
|
||||||
pageBreakBefore: 'avoid',
|
pageBreakBefore: 'avoid',
|
||||||
pageBreakInside: 'avoid',
|
pageBreakInside: 'avoid',
|
||||||
minHeight: 'auto',
|
minHeight: 'auto',
|
||||||
|
...footerColorStyle
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
|
|
@ -3039,8 +3130,8 @@ const Printstyle2 = ({
|
||||||
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
|
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
|
||||||
''
|
''
|
||||||
) : (
|
) : (
|
||||||
<div className="PrintStyle2-fistDiv">
|
<div className="PrintStyle2-fistDiv" style={{...headerStyle }}>
|
||||||
<div style={{ display: 'flex', flexDirection: 'row' }}>
|
<div style={{ display: 'flex', flexDirection: 'row'}}>
|
||||||
{GlobaldummyData ? (
|
{GlobaldummyData ? (
|
||||||
GlobalLogo && (
|
GlobalLogo && (
|
||||||
<img
|
<img
|
||||||
|
|
@ -3073,7 +3164,7 @@ const Printstyle2 = ({
|
||||||
style={{
|
style={{
|
||||||
fontSize: '18px',
|
fontSize: '18px',
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
color: SelectedHeaderColor,
|
// color: SelectedHeaderColor,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
|
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
|
||||||
|
|
@ -3183,86 +3274,86 @@ const Printstyle2 = ({
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalSlNo && <th style={{ width: '8px' }}>S.No</th>
|
? GlobalSlNo && <th style={{...tableHeaderStyle,width: '8px' }}>S.No</th>
|
||||||
: SLNO && <th style={{ width: '8px' }}>S.No</th>}
|
: SLNO && <th style={{...tableHeaderStyle, width: '8px' }}>S.No</th>}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalItem && <th>Item</th>
|
? GlobalItem && <th style={{...tableHeaderStyle}}>Item</th>
|
||||||
: Item && <th>Item</th>}
|
: Item && <th style={{...tableHeaderStyle}}>Item</th>}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalHsnCode && (
|
? GlobalHsnCode && (
|
||||||
<th style={{ width: '8px', textAlign: 'right' }}>
|
<th style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}>
|
||||||
HSN
|
HSN
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: HsnCode && (
|
: HsnCode && (
|
||||||
<th style={{ width: '8px', textAlign: 'right' }}>
|
<th style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}>
|
||||||
HSN
|
HSN
|
||||||
</th>
|
</th>
|
||||||
)}
|
)}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalQuantity && (
|
? GlobalQuantity && (
|
||||||
<th style={{ width: '8px', textAlign: 'right' }}>
|
<th style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}>
|
||||||
Qty
|
Qty
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: Quantity && (
|
: Quantity && (
|
||||||
<th style={{ width: '8px', textAlign: 'right' }}>
|
<th style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}>
|
||||||
{WeightasKg ? 'Qty/Kg' : 'Qty'}
|
{WeightasKg ? 'Qty/Kg' : 'Qty'}
|
||||||
</th>
|
</th>
|
||||||
)}
|
)}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalMRP && (
|
? GlobalMRP && (
|
||||||
<th style={{ width: '8px', textAlign: 'right' }}>
|
<th style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}>
|
||||||
MRP
|
MRP
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: MRP && (
|
: MRP && (
|
||||||
<th style={{ width: '8px', textAlign: 'right' }}>
|
<th style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}>
|
||||||
MRP
|
MRP
|
||||||
</th>
|
</th>
|
||||||
)}
|
)}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalAmount && (
|
? GlobalAmount && (
|
||||||
<th style={{ width: '8px', textAlign: 'right' }}>
|
<th style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}>
|
||||||
Amt
|
Amt
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: Amount && (
|
: Amount && (
|
||||||
<th style={{ width: '8px', textAlign: 'right' }}>
|
<th style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}>
|
||||||
Amt
|
Amt
|
||||||
</th>
|
</th>
|
||||||
)}
|
)}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalDiscount && (
|
? GlobalDiscount && (
|
||||||
<th style={{ width: '8px', textAlign: 'right' }}>
|
<th style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}>
|
||||||
Dis{' '}
|
Dis{' '}
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: Discount && (
|
: Discount && (
|
||||||
<th style={{ width: '8px', textAlign: 'right' }}>
|
<th style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}>
|
||||||
Dis{' '}
|
Dis{' '}
|
||||||
</th>
|
</th>
|
||||||
)}
|
)}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalTax && (
|
? GlobalTax && (
|
||||||
<th style={{ width: '10px', textAlign: 'center' }}>
|
<th style={{...tableHeaderStyle, width: '10px', textAlign: 'center' }}>
|
||||||
Tax %
|
Tax %
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: Tax == true &&
|
: Tax == true &&
|
||||||
table2Data?.OrderType !== 'E' && (
|
table2Data?.OrderType !== 'E' && (
|
||||||
<th style={{ width: '10px', textAlign: 'center' }}>
|
<th style={{...tableHeaderStyle, width: '10px', textAlign: 'center' }}>
|
||||||
Tax %
|
Tax %
|
||||||
</th>
|
</th>
|
||||||
)}
|
)}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalRate && (
|
? GlobalRate && (
|
||||||
<th style={{ width: '8px', textAlign: 'right' }}>
|
<th style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}>
|
||||||
Rate
|
Rate
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: Rate && (
|
: Rate && (
|
||||||
<th style={{ width: '8px', textAlign: 'right' }}>
|
<th style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}>
|
||||||
Rate
|
Rate
|
||||||
</th>
|
</th>
|
||||||
)}
|
)}
|
||||||
|
|
@ -3272,7 +3363,18 @@ const Printstyle2 = ({
|
||||||
{(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 && (
|
? GlobalSlNo && (
|
||||||
<td className="Re-print-body-Rate">
|
<td className="Re-print-body-Rate">
|
||||||
|
|
@ -3509,86 +3611,86 @@ const Printstyle2 = ({
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalSlNo && <th style={{ width: '8px' }}>S.No</th>
|
? GlobalSlNo && <th style={{...tableHeaderStyle, width: '8px' }}>S.No</th>
|
||||||
: SLNO && <th style={{ width: '8px' }}>S.No</th>}
|
: SLNO && <th style={{...tableHeaderStyle, width: '8px' }}>S.No</th>}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalItem && <th>Item</th>
|
? GlobalItem && <th style={{...tableHeaderStyle}}>Item</th>
|
||||||
: Item && <th>Item</th>}
|
: Item && <th style={{...tableHeaderStyle}}>Item</th>}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalHsnCode && (
|
? GlobalHsnCode && (
|
||||||
<th style={{ width: '8px', textAlign: 'right' }}>
|
<th style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}>
|
||||||
HSN
|
HSN
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: HsnCode && (
|
: HsnCode && (
|
||||||
<th style={{ width: '8px', textAlign: 'right' }}>
|
<th style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}>
|
||||||
HSN
|
HSN
|
||||||
</th>
|
</th>
|
||||||
)}
|
)}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalQuantity && (
|
? GlobalQuantity && (
|
||||||
<th style={{ width: '8px', textAlign: 'right' }}>
|
<th style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}>
|
||||||
Qty
|
Qty
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: Quantity && (
|
: Quantity && (
|
||||||
<th style={{ width: '8px', textAlign: 'right' }}>
|
<th style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}>
|
||||||
{WeightasKg ? 'Qty/Kg' : 'Qty'}
|
{WeightasKg ? 'Qty/Kg' : 'Qty'}
|
||||||
</th>
|
</th>
|
||||||
)}
|
)}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalMRP && (
|
? GlobalMRP && (
|
||||||
<th style={{ width: '8px', textAlign: 'right' }}>
|
<th style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}>
|
||||||
MRP
|
MRP
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: MRP && (
|
: MRP && (
|
||||||
<th style={{ width: '8px', textAlign: 'right' }}>
|
<th style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}>
|
||||||
MRP
|
MRP
|
||||||
</th>
|
</th>
|
||||||
)}
|
)}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalAmount && (
|
? GlobalAmount && (
|
||||||
<th style={{ width: '8px', textAlign: 'right' }}>
|
<th style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}>
|
||||||
Amt
|
Amt
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: Amount && (
|
: Amount && (
|
||||||
<th style={{ width: '8px', textAlign: 'right' }}>
|
<th style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}>
|
||||||
Amt
|
Amt
|
||||||
</th>
|
</th>
|
||||||
)}
|
)}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalDiscount && (
|
? GlobalDiscount && (
|
||||||
<th style={{ width: '8px', textAlign: 'right' }}>
|
<th style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}>
|
||||||
Dis{' '}
|
Dis{' '}
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: Discount && (
|
: Discount && (
|
||||||
<th style={{ width: '8px', textAlign: 'right' }}>
|
<th style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}>
|
||||||
Dis{' '}
|
Dis{' '}
|
||||||
</th>
|
</th>
|
||||||
)}
|
)}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalTax && (
|
? GlobalTax && (
|
||||||
<th style={{ width: '10px', textAlign: 'center' }}>
|
<th style={{...tableHeaderStyle, width: '10px', textAlign: 'center' }}>
|
||||||
Tax %
|
Tax %
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: Tax == true &&
|
: Tax == true &&
|
||||||
table2Data?.OrderType !== 'E' && (
|
table2Data?.OrderType !== 'E' && (
|
||||||
<th style={{ width: '10px', textAlign: 'center' }}>
|
<th style={{...tableHeaderStyle, width: '10px', textAlign: 'center' }}>
|
||||||
Tax %
|
Tax %
|
||||||
</th>
|
</th>
|
||||||
)}
|
)}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalRate && (
|
? GlobalRate && (
|
||||||
<th style={{ width: '8px', textAlign: 'right' }}>
|
<th style={{ ...tableHeaderStyle,width: '8px', textAlign: 'right' }}>
|
||||||
Rate
|
Rate
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: Rate && (
|
: Rate && (
|
||||||
<th style={{ width: '8px', textAlign: 'right' }}>
|
<th style={{...tableHeaderStyle, width: '8px', textAlign: 'right' }}>
|
||||||
Rate
|
Rate
|
||||||
</th>
|
</th>
|
||||||
)}
|
)}
|
||||||
|
|
@ -3598,7 +3700,18 @@ const Printstyle2 = ({
|
||||||
{(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 && (
|
? GlobalSlNo && (
|
||||||
<td className="Re-print-body-Rate">
|
<td className="Re-print-body-Rate">
|
||||||
|
|
@ -3772,7 +3885,7 @@ const Printstyle2 = ({
|
||||||
<hr className="PrintStyle2-print-dottline" />
|
<hr className="PrintStyle2-print-dottline" />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className="PrintStyle2-ThirdDivMaster">
|
<div className="PrintStyle2-ThirdDivMaster" style={{...netAmountStyle}}>
|
||||||
<div className="PrintStyle2-ThirdP">
|
<div className="PrintStyle2-ThirdP">
|
||||||
<div>
|
<div>
|
||||||
<div style={{ textAlign: 'left', fontWeight: '600' }}>Qty</div>
|
<div style={{ textAlign: 'left', fontWeight: '600' }}>Qty</div>
|
||||||
|
|
@ -4386,6 +4499,7 @@ const Printstyle2 = ({
|
||||||
pageBreakBefore: 'avoid',
|
pageBreakBefore: 'avoid',
|
||||||
pageBreakInside: 'avoid',
|
pageBreakInside: 'avoid',
|
||||||
minHeight: 'auto',
|
minHeight: 'auto',
|
||||||
|
...footerColorStyle
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue