This commit is contained in:
Tamilselvan 2026-03-05 14:04:20 +05:30
parent a123ddfe5e
commit 0027bb1f49
1 changed files with 151 additions and 145 deletions

View File

@ -31,16 +31,16 @@ import {
GlobalprintCredit,
GlobalprintTax,
GlobalSelectedPrintHeaderColor,
GlobalSelectedPrintHeaderFontColor,
GlobalSelectedTableHeaderColor,
GlobalSelectedTableHeaderFontColor,
GlobalSelectedTableBodyFontColor,
GlobalSelectedTableBodyColor,
GlobalRowType,
GlobalSelectedFooterColor,
GlobalSelectedFooterFontColor,
GlobalSelectedNetAmountColor,
GlobalSelectedNetAmountFontColor,
GlobalSelectedPrintHeaderFontColor,
GlobalSelectedTableHeaderColor,
GlobalSelectedTableHeaderFontColor,
GlobalSelectedTableBodyFontColor,
GlobalSelectedTableBodyColor,
GlobalRowType,
GlobalSelectedFooterColor,
GlobalSelectedFooterFontColor,
GlobalSelectedNetAmountColor,
GlobalSelectedNetAmountFontColor,
} from '../../../../Features/ThemeChange/ThemeChange';
import {
GlobalUpiIDprint,
@ -114,23 +114,29 @@ 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(
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 Retailshortname = SettingData?.[0]?.SettingDtlDetails?.find(
(setting) => setting?.SettingIdName?.toLowerCase() === 'retailshortname'
);
const Wholesaleshortname = SettingData?.[0]?.SettingDtlDetails?.find(
(setting) => setting?.SettingIdName?.toLowerCase() === 'wholesaleshortname'
);
const UomPrint = SettingData?.[0]?.SettingDtlDetails?.filter(
(i) => i.SettingIdName === 'PrintUom'
)?.[0];
const estimatePrintHeader =
@ -504,7 +510,7 @@ const Printstyle12 = ({
await printDiv('PrintStyle12', style12, 'FontApply');
};
const headerStyle = {
const headerStyle = {
backgroundColor: GlobaldummyData
? SelectedHeaderColor
: headerColor?.background,
@ -810,67 +816,67 @@ const Printstyle12 = ({
<thead>
<tr>
{GlobaldummyData
? GlobalSlNo && <th style={{...tableHeaderStyle}}>S.No</th>
: SLNO && <th style={{...tableHeaderStyle}}>S.No</th>}
? GlobalSlNo && <th style={{ ...tableHeaderStyle }}>S.No</th>
: SLNO && <th style={{ ...tableHeaderStyle }}>S.No</th>}
{GlobaldummyData
? GlobalItem && <th style={{...tableHeaderStyle}}>Description</th>
: Item && <th style={{...tableHeaderStyle}}>Des</th>}
? GlobalItem && <th style={{ ...tableHeaderStyle }}>Description</th>
: Item && <th style={{ ...tableHeaderStyle }}>Des</th>}
{GlobaldummyData
? GlobalQuantity && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>Qty</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>Qty</th>
)
: Quantity && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>
{' '}
{WeightasKg ? 'Qty/Kg' : 'Qty'}
</th>
)}
{GlobaldummyData
? GlobalMRP && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>MRP</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>MRP</th>
)
: MRP && (
<th style={{ ...tableHeaderStyle,textAlign: 'right' }}>MRP</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>MRP</th>
)}
{GlobaldummyData
? GlobalRate && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>Rate</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>Rate</th>
)
: Rate && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>Rate</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>Rate</th>
)}
{GlobaldummyData
? GlobalHsnCode && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>HSN</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>HSN</th>
)
: HsnCode && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>HSN</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>HSN</th>
)}
{GlobaldummyData
? GlobalDiscount && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>(%)</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>(%)</th>
)
: Discount && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>(%)</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>(%)</th>
)}
{GlobaldummyData
? GlobalTax && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>
Tax (%)
</th>
)
: Tax &&
table2Data?.OrderType !== 'E' && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>
Tax (%)
</th>
)}
{GlobaldummyData
? GlobalAmount && (
<th style={{ ...tableHeaderStyle,textAlign: 'right' }}>Amt</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>Amt</th>
)
: Amount && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>Amt</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>Amt</th>
)}
</tr>
</thead>
@ -878,17 +884,17 @@ const Printstyle12 = ({
{dataChunk?.map((item, index) => {
return (
<tr key={index}
style={
index % 2 !== 1 && rowtypeStyle === "even"
? {
...tableBodyStyle
}
: index % 2 === 1 && rowtypeStyle === "odd"
? {
...tableBodyStyle
}
: {}
}>
style={
index % 2 !== 1 && rowtypeStyle === "even"
? {
...tableBodyStyle
}
: index % 2 === 1 && rowtypeStyle === "odd"
? {
...tableBodyStyle
}
: {}
}>
{GlobaldummyData
? GlobalSlNo && <td>{index + 1}</td>
: SLNO && (
@ -1107,67 +1113,67 @@ const Printstyle12 = ({
<thead>
<tr>
{GlobaldummyData
? GlobalSlNo && <th style={{...tableHeaderStyle,}}>S.No</th>
: SLNO && <th style={{...tableHeaderStyle,}}>S.No</th>}
? GlobalSlNo && <th style={{ ...tableHeaderStyle, }}>S.No</th>
: SLNO && <th style={{ ...tableHeaderStyle, }}>S.No</th>}
{GlobaldummyData
? GlobalItem && <th style={{...tableHeaderStyle,}}>Description</th>
: Item && <th style={{...tableHeaderStyle,}}>Des</th>}
? GlobalItem && <th style={{ ...tableHeaderStyle, }}>Description</th>
: Item && <th style={{ ...tableHeaderStyle, }}>Des</th>}
{GlobaldummyData
? GlobalQuantity && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>Qty</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>Qty</th>
)
: Quantity && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>
{' '}
{WeightasKg ? 'Qty/Kg' : 'Qty'}
</th>
)}
{GlobaldummyData
? GlobalMRP && (
<th style={{ ...tableHeaderStyle,textAlign: 'right' }}>MRP</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>MRP</th>
)
: MRP && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>MRP</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>MRP</th>
)}
{GlobaldummyData
? GlobalRate && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>Rate</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>Rate</th>
)
: Rate && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>Rate</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>Rate</th>
)}
{GlobaldummyData
? GlobalHsnCode && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>HSN</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>HSN</th>
)
: HsnCode && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>HSN</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>HSN</th>
)}
{GlobaldummyData
? GlobalDiscount && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>(%)</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>(%)</th>
)
: Discount && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>(%)</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>(%)</th>
)}
{GlobaldummyData
? GlobalTax && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>
Tax (%)
</th>
)
: Tax &&
table2Data?.OrderType !== 'E' && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>
Tax (%)
</th>
)}
{GlobaldummyData
? GlobalAmount && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>Amt</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>Amt</th>
)
: Amount && (
<th style={{ ...tableHeaderStyle,textAlign: 'right' }}>Amt</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>Amt</th>
)}
</tr>
</thead>
@ -1175,17 +1181,17 @@ const Printstyle12 = ({
{dataChunk?.map((item, index) => {
return (
<tr key={index}
style={
index % 2 !== 1 && rowtypeStyle === "even"
? {
...tableBodyStyle
}
: index % 2 === 1 && rowtypeStyle === "odd"
? {
...tableBodyStyle
}
: {}
}>
style={
index % 2 !== 1 && rowtypeStyle === "even"
? {
...tableBodyStyle
}
: index % 2 === 1 && rowtypeStyle === "odd"
? {
...tableBodyStyle
}
: {}
}>
{GlobaldummyData
? GlobalSlNo && <td>{index + 1}</td>
: SLNO && (
@ -3290,7 +3296,7 @@ const Printstyle12 = ({
{!estimatePrintHeader && table2Data?.OrderType === 'E' ? (
''
) : (
<div className="PrintStyle12-firstDiv" style={{...headerStyle}}>
<div className="PrintStyle12-firstDiv" style={{ ...headerStyle }}>
{/* <h3>{table2Data?.BrName}</h3> */}
<div style={{ display: 'flex', flexDirection: 'column' }}>
<hr
@ -3466,58 +3472,58 @@ const Printstyle12 = ({
<thead>
<tr>
{GlobaldummyData
? GlobalSlNo && <th style={{...tableHeaderStyle}}>S.No</th>
: SLNO && <th style={{...tableHeaderStyle}}>S.No</th>}
? GlobalSlNo && <th style={{ ...tableHeaderStyle }}>S.No</th>
: SLNO && <th style={{ ...tableHeaderStyle }}>S.No</th>}
{GlobaldummyData
? GlobalItem && <th style={{...tableHeaderStyle}}>Description</th>
: Item && <th style={{...tableHeaderStyle}}>Des</th>}
? GlobalItem && <th style={{ ...tableHeaderStyle }}>Description</th>
: Item && <th style={{ ...tableHeaderStyle }}>Des</th>}
{GlobaldummyData
? GlobalQuantity && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>Qty</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>Qty</th>
)
: Quantity && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>
{' '}
{WeightasKg ? 'Qty/Kg' : 'Qty'}
</th>
)}
{GlobaldummyData
? GlobalMRP && (
<th style={{ ...tableHeaderStyle,textAlign: 'right' }}>MRP</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>MRP</th>
)
: MRP && <th style={{ ...tableHeaderStyle,textAlign: 'right' }}>MRP</th>}
: MRP && <th style={{ ...tableHeaderStyle, textAlign: 'right' }}>MRP</th>}
{GlobaldummyData
? GlobalRate && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>Rate</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>Rate</th>
)
: Rate && <th style={{...tableHeaderStyle, textAlign: 'right' }}>Rate</th>}
: Rate && <th style={{ ...tableHeaderStyle, textAlign: 'right' }}>Rate</th>}
{GlobaldummyData
? GlobalHsnCode && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>HSN</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>HSN</th>
)
: HsnCode && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>HSN</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>HSN</th>
)}
{GlobaldummyData
? GlobalDiscount && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>(%)</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>(%)</th>
)
: Discount && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>(%)</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>(%)</th>
)}
{GlobaldummyData
? GlobalTax && (
<th style={{ ...tableHeaderStyle,textAlign: 'right' }}>Tax (%)</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>Tax (%)</th>
)
: Tax &&
table2Data?.OrderType !== 'E' && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>Tax (%)</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>Tax (%)</th>
)}
{GlobaldummyData
? GlobalAmount && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>Amt</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>Amt</th>
)
: Amount && <th style={{...tableHeaderStyle, textAlign: 'right' }}>Amt</th>}
: Amount && <th style={{ ...tableHeaderStyle, textAlign: 'right' }}>Amt</th>}
</tr>
</thead>
<tbody>
@ -3525,17 +3531,17 @@ const Printstyle12 = ({
(item, index) => {
return (
<tr key={index}
style={
index % 2 !== 1 && rowtypeStyle === "even"
? {
...tableBodyStyle
}
: index % 2 === 1 && rowtypeStyle === "odd"
? {
...tableBodyStyle
}
: {}
}>
style={
index % 2 !== 1 && rowtypeStyle === "even"
? {
...tableBodyStyle
}
: index % 2 === 1 && rowtypeStyle === "odd"
? {
...tableBodyStyle
}
: {}
}>
{GlobaldummyData
? GlobalSlNo && <td>{index + 1}</td>
: SLNO && <td>{index + 1}</td>}
@ -3774,44 +3780,44 @@ const Printstyle12 = ({
<thead>
<tr>
{GlobaldummyData
? GlobalSlNo && <th style={{...tableHeaderStyle}}>S.No</th>
: SLNO && <th style={{...tableHeaderStyle}}>S.No</th>}
? GlobalSlNo && <th style={{ ...tableHeaderStyle }}>S.No</th>
: SLNO && <th style={{ ...tableHeaderStyle }}>S.No</th>}
{GlobaldummyData
? GlobalItem && <th style={{...tableHeaderStyle}}>Description</th>
: Item && <th style={{...tableHeaderStyle}}>Des</th>}
? GlobalItem && <th style={{ ...tableHeaderStyle }}>Description</th>
: Item && <th style={{ ...tableHeaderStyle }}>Des</th>}
{GlobaldummyData
? GlobalQuantity && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>Qty</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>Qty</th>
)
: Quantity && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>
{' '}
{WeightasKg ? 'Qty/Kg' : 'Qty'}
</th>
)}
{GlobaldummyData
? GlobalMRP && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>MRP</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>MRP</th>
)
: MRP && <th style={{...tableHeaderStyle, textAlign: 'right' }}>MRP</th>}
: MRP && <th style={{ ...tableHeaderStyle, textAlign: 'right' }}>MRP</th>}
{GlobaldummyData
? GlobalRate && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>Rate</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>Rate</th>
)
: Rate && <th style={{...tableHeaderStyle, textAlign: 'right' }}>Rate</th>}
: Rate && <th style={{ ...tableHeaderStyle, textAlign: 'right' }}>Rate</th>}
{GlobaldummyData
? GlobalHsnCode && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>HSN</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>HSN</th>
)
: HsnCode && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>HSN</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>HSN</th>
)}
{GlobaldummyData
? GlobalDiscount && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>(%)</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>(%)</th>
)
: Discount && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>(%)</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>(%)</th>
)}
{GlobaldummyData
? GlobalTax && (
@ -3819,13 +3825,13 @@ const Printstyle12 = ({
)
: Tax &&
table2Data?.OrderType !== 'E' && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>Tax (%)</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>Tax (%)</th>
)}
{GlobaldummyData
? GlobalAmount && (
<th style={{...tableHeaderStyle, textAlign: 'right' }}>Amt</th>
<th style={{ ...tableHeaderStyle, textAlign: 'right' }}>Amt</th>
)
: Amount && <th style={{...tableHeaderStyle, textAlign: 'right' }}>Amt</th>}
: Amount && <th style={{ ...tableHeaderStyle, textAlign: 'right' }}>Amt</th>}
</tr>
</thead>
<tbody>
@ -3833,17 +3839,17 @@ const Printstyle12 = ({
(item, index) => {
return (
<tr key={index}
style={
index % 2 !== 1 && rowtypeStyle === "even"
? {
...tableBodyStyle
}
: index % 2 === 1 && rowtypeStyle === "odd"
? {
...tableBodyStyle
}
: {}
}>
style={
index % 2 !== 1 && rowtypeStyle === "even"
? {
...tableBodyStyle
}
: index % 2 === 1 && rowtypeStyle === "odd"
? {
...tableBodyStyle
}
: {}
}>
{GlobaldummyData
? GlobalSlNo && <td>{index + 1}</td>
: SLNO && <td>{index + 1}</td>}
@ -4094,7 +4100,7 @@ const Printstyle12 = ({
)}
</>
)}
<div style={{ display: 'flex', justifyContent: 'space-between',...netAmountStyle }}>
<div style={{ display: 'flex', justifyContent: 'space-between', ...netAmountStyle }}>
<div style={{ width: '45%', fontWeight: '600' }}>Amount</div>
<div> : </div>
<div