Merge branch 'feature/fixing-print-layout' into develop
This commit is contained in:
@@ -45,7 +45,8 @@ export const fetchBarcodeDataForPrint = withUser(async (user: AuthenticatedUser,
|
|||||||
bills: 1,
|
bills: 1,
|
||||||
barcodeImage: 1,
|
barcodeImage: 1,
|
||||||
hub3aText: 1,
|
hub3aText: 1,
|
||||||
payedAmount: 1
|
payedAmount: 1,
|
||||||
|
paid: 1
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.toArray();
|
.toArray();
|
||||||
@@ -55,11 +56,8 @@ export const fetchBarcodeDataForPrint = withUser(async (user: AuthenticatedUser,
|
|||||||
|
|
||||||
for (const location of locations) {
|
for (const location of locations) {
|
||||||
for (const bill of location.bills) {
|
for (const bill of location.bills) {
|
||||||
// Only include bills that have barcode images
|
// Only include bills that have barcode images and are NOT PAID
|
||||||
if ( ( bill.hub3aText && bill.hub3aText.trim() !== "") ||
|
if ( ( bill.hub3aText && bill.hub3aText.trim() !== "" && !bill.paid) ) {
|
||||||
// LEGACY SUPPORT ... untill all bills have been migrated
|
|
||||||
(bill.barcodeImage && bill.barcodeImage.trim() !== "")
|
|
||||||
) {
|
|
||||||
printData.push({
|
printData.push({
|
||||||
locationName: location.name,
|
locationName: location.name,
|
||||||
billName: bill.name,
|
billName: bill.name,
|
||||||
|
|||||||
@@ -24,6 +24,12 @@ export const PrintPreview: React.FC<PrintPreviewProps> = ({ data, year, month, t
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* Print-specific CSS styles */}
|
{/* Print-specific CSS styles */}
|
||||||
|
<style jsx global>{`
|
||||||
|
html {
|
||||||
|
background-color: white !important;
|
||||||
|
color-scheme: light !important;
|
||||||
|
}
|
||||||
|
`}</style>
|
||||||
<style jsx>{`
|
<style jsx>{`
|
||||||
@media print {
|
@media print {
|
||||||
@page {
|
@page {
|
||||||
@@ -132,7 +138,7 @@ export const PrintPreview: React.FC<PrintPreviewProps> = ({ data, year, month, t
|
|||||||
<td className="border-2 border-gray-800 px-3 py-1.5 text-center">
|
<td className="border-2 border-gray-800 px-3 py-1.5 text-center">
|
||||||
<div className="flex justify-center items-center">
|
<div className="flex justify-center items-center">
|
||||||
{
|
{
|
||||||
item.hub3aText ? <Pdf417Barcode hub3aText={item.hub3aText} /> : null
|
item.hub3aText ? <Pdf417Barcode hub3aText={item.hub3aText} className="print:m-[5em_auto]" /> : null
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user