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