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