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