changed 50 sku and page zoomed out

This commit is contained in:
suryac 2026-08-27 17:39:30 +05:30
parent 513e833ead
commit ab626fb506
2 changed files with 6 additions and 2 deletions

View File

@ -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;

View File

@ -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;