changed 50 sku and page zoomed out
This commit is contained in:
parent
513e833ead
commit
ab626fb506
@ -272,4 +272,4 @@ export const HIDDEN_FORM_FIELDS = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
export const LOOKUP_RECORD_LIMIT = 200;
|
export const LOOKUP_RECORD_LIMIT = 200;
|
||||||
export const MAX_SKUS_PER_CHUNK = 20;
|
export const MAX_SKUS_PER_CHUNK = 50;
|
||||||
|
|||||||
@ -47,7 +47,11 @@ export function DailySalesReportPage() {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const generatePdfDoc = () => {
|
const generatePdfDoc = () => {
|
||||||
const doc = new jsPDF({ orientation: 'landscape' });
|
const totalSkus = reportData?.response?.headers?.reduce((acc: number, h: any) => acc + (h.skus?.length || 0), 0) || 0;
|
||||||
|
const maxSkusOnPage = Math.min(totalSkus, MAX_SKUS_PER_CHUNK);
|
||||||
|
const requiredWidth = Math.max(297, (maxSkusOnPage + 3) * 12 + 40);
|
||||||
|
|
||||||
|
const doc = new jsPDF({ orientation: 'landscape', format: [requiredWidth, 210] });
|
||||||
const pageWidth = doc.internal.pageSize.getWidth();
|
const pageWidth = doc.internal.pageSize.getWidth();
|
||||||
const centerX = pageWidth / 2;
|
const centerX = pageWidth / 2;
|
||||||
const rightMargin = pageWidth - 14;
|
const rightMargin = pageWidth - 14;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user