Implement dynamic header and table color functionality
This commit is contained in:
parent
5470f019f3
commit
47745687ee
|
|
@ -28,6 +28,16 @@ import {
|
||||||
GlobalprintCredit,
|
GlobalprintCredit,
|
||||||
GlobalprintTax,
|
GlobalprintTax,
|
||||||
GlobalSelectedPrintHeaderColor,
|
GlobalSelectedPrintHeaderColor,
|
||||||
|
GlobalSelectedPrintHeaderFontColor,
|
||||||
|
GlobalSelectedTableHeaderColor,
|
||||||
|
GlobalSelectedTableHeaderFontColor,
|
||||||
|
GlobalSelectedTableBodyFontColor,
|
||||||
|
GlobalSelectedTableBodyColor,
|
||||||
|
GlobalRowType,
|
||||||
|
GlobalSelectedFooterColor,
|
||||||
|
GlobalSelectedFooterFontColor,
|
||||||
|
GlobalSelectedNetAmountColor,
|
||||||
|
GlobalSelectedNetAmountFontColor,
|
||||||
} from '../../../../Features/ThemeChange/ThemeChange';
|
} from '../../../../Features/ThemeChange/ThemeChange';
|
||||||
import {
|
import {
|
||||||
GlobalUpiIDprint,
|
GlobalUpiIDprint,
|
||||||
|
|
@ -131,6 +141,22 @@ const PrintStyle10 = ({
|
||||||
(ps) => ps.PaymentTypeName === 'UPI'
|
(ps) => ps.PaymentTypeName === 'UPI'
|
||||||
);
|
);
|
||||||
const SelectedHeaderColor = useSelector(GlobalSelectedPrintHeaderColor);
|
const SelectedHeaderColor = useSelector(GlobalSelectedPrintHeaderColor);
|
||||||
|
const SelectedHeaderFontColor = useSelector(GlobalSelectedPrintHeaderFontColor);
|
||||||
|
const SelectedTableHeaderColor = useSelector(GlobalSelectedTableHeaderColor);
|
||||||
|
const SelectedTableHeaderFontColor = useSelector(GlobalSelectedTableHeaderFontColor);
|
||||||
|
const SelectedTableBodyColor = useSelector(GlobalSelectedTableBodyColor);
|
||||||
|
const SelectedTableBodyFontColor = useSelector(GlobalSelectedTableBodyFontColor);
|
||||||
|
const SelectedRowType = useSelector(GlobalRowType);
|
||||||
|
const SelectedTableFooterColor = useSelector(GlobalSelectedFooterColor);
|
||||||
|
const SelectedTableFooterFontColor = useSelector(GlobalSelectedFooterFontColor);
|
||||||
|
const SelectedNetAmountColor = useSelector(GlobalSelectedNetAmountColor);
|
||||||
|
const SelectedNetAmountFontColor = useSelector(GlobalSelectedNetAmountFontColor);
|
||||||
|
let printColors = printDatas?.PrintColors;
|
||||||
|
const headerColor = printColors?.find(obj => obj.headerColor)?.headerColor;
|
||||||
|
const tableHeaderColor = printColors?.find(obj => obj.tableHeaderColor)?.tableHeaderColor;
|
||||||
|
const tableBodyColor = printColors?.find(obj => obj.tableBodyColor)?.tableBodyColor;
|
||||||
|
const footerColor = printColors?.find(obj => obj.footerColor)?.footerColor;
|
||||||
|
const netAmtColor = printColors?.find(obj => obj.netAmtColor)?.netAmtColor;
|
||||||
|
|
||||||
const isEditedBill = PaymentStatus?.some((payment) => {
|
const isEditedBill = PaymentStatus?.some((payment) => {
|
||||||
const type = payment?.AdjustmentType?.toLowerCase();
|
const type = payment?.AdjustmentType?.toLowerCase();
|
||||||
|
|
@ -349,7 +375,51 @@ const PrintStyle10 = ({
|
||||||
? paginatedChunks[paginatedChunks.length - 1].length
|
? paginatedChunks[paginatedChunks.length - 1].length
|
||||||
: 0;
|
: 0;
|
||||||
const shouldFooterBeOnNewPage = lastChunkRows > (PageSize == 'A5' ? 5 : 10);
|
const shouldFooterBeOnNewPage = lastChunkRows > (PageSize == 'A5' ? 5 : 10);
|
||||||
|
const headerStyle = {
|
||||||
|
backgroundColor: GlobaldummyData
|
||||||
|
? SelectedHeaderColor
|
||||||
|
: headerColor?.background,
|
||||||
|
|
||||||
|
color: GlobaldummyData
|
||||||
|
? SelectedHeaderFontColor
|
||||||
|
: headerColor?.font,
|
||||||
|
}
|
||||||
|
const tableHeaderStyle = {
|
||||||
|
backgroundColor: GlobaldummyData
|
||||||
|
? SelectedTableHeaderColor
|
||||||
|
: tableHeaderColor?.background,
|
||||||
|
|
||||||
|
color: GlobaldummyData
|
||||||
|
? SelectedTableHeaderFontColor
|
||||||
|
: tableHeaderColor?.font,
|
||||||
|
}
|
||||||
|
const tableBodyStyle = {
|
||||||
|
backgroundColor: GlobaldummyData
|
||||||
|
? SelectedTableBodyColor
|
||||||
|
: tableBodyColor?.background,
|
||||||
|
color: GlobaldummyData
|
||||||
|
? SelectedTableBodyFontColor
|
||||||
|
: tableBodyColor?.font,
|
||||||
|
}
|
||||||
|
const rowtypeStyle = GlobaldummyData ? SelectedRowType : tableBodyColor?.rowType;
|
||||||
|
const footerColorStyle = {
|
||||||
|
backgroundColor: GlobaldummyData
|
||||||
|
? SelectedTableFooterColor
|
||||||
|
: footerColor?.background,
|
||||||
|
|
||||||
|
color: GlobaldummyData
|
||||||
|
? SelectedTableFooterFontColor
|
||||||
|
: footerColor?.font,
|
||||||
|
}
|
||||||
|
const netAmountStyle = {
|
||||||
|
backgroundColor: GlobaldummyData
|
||||||
|
? SelectedNetAmountColor
|
||||||
|
: netAmtColor?.background,
|
||||||
|
|
||||||
|
color: GlobaldummyData
|
||||||
|
? SelectedNetAmountFontColor
|
||||||
|
: netAmtColor?.font,
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{FormatTheme ? (
|
{FormatTheme ? (
|
||||||
|
|
@ -407,7 +477,7 @@ const PrintStyle10 = ({
|
||||||
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
|
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
|
||||||
''
|
''
|
||||||
) : (
|
) : (
|
||||||
<div className="PrintStyle10-print">
|
<div className="PrintStyle10-print" style={{ ...headerStyle }}>
|
||||||
<div style={{ display: 'flex' }}>
|
<div style={{ display: 'flex' }}>
|
||||||
<div>
|
<div>
|
||||||
{GlobalLogo && GlobaldummyData ? (
|
{GlobalLogo && GlobaldummyData ? (
|
||||||
|
|
@ -433,7 +503,6 @@ const PrintStyle10 = ({
|
||||||
className="ShopName"
|
className="ShopName"
|
||||||
style={{
|
style={{
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
color: SelectedHeaderColor,
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
|
|
@ -541,25 +610,25 @@ const PrintStyle10 = ({
|
||||||
<tr>
|
<tr>
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalSlNo && (
|
? GlobalSlNo && (
|
||||||
<th style={{ width: '10px' }}>S.N</th>
|
<th style={{ ...tableHeaderStyle, width: '10px' }}>S.N</th>
|
||||||
)
|
)
|
||||||
: SLNO && <th style={{ width: '10px' }}>S.N</th>}
|
: SLNO && <th style={{ ...tableHeaderStyle, width: '10px' }}>S.N</th>}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalItem && (
|
? GlobalItem && (
|
||||||
<th style={{ width: '10px' }}>Item</th>
|
<th style={{ ...tableHeaderStyle, width: '10px' }}>Item</th>
|
||||||
)
|
)
|
||||||
: Item && <th style={{ width: '10px' }}>Item</th>}
|
: Item && <th style={{ ...tableHeaderStyle, width: '10px' }}>Item</th>}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalQuantity && (
|
? GlobalQuantity && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '10px', textAlign: 'right' }}
|
style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
Qty
|
Qty
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: Quantity && (
|
: Quantity && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '10px', textAlign: 'right' }}
|
style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
{WeightasKg ? 'Qty/Kg' : 'Qty'}
|
{WeightasKg ? 'Qty/Kg' : 'Qty'}
|
||||||
</th>
|
</th>
|
||||||
|
|
@ -567,14 +636,14 @@ const PrintStyle10 = ({
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalHsnCode && (
|
? GlobalHsnCode && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '10px', textAlign: 'right' }}
|
style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
HSN
|
HSN
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: HsnCode && (
|
: HsnCode && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '10px', textAlign: 'right' }}
|
style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
HSN
|
HSN
|
||||||
</th>
|
</th>
|
||||||
|
|
@ -582,14 +651,14 @@ const PrintStyle10 = ({
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalMRP && (
|
? GlobalMRP && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '10px', textAlign: 'right' }}
|
style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
MRP
|
MRP
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: MRP && (
|
: MRP && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '10px', textAlign: 'right' }}
|
style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
MRP
|
MRP
|
||||||
</th>
|
</th>
|
||||||
|
|
@ -597,14 +666,14 @@ const PrintStyle10 = ({
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalDiscount && (
|
? GlobalDiscount && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '10px', textAlign: 'right' }}
|
style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
Dis{' '}
|
Dis{' '}
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: Discount && (
|
: Discount && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '10px', textAlign: 'right' }}
|
style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
Dis{' '}
|
Dis{' '}
|
||||||
</th>
|
</th>
|
||||||
|
|
@ -612,7 +681,7 @@ const PrintStyle10 = ({
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalTax && (
|
? GlobalTax && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '10px', textAlign: 'right' }}
|
style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
Tax %{' '}
|
Tax %{' '}
|
||||||
</th>
|
</th>
|
||||||
|
|
@ -620,7 +689,7 @@ const PrintStyle10 = ({
|
||||||
: Tax &&
|
: Tax &&
|
||||||
table2Data?.OrderType !== 'E' && (
|
table2Data?.OrderType !== 'E' && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '10px', textAlign: 'right' }}
|
style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
Tax %{' '}
|
Tax %{' '}
|
||||||
</th>
|
</th>
|
||||||
|
|
@ -628,14 +697,14 @@ const PrintStyle10 = ({
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalRate && (
|
? GlobalRate && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '10px', textAlign: 'right' }}
|
style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
Rate
|
Rate
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: Rate && (
|
: Rate && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '10px', textAlign: 'right' }}
|
style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
Rate
|
Rate
|
||||||
</th>
|
</th>
|
||||||
|
|
@ -643,14 +712,14 @@ const PrintStyle10 = ({
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalAmount && (
|
? GlobalAmount && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '10px', textAlign: 'right' }}
|
style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
Amt
|
Amt
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: Amount && (
|
: Amount && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '10px', textAlign: 'right' }}
|
style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
Amt
|
Amt
|
||||||
</th>
|
</th>
|
||||||
|
|
@ -660,7 +729,18 @@ const PrintStyle10 = ({
|
||||||
<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
|
<td
|
||||||
|
|
@ -872,25 +952,25 @@ const PrintStyle10 = ({
|
||||||
<tr>
|
<tr>
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalSlNo && (
|
? GlobalSlNo && (
|
||||||
<th style={{ width: '10px' }}>S.N</th>
|
<th style={{ ...tableHeaderStyle, width: '10px' }}>S.N</th>
|
||||||
)
|
)
|
||||||
: SLNO && <th style={{ width: '10px' }}>S.N</th>}
|
: SLNO && <th style={{ ...tableHeaderStyle, width: '10px' }}>S.N</th>}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalItem && (
|
? GlobalItem && (
|
||||||
<th style={{ width: '10px' }}>Item</th>
|
<th style={{ ...tableHeaderStyle, width: '10px' }}>Item</th>
|
||||||
)
|
)
|
||||||
: Item && <th style={{ width: '10px' }}>Item</th>}
|
: Item && <th style={{ ...tableHeaderStyle, width: '10px' }}>Item</th>}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalQuantity && (
|
? GlobalQuantity && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '10px', textAlign: 'right' }}
|
style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
Qty
|
Qty
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: Quantity && (
|
: Quantity && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '10px', textAlign: 'right' }}
|
style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
{WeightasKg ? 'Qty/Kg' : 'Qty'}
|
{WeightasKg ? 'Qty/Kg' : 'Qty'}
|
||||||
</th>
|
</th>
|
||||||
|
|
@ -898,14 +978,14 @@ const PrintStyle10 = ({
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalHsnCode && (
|
? GlobalHsnCode && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '10px', textAlign: 'right' }}
|
style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
HSN
|
HSN
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: HsnCode && (
|
: HsnCode && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '10px', textAlign: 'right' }}
|
style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
HSN
|
HSN
|
||||||
</th>
|
</th>
|
||||||
|
|
@ -913,14 +993,14 @@ const PrintStyle10 = ({
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalMRP && (
|
? GlobalMRP && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '10px', textAlign: 'right' }}
|
style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
MRP
|
MRP
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: MRP && (
|
: MRP && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '10px', textAlign: 'right' }}
|
style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
MRP
|
MRP
|
||||||
</th>
|
</th>
|
||||||
|
|
@ -928,14 +1008,14 @@ const PrintStyle10 = ({
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalDiscount && (
|
? GlobalDiscount && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '10px', textAlign: 'right' }}
|
style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
Dis{' '}
|
Dis{' '}
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: Discount && (
|
: Discount && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '10px', textAlign: 'right' }}
|
style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
Dis{' '}
|
Dis{' '}
|
||||||
</th>
|
</th>
|
||||||
|
|
@ -943,7 +1023,7 @@ const PrintStyle10 = ({
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalTax && (
|
? GlobalTax && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '10px', textAlign: 'right' }}
|
style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
Tax %{' '}
|
Tax %{' '}
|
||||||
</th>
|
</th>
|
||||||
|
|
@ -951,7 +1031,7 @@ const PrintStyle10 = ({
|
||||||
: Tax &&
|
: Tax &&
|
||||||
table2Data?.OrderType !== 'E' && (
|
table2Data?.OrderType !== 'E' && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '10px', textAlign: 'right' }}
|
style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
Tax %{' '}
|
Tax %{' '}
|
||||||
</th>
|
</th>
|
||||||
|
|
@ -959,14 +1039,14 @@ const PrintStyle10 = ({
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalRate && (
|
? GlobalRate && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '10px', textAlign: 'right' }}
|
style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
Rate
|
Rate
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: Rate && (
|
: Rate && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '10px', textAlign: 'right' }}
|
style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
Rate
|
Rate
|
||||||
</th>
|
</th>
|
||||||
|
|
@ -974,14 +1054,14 @@ const PrintStyle10 = ({
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalAmount && (
|
? GlobalAmount && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '10px', textAlign: 'right' }}
|
style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
Amt
|
Amt
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: Amount && (
|
: Amount && (
|
||||||
<th
|
<th
|
||||||
style={{ width: '10px', textAlign: 'right' }}
|
style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
Amt
|
Amt
|
||||||
</th>
|
</th>
|
||||||
|
|
@ -991,7 +1071,18 @@ const PrintStyle10 = ({
|
||||||
<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
|
<td
|
||||||
|
|
@ -1155,7 +1246,7 @@ const PrintStyle10 = ({
|
||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
rowGap: '0.1rem',
|
rowGap: '0.1rem',
|
||||||
fontSize: 'clamp(0.7rem, 2.5vw, 1rem)',
|
fontSize: 'clamp(0.7rem, 2.5vw, 1rem)',
|
||||||
|
...netAmountStyle,
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
@ -1898,6 +1989,7 @@ const PrintStyle10 = ({
|
||||||
pageBreakBefore: 'avoid',
|
pageBreakBefore: 'avoid',
|
||||||
pageBreakInside: 'avoid',
|
pageBreakInside: 'avoid',
|
||||||
minHeight: 'auto',
|
minHeight: 'auto',
|
||||||
|
...footerColorStyle
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
|
|
@ -2118,7 +2210,7 @@ const PrintStyle10 = ({
|
||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
rowGap: '0.1rem',
|
rowGap: '0.1rem',
|
||||||
fontSize: 'clamp(0.7rem, 2.5vw, 1rem)',
|
fontSize: 'clamp(0.7rem, 2.5vw, 1rem)',
|
||||||
|
...netAmountStyle,
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
@ -2840,6 +2932,7 @@ const PrintStyle10 = ({
|
||||||
pageBreakBefore: 'avoid',
|
pageBreakBefore: 'avoid',
|
||||||
pageBreakInside: 'avoid',
|
pageBreakInside: 'avoid',
|
||||||
minHeight: 'auto',
|
minHeight: 'auto',
|
||||||
|
...footerColorStyle
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
|
|
@ -3036,7 +3129,7 @@ const PrintStyle10 = ({
|
||||||
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
|
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
|
||||||
''
|
''
|
||||||
) : (
|
) : (
|
||||||
<div className="PrintStyle10-print">
|
<div className="PrintStyle10-print" style={{ ...headerStyle }}>
|
||||||
<div style={{ display: 'flex' }}>
|
<div style={{ display: 'flex' }}>
|
||||||
<div>
|
<div>
|
||||||
{GlobalLogo && GlobaldummyData ? (
|
{GlobalLogo && GlobaldummyData ? (
|
||||||
|
|
@ -3060,7 +3153,7 @@ const PrintStyle10 = ({
|
||||||
<div className="Address" style={{ fontWeight: '600' }}>
|
<div className="Address" style={{ fontWeight: '600' }}>
|
||||||
<div
|
<div
|
||||||
className="ShopName"
|
className="ShopName"
|
||||||
style={{ fontWeight: '600', color: SelectedHeaderColor }}
|
style={{ fontWeight: '600', }}
|
||||||
>
|
>
|
||||||
{GlobaldummyData ? 'ABC Shop' : table2Data?.BrName}{' '}
|
{GlobaldummyData ? 'ABC Shop' : table2Data?.BrName}{' '}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -3152,86 +3245,86 @@ const PrintStyle10 = ({
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalSlNo && <th style={{ width: '10px' }}>S.N</th>
|
? GlobalSlNo && <th style={{ ...tableHeaderStyle, width: '10px' }}>S.N</th>
|
||||||
: SLNO && <th style={{ width: '10px' }}>S.N</th>}
|
: SLNO && <th style={{ ...tableHeaderStyle, width: '10px' }}>S.N</th>}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalItem && <th style={{ width: '10px' }}>Item</th>
|
? GlobalItem && <th style={{ ...tableHeaderStyle, width: '10px' }}>Item</th>
|
||||||
: Item && <th style={{ width: '10px' }}>Item</th>}
|
: Item && <th style={{ ...tableHeaderStyle, width: '10px' }}>Item</th>}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalQuantity && (
|
? GlobalQuantity && (
|
||||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
<th style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||||
Qty
|
Qty
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: Quantity && (
|
: Quantity && (
|
||||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
<th style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||||
{WeightasKg ? 'Qty/Kg' : 'Qty'}
|
{WeightasKg ? 'Qty/Kg' : 'Qty'}
|
||||||
</th>
|
</th>
|
||||||
)}
|
)}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalHsnCode && (
|
? GlobalHsnCode && (
|
||||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
<th style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||||
HSN
|
HSN
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: HsnCode && (
|
: HsnCode && (
|
||||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
<th style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||||
HSN
|
HSN
|
||||||
</th>
|
</th>
|
||||||
)}
|
)}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalMRP && (
|
? GlobalMRP && (
|
||||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
<th style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||||
MRP
|
MRP
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: MRP && (
|
: MRP && (
|
||||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
<th style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||||
MRP
|
MRP
|
||||||
</th>
|
</th>
|
||||||
)}
|
)}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalDiscount && (
|
? GlobalDiscount && (
|
||||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
<th style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||||
Dis{' '}
|
Dis{' '}
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: Discount && (
|
: Discount && (
|
||||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
<th style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||||
Dis{' '}
|
Dis{' '}
|
||||||
</th>
|
</th>
|
||||||
)}
|
)}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalTax && (
|
? GlobalTax && (
|
||||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
<th style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||||
Tax %{' '}
|
Tax %{' '}
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: Tax &&
|
: Tax &&
|
||||||
table2Data?.OrderType !== 'E' && (
|
table2Data?.OrderType !== 'E' && (
|
||||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
<th style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||||
Tax %{' '}
|
Tax %{' '}
|
||||||
</th>
|
</th>
|
||||||
)}
|
)}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalRate && (
|
? GlobalRate && (
|
||||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
<th style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||||
Rate
|
Rate
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: Rate && (
|
: Rate && (
|
||||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
<th style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||||
Rate
|
Rate
|
||||||
</th>
|
</th>
|
||||||
)}
|
)}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalAmount && (
|
? GlobalAmount && (
|
||||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
<th style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||||
Amt
|
Amt
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: Amount && (
|
: Amount && (
|
||||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
<th style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||||
Amt
|
Amt
|
||||||
</th>
|
</th>
|
||||||
)}
|
)}
|
||||||
|
|
@ -3241,7 +3334,18 @@ const PrintStyle10 = ({
|
||||||
{(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
|
<td
|
||||||
|
|
@ -3460,47 +3564,47 @@ const PrintStyle10 = ({
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalSlNo && <th style={{ width: '10px' }}>S.N</th>
|
? GlobalSlNo && <th style={{ ...tableHeaderStyle, width: '10px' }}>S.N</th>
|
||||||
: SLNO && <th style={{ width: '10px' }}>S.N</th>}
|
: SLNO && <th style={{ ...tableHeaderStyle, width: '10px' }}>S.N</th>}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalItem && <th style={{ width: '10px' }}>Item</th>
|
? GlobalItem && <th style={{ width: '10px' }}>Item</th>
|
||||||
: Item && <th style={{ width: '10px' }}>Item</th>}
|
: Item && <th style={{ ...tableHeaderStyle, width: '10px' }}>Item</th>}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalQuantity && (
|
? GlobalQuantity && (
|
||||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
<th style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||||
Qty
|
Qty
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: Quantity && (
|
: Quantity && (
|
||||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
<th style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||||
{WeightasKg ? 'Qty/Kg' : 'Qty'}
|
{WeightasKg ? 'Qty/Kg' : 'Qty'}
|
||||||
</th>
|
</th>
|
||||||
)}
|
)}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalHsnCode && (
|
? GlobalHsnCode && (
|
||||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
<th style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||||
HSN
|
HSN
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: HsnCode && (
|
: HsnCode && (
|
||||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
<th style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||||
HSN
|
HSN
|
||||||
</th>
|
</th>
|
||||||
)}
|
)}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalMRP && (
|
? GlobalMRP && (
|
||||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
<th style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||||
MRP
|
MRP
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: MRP && (
|
: MRP && (
|
||||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
<th style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||||
MRP
|
MRP
|
||||||
</th>
|
</th>
|
||||||
)}
|
)}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalDiscount && (
|
? GlobalDiscount && (
|
||||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
<th style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||||
Dis{' '}
|
Dis{' '}
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
|
|
@ -3511,35 +3615,35 @@ const PrintStyle10 = ({
|
||||||
)}
|
)}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalTax && (
|
? GlobalTax && (
|
||||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
<th style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||||
Tax %{' '}
|
Tax %{' '}
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: Tax &&
|
: Tax &&
|
||||||
table2Data?.OrderType !== 'E' && (
|
table2Data?.OrderType !== 'E' && (
|
||||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
<th style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||||
Tax %{' '}
|
Tax %{' '}
|
||||||
</th>
|
</th>
|
||||||
)}
|
)}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalRate && (
|
? GlobalRate && (
|
||||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
<th style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||||
Rate
|
Rate
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: Rate && (
|
: Rate && (
|
||||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
<th style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||||
Rate
|
Rate
|
||||||
</th>
|
</th>
|
||||||
)}
|
)}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalAmount && (
|
? GlobalAmount && (
|
||||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
<th style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||||
Amt
|
Amt
|
||||||
</th>
|
</th>
|
||||||
)
|
)
|
||||||
: Amount && (
|
: Amount && (
|
||||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
<th style={{ ...tableHeaderStyle, width: '10px', textAlign: 'right' }}>
|
||||||
Amt
|
Amt
|
||||||
</th>
|
</th>
|
||||||
)}
|
)}
|
||||||
|
|
@ -3549,7 +3653,18 @@ const PrintStyle10 = ({
|
||||||
{(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
|
<td
|
||||||
|
|
@ -3699,8 +3814,8 @@ const PrintStyle10 = ({
|
||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
rowGap: '0.1rem',
|
rowGap: '0.1rem',
|
||||||
fontSize: 'clamp(0.7rem, 2.5vw, 1rem)',
|
fontSize: 'clamp(0.7rem, 2.5vw, 1rem)',
|
||||||
|
|
||||||
fontWeight: '600',
|
fontWeight: '600',
|
||||||
|
...netAmountStyle
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div className="PrintStyle10-items">
|
<div className="PrintStyle10-items">
|
||||||
|
|
@ -4381,6 +4496,7 @@ const PrintStyle10 = ({
|
||||||
pageBreakBefore: 'avoid',
|
pageBreakBefore: 'avoid',
|
||||||
pageBreakInside: 'avoid',
|
pageBreakInside: 'avoid',
|
||||||
minHeight: 'auto',
|
minHeight: 'auto',
|
||||||
|
...footerColorStyle
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue