Implement dynamic header and table color functionality
This commit is contained in:
parent
282d8f23f6
commit
12509a49fd
|
|
@ -4,7 +4,18 @@ import { useDispatch, useSelector } from "react-redux";
|
||||||
import {
|
import {
|
||||||
GlobalPritdummyData,
|
GlobalPritdummyData,
|
||||||
changeReprintDataFound,
|
changeReprintDataFound,
|
||||||
GlobalprinttermsAndConditions
|
GlobalprinttermsAndConditions,
|
||||||
|
GlobalSelectedPrintHeaderColor,
|
||||||
|
GlobalSelectedPrintHeaderFontColor,
|
||||||
|
GlobalSelectedTableHeaderColor,
|
||||||
|
GlobalSelectedTableHeaderFontColor,
|
||||||
|
GlobalSelectedTableBodyColor,
|
||||||
|
GlobalSelectedTableBodyFontColor,
|
||||||
|
GlobalRowType,
|
||||||
|
GlobalSelectedFooterColor,
|
||||||
|
GlobalSelectedFooterFontColor,
|
||||||
|
GlobalSelectedNetAmountColor,
|
||||||
|
GlobalSelectedNetAmountFontColor,
|
||||||
} from '../../../Features/ThemeChange/ThemeChange';
|
} from '../../../Features/ThemeChange/ThemeChange';
|
||||||
import "../../../Styles/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle7.scss"
|
import "../../../Styles/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle7.scss"
|
||||||
import { extractLastNumber } from "../../../Services/Others";
|
import { extractLastNumber } from "../../../Services/Others";
|
||||||
|
|
@ -29,10 +40,25 @@ const PurPrintStyle7 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C
|
||||||
const Rate = FieldDetails?.["Rate"];
|
const Rate = FieldDetails?.["Rate"];
|
||||||
const Amount = FieldDetails?.["Amount"];
|
const Amount = FieldDetails?.["Amount"];
|
||||||
const HsnCode = FieldDetails?.["HsnCode"];
|
const HsnCode = FieldDetails?.["HsnCode"];
|
||||||
|
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 GlobaldummyData = useSelector(GlobalPritdummyData);
|
const GlobaldummyData = useSelector(GlobalPritdummyData);
|
||||||
const GlobaltermsAndConditions = useSelector(GlobalprinttermsAndConditions);
|
const GlobaltermsAndConditions = useSelector(GlobalprinttermsAndConditions);
|
||||||
|
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 TermsAndConditions = printDatas?.TermsandConditions
|
let TermsAndConditions = printDatas?.TermsandConditions
|
||||||
|
|
@ -43,32 +69,14 @@ const PurPrintStyle7 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C
|
||||||
let PageSize = printDatas?.PageSize
|
let PageSize = printDatas?.PageSize
|
||||||
const Signature = FieldDetails?.["signature"];
|
const Signature = FieldDetails?.["signature"];
|
||||||
const TermsnAdCondition = FieldDetails?.["terms&conditions"];
|
const TermsnAdCondition = FieldDetails?.["terms&conditions"];
|
||||||
|
|
||||||
|
|
||||||
const keysLength = Object.keys(table2Data ?? {}).length;
|
const keysLength = Object.keys(table2Data ?? {}).length;
|
||||||
if (keysLength > 0) {
|
if (keysLength > 0) {
|
||||||
dispatch(changeReprintDataFound(true));
|
dispatch(changeReprintDataFound(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const TakeawayData = table2Data?.[0]?.ProductDetails
|
const TakeawayData = table2Data?.[0]?.ProductDetails
|
||||||
console.log(TakeawayData, "TakeawayData", table2Data)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let TotalOfferAmount = 0;
|
let TotalOfferAmount = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const chunkSize = PageSize == "A5" ? 8 : 11;
|
const chunkSize = PageSize == "A5" ? 8 : 11;
|
||||||
let dataSource = table2Data?.[0]?.ProductDetails;
|
let dataSource = table2Data?.[0]?.ProductDetails;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Paginate the data
|
// Paginate the data
|
||||||
const paginatedChunks = [];
|
const paginatedChunks = [];
|
||||||
for (let i = 0; i < dataSource?.length; i += chunkSize) {
|
for (let i = 0; i < dataSource?.length; i += chunkSize) {
|
||||||
|
|
@ -76,8 +84,51 @@ const PurPrintStyle7 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C
|
||||||
}
|
}
|
||||||
const lastChunkRows = paginatedChunks.length > 0 ? paginatedChunks[paginatedChunks.length - 1].length : 0;
|
const lastChunkRows = paginatedChunks.length > 0 ? paginatedChunks[paginatedChunks.length - 1].length : 0;
|
||||||
const shouldFooterBeOnNewPage = lastChunkRows > (PageSize == "A5" ? 5 : 10);
|
const shouldFooterBeOnNewPage = lastChunkRows > (PageSize == "A5" ? 5 : 10);
|
||||||
{ console.log(TakeawayData, "TakeawayDataTakeawayData") }
|
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 (
|
||||||
<>
|
<>
|
||||||
|
|
@ -89,13 +140,13 @@ const PurPrintStyle7 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C
|
||||||
|
|
||||||
<div className="header" style={{ position: isMobile ? GlobaldummyData ? "absolute" : "fixed" : "", top: 0, width: "100%" }}>
|
<div className="header" style={{ position: isMobile ? GlobaldummyData ? "absolute" : "fixed" : "", top: 0, width: "100%" }}>
|
||||||
<hr class="star-line" />
|
<hr class="star-line" />
|
||||||
<div className="PrintStyle7-print">
|
<div className="PrintStyle7-print" style={{...headerStyle}}>
|
||||||
<div style={{ fontSize: '16px', fontWeight: '600' }}> { table2Data?.[0]?.BrName}</div>
|
<div style={{ fontSize: '16px', fontWeight: '600' }}> {table2Data?.[0]?.BrName}</div>
|
||||||
<div style={{ fontSize: '10px', fontWeight: '600' }} >{GlobaldummyData ?
|
<div style={{ fontSize: '10px', fontWeight: '600' }} >{GlobaldummyData ?
|
||||||
'BranchAddress, Town- 635XXX City - State' :
|
'BranchAddress, Town- 635XXX City - State' :
|
||||||
(table2Data?.[0]?.AddressDetails?.[0]?.Address1 || '') + (table2Data?.[0]?.AddressDetails?.[0]?.City ? (table2Data?.[0]?.AddressDetails?.[0]?.Address1 && table2Data?.[0]?.AddressDetails?.[0]?.City ? '-' : '') + table2Data?.[0]?.AddressDetails?.[0]?.City : '') + (table2Data?.[0]?.AddressDetails?.[0]?.Zip ? (table2Data?.[0]?.AddressDetails?.[0]?.City && table2Data?.[0]?.AddressDetails?.[0]?.Zip ? '-' : '') + table2Data?.[0]?.AddressDetails?.[0]?.Zip : '')}
|
(table2Data?.[0]?.AddressDetails?.[0]?.Address1 || '') + (table2Data?.[0]?.AddressDetails?.[0]?.City ? (table2Data?.[0]?.AddressDetails?.[0]?.Address1 && table2Data?.[0]?.AddressDetails?.[0]?.City ? '-' : '') + table2Data?.[0]?.AddressDetails?.[0]?.City : '') + (table2Data?.[0]?.AddressDetails?.[0]?.Zip ? (table2Data?.[0]?.AddressDetails?.[0]?.City && table2Data?.[0]?.AddressDetails?.[0]?.Zip ? '-' : '') + table2Data?.[0]?.AddressDetails?.[0]?.Zip : '')}
|
||||||
</div>
|
</div>
|
||||||
{ <div style={{ fontSize: "12px", margin: "2px 0 0 0", textTransform: 'uppercase' }}>{BillName} </div>}
|
{<div style={{ fontSize: "12px", margin: "2px 0 0 0", textTransform: 'uppercase' }}>{BillName} </div>}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr className="PrintStyle7-print-dottline" />
|
<hr className="PrintStyle7-print-dottline" />
|
||||||
|
|
@ -115,7 +166,7 @@ const PurPrintStyle7 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C
|
||||||
<div style={{ marginTop: GlobaldummyData ? "9rem" : "0rem" }} className="print-body">
|
<div style={{ marginTop: GlobaldummyData ? "9rem" : "0rem" }} className="print-body">
|
||||||
<div className="PrintStyle7-print-table" >
|
<div className="PrintStyle7-print-table" >
|
||||||
|
|
||||||
{(TakeawayData?.length > 0 ) &&
|
{(TakeawayData?.length > 0) &&
|
||||||
<>
|
<>
|
||||||
<div className="PrintStyle7-print-tableMaster">
|
<div className="PrintStyle7-print-tableMaster">
|
||||||
|
|
||||||
|
|
@ -123,30 +174,41 @@ const PurPrintStyle7 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C
|
||||||
<table className="PrintStyle7-print-table">
|
<table className="PrintStyle7-print-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
{ SLNO == true && <th style={{ width: '10px', }}>S</th>}
|
{SLNO == true && <th style={{ width: '10px', ...tableHeaderStyle }}>S.No</th>}
|
||||||
{ Item == true && <th>Item</th>}
|
{Item == true && <th style={{ ...tableHeaderStyle }}>Item</th>}
|
||||||
{ HsnCode == true && <th style={{ width: '10px', }}>HSN</th>}
|
{HsnCode == true && <th style={{ width: '10px', ...tableHeaderStyle }}>HSN</th>}
|
||||||
{ Quantity == true && <th style={{ width: '10px', }}>Qty</th>}
|
{Quantity == true && <th style={{ width: '10px', ...tableHeaderStyle }}>Qty</th>}
|
||||||
{GlobaldummyData ? GlobalMRP && <th style={{ width: '10px' }}>MRP</th> : MRP == true && <th style={{ width: '10px' }}>MRP</th>}
|
{GlobaldummyData ? GlobalMRP && <th style={{ width: '10px', ...tableHeaderStyle }}>MRP</th> : MRP == true && <th style={{...tableHeaderStyle, width: '10px' }}>MRP</th>}
|
||||||
{GlobaldummyData ? GlobalRate && <th style={{ width: '10px' }}>Rate</th> : Rate == true && <th style={{ width: '10px' }}>Rate</th>}
|
{GlobaldummyData ? GlobalRate && <th style={{ width: '10px', ...tableHeaderStyle }}>Rate</th> : Rate == true && <th style={{...tableHeaderStyle, width: '10px' }}>Rate</th>}
|
||||||
{ Discount == true && <th style={{ width: '10px' }}>Dis </th>}
|
{Discount == true && <th style={{ width: '10px', ...tableHeaderStyle }}>Dis </th>}
|
||||||
{ Amount == true && <th style={{ width: '10px', textAlign: 'right' }}>Amt</th>}
|
{Amount == true && <th style={{ width: '10px', textAlign: 'right', ...tableHeaderStyle }}>Amt</th>}
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{dataChunk?.map((item, index) => (
|
{dataChunk?.map((item, index) => (
|
||||||
<tr key={index} >
|
<tr key={index}
|
||||||
{ SLNO == true && <td style={{ textAlign: 'center' }}>{chunkIndex * chunkSize + index + 1}</td>}
|
style={
|
||||||
{ Item == true && <td style={{ display: 'flex', flexDirection: 'column' }}>
|
index % 2 !== 1 && rowtypeStyle === "even"
|
||||||
|
? {
|
||||||
|
...tableBodyStyle
|
||||||
|
}
|
||||||
|
: index % 2 === 1 && rowtypeStyle === "odd"
|
||||||
|
? {
|
||||||
|
...tableBodyStyle
|
||||||
|
}
|
||||||
|
: {}
|
||||||
|
}>
|
||||||
|
{SLNO == true && <td style={{ textAlign: 'center' }}>{chunkIndex * chunkSize + index + 1}</td>}
|
||||||
|
{Item == true && <td style={{ display: 'flex', flexDirection: 'column' }}>
|
||||||
<div>{item?.ProdName}</div>
|
<div>{item?.ProdName}</div>
|
||||||
<div>({item?.Size ? item?.Size : "1"} {item?.SinglePc == 'Y' ? 'PCS' : item?.Type != "C" ? item?.UomName : "COMBO"})</div>
|
<div>({item?.Size ? item?.Size : "1"} {item?.SinglePc == 'Y' ? 'PCS' : item?.Type != "C" ? item?.UomName : "COMBO"})</div>
|
||||||
</td>}
|
</td>}
|
||||||
{ HsnCode == true && <td style={{ textAlign: 'center' }}>{item?.HSN}</td>}
|
{HsnCode == true && <td style={{ textAlign: 'center' }}>{item?.HSN}</td>}
|
||||||
{ Quantity == true && <td style={{ textAlign: 'center' }}>{item?.Qty}</td>}
|
{Quantity == true && <td style={{ textAlign: 'center' }}>{item?.Qty}</td>}
|
||||||
{ MRP == true && <td style={{ textAlign: 'right' }}>{item?.SinglePc === 'Y' ? item?.Price : item?.MRP}</td>}
|
{MRP == true && <td style={{ textAlign: 'right' }}>{item?.SinglePc === 'Y' ? item?.Price : item?.MRP}</td>}
|
||||||
{Rate == true && <td style={{ textAlign: 'right' }}>{item?.Price}</td>}
|
{Rate == true && <td style={{ textAlign: 'right' }}>{item?.Price}</td>}
|
||||||
{ Discount == true && <td style={{ textAlign: 'right' }}>{item?.Type != "C" ? item?.OfferAmt || 0 : item?.OfferValue || 0}</td>}
|
{Discount == true && <td style={{ textAlign: 'right' }}>{item?.Type != "C" ? item?.OfferAmt || 0 : item?.OfferValue || 0}</td>}
|
||||||
{ Amount == true && <td style={{ textAlign: 'right' }}>{item?.NetAmt?.toFixed(2)}</td>}
|
{Amount == true && <td style={{ textAlign: 'right' }}>{item?.NetAmt?.toFixed(2)}</td>}
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
))}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
@ -161,10 +223,10 @@ const PurPrintStyle7 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C
|
||||||
{((chunkIndex === paginatedChunks.length - 1) && (!shouldFooterBeOnNewPage)) && FormatTheme &&
|
{((chunkIndex === paginatedChunks.length - 1) && (!shouldFooterBeOnNewPage)) && FormatTheme &&
|
||||||
<>
|
<>
|
||||||
<div className='PrintStyle7-SecondDiv3'>
|
<div className='PrintStyle7-SecondDiv3'>
|
||||||
<div className='PrintStyle7-SecondDivMaster'>
|
<div className='PrintStyle7-SecondDivMaster' style={{ ...netAmountStyle }}>
|
||||||
<div style={{ fontWeight: "600" }}>Items : { totalQuantityFilter?.length}</div>
|
<div style={{ fontWeight: "600" }}>Items : {totalQuantityFilter?.length}</div>
|
||||||
<div style={{ fontWeight: "600" }}>Qty : { totalQuantity}</div>
|
<div style={{ fontWeight: "600" }}>Qty : {totalQuantity}</div>
|
||||||
{(table2Data?.OverallDisc > 0 || TotalOfferAmount > 0) && <div style={{ fontWeight: "600" }}>Off : { Number(TotalOfferAmount + table2Data?.OverallDisc).toFixed(2)}</div>}
|
{(table2Data?.OverallDisc > 0 || TotalOfferAmount > 0) && <div style={{ fontWeight: "600" }}>Off : {Number(TotalOfferAmount + table2Data?.OverallDisc).toFixed(2)}</div>}
|
||||||
</div>
|
</div>
|
||||||
<div style={{ display: 'flex', justifyContent: 'center' }}>
|
<div style={{ display: 'flex', justifyContent: 'center' }}>
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -315,6 +377,7 @@ const PurPrintStyle7 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C
|
||||||
pageBreakBefore: "avoid",
|
pageBreakBefore: "avoid",
|
||||||
pageBreakInside: "avoid",
|
pageBreakInside: "avoid",
|
||||||
minHeight: "auto",
|
minHeight: "auto",
|
||||||
|
...footerColorStyle
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{
|
{
|
||||||
|
|
@ -339,7 +402,7 @@ const PurPrintStyle7 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C
|
||||||
</div>)
|
</div>)
|
||||||
}
|
}
|
||||||
|
|
||||||
{ Signature == true && (<div style={{ display: "flex", flexDirection: "column", alignItems: "center", marginTop: "1rem", paddingBottom: "1rem" }}>
|
{Signature == true && (<div style={{ display: "flex", flexDirection: "column", alignItems: "center", marginTop: "1rem", paddingBottom: "1rem" }}>
|
||||||
<p style={{ fontSize: "13px", fontWeight: "bold", marginBottom: "6px" }}>Signature</p>
|
<p style={{ fontSize: "13px", fontWeight: "bold", marginBottom: "6px" }}>Signature</p>
|
||||||
<img style={{ width: "100px", height: "60px" }} src={SignatureImg} alt="" />
|
<img style={{ width: "100px", height: "60px" }} src={SignatureImg} alt="" />
|
||||||
</div>)}
|
</div>)}
|
||||||
|
|
@ -376,10 +439,10 @@ const PurPrintStyle7 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C
|
||||||
>
|
>
|
||||||
<>
|
<>
|
||||||
<div className='PrintStyle7-SecondDiv3'>
|
<div className='PrintStyle7-SecondDiv3'>
|
||||||
<div className='PrintStyle7-SecondDivMaster'>
|
<div className='PrintStyle7-SecondDivMaster' style={{ ...netAmountStyle }}>
|
||||||
<div style={{ fontWeight: "600" }}>Items : { totalQuantityFilter?.length}</div>
|
<div style={{ fontWeight: "600" }}>Items : {totalQuantityFilter?.length}</div>
|
||||||
<div style={{ fontWeight: "600" }}>Qty : { totalQuantity}</div>
|
<div style={{ fontWeight: "600" }}>Qty : {totalQuantity}</div>
|
||||||
{(table2Data?.OverallDisc > 0 || TotalOfferAmount > 0) && <div style={{ fontWeight: "600" }}>Off : { Number(TotalOfferAmount + table2Data?.OverallDisc).toFixed(2)}</div>}
|
{(table2Data?.OverallDisc > 0 || TotalOfferAmount > 0) && <div style={{ fontWeight: "600" }}>Off : {Number(TotalOfferAmount + table2Data?.OverallDisc).toFixed(2)}</div>}
|
||||||
</div>
|
</div>
|
||||||
<div style={{ display: 'flex', justifyContent: 'center' }}>
|
<div style={{ display: 'flex', justifyContent: 'center' }}>
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -506,7 +569,7 @@ const PurPrintStyle7 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style={{ display: 'flex', justifyContent: 'center', fontSize: '16px', fontWeight: '600' }}>Amount : ₹{ Number(table2Data?.[0]?.NetAmount).toFixed(2)}</div>
|
<div style={{ display: 'flex', justifyContent: 'center', fontSize: '16px', fontWeight: '600' }}>Amount : ₹{Number(table2Data?.[0]?.NetAmount).toFixed(2)}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -519,23 +582,15 @@ const PurPrintStyle7 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C
|
||||||
<div style={{ marginLeft: '13px', padding: 0, fontSize: "8px", fontWeight: "600" }}>Customer : {table2Data?.CustSuppName}</div>
|
<div style={{ marginLeft: '13px', padding: 0, fontSize: "8px", fontWeight: "600" }}>Customer : {table2Data?.CustSuppName}</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div className="page-footerA4Style11"
|
<div className="page-footerA4Style11"
|
||||||
style={{
|
style={{
|
||||||
marginTop: "auto",
|
marginTop: "auto",
|
||||||
pageBreakBefore: "avoid",
|
pageBreakBefore: "avoid",
|
||||||
pageBreakInside: "avoid",
|
pageBreakInside: "avoid",
|
||||||
minHeight: "auto",
|
minHeight: "auto",
|
||||||
|
...footerColorStyle
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div style={{ display: "flex", width: "90%", padding: "0 1rem", justifyContent: GlobaltermsAndConditions ? "space-between" : "flex-end", alignItems: "center" }}>
|
<div style={{ display: "flex", width: "90%", padding: "0 1rem", justifyContent: GlobaltermsAndConditions ? "space-between" : "flex-end", alignItems: "center" }}>
|
||||||
{
|
{
|
||||||
(TermsnAdCondition == true && TermsAndConditions?.length > 0) && (<div style={{ margin: "8px 0", fontFamily: "sans-serif", width: "100%", display: "flex", flexDirection: "column", alignItems: "flex-start" }}>
|
(TermsnAdCondition == true && TermsAndConditions?.length > 0) && (<div style={{ margin: "8px 0", fontFamily: "sans-serif", width: "100%", display: "flex", flexDirection: "column", alignItems: "flex-start" }}>
|
||||||
|
|
@ -549,32 +604,27 @@ const PurPrintStyle7 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C
|
||||||
</div>)
|
</div>)
|
||||||
}
|
}
|
||||||
|
|
||||||
{ Signature == true && (<div style={{ display: "flex", flexDirection: "column", alignItems: "center", marginTop: "1rem", paddingBottom: "1rem" }}>
|
{Signature == true && (<div style={{ display: "flex", flexDirection: "column", alignItems: "center", marginTop: "1rem", paddingBottom: "1rem" }}>
|
||||||
<p style={{ fontSize: "13px", fontWeight: "bold", marginBottom: "6px" }}>Signature</p>
|
<p style={{ fontSize: "13px", fontWeight: "bold", marginBottom: "6px" }}>Signature</p>
|
||||||
<img style={{ width: "100px", height: "60px" }} src={SignatureImg} alt="" />
|
<img style={{ width: "100px", height: "60px" }} src={SignatureImg} alt="" />
|
||||||
</div>)}
|
</div>)}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</>
|
</>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
:
|
:
|
||||||
<div className="PrintStyle7MasterDiv" id={`SQPrintStyle7`} style={{ fontFamily: "'Courier New', Courier, monospace" }}>
|
<div className="PrintStyle7MasterDiv" id={`SQPrintStyle7`} style={{ fontFamily: "'Courier New', Courier, monospace" }}>
|
||||||
<hr class="star-line" />
|
<hr class="star-line" />
|
||||||
<div className="PrintStyle7-print">
|
<div className="PrintStyle7-print" style={{...headerStyle}}>
|
||||||
<div style={{ fontSize: '16px', fontWeight: '600' }}> { table2Data?.[0]?.BrName}</div>
|
<div style={{ fontSize: '16px', fontWeight: '600' }}> {table2Data?.[0]?.BrName}</div>
|
||||||
<div style={{ fontSize: '10px', fontWeight: '600' }} >{
|
<div style={{ fontSize: '10px', fontWeight: '600' }} >{
|
||||||
(table2Data?.[0]?.AddressDetails?.[0]?.Address1 || '') + (table2Data?.[0]?.AddressDetails?.[0]?.City ? (table2Data?.[0]?.AddressDetails?.[0]?.Address1 && table2Data?.[0]?.AddressDetails?.[0]?.City ? '-' : '') + table2Data?.[0]?.AddressDetails?.[0]?.City : '') + (table2Data?.[0]?.AddressDetails?.[0]?.Zip ? (table2Data?.[0]?.AddressDetails?.[0]?.City && table2Data?.[0]?.AddressDetails?.[0]?.Zip ? '-' : '') + table2Data?.[0]?.AddressDetails?.[0]?.Zip : '')}
|
(table2Data?.[0]?.AddressDetails?.[0]?.Address1 || '') + (table2Data?.[0]?.AddressDetails?.[0]?.City ? (table2Data?.[0]?.AddressDetails?.[0]?.Address1 && table2Data?.[0]?.AddressDetails?.[0]?.City ? '-' : '') + table2Data?.[0]?.AddressDetails?.[0]?.City : '') + (table2Data?.[0]?.AddressDetails?.[0]?.Zip ? (table2Data?.[0]?.AddressDetails?.[0]?.City && table2Data?.[0]?.AddressDetails?.[0]?.Zip ? '-' : '') + table2Data?.[0]?.AddressDetails?.[0]?.Zip : '')}
|
||||||
</div>
|
</div>
|
||||||
{ <div style={{ fontSize: "12px", margin: "2px 0 0 0", textTransform: 'uppercase' }}>{BillName} </div>}
|
{<div style={{ fontSize: "12px", margin: "2px 0 0 0", textTransform: 'uppercase' }}>{BillName} </div>}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr className="PrintStyle7-print-dottline" />
|
<hr className="PrintStyle7-print-dottline" />
|
||||||
|
|
@ -604,30 +654,41 @@ const PurPrintStyle7 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C
|
||||||
<table className="PrintStyle7-print-table">
|
<table className="PrintStyle7-print-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
{ SLNO == true && <th style={{ width: '10px', }}>S</th>}
|
{SLNO == true && <th style={{ width: '10px', ...tableHeaderStyle }}>S.No</th>}
|
||||||
{ Item == true && <th>Item</th>}
|
{Item == true && <th style={{ ...tableHeaderStyle }}>Item</th>}
|
||||||
{ HsnCode == true && <th style={{ width: '10px', }}>HSN</th>}
|
{HsnCode == true && <th style={{ width: '10px', ...tableHeaderStyle }}>HSN</th>}
|
||||||
{ Quantity == true && <th style={{ width: '10px', }}>Qty</th>}
|
{Quantity == true && <th style={{ width: '10px', ...tableHeaderStyle }}>Qty</th>}
|
||||||
{ MRP == true && <th style={{ width: '10px' }}>MRP</th>}
|
{MRP == true && <th style={{ width: '10px', ...tableHeaderStyle }}>MRP</th>}
|
||||||
{ Rate == true && <th style={{ width: '10px' }}>Rate</th>}
|
{Rate == true && <th style={{ width: '10px', ...tableHeaderStyle }}>Rate</th>}
|
||||||
{ Discount == true && <th style={{ width: '10px' }}>Dis </th>}
|
{Discount == true && <th style={{ width: '10px', ...tableHeaderStyle }}>Dis </th>}
|
||||||
{ Amount == true && <th style={{ width: '10px', textAlign: 'right' }}>Amt</th>}
|
{Amount == true && <th style={{ width: '10px', textAlign: 'right', ...tableHeaderStyle }}>Amt</th>}
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{(GlobaldummyData ? products : TakeawayData)?.map((item, index) => (
|
{(GlobaldummyData ? products : TakeawayData)?.map((item, index) => (
|
||||||
<tr key={index} >
|
<tr key={index}
|
||||||
{ SLNO == true && <td style={{ textAlign: 'center' }}>{index + 1}</td>}
|
style={
|
||||||
{ Item == true && <td style={{ display: 'flex', flexDirection: 'column' }}>
|
index % 2 !== 1 && rowtypeStyle === "even"
|
||||||
|
? {
|
||||||
|
...tableBodyStyle
|
||||||
|
}
|
||||||
|
: index % 2 === 1 && rowtypeStyle === "odd"
|
||||||
|
? {
|
||||||
|
...tableBodyStyle
|
||||||
|
}
|
||||||
|
: {}
|
||||||
|
}>
|
||||||
|
{SLNO == true && <td style={{ textAlign: 'center' }}>{index + 1}</td>}
|
||||||
|
{Item == true && <td style={{ display: 'flex', flexDirection: 'column' }}>
|
||||||
<div>{item?.ProdName}</div>
|
<div>{item?.ProdName}</div>
|
||||||
<div>({item?.Size ? item?.Size : "1"} {item?.SinglePc == 'Y' ? 'PCS' : item?.Type != "C" ? item?.UomName : "COMBO"})</div>
|
<div>({item?.Size ? item?.Size : "1"} {item?.SinglePc == 'Y' ? 'PCS' : item?.Type != "C" ? item?.UomName : "COMBO"})</div>
|
||||||
</td>}
|
</td>}
|
||||||
{ HsnCode == true && <td style={{ textAlign: 'center' }}>{item?.HSN}</td>}
|
{HsnCode == true && <td style={{ textAlign: 'center' }}>{item?.HSN}</td>}
|
||||||
{ Quantity == true && <td style={{ textAlign: 'center' }}>{item?.Qty}</td>}
|
{Quantity == true && <td style={{ textAlign: 'center' }}>{item?.Qty}</td>}
|
||||||
{ MRP == true && <td style={{ textAlign: 'right' }}>{item?.SinglePc === 'Y' ? item?.Price : item?.MRP}</td>}
|
{MRP == true && <td style={{ textAlign: 'right' }}>{item?.SinglePc === 'Y' ? item?.Price : item?.MRP}</td>}
|
||||||
{Rate == true && <td style={{ textAlign: 'right' }}>{item?.Price}</td>}
|
{Rate == true && <td style={{ textAlign: 'right' }}>{item?.Price}</td>}
|
||||||
{ Discount == true && <td style={{ textAlign: 'right' }}>{item?.Type != "C" ? item?.OfferAmt || 0 : item?.OfferValue || 0}</td>}
|
{Discount == true && <td style={{ textAlign: 'right' }}>{item?.Type != "C" ? item?.OfferAmt || 0 : item?.OfferValue || 0}</td>}
|
||||||
{ Amount == true && <td style={{ textAlign: 'right' }}>{item?.NetAmt?.toFixed(2)}</td>}
|
{Amount == true && <td style={{ textAlign: 'right' }}>{item?.NetAmt?.toFixed(2)}</td>}
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
))}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
@ -638,10 +699,10 @@ const PurPrintStyle7 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='PrintStyle7-SecondDiv3'>
|
<div className='PrintStyle7-SecondDiv3'>
|
||||||
<div className='PrintStyle7-SecondDivMaster'>
|
<div className='PrintStyle7-SecondDivMaster' style={{ ...netAmountStyle }}>
|
||||||
<div style={{ fontWeight: "600" }}>Items : { totalQuantityFilter?.length}</div>
|
<div style={{ fontWeight: "600" }}>Items : {totalQuantityFilter?.length}</div>
|
||||||
<div style={{ fontWeight: "600" }}>Qty : { totalQuantity}</div>
|
<div style={{ fontWeight: "600" }}>Qty : {totalQuantity}</div>
|
||||||
{(table2Data?.OverallDisc > 0 || TotalOfferAmount > 0) && <div style={{ fontWeight: "600" }}>Off : { Number(TotalOfferAmount + table2Data?.OverallDisc).toFixed(2)}</div>}
|
{(table2Data?.OverallDisc > 0 || TotalOfferAmount > 0) && <div style={{ fontWeight: "600" }}>Off : {Number(TotalOfferAmount + table2Data?.OverallDisc).toFixed(2)}</div>}
|
||||||
</div>
|
</div>
|
||||||
<div style={{ display: 'flex', justifyContent: 'center' }}>
|
<div style={{ display: 'flex', justifyContent: 'center' }}>
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -768,7 +829,7 @@ const PurPrintStyle7 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style={{ display: 'flex', justifyContent: 'center', fontSize: '16px', fontWeight: '600' }}>Amount : ₹{ Number(table2Data?.[0]?.NetAmount).toFixed(2)}</div>
|
<div style={{ display: 'flex', justifyContent: 'center', fontSize: '16px', fontWeight: '600' }}>Amount : ₹{Number(table2Data?.[0]?.NetAmount).toFixed(2)}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -791,6 +852,7 @@ const PurPrintStyle7 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, C
|
||||||
pageBreakBefore: "avoid",
|
pageBreakBefore: "avoid",
|
||||||
pageBreakInside: "avoid",
|
pageBreakInside: "avoid",
|
||||||
minHeight: "auto",
|
minHeight: "auto",
|
||||||
|
...footerColorStyle
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue