Implement dynamic header and table color functionality
This commit is contained in:
parent
7245aa95b4
commit
d5c5365a09
|
|
@ -31,6 +31,16 @@ import {
|
|||
GlobalprintCredit,
|
||||
GlobalprintTax,
|
||||
GlobalSelectedPrintHeaderColor,
|
||||
GlobalSelectedPrintHeaderFontColor,
|
||||
GlobalSelectedTableHeaderColor,
|
||||
GlobalSelectedTableHeaderFontColor,
|
||||
GlobalSelectedTableBodyFontColor,
|
||||
GlobalSelectedTableBodyColor,
|
||||
GlobalRowType,
|
||||
GlobalSelectedFooterColor,
|
||||
GlobalSelectedFooterFontColor,
|
||||
GlobalSelectedNetAmountColor,
|
||||
GlobalSelectedNetAmountFontColor,
|
||||
} from '../../../../Features/ThemeChange/ThemeChange';
|
||||
import {
|
||||
GlobalUpiIDprint,
|
||||
|
|
@ -104,6 +114,25 @@ const Printstyle12 = ({
|
|||
const GlobalCredit = useSelector(GlobalprintCredit);
|
||||
const SettingData = useSelector(PreferenceData);
|
||||
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 UomPrint = SettingData?.[0]?.SettingDtlDetails?.filter(
|
||||
(i) => i.SettingIdName === 'PrintUom'
|
||||
)?.[0];
|
||||
const estimatePrintHeader =
|
||||
SettingData?.[0]?.SettingDtlDetails?.find(
|
||||
(setting) =>
|
||||
|
|
@ -475,6 +504,51 @@ const Printstyle12 = ({
|
|||
await printDiv('PrintStyle12', style12, 'FontApply');
|
||||
};
|
||||
|
||||
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 ? (
|
||||
|
|
@ -736,74 +810,85 @@ const Printstyle12 = ({
|
|||
<thead>
|
||||
<tr>
|
||||
{GlobaldummyData
|
||||
? GlobalSlNo && <th>S.No</th>
|
||||
: SLNO && <th>S.No</th>}
|
||||
? GlobalSlNo && <th style={{...tableHeaderStyle}}>S.No</th>
|
||||
: SLNO && <th style={{...tableHeaderStyle}}>S.No</th>}
|
||||
{GlobaldummyData
|
||||
? GlobalItem && <th>Description</th>
|
||||
: Item && <th>Des</th>}
|
||||
? GlobalItem && <th style={{...tableHeaderStyle}}>Description</th>
|
||||
: Item && <th style={{...tableHeaderStyle}}>Des</th>}
|
||||
{GlobaldummyData
|
||||
? GlobalQuantity && (
|
||||
<th style={{ textAlign: 'right' }}>Qty</th>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>Qty</th>
|
||||
)
|
||||
: Quantity && (
|
||||
<th style={{ textAlign: 'right' }}>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>
|
||||
{' '}
|
||||
{WeightasKg ? 'Qty/Kg' : 'Qty'}
|
||||
</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalMRP && (
|
||||
<th style={{ textAlign: 'right' }}>MRP</th>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>MRP</th>
|
||||
)
|
||||
: MRP && (
|
||||
<th style={{ textAlign: 'right' }}>MRP</th>
|
||||
<th style={{ ...tableHeaderStyle,textAlign: 'right' }}>MRP</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalRate && (
|
||||
<th style={{ textAlign: 'right' }}>Rate</th>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>Rate</th>
|
||||
)
|
||||
: Rate && (
|
||||
<th style={{ textAlign: 'right' }}>Rate</th>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>Rate</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalHsnCode && (
|
||||
<th style={{ textAlign: 'right' }}>HSN</th>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>HSN</th>
|
||||
)
|
||||
: HsnCode && (
|
||||
<th style={{ textAlign: 'right' }}>HSN</th>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>HSN</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalDiscount && (
|
||||
<th style={{ textAlign: 'right' }}>(%)</th>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>(%)</th>
|
||||
)
|
||||
: Discount && (
|
||||
<th style={{ textAlign: 'right' }}>(%)</th>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>(%)</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalTax && (
|
||||
<th style={{ textAlign: 'right' }}>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>
|
||||
Tax (%)
|
||||
</th>
|
||||
)
|
||||
: Tax &&
|
||||
table2Data?.OrderType !== 'E' && (
|
||||
<th style={{ textAlign: 'right' }}>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>
|
||||
Tax (%)
|
||||
</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalAmount && (
|
||||
<th style={{ textAlign: 'right' }}>Amt</th>
|
||||
<th style={{ ...tableHeaderStyle,textAlign: 'right' }}>Amt</th>
|
||||
)
|
||||
: Amount && (
|
||||
<th style={{ textAlign: 'right' }}>Amt</th>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>Amt</th>
|
||||
)}
|
||||
</tr>
|
||||
</thead>
|
||||
<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>{index + 1}</td>
|
||||
: SLNO && (
|
||||
|
|
@ -1022,74 +1107,85 @@ const Printstyle12 = ({
|
|||
<thead>
|
||||
<tr>
|
||||
{GlobaldummyData
|
||||
? GlobalSlNo && <th>S.No</th>
|
||||
: SLNO && <th>S.No</th>}
|
||||
? GlobalSlNo && <th style={{...tableHeaderStyle,}}>S.No</th>
|
||||
: SLNO && <th style={{...tableHeaderStyle,}}>S.No</th>}
|
||||
{GlobaldummyData
|
||||
? GlobalItem && <th>Description</th>
|
||||
: Item && <th>Des</th>}
|
||||
? GlobalItem && <th style={{...tableHeaderStyle,}}>Description</th>
|
||||
: Item && <th style={{...tableHeaderStyle,}}>Des</th>}
|
||||
{GlobaldummyData
|
||||
? GlobalQuantity && (
|
||||
<th style={{ textAlign: 'right' }}>Qty</th>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>Qty</th>
|
||||
)
|
||||
: Quantity && (
|
||||
<th style={{ textAlign: 'right' }}>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>
|
||||
{' '}
|
||||
{WeightasKg ? 'Qty/Kg' : 'Qty'}
|
||||
</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalMRP && (
|
||||
<th style={{ textAlign: 'right' }}>MRP</th>
|
||||
<th style={{ ...tableHeaderStyle,textAlign: 'right' }}>MRP</th>
|
||||
)
|
||||
: MRP && (
|
||||
<th style={{ textAlign: 'right' }}>MRP</th>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>MRP</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalRate && (
|
||||
<th style={{ textAlign: 'right' }}>Rate</th>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>Rate</th>
|
||||
)
|
||||
: Rate && (
|
||||
<th style={{ textAlign: 'right' }}>Rate</th>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>Rate</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalHsnCode && (
|
||||
<th style={{ textAlign: 'right' }}>HSN</th>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>HSN</th>
|
||||
)
|
||||
: HsnCode && (
|
||||
<th style={{ textAlign: 'right' }}>HSN</th>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>HSN</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalDiscount && (
|
||||
<th style={{ textAlign: 'right' }}>(%)</th>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>(%)</th>
|
||||
)
|
||||
: Discount && (
|
||||
<th style={{ textAlign: 'right' }}>(%)</th>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>(%)</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalTax && (
|
||||
<th style={{ textAlign: 'right' }}>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>
|
||||
Tax (%)
|
||||
</th>
|
||||
)
|
||||
: Tax &&
|
||||
table2Data?.OrderType !== 'E' && (
|
||||
<th style={{ textAlign: 'right' }}>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>
|
||||
Tax (%)
|
||||
</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalAmount && (
|
||||
<th style={{ textAlign: 'right' }}>Amt</th>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>Amt</th>
|
||||
)
|
||||
: Amount && (
|
||||
<th style={{ textAlign: 'right' }}>Amt</th>
|
||||
<th style={{ ...tableHeaderStyle,textAlign: 'right' }}>Amt</th>
|
||||
)}
|
||||
</tr>
|
||||
</thead>
|
||||
<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>{index + 1}</td>
|
||||
: SLNO && (
|
||||
|
|
@ -1374,6 +1470,7 @@ const Printstyle12 = ({
|
|||
style={{
|
||||
display: 'flex',
|
||||
justifyContent: 'space-between',
|
||||
...netAmountStyle
|
||||
}}
|
||||
>
|
||||
<div style={{ width: '45%', fontWeight: '600' }}>
|
||||
|
|
@ -2008,6 +2105,7 @@ const Printstyle12 = ({
|
|||
pageBreakBefore: 'avoid',
|
||||
pageBreakInside: 'avoid',
|
||||
minHeight: 'auto',
|
||||
...footerColorStyle
|
||||
}}
|
||||
>
|
||||
{GlobaldummyData
|
||||
|
|
@ -2366,6 +2464,7 @@ const Printstyle12 = ({
|
|||
style={{
|
||||
display: 'flex',
|
||||
justifyContent: 'space-between',
|
||||
...netAmountStyle
|
||||
}}
|
||||
>
|
||||
<div style={{ width: '45%', fontWeight: '600' }}>
|
||||
|
|
@ -2995,6 +3094,7 @@ const Printstyle12 = ({
|
|||
pageBreakBefore: 'avoid',
|
||||
pageBreakInside: 'avoid',
|
||||
minHeight: 'auto',
|
||||
...footerColorStyle
|
||||
}}
|
||||
>
|
||||
{GlobaldummyData
|
||||
|
|
@ -3190,7 +3290,7 @@ const Printstyle12 = ({
|
|||
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
|
||||
''
|
||||
) : (
|
||||
<div className="PrintStyle12-firstDiv">
|
||||
<div className="PrintStyle12-firstDiv" style={{...headerStyle}}>
|
||||
{/* <h3>{table2Data?.BrName}</h3> */}
|
||||
<div style={{ display: 'flex', flexDirection: 'column' }}>
|
||||
<hr
|
||||
|
|
@ -3366,65 +3466,76 @@ const Printstyle12 = ({
|
|||
<thead>
|
||||
<tr>
|
||||
{GlobaldummyData
|
||||
? GlobalSlNo && <th>S.No</th>
|
||||
: SLNO && <th>S.No</th>}
|
||||
? GlobalSlNo && <th style={{...tableHeaderStyle}}>S.No</th>
|
||||
: SLNO && <th style={{...tableHeaderStyle}}>S.No</th>}
|
||||
{GlobaldummyData
|
||||
? GlobalItem && <th>Description</th>
|
||||
: Item && <th>Des</th>}
|
||||
? GlobalItem && <th style={{...tableHeaderStyle}}>Description</th>
|
||||
: Item && <th style={{...tableHeaderStyle}}>Des</th>}
|
||||
{GlobaldummyData
|
||||
? GlobalQuantity && (
|
||||
<th style={{ textAlign: 'right' }}>Qty</th>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>Qty</th>
|
||||
)
|
||||
: Quantity && (
|
||||
<th style={{ textAlign: 'right' }}>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>
|
||||
{' '}
|
||||
{WeightasKg ? 'Qty/Kg' : 'Qty'}
|
||||
</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalMRP && (
|
||||
<th style={{ textAlign: 'right' }}>MRP</th>
|
||||
<th style={{ ...tableHeaderStyle,textAlign: 'right' }}>MRP</th>
|
||||
)
|
||||
: MRP && <th style={{ textAlign: 'right' }}>MRP</th>}
|
||||
: MRP && <th style={{ ...tableHeaderStyle,textAlign: 'right' }}>MRP</th>}
|
||||
{GlobaldummyData
|
||||
? GlobalRate && (
|
||||
<th style={{ textAlign: 'right' }}>Rate</th>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>Rate</th>
|
||||
)
|
||||
: Rate && <th style={{ textAlign: 'right' }}>Rate</th>}
|
||||
: Rate && <th style={{...tableHeaderStyle, textAlign: 'right' }}>Rate</th>}
|
||||
{GlobaldummyData
|
||||
? GlobalHsnCode && (
|
||||
<th style={{ textAlign: 'right' }}>HSN</th>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>HSN</th>
|
||||
)
|
||||
: HsnCode && (
|
||||
<th style={{ textAlign: 'right' }}>HSN</th>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>HSN</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalDiscount && (
|
||||
<th style={{ textAlign: 'right' }}>(%)</th>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>(%)</th>
|
||||
)
|
||||
: Discount && (
|
||||
<th style={{ textAlign: 'right' }}>(%)</th>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>(%)</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalTax && (
|
||||
<th style={{ textAlign: 'right' }}>Tax (%)</th>
|
||||
<th style={{ ...tableHeaderStyle,textAlign: 'right' }}>Tax (%)</th>
|
||||
)
|
||||
: Tax &&
|
||||
table2Data?.OrderType !== 'E' && (
|
||||
<th style={{ textAlign: 'right' }}>Tax (%)</th>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>Tax (%)</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalAmount && (
|
||||
<th style={{ textAlign: 'right' }}>Amt</th>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>Amt</th>
|
||||
)
|
||||
: Amount && <th style={{ textAlign: 'right' }}>Amt</th>}
|
||||
: Amount && <th style={{...tableHeaderStyle, textAlign: 'right' }}>Amt</th>}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{(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>{index + 1}</td>
|
||||
: SLNO && <td>{index + 1}</td>}
|
||||
|
|
@ -3663,65 +3774,76 @@ const Printstyle12 = ({
|
|||
<thead>
|
||||
<tr>
|
||||
{GlobaldummyData
|
||||
? GlobalSlNo && <th>S.No</th>
|
||||
: SLNO && <th>S.No</th>}
|
||||
? GlobalSlNo && <th style={{...tableHeaderStyle}}>S.No</th>
|
||||
: SLNO && <th style={{...tableHeaderStyle}}>S.No</th>}
|
||||
{GlobaldummyData
|
||||
? GlobalItem && <th>Description</th>
|
||||
: Item && <th>Des</th>}
|
||||
? GlobalItem && <th style={{...tableHeaderStyle}}>Description</th>
|
||||
: Item && <th style={{...tableHeaderStyle}}>Des</th>}
|
||||
{GlobaldummyData
|
||||
? GlobalQuantity && (
|
||||
<th style={{ textAlign: 'right' }}>Qty</th>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>Qty</th>
|
||||
)
|
||||
: Quantity && (
|
||||
<th style={{ textAlign: 'right' }}>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>
|
||||
{' '}
|
||||
{WeightasKg ? 'Qty/Kg' : 'Qty'}
|
||||
</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalMRP && (
|
||||
<th style={{ textAlign: 'right' }}>MRP</th>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>MRP</th>
|
||||
)
|
||||
: MRP && <th style={{ textAlign: 'right' }}>MRP</th>}
|
||||
: MRP && <th style={{...tableHeaderStyle, textAlign: 'right' }}>MRP</th>}
|
||||
{GlobaldummyData
|
||||
? GlobalRate && (
|
||||
<th style={{ textAlign: 'right' }}>Rate</th>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>Rate</th>
|
||||
)
|
||||
: Rate && <th style={{ textAlign: 'right' }}>Rate</th>}
|
||||
: Rate && <th style={{...tableHeaderStyle, textAlign: 'right' }}>Rate</th>}
|
||||
{GlobaldummyData
|
||||
? GlobalHsnCode && (
|
||||
<th style={{ textAlign: 'right' }}>HSN</th>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>HSN</th>
|
||||
)
|
||||
: HsnCode && (
|
||||
<th style={{ textAlign: 'right' }}>HSN</th>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>HSN</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalDiscount && (
|
||||
<th style={{ textAlign: 'right' }}>(%)</th>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>(%)</th>
|
||||
)
|
||||
: Discount && (
|
||||
<th style={{ textAlign: 'right' }}>(%)</th>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>(%)</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalTax && (
|
||||
<th style={{ textAlign: 'right' }}>Tax (%)</th>
|
||||
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>Tax (%)</th>
|
||||
)
|
||||
: Tax &&
|
||||
table2Data?.OrderType !== 'E' && (
|
||||
<th style={{ textAlign: 'right' }}>Tax (%)</th>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>Tax (%)</th>
|
||||
)}
|
||||
{GlobaldummyData
|
||||
? GlobalAmount && (
|
||||
<th style={{ textAlign: 'right' }}>Amt</th>
|
||||
<th style={{...tableHeaderStyle, textAlign: 'right' }}>Amt</th>
|
||||
)
|
||||
: Amount && <th style={{ textAlign: 'right' }}>Amt</th>}
|
||||
: Amount && <th style={{...tableHeaderStyle, textAlign: 'right' }}>Amt</th>}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{(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>{index + 1}</td>
|
||||
: SLNO && <td>{index + 1}</td>}
|
||||
|
|
@ -3972,7 +4094,7 @@ const Printstyle12 = ({
|
|||
)}
|
||||
</>
|
||||
)}
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between',...netAmountStyle }}>
|
||||
<div style={{ width: '45%', fontWeight: '600' }}>Amount</div>
|
||||
<div> : </div>
|
||||
<div
|
||||
|
|
@ -4576,6 +4698,7 @@ const Printstyle12 = ({
|
|||
pageBreakBefore: 'avoid',
|
||||
pageBreakInside: 'avoid',
|
||||
minHeight: 'auto',
|
||||
...footerColorStyle
|
||||
}}
|
||||
>
|
||||
{GlobaldummyData
|
||||
|
|
|
|||
Loading…
Reference in New Issue