Implement dynamic header and table color functionality
This commit is contained in:
parent
12509a49fd
commit
487742bbd4
|
|
@ -4,7 +4,19 @@ 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/PrintStyle8.scss';
|
import '../../../Styles/BookingScreen/PrintTemplates/ThermalPrinter/PrintStyle8.scss';
|
||||||
import { extractLastNumber } from "../../../Services/Others";
|
import { extractLastNumber } from "../../../Services/Others";
|
||||||
|
|
@ -27,11 +39,26 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
|
||||||
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
|
||||||
let SignatureImg = printDatas?.Signature
|
let SignatureImg = printDatas?.Signature
|
||||||
|
|
@ -74,7 +101,51 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
|
||||||
}
|
}
|
||||||
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 : 13);
|
const shouldFooterBeOnNewPage = lastChunkRows > (PageSize == "A5" ? 5 : 13);
|
||||||
|
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 (
|
||||||
<>
|
<>
|
||||||
|
|
@ -85,8 +156,8 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
|
||||||
|
|
||||||
|
|
||||||
{/* <div className="header" style={{ position: "fixed", top: 0, width: "100%" }}> */}
|
{/* <div className="header" style={{ position: "fixed", top: 0, width: "100%" }}> */}
|
||||||
<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%" }}>
|
||||||
<div className='PrintStyle8-fistDiv' style={{}} >
|
<div className='PrintStyle8-fistDiv' style={{ ...headerStyle }} >
|
||||||
{/* <h3>{table2Data?.[0]?.BrName}</h3> */}
|
{/* <h3>{table2Data?.[0]?.BrName}</h3> */}
|
||||||
<div style={{ fontSize: "clamp(1.25rem, 2.5vw, 1.75rem)", fontWeight: '600', }} >{table2Data?.[0]?.BrName}</div>
|
<div style={{ fontSize: "clamp(1.25rem, 2.5vw, 1.75rem)", fontWeight: '600', }} >{table2Data?.[0]?.BrName}</div>
|
||||||
<div className='PrintStyle8-BrAddress' style={{ fontSize: "clamp(0.63rem, 2.5vw, 1.2rem)" }}>
|
<div className='PrintStyle8-BrAddress' style={{ fontSize: "clamp(0.63rem, 2.5vw, 1.2rem)" }}>
|
||||||
|
|
@ -94,21 +165,19 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
|
||||||
(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 className='PrintStyle8-BrAddress' style={{ fontSize: "clamp(0.63rem, 2.5vw, 1.2rem)" }}>
|
<div className='PrintStyle8-BrAddress' style={{ fontSize: "clamp(0.63rem, 2.5vw, 1.2rem)" }}>
|
||||||
Mobile : +91 {GlobaldummyData ? '986XXXXXXX' : table2Data?.[0]?.BrMobile}</div>
|
Mobile : +91 {GlobaldummyData ? '986XXXXXXX' : table2Data?.[0]?.BrMobile}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{<div className='PrintStyle4-FourthSpan' style={{ textTransform: 'uppercase', fontWeight: '600' }}>
|
{<div className='PrintStyle4-FourthSpan' style={{ textTransform: 'uppercase', fontWeight: '600' }}>{BillName}</div>}
|
||||||
{BillName}</div>}
|
|
||||||
|
|
||||||
<div className='PrintStyle8-SecondDiv'>
|
<div className='PrintStyle8-SecondDiv'>
|
||||||
<div style={{ fontWeight: '600' }}>Bill No :{table2Data?.[0]?.QuotationNo && extractLastNumber(table2Data?.[0]?.QuotationNo)}</div>
|
<div style={{ fontWeight: '600' }}>Bill No :{table2Data?.[0]?.QuotationNo && extractLastNumber(table2Data?.[0]?.QuotationNo)}</div>
|
||||||
<div style={{ fontSize: "clamp(0.63rem, 2.5vw, 1.2rem)" }}>{ Date1}</div>
|
<div style={{ fontSize: "clamp(0.63rem, 2.5vw, 1.2rem)" }}>{Date1}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr className="PrintStyle8-print-dottline" />
|
<hr className="PrintStyle8-print-dottline" />
|
||||||
</div>
|
</div>
|
||||||
<div style={{ marginTop: "0rem" }} className="print-body">
|
<div style={{ marginTop: "0rem" }} className="print-body">
|
||||||
{(TakeawayData?.length > 0) &&
|
{(TakeawayData?.length > 0) &&
|
||||||
<>
|
<>
|
||||||
|
|
||||||
|
|
@ -116,32 +185,43 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
|
||||||
<table className="PrintStyle8-print-table">
|
<table className="PrintStyle8-print-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
{SLNO && <th style={{ width: "10px", textAlign: "center" }}>S.No</th>}
|
{SLNO && <th style={{ width: "10px", textAlign: "center", ...tableHeaderStyle }}>S.No</th>}
|
||||||
{Item && <th>Des</th>}
|
{Item && <th style={{ ...tableHeaderStyle }}>Des</th>}
|
||||||
{HsnCode && <th style={{ width: "10px", textAlign: "right" }}>HSN</th>}
|
{HsnCode && <th style={{ width: "10px", textAlign: "right", ...tableHeaderStyle }}>HSN</th>}
|
||||||
{MRP && <th style={{ width: "10px", textAlign: "right" }}>MRP</th>}
|
{MRP && <th style={{ width: "10px", textAlign: "right", ...tableHeaderStyle }}>MRP</th>}
|
||||||
{Rate && <th style={{ width: "10px", textAlign: "right" }}>Rt</th>}
|
{Rate && <th style={{ width: "10px", textAlign: "right", ...tableHeaderStyle }}>Rt</th>}
|
||||||
{
|
{
|
||||||
Discount && <th style={{ width: "10px", textAlign: "right" }}>(%)</th>}
|
Discount && <th style={{ width: "10px", textAlign: "right", ...tableHeaderStyle }}>(%)</th>}
|
||||||
{Quantity && <th style={{ width: "10px", textAlign: "right" }}>Qty</th>}
|
{Quantity && <th style={{ width: "10px", textAlign: "right", ...tableHeaderStyle }}>Qty</th>}
|
||||||
{Amount && <th style={{ width: "10px", textAlign: "right" }}>Amt</th>}
|
{Amount && <th style={{ width: "10px", textAlign: "right", ...tableHeaderStyle }}>Amt</th>}
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{dataChunk?.map((item, index) => {
|
{dataChunk?.map((item, index) => {
|
||||||
return (
|
return (
|
||||||
<tr key={index}>
|
<tr key={index}
|
||||||
{ SLNO && <td style={{ textAlign: 'center' }}>{chunkIndex * chunkSize + index + 1}</td>}
|
style={
|
||||||
|
index % 2 !== 1 && rowtypeStyle === "even"
|
||||||
|
? {
|
||||||
|
...tableBodyStyle
|
||||||
|
}
|
||||||
|
: index % 2 === 1 && rowtypeStyle === "odd"
|
||||||
|
? {
|
||||||
|
...tableBodyStyle
|
||||||
|
}
|
||||||
|
: {}
|
||||||
|
}>
|
||||||
|
{SLNO && <td style={{ textAlign: 'center' }}>{chunkIndex * chunkSize + index + 1}</td>}
|
||||||
{Item && <td style={{ display: 'flex', flexDirection: 'column' }}>
|
{Item && <td style={{ display: 'flex', flexDirection: 'column' }}>
|
||||||
<div>{item?.ProdName}</div>
|
<div>{item?.ProdName}</div>
|
||||||
<div>({ item?.Type != "C" ? item?.UomName : "COMBO"})</div>
|
<div>({item?.Type != "C" ? item?.UomName : "COMBO"})</div>
|
||||||
</td>}
|
</td>}
|
||||||
{ HsnCode && <td>{item?.HSN}</td>}
|
{HsnCode && <td>{item?.HSN}</td>}
|
||||||
{ MRP && <td style={{ textAlign: 'right' }}>{item?.SinglePc === 'Y' ? item?.Price : item?.MRP}</td>}
|
{MRP && <td style={{ textAlign: 'right' }}>{item?.SinglePc === 'Y' ? item?.Price : item?.MRP}</td>}
|
||||||
{ Rate && <td style={{ textAlign: 'right' }}>{item?.Price}</td>}
|
{Rate && <td style={{ textAlign: 'right' }}>{item?.Price}</td>}
|
||||||
{ Discount && <td style={{ textAlign: 'right' }}>{item?.Type != "C" ? item?.OfferAmt || 0 : item?.OfferValue || 0}</td>}
|
{Discount && <td style={{ textAlign: 'right' }}>{item?.Type != "C" ? item?.OfferAmt || 0 : item?.OfferValue || 0}</td>}
|
||||||
{ Quantity && <td style={{ textAlign: 'right' }}>{item?.Qty}</td>}
|
{Quantity && <td style={{ textAlign: 'right' }}>{item?.Qty}</td>}
|
||||||
{ Amount && <td style={{ width: "10px", textAlign: 'right' }}>{(table2Data?.[0]?.NetAmount).toFixed(2)}</td>}
|
{Amount && <td style={{ width: "10px", textAlign: 'right' }}>{(table2Data?.[0]?.NetAmount).toFixed(2)}</td>}
|
||||||
</tr>
|
</tr>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
|
|
@ -157,7 +237,7 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
|
||||||
|
|
||||||
<>
|
<>
|
||||||
<hr className="PrintStyle8-print-dottline" />
|
<hr className="PrintStyle8-print-dottline" />
|
||||||
<div style={{ fontSize: "12px" }}>
|
<div style={{ fontSize: "12px",...netAmountStyle }}>
|
||||||
<div style={{ display: "flex", justifyContent: "space-between" }}>
|
<div style={{ display: "flex", justifyContent: "space-between" }}>
|
||||||
<div style={{ width: '40%' }}>Items </div>
|
<div style={{ width: '40%' }}>Items </div>
|
||||||
<div> : </div>
|
<div> : </div>
|
||||||
|
|
@ -311,12 +391,12 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div className='PrintStyle8-Qr-Order'>
|
<div className='PrintStyle8-Qr-Order'>
|
||||||
|
|
||||||
<div className='PrintStyle8-OrderNo'>
|
<div className='PrintStyle8-OrderNo'>
|
||||||
|
|
||||||
{table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData &&
|
{table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData &&
|
||||||
<div style={{ marginLeft: '14px', padding: 0, fontSize: "12px", fontWeight: "600" }}>Customer : {table2Data?.CustSuppName}
|
<div style={{ marginLeft: '14px', padding: 0, fontSize: "12px", fontWeight: "600" }}>Customer : {table2Data?.CustSuppName}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -325,7 +405,7 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -335,8 +415,8 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
|
||||||
pageBreakBefore: "avoid",
|
pageBreakBefore: "avoid",
|
||||||
pageBreakInside: "avoid",
|
pageBreakInside: "avoid",
|
||||||
minHeight: "auto",
|
minHeight: "auto",
|
||||||
}}
|
...footerColorStyle
|
||||||
>
|
}} >
|
||||||
{
|
{
|
||||||
Notestext && (<div>
|
Notestext && (<div>
|
||||||
<p style={{ padding: "0rem 1rem" }}>{Notestext}</p>
|
<p style={{ padding: "0rem 1rem" }}>{Notestext}</p>
|
||||||
|
|
@ -344,8 +424,6 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
|
||||||
<hr className="PrintA4Style11-print-dottline" />
|
<hr className="PrintA4Style11-print-dottline" />
|
||||||
</div>)
|
</div>)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
<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" }}>
|
||||||
|
|
@ -359,16 +437,13 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
|
||||||
</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>
|
||||||
|
|
@ -395,7 +470,7 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
|
||||||
>
|
>
|
||||||
<>
|
<>
|
||||||
<hr className="PrintStyle8-print-dottline" />
|
<hr className="PrintStyle8-print-dottline" />
|
||||||
<div style={{ fontSize: "12px" }}>
|
<div style={{ fontSize: "12px",...netAmountStyle }}>
|
||||||
<div style={{ display: "flex", justifyContent: "space-between" }}>
|
<div style={{ display: "flex", justifyContent: "space-between" }}>
|
||||||
<div style={{ width: '40%' }}>Items </div>
|
<div style={{ width: '40%' }}>Items </div>
|
||||||
<div> : </div>
|
<div> : </div>
|
||||||
|
|
@ -549,18 +624,18 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div className='PrintStyle8-Qr-Order'>
|
<div className='PrintStyle8-Qr-Order'>
|
||||||
|
|
||||||
<div className='PrintStyle8-OrderNo'>
|
<div className='PrintStyle8-OrderNo'>
|
||||||
|
|
||||||
|
|
||||||
{CashierName && CashierName !== undefined && CashierName !== null && !GlobaldummyData &&
|
{CashierName && CashierName !== undefined && CashierName !== null && !GlobaldummyData &&
|
||||||
<div style={{ marginLeft: '14px', padding: 0, fontSize: "12px", fontWeight: "600" }}>Cashier : {CashierName}
|
<div style={{ marginLeft: '14px', padding: 0, fontSize: "12px", fontWeight: "600" }}>Cashier : {CashierName}
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
{table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData &&
|
{table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData &&
|
||||||
<div style={{ marginLeft: '14px', padding: 0, fontSize: "12px", fontWeight: "600" }}>Customer : {table2Data?.CustSuppName}
|
<div style={{ marginLeft: '14px', padding: 0, fontSize: "12px", fontWeight: "600" }}>Customer : {table2Data?.CustSuppName}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -576,6 +651,7 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
|
||||||
pageBreakBefore: "avoid",
|
pageBreakBefore: "avoid",
|
||||||
pageBreakInside: "avoid",
|
pageBreakInside: "avoid",
|
||||||
minHeight: "auto",
|
minHeight: "auto",
|
||||||
|
...footerColorStyle
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{
|
{
|
||||||
|
|
@ -600,7 +676,7 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
|
||||||
</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>)}
|
||||||
|
|
@ -609,7 +685,7 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</>
|
</>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -618,7 +694,7 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
|
||||||
</div>
|
</div>
|
||||||
:
|
:
|
||||||
<div id={`SQPrintStyle8`} className='PrintStyle8MasterDiv' style={{ fontFamily: "'Courier New', Courier, monospace" }}>
|
<div id={`SQPrintStyle8`} className='PrintStyle8MasterDiv' style={{ fontFamily: "'Courier New', Courier, monospace" }}>
|
||||||
<div className='PrintStyle8-fistDiv' style={{}} >
|
<div className='PrintStyle8-fistDiv' style={{ headerStyle }} >
|
||||||
{/* <h3>{table2Data?.[0]?.BrName}</h3> */}
|
{/* <h3>{table2Data?.[0]?.BrName}</h3> */}
|
||||||
<div style={{ fontSize: "clamp(1.25rem, 2.5vw, 1.75rem)", fontWeight: '600', }} >{GlobaldummyData ? 'XYZ Shop' : table2Data?.[0]?.BrName}</div>
|
<div style={{ fontSize: "clamp(1.25rem, 2.5vw, 1.75rem)", fontWeight: '600', }} >{GlobaldummyData ? 'XYZ Shop' : table2Data?.[0]?.BrName}</div>
|
||||||
<div className='PrintStyle8-BrAddress' style={{ fontSize: "clamp(0.63rem, 2.5vw, 1.2rem)" }}>
|
<div className='PrintStyle8-BrAddress' style={{ fontSize: "clamp(0.63rem, 2.5vw, 1.2rem)" }}>
|
||||||
|
|
@ -626,18 +702,18 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
|
||||||
'BranchAddress, Town- 635XXX City - State' :
|
'BranchAddress, Town- 635XXX City - State' :
|
||||||
(BranchAddress || '') + (BranchCity ? (BranchAddress && BranchCity ? '-' : '') + BranchCity : '') + (BranchZip ? (BranchCity && BranchZip ? '-' : '') + BranchZip : '')}
|
(BranchAddress || '') + (BranchCity ? (BranchAddress && BranchCity ? '-' : '') + BranchCity : '') + (BranchZip ? (BranchCity && BranchZip ? '-' : '') + BranchZip : '')}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='PrintStyle8-BrAddress' style={{ fontSize: "clamp(0.63rem, 2.5vw, 1.2rem)" }}> Mobile : +91 {GlobaldummyData ? '986XXXXXXX' : table2Data?.[0]?.BrMobile}</div>
|
<div className='PrintStyle8-BrAddress' style={{ fontSize: "clamp(0.63rem, 2.5vw, 1.2rem)" }}> Mobile : +91 {GlobaldummyData ? '986XXXXXXX' : table2Data?.[0]?.BrMobile}</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div className='PrintStyle4-FourthSpan' style={{ textTransform: 'uppercase', fontWeight: '600' }}>
|
<div className='PrintStyle4-FourthSpan' style={{ textTransform: 'uppercase', fontWeight: '600' }}>
|
||||||
{BillName}</div>
|
{BillName}</div>
|
||||||
|
|
||||||
|
|
||||||
<div className='PrintStyle8-SecondDiv'>
|
<div className='PrintStyle8-SecondDiv'>
|
||||||
<div style={{ fontWeight: '600' }}>Bill No :{
|
<div style={{ fontWeight: '600' }}>Bill No :{
|
||||||
table2Data?.[0]?.QuotationNo && extractLastNumber(table2Data?.[0]?.QuotationNo)}</div>
|
table2Data?.[0]?.QuotationNo && extractLastNumber(table2Data?.[0]?.QuotationNo)}</div>
|
||||||
<div style={{ fontSize: "clamp(0.63rem, 2.5vw, 1.2rem)" }}>{ Date1}</div>
|
<div style={{ fontSize: "clamp(0.63rem, 2.5vw, 1.2rem)" }}>{Date1}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr className="PrintStyle8-print-dottline" />
|
<hr className="PrintStyle8-print-dottline" />
|
||||||
|
|
@ -648,22 +724,33 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
|
||||||
<table className="PrintStyle8-print-table">
|
<table className="PrintStyle8-print-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
{SLNO && <th style={{ width: "10px", textAlign: "center" }}>S.No</th>}
|
{SLNO && <th style={{ ...tableHeaderStyle, width: "10px", textAlign: "center" }}>S.No</th>}
|
||||||
{Item && <th>Des</th>}
|
{Item && <th style={{ ...tableHeaderStyle }}>Des</th>}
|
||||||
{HsnCode && <th style={{ width: "10px", textAlign: "right" }}>HSN</th>}
|
{HsnCode && <th style={{ ...tableHeaderStyle, width: "10px", textAlign: "right" }}>HSN</th>}
|
||||||
{MRP && <th style={{ width: "10px", textAlign: "right" }}>MRP</th>}
|
{MRP && <th style={{ ...tableHeaderStyle, width: "10px", textAlign: "right" }}>MRP</th>}
|
||||||
{Rate && <th style={{ width: "10px", textAlign: "right" }}>Rt</th>}
|
{Rate && <th style={{ ...tableHeaderStyle, width: "10px", textAlign: "right" }}>Rt</th>}
|
||||||
{Discount && <th style={{ width: "10px", textAlign: "right" }}>(%)</th>}
|
{Discount && <th style={{ ...tableHeaderStyle, width: "10px", textAlign: "right" }}>(%)</th>}
|
||||||
{Quantity && <th style={{ width: "10px", textAlign: "right" }}>Qty</th>}
|
{Quantity && <th style={{ ...tableHeaderStyle, width: "10px", textAlign: "right" }}>Qty</th>}
|
||||||
{Amount && <th style={{ width: "10px", textAlign: "right" }}>Amt</th>}
|
{Amount && <th style={{ ...tableHeaderStyle, width: "10px", textAlign: "right" }}>Amt</th>}
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{(TakeawayData)?.map((item, index) => {
|
{(TakeawayData)?.map((item, index) => {
|
||||||
return (
|
return (
|
||||||
<tr key={index}>
|
<tr key={index}
|
||||||
{ SLNO && <td style={{ textAlign: 'center' }}>{index + 1}</td>}
|
style={
|
||||||
{ Item && <td style={{ display: 'flex', flexDirection: 'column' }}>
|
index % 2 !== 1 && rowtypeStyle === "even"
|
||||||
|
? {
|
||||||
|
...tableBodyStyle
|
||||||
|
}
|
||||||
|
: index % 2 === 1 && rowtypeStyle === "odd"
|
||||||
|
? {
|
||||||
|
...tableBodyStyle
|
||||||
|
}
|
||||||
|
: {}
|
||||||
|
}>
|
||||||
|
{SLNO && <td style={{ textAlign: 'center' }}>{index + 1}</td>}
|
||||||
|
{Item && <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>}
|
||||||
|
|
@ -683,7 +770,7 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
|
||||||
}
|
}
|
||||||
|
|
||||||
<hr className="PrintStyle8-print-dottline" />
|
<hr className="PrintStyle8-print-dottline" />
|
||||||
<div style={{ fontSize: "12px" }}>
|
<div style={{ fontSize: "12px",...netAmountStyle }}>
|
||||||
<div style={{ display: "flex", justifyContent: "space-between" }}>
|
<div style={{ display: "flex", justifyContent: "space-between" }}>
|
||||||
<div style={{ width: '40%' }}>Items </div>
|
<div style={{ width: '40%' }}>Items </div>
|
||||||
<div> : </div>
|
<div> : </div>
|
||||||
|
|
@ -692,7 +779,7 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
|
||||||
<div style={{ display: "flex", justifyContent: "space-between" }}>
|
<div style={{ display: "flex", justifyContent: "space-between" }}>
|
||||||
<div style={{ width: '40%' }}>Qty </div>
|
<div style={{ width: '40%' }}>Qty </div>
|
||||||
<div> : </div>
|
<div> : </div>
|
||||||
<div style={{ padding: '0rem 1rem', width: '40%', textAlign: 'right' }} >{ totalQuantity}</div>
|
<div style={{ padding: '0rem 1rem', width: '40%', textAlign: 'right' }} >{totalQuantity}</div>
|
||||||
</div>
|
</div>
|
||||||
{(table2Data?.OverallDisc > 0 || TotalOfferAmount > 0) &&
|
{(table2Data?.OverallDisc > 0 || TotalOfferAmount > 0) &&
|
||||||
<div style={{ display: "flex", justifyContent: "space-between" }}>
|
<div style={{ display: "flex", justifyContent: "space-between" }}>
|
||||||
|
|
@ -706,7 +793,7 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
|
||||||
<div style={{ display: "flex", justifyContent: "space-between" }}>
|
<div style={{ display: "flex", justifyContent: "space-between" }}>
|
||||||
<div style={{ width: '40%' }}>Amount</div>
|
<div style={{ width: '40%' }}>Amount</div>
|
||||||
<div> : </div>
|
<div> : </div>
|
||||||
<div style={{ padding: '0rem 1rem', width: '40%', textAlign: 'right' }}>{ Number(table2Data?.[0]?.NetAmount).toFixed(2)}</div>
|
<div style={{ padding: '0rem 1rem', width: '40%', textAlign: 'right' }}>{Number(table2Data?.[0]?.NetAmount).toFixed(2)}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -845,7 +932,7 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
|
||||||
<div className='PrintStyle8-Qr-Order'>
|
<div className='PrintStyle8-Qr-Order'>
|
||||||
|
|
||||||
<div className='PrintStyle8-OrderNo'>
|
<div className='PrintStyle8-OrderNo'>
|
||||||
|
|
||||||
{table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData &&
|
{table2Data?.CustSuppName && table2Data?.CustSuppName !== undefined && table2Data?.CustSuppName !== null && !GlobaldummyData &&
|
||||||
<div style={{ marginLeft: '14px', padding: 0, fontSize: "12px", fontWeight: "600" }}>Customer : {table2Data?.CustSuppName}
|
<div style={{ marginLeft: '14px', padding: 0, fontSize: "12px", fontWeight: "600" }}>Customer : {table2Data?.CustSuppName}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -854,7 +941,7 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -864,6 +951,7 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
|
||||||
pageBreakBefore: "avoid",
|
pageBreakBefore: "avoid",
|
||||||
pageBreakInside: "avoid",
|
pageBreakInside: "avoid",
|
||||||
minHeight: "auto",
|
minHeight: "auto",
|
||||||
|
...footerColorStyle
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{
|
{
|
||||||
|
|
@ -888,7 +976,7 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
|
||||||
</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>)}
|
||||||
|
|
@ -897,7 +985,7 @@ const PurPrintstyle8 = ({ index, ExtraChargeTotal, Date1, totalQuantityFilter, B
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue