Implement dynamic header and table color functionality
This commit is contained in:
parent
b63567aa91
commit
74e7def89b
|
|
@ -31,6 +31,16 @@ import {
|
|||
GlobalprintCredit,
|
||||
GlobalprintTax,
|
||||
GlobalSelectedPrintHeaderColor,
|
||||
GlobalSelectedPrintHeaderFontColor,
|
||||
GlobalSelectedTableHeaderColor,
|
||||
GlobalSelectedTableHeaderFontColor,
|
||||
GlobalSelectedTableBodyColor,
|
||||
GlobalSelectedTableBodyFontColor,
|
||||
GlobalSelectedFooterColor,
|
||||
GlobalSelectedFooterFontColor,
|
||||
GlobalRowType,
|
||||
GlobalSelectedNetAmountColor,
|
||||
GlobalSelectedNetAmountFontColor,
|
||||
} from '../../../../Features/ThemeChange/ThemeChange';
|
||||
import '../../../../Styles/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle1.scss';
|
||||
import QRCode from 'react-qr-code';
|
||||
|
|
@ -67,7 +77,6 @@ const PrintStyle1 = ({
|
|||
const FieldDetails = useSelector(GloabalFieldDetails);
|
||||
const SLNO = FieldDetails?.['Sl.No'];
|
||||
const Item = FieldDetails?.['Item'];
|
||||
console.log(Item, 'PrintStyle1PrintStyle1');
|
||||
const MRP = FieldDetails?.['MRP'];
|
||||
const Discount = FieldDetails?.['Discount'];
|
||||
const Tax = FieldDetails?.['Tax'];
|
||||
|
|
@ -80,6 +89,12 @@ const PrintStyle1 = ({
|
|||
const LogoField = FieldDetails?.['Logo'];
|
||||
const CreditDetails = FieldDetails?.['Credit details'];
|
||||
const WeightasKg = FieldDetails?.['Weight'];
|
||||
const HeaderColor = FieldDetails?.['Header Colour'];
|
||||
const NetAmountColor = FieldDetails?.['Net Amount'];
|
||||
const TableHeaderColour = FieldDetails?.['Table Header Colour'];
|
||||
const TableBodyColour = FieldDetails?.['Table Body Colour'];
|
||||
const FooterColor = FieldDetails?.['Footer Colour'];
|
||||
console.log(FieldDetails, 'FieldDetailsFieldDetails', printDatas);
|
||||
const GlobalSlNo = useSelector(GlobalprintSlNo);
|
||||
const GlobalItem = useSelector(GlobalprintItem);
|
||||
const GlobalMRP = useSelector(GlobalprintMRP);
|
||||
|
|
@ -96,7 +111,16 @@ const PrintStyle1 = ({
|
|||
const GlobalLogo = useSelector(GlobalprintLogo);
|
||||
const GlobalCredit = useSelector(GlobalprintCredit);
|
||||
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);
|
||||
const GlobaltermsAndConditions = useSelector(GlobalprinttermsAndConditions);
|
||||
const GlobalSignatureImages = useSelector(GlobalSignatureImage);
|
||||
const GlobalIsnotes = useSelector(Globalnotes);
|
||||
|
|
@ -128,10 +152,10 @@ const PrintStyle1 = ({
|
|||
(setting) =>
|
||||
setting?.SettingIdName?.toLowerCase() === 'estimatetitle'
|
||||
)?.SettingValue === 'Y';
|
||||
const UomPrint = SettingData?.[0]?.SettingDtlDetails?.filter(
|
||||
(i) => i.SettingIdName === 'PrintUom'
|
||||
)?.[0];
|
||||
|
||||
const UomPrint = SettingData?.[0]?.SettingDtlDetails?.filter(
|
||||
(i) => i.SettingIdName === 'PrintUom'
|
||||
)?.[0];
|
||||
|
||||
|
||||
const keysLength = Object.keys(table2Data ?? {}).length;
|
||||
const paymentTypeUPI = PaymentStatus?.find(
|
||||
|
|
@ -145,6 +169,12 @@ const PrintStyle1 = ({
|
|||
let BillName = printDatas?.PrintHdrName;
|
||||
let FormatTheme = printDatas?.PrintType == 'S' ? true : false;
|
||||
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 TermsnAdCondition = FieldDetails?.['terms&conditions'];
|
||||
const isEditedBill = PaymentStatus?.some(payment => {
|
||||
|
|
@ -372,10 +402,42 @@ const PrintStyle1 = ({
|
|||
: 0;
|
||||
const shouldFooterBeOnNewPage =
|
||||
lastChunkRows > (isMobile ? 11 : PageSize == 'A5' ? 5 : 10);
|
||||
console.log(
|
||||
PageSize == 'A5' ? '210mm' : '297mm',
|
||||
'aggregatedPaymentsaggregatedPayments'
|
||||
);
|
||||
const headerStyle = {
|
||||
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 ? (
|
||||
|
|
@ -432,7 +494,15 @@ const PrintStyle1 = ({
|
|||
width: '100%',
|
||||
}}
|
||||
>
|
||||
<div style={{ display: 'flex', justifyContent: 'center' }}>
|
||||
<div style={{ display: 'flex', justifyContent: 'center', ...(GlobaldummyData
|
||||
? {
|
||||
color: SelectedHeaderFontColor,
|
||||
backgroundColor: SelectedHeaderColor,
|
||||
}
|
||||
: {
|
||||
color: headerColor?.font,
|
||||
backgroundColor: headerColor?.background,
|
||||
}), }}>
|
||||
{GlobaldummyData ? (
|
||||
GlobalLogo && (
|
||||
<img
|
||||
|
|
@ -456,14 +526,14 @@ const PrintStyle1 = ({
|
|||
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
|
||||
''
|
||||
) : (
|
||||
<div className="PrintStyle1-print">
|
||||
<div
|
||||
<div className="PrintStyle1-print"
|
||||
style={{
|
||||
fontSize: 'clamp(2rem, 2.5vw, 2rem)',
|
||||
fontWeight: '600',
|
||||
color: SelectedHeaderColor,
|
||||
}}
|
||||
>
|
||||
color: GlobaldummyData ? SelectedHeaderFontColor : headerColor?.font,
|
||||
backgroundColor: GlobaldummyData ? SelectedHeaderColor : headerColor?.background,
|
||||
}}>
|
||||
<div>
|
||||
{' '}
|
||||
{GlobaldummyData ? 'XYZ Shop' : table2Data?.BrName}
|
||||
</div>
|
||||
|
|
@ -664,58 +734,58 @@ const PrintStyle1 = ({
|
|||
<tr>
|
||||
{GlobaldummyData
|
||||
? GlobalSlNo && (
|
||||
<th style={{ width: '10px' }}>S.No</th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>S.No</th>
|
||||
)
|
||||
: SLNO == true && (
|
||||
<th style={{ width: '10px' }}>S.No</th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>S.No</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalItem && <th>Item</th>
|
||||
: Item == true && <th>Item</th>}
|
||||
? GlobalItem && <th style={{ ...headerStyle }}>Item</th>
|
||||
: Item == true && <th style={{ ...headerStyle }}>Item</th>}
|
||||
{GlobaldummyData
|
||||
? GlobalHsnCode && (
|
||||
<th style={{ width: '10px' }}>HSN</th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>HSN</th>
|
||||
)
|
||||
: HsnCode == true && (
|
||||
<th style={{ width: '10px' }}>HSN</th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>HSN</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalQuantity && (
|
||||
<th style={{ width: '10px' }}>Qty</th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>Qty</th>
|
||||
)
|
||||
: Quantity == true && (
|
||||
<th style={{ width: '10px' }}>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>
|
||||
{WeightasKg ? 'Qty/Kg' : 'Qty'}
|
||||
</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalMRP && (
|
||||
<th style={{ width: '10px' }}>MRP</th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>MRP</th>
|
||||
)
|
||||
: MRP == true && (
|
||||
<th style={{ width: '10px' }}>MRP</th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>MRP</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalRate && (
|
||||
<th style={{ width: '10px' }}>Rate</th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>Rate</th>
|
||||
)
|
||||
: Rate == true && (
|
||||
<th style={{ width: '10px' }}>Rate</th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>Rate</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalDiscount && (
|
||||
<th style={{ width: '10px' }}>Dis </th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>Dis </th>
|
||||
)
|
||||
: Discount == true && (
|
||||
<th style={{ width: '10px' }}>Dis </th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>Dis </th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalTax && (
|
||||
<th style={{ width: '10px' }}>Tax %</th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>Tax %</th>
|
||||
)
|
||||
: Tax == true &&
|
||||
table2Data?.OrderType !== 'E' && (
|
||||
<th style={{ width: '10px' }}>Tax %</th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>Tax %</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalAmount && (
|
||||
|
|
@ -723,6 +793,7 @@ const PrintStyle1 = ({
|
|||
style={{
|
||||
width: '10px',
|
||||
textAlign: 'right',
|
||||
...headerStyle,
|
||||
}}
|
||||
>
|
||||
Amt
|
||||
|
|
@ -733,6 +804,7 @@ const PrintStyle1 = ({
|
|||
style={{
|
||||
width: '10px',
|
||||
textAlign: 'right',
|
||||
...headerStyle,
|
||||
}}
|
||||
>
|
||||
Amt
|
||||
|
|
@ -742,7 +814,18 @@ const PrintStyle1 = ({
|
|||
</thead>
|
||||
<tbody>
|
||||
{dataChunk?.map((item, index) => (
|
||||
<tr key={index}>
|
||||
<tr key={index}
|
||||
style={
|
||||
index % 2 !== 1 && rowtypeStyle === "even"
|
||||
? {
|
||||
...tableBodyStyle
|
||||
}
|
||||
: index % 2 === 1 && rowtypeStyle === "odd"
|
||||
? {
|
||||
...tableBodyStyle
|
||||
}
|
||||
: {}
|
||||
}>
|
||||
{GlobaldummyData
|
||||
? GlobalSlNo && (
|
||||
<td style={{ textAlign: 'center' }}>
|
||||
|
|
@ -758,7 +841,7 @@ const PrintStyle1 = ({
|
|||
? GlobalItem && <td>{item?.ProdName}</td>
|
||||
: Item == true && (
|
||||
<td
|
||||
|
||||
|
||||
>
|
||||
<div>{item?.ProdName}</div>
|
||||
{PackageDetails?.filter(
|
||||
|
|
@ -798,7 +881,7 @@ const PrintStyle1 = ({
|
|||
{' '}
|
||||
{item?.BrandName !== null
|
||||
? <div>{item?.BrandName}</div>
|
||||
: ''}
|
||||
: ''}
|
||||
|
||||
<div style={{ display: "flex", gap: "2px", flexDirection: "column" }}>
|
||||
{item?.ProductIdentifierDtls?.length > 0
|
||||
|
|
@ -953,58 +1036,58 @@ const PrintStyle1 = ({
|
|||
<tr>
|
||||
{GlobaldummyData
|
||||
? GlobalSlNo && (
|
||||
<th style={{ width: '10px' }}>S.No</th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>S.No</th>
|
||||
)
|
||||
: SLNO == true && (
|
||||
<th style={{ width: '10px' }}>S.No</th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>S.No</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalItem && <th>Item</th>
|
||||
: Item == true && <th>Item</th>}
|
||||
? GlobalItem && <th style={{ ...headerStyle, }}>Item</th>
|
||||
: Item == true && <th style={{ ...headerStyle, }}>Item</th>}
|
||||
{GlobaldummyData
|
||||
? GlobalHsnCode && (
|
||||
<th style={{ width: '10px' }}>HSN</th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>HSN</th>
|
||||
)
|
||||
: HsnCode == true && (
|
||||
<th style={{ width: '10px' }}>HSN</th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>HSN</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalQuantity && (
|
||||
<th style={{ width: '10px' }}>Qty</th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>Qty</th>
|
||||
)
|
||||
: Quantity == true && (
|
||||
<th style={{ width: '10px' }}>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>
|
||||
{WeightasKg ? 'Qty/Kg' : 'Qty'}
|
||||
</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalMRP && (
|
||||
<th style={{ width: '10px' }}>MRP</th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>MRP</th>
|
||||
)
|
||||
: MRP == true && (
|
||||
<th style={{ width: '10px' }}>MRP</th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>MRP</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalRate && (
|
||||
<th style={{ width: '10px' }}>Rate</th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>Rate</th>
|
||||
)
|
||||
: Rate == true && (
|
||||
<th style={{ width: '10px' }}>Rate</th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>Rate</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalDiscount && (
|
||||
<th style={{ width: '10px' }}>Dis </th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>Dis </th>
|
||||
)
|
||||
: Discount == true && (
|
||||
<th style={{ width: '10px' }}>Dis </th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>Dis </th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalTax && (
|
||||
<th style={{ width: '10px' }}>Tax %</th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>Tax %</th>
|
||||
)
|
||||
: Tax == true &&
|
||||
table2Data?.OrderType !== 'E' && (
|
||||
<th style={{ width: '10px' }}>Tax %</th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>Tax %</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalAmount && (
|
||||
|
|
@ -1012,6 +1095,7 @@ const PrintStyle1 = ({
|
|||
style={{
|
||||
width: '10px',
|
||||
textAlign: 'right',
|
||||
...headerStyle,
|
||||
}}
|
||||
>
|
||||
Amt
|
||||
|
|
@ -1022,6 +1106,7 @@ const PrintStyle1 = ({
|
|||
style={{
|
||||
width: '10px',
|
||||
textAlign: 'right',
|
||||
...headerStyle,
|
||||
}}
|
||||
>
|
||||
Amt
|
||||
|
|
@ -1031,7 +1116,18 @@ const PrintStyle1 = ({
|
|||
</thead>
|
||||
<tbody>
|
||||
{dataChunk?.map((item, index) => (
|
||||
<tr key={index}>
|
||||
<tr key={index}
|
||||
style={
|
||||
index % 2 !== 1 && rowtypeStyle === "even"
|
||||
? {
|
||||
...tableBodyStyle
|
||||
}
|
||||
: index % 2 === 1 && rowtypeStyle === "odd"
|
||||
? {
|
||||
...tableBodyStyle
|
||||
}
|
||||
: {}
|
||||
}>
|
||||
{GlobaldummyData
|
||||
? GlobalSlNo && (
|
||||
<td style={{ textAlign: 'center' }}>
|
||||
|
|
@ -1047,20 +1143,20 @@ const PrintStyle1 = ({
|
|||
? GlobalItem && <td>{item?.ProdName}</td>
|
||||
: Item == true && (
|
||||
<td
|
||||
|
||||
|
||||
>
|
||||
<div>{item?.ProdName}</div>
|
||||
{UomPrint?.SettingValue === 'Y' &&
|
||||
<div>
|
||||
({item?.Size ? item?.Size : '1'}{' '}
|
||||
{item?.SinglePc == 'Y'
|
||||
? 'PCS'
|
||||
: item?.Type != 'C'
|
||||
? item?.UomName
|
||||
: 'COMBO'}
|
||||
)
|
||||
</div>
|
||||
}
|
||||
<div>
|
||||
({item?.Size ? item?.Size : '1'}{' '}
|
||||
{item?.SinglePc == 'Y'
|
||||
? 'PCS'
|
||||
: item?.Type != 'C'
|
||||
? item?.UomName
|
||||
: 'COMBO'}
|
||||
)
|
||||
</div>
|
||||
}
|
||||
{sportsAppPreference &&
|
||||
`${item?.BookingDate?.trim()
|
||||
? `(${dateFormatChange(item.BookingDate)})`
|
||||
|
|
@ -1225,6 +1321,7 @@ const PrintStyle1 = ({
|
|||
padding: 0,
|
||||
fontSize: '10px',
|
||||
fontWeight: '600',
|
||||
...netAmountStyle
|
||||
}}
|
||||
>
|
||||
Amount :₹
|
||||
|
|
@ -1815,6 +1912,7 @@ const PrintStyle1 = ({
|
|||
pageBreakBefore: 'avoid',
|
||||
pageBreakInside: 'avoid',
|
||||
minHeight: 'auto',
|
||||
...footerColorStyle
|
||||
}}
|
||||
>
|
||||
{GlobaldummyData
|
||||
|
|
@ -2091,6 +2189,7 @@ const PrintStyle1 = ({
|
|||
padding: 0,
|
||||
fontSize: '10px',
|
||||
fontWeight: '600',
|
||||
...netAmountStyle
|
||||
}}
|
||||
>
|
||||
Amount :₹
|
||||
|
|
@ -2667,6 +2766,7 @@ const PrintStyle1 = ({
|
|||
pageBreakBefore: 'avoid',
|
||||
pageBreakInside: 'avoid',
|
||||
minHeight: 'auto',
|
||||
...footerColorStyle
|
||||
}}
|
||||
>
|
||||
{GlobaldummyData
|
||||
|
|
@ -2922,6 +3022,7 @@ const PrintStyle1 = ({
|
|||
padding: 0,
|
||||
fontSize: '10px',
|
||||
fontWeight: '600',
|
||||
...netAmountStyle
|
||||
}}
|
||||
>
|
||||
Amount :₹
|
||||
|
|
@ -3491,6 +3592,7 @@ const PrintStyle1 = ({
|
|||
pageBreakBefore: 'avoid',
|
||||
pageBreakInside: 'avoid',
|
||||
minHeight: 'auto',
|
||||
...footerColorStyle
|
||||
}}
|
||||
>
|
||||
{GlobaldummyData
|
||||
|
|
@ -3696,7 +3798,21 @@ const PrintStyle1 = ({
|
|||
id={`PrintStyle1-${index}`}
|
||||
style={{ fontFamily: "'Courier New', Courier, monospace" }}
|
||||
>
|
||||
<div style={{ display: 'flex', justifyContent: 'center' }}>
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
justifyContent: "center",
|
||||
...(GlobaldummyData
|
||||
? {
|
||||
color: SelectedHeaderFontColor,
|
||||
backgroundColor: SelectedHeaderColor,
|
||||
}
|
||||
: {
|
||||
color: headerColor?.font,
|
||||
backgroundColor: headerColor?.background,
|
||||
}),
|
||||
}}
|
||||
>
|
||||
{GlobaldummyData ? (
|
||||
GlobalLogo && (
|
||||
<img
|
||||
|
|
@ -3720,12 +3836,17 @@ const PrintStyle1 = ({
|
|||
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
|
||||
''
|
||||
) : (
|
||||
<div className="PrintStyle1-print">
|
||||
<div className="PrintStyle1-print"
|
||||
style={
|
||||
GlobaldummyData
|
||||
? { color: SelectedHeaderFontColor, backgroundColor: SelectedHeaderColor }
|
||||
: { color: headerColor?.font, backgroundColor: headerColor?.background }
|
||||
}>
|
||||
<div
|
||||
style={{
|
||||
fontSize: 'clamp(2rem, 2.5vw, 2rem)',
|
||||
fontWeight: '600',
|
||||
color: SelectedHeaderColor,
|
||||
// color: SelectedHeaderColor,
|
||||
}}
|
||||
>
|
||||
{' '}
|
||||
|
|
@ -3900,60 +4021,60 @@ const PrintStyle1 = ({
|
|||
<thead>
|
||||
<tr>
|
||||
{GlobaldummyData
|
||||
? GlobalSlNo && <th style={{ width: '10px' }}>S.No</th>
|
||||
? GlobalSlNo && <th style={{ ...headerStyle, width: '10px' }}>S.No</th>
|
||||
: SLNO == true && (
|
||||
<th style={{ width: '10px' }}>S.No</th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>S.No</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalItem && (
|
||||
<th style={{ textAlign: 'left' }}>Item</th>
|
||||
<th style={{ ...headerStyle, textAlign: 'left' }}>Item</th>
|
||||
)
|
||||
: Item == true && <th>Item</th>}
|
||||
: Item == true && <th style={{ ...headerStyle }}>Item</th>}
|
||||
{GlobaldummyData
|
||||
? GlobalHsnCode && (
|
||||
<th style={{ width: '10px' }}>HSN</th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>HSN</th>
|
||||
)
|
||||
: HsnCode == true && (
|
||||
<th style={{ width: '10px' }}>HSN</th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>HSN</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalQuantity && (
|
||||
<th style={{ width: '10px' }}>Qty</th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>Qty</th>
|
||||
)
|
||||
: Quantity == true && (
|
||||
<th style={{ width: '10px' }}>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>
|
||||
{WeightasKg ? 'Qty/Kg' : 'Qty'}
|
||||
</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalMRP && <th style={{ width: '10px' }}>MRP</th>
|
||||
: MRP == true && <th style={{ width: '10px' }}>MRP</th>}
|
||||
? GlobalMRP && <th style={{ ...headerStyle, width: '10px' }}>MRP</th>
|
||||
: MRP == true && <th style={{ ...headerStyle, width: '10px' }}>MRP</th>}
|
||||
{GlobaldummyData
|
||||
? GlobalRate && <th style={{ width: '10px' }}>Rate</th>
|
||||
? GlobalRate && <th style={{ ...headerStyle, width: '10px' }}>Rate</th>
|
||||
: Rate == true && (
|
||||
<th style={{ width: '10px' }}>Rate</th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>Rate</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalDiscount && (
|
||||
<th style={{ width: '10px' }}>Dis </th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>Dis </th>
|
||||
)
|
||||
: Discount == true && (
|
||||
<th style={{ width: '10px' }}>Dis </th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>Dis </th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalTax && <th style={{ width: '10px' }}>Tax %</th>
|
||||
? GlobalTax && <th style={{ ...headerStyle, width: '10px' }}>Tax %</th>
|
||||
: Tax == true &&
|
||||
table2Data?.OrderType !== 'E' && (
|
||||
<th style={{ width: '10px' }}>Tax %</th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>Tax %</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalAmount && (
|
||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
||||
<th style={{ ...headerStyle, width: '10px', textAlign: 'right' }}>
|
||||
Amt
|
||||
</th>
|
||||
)
|
||||
: Amount == true && (
|
||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
||||
<th style={{ ...headerStyle, width: '10px', textAlign: 'right' }}>
|
||||
Amt
|
||||
</th>
|
||||
)}
|
||||
|
|
@ -3962,7 +4083,18 @@ const PrintStyle1 = ({
|
|||
<tbody>
|
||||
{(GlobaldummyData ? products : TakeawayData)?.map(
|
||||
(item, index) => (
|
||||
<tr key={index}>
|
||||
<tr key={index}
|
||||
style={
|
||||
index % 2 !== 1 && rowtypeStyle === "even"
|
||||
? {
|
||||
...tableBodyStyle
|
||||
}
|
||||
: index % 2 === 1 && rowtypeStyle === "odd"
|
||||
? {
|
||||
...tableBodyStyle
|
||||
}
|
||||
: {}
|
||||
}>
|
||||
{GlobaldummyData
|
||||
? GlobalSlNo && (
|
||||
<td style={{ textAlign: 'center' }}>
|
||||
|
|
@ -3978,7 +4110,7 @@ const PrintStyle1 = ({
|
|||
? GlobalItem && <td>{item?.ProdName}</td>
|
||||
: Item == true && (
|
||||
<td
|
||||
|
||||
|
||||
>
|
||||
<div>{item?.ProdName}</div>
|
||||
{PackageDetails?.filter(
|
||||
|
|
@ -3999,7 +4131,7 @@ const PrintStyle1 = ({
|
|||
))}
|
||||
</div>
|
||||
) : (
|
||||
UomPrint?.SettingValue === 'Y' &&
|
||||
UomPrint?.SettingValue === 'Y' &&
|
||||
<div>
|
||||
({item?.Size ? item?.Size : '1'}{' '}
|
||||
{item?.SinglePc == 'Y'
|
||||
|
|
@ -4019,7 +4151,7 @@ const PrintStyle1 = ({
|
|||
{item?.BrandName !== null
|
||||
? item?.BrandName
|
||||
: ''}
|
||||
|
||||
|
||||
<div style={{ display: 'flex', gap: "3px", flexDirection: "column" }}>
|
||||
{item?.ProductIdentifierDtls?.length > 0
|
||||
? item?.ProductIdentifierDtls.filter(
|
||||
|
|
@ -4167,58 +4299,58 @@ const PrintStyle1 = ({
|
|||
<thead>
|
||||
<tr>
|
||||
{GlobaldummyData
|
||||
? GlobalSlNo && <th style={{ width: '10px' }}>S.No</th>
|
||||
? GlobalSlNo && <th style={{ ...headerStyle, width: '10px' }}>S.No</th>
|
||||
: SLNO == true && (
|
||||
<th style={{ width: '10px' }}>S.No</th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>S.No</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalItem && <th>Item</th>
|
||||
: Item == true && <th>Item</th>}
|
||||
? GlobalItem && <th style={{ ...headerStyle, }}>Item</th>
|
||||
: Item == true && <th style={{ ...headerStyle, }}>Item</th>}
|
||||
{GlobaldummyData
|
||||
? GlobalHsnCode && (
|
||||
<th style={{ width: '10px' }}>HSN</th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>HSN</th>
|
||||
)
|
||||
: HsnCode == true && (
|
||||
<th style={{ width: '10px' }}>HSN</th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>HSN</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalQuantity && (
|
||||
<th style={{ width: '10px' }}>Qty</th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>Qty</th>
|
||||
)
|
||||
: Quantity == true && (
|
||||
<th style={{ width: '10px' }}>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>
|
||||
{WeightasKg ? 'Qty/Kg' : 'Qty'}
|
||||
</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalMRP && <th style={{ width: '10px' }}>MRP</th>
|
||||
: MRP == true && <th style={{ width: '10px' }}>MRP</th>}
|
||||
? GlobalMRP && <th style={{ ...headerStyle, width: '10px' }}>MRP</th>
|
||||
: MRP == true && <th style={{ ...headerStyle, width: '10px' }}>MRP</th>}
|
||||
{GlobaldummyData
|
||||
? GlobalRate && <th style={{ width: '10px' }}>Rate</th>
|
||||
? GlobalRate && <th style={{ ...headerStyle, width: '10px' }}>Rate</th>
|
||||
: Rate == true && (
|
||||
<th style={{ width: '10px' }}>Rate</th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>Rate</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalDiscount && (
|
||||
<th style={{ width: '10px' }}>Dis </th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>Dis </th>
|
||||
)
|
||||
: Discount == true && (
|
||||
<th style={{ width: '10px' }}>Dis </th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>Dis </th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalTax && <th style={{ width: '10px' }}>Tax %</th>
|
||||
? GlobalTax && <th style={{ ...headerStyle, width: '10px' }}>Tax %</th>
|
||||
: Tax == true &&
|
||||
table2Data?.OrderType !== 'E' && (
|
||||
<th style={{ width: '10px' }}>Tax %</th>
|
||||
<th style={{ ...headerStyle, width: '10px' }}>Tax %</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalAmount && (
|
||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
||||
<th style={{ ...headerStyle, width: '10px', textAlign: 'right' }}>
|
||||
Amt
|
||||
</th>
|
||||
)
|
||||
: Amount == true && (
|
||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
||||
<th style={{ ...headerStyle, width: '10px', textAlign: 'right' }}>
|
||||
Amt
|
||||
</th>
|
||||
)}
|
||||
|
|
@ -4227,7 +4359,18 @@ const PrintStyle1 = ({
|
|||
<tbody>
|
||||
{(GlobaldummyData ? products : DineInData)?.map(
|
||||
(item, index) => (
|
||||
<tr key={index}>
|
||||
<tr key={index}
|
||||
style={
|
||||
index % 2 !== 1 && rowtypeStyle === "even"
|
||||
? {
|
||||
...tableBodyStyle
|
||||
}
|
||||
: index % 2 === 1 && rowtypeStyle === "odd"
|
||||
? {
|
||||
...tableBodyStyle
|
||||
}
|
||||
: {}
|
||||
}>
|
||||
{GlobaldummyData
|
||||
? GlobalSlNo && (
|
||||
<td style={{ textAlign: 'center' }}>
|
||||
|
|
@ -4243,20 +4386,20 @@ const PrintStyle1 = ({
|
|||
? GlobalItem && <td>{item?.ProdName}</td>
|
||||
: Item == true && (
|
||||
<td
|
||||
|
||||
|
||||
>
|
||||
<div>{item?.ProdName}</div>
|
||||
{UomPrint?.SettingValue === 'Y' &&
|
||||
<div>
|
||||
({item?.Size ? item?.Size : '1'}{' '}
|
||||
{item?.SinglePc == 'Y'
|
||||
? 'PCS'
|
||||
: item?.Type != 'C'
|
||||
? item?.UomName
|
||||
: 'COMBO'}
|
||||
)
|
||||
</div>
|
||||
}
|
||||
<div>
|
||||
({item?.Size ? item?.Size : '1'}{' '}
|
||||
{item?.SinglePc == 'Y'
|
||||
? 'PCS'
|
||||
: item?.Type != 'C'
|
||||
? item?.UomName
|
||||
: 'COMBO'}
|
||||
)
|
||||
</div>
|
||||
}
|
||||
{sportsAppPreference &&
|
||||
`${item?.BookingDate?.trim()
|
||||
? `(${dateFormatChange(item.BookingDate)})`
|
||||
|
|
@ -4414,6 +4557,7 @@ const PrintStyle1 = ({
|
|||
padding: 0,
|
||||
fontSize: '10px',
|
||||
fontWeight: '600',
|
||||
...netAmountStyle
|
||||
}}
|
||||
>
|
||||
Amount :₹
|
||||
|
|
@ -4954,7 +5098,6 @@ const PrintStyle1 = ({
|
|||
)}
|
||||
|
||||
<hr className="PrintStyle1-print-dottline" />
|
||||
|
||||
<div
|
||||
className="page-footerA4Style11"
|
||||
style={{
|
||||
|
|
@ -4962,6 +5105,7 @@ const PrintStyle1 = ({
|
|||
pageBreakBefore: 'avoid',
|
||||
pageBreakInside: 'avoid',
|
||||
minHeight: 'auto',
|
||||
...footerColorStyle
|
||||
}}
|
||||
>
|
||||
{GlobaldummyData
|
||||
|
|
|
|||
Loading…
Reference in New Issue