diff --git a/app/Controllers/Api/v1/MedicalStoreApi.php b/app/Controllers/Api/v1/MedicalStoreApi.php index fc8d719..69d5ab8 100644 --- a/app/Controllers/Api/v1/MedicalStoreApi.php +++ b/app/Controllers/Api/v1/MedicalStoreApi.php @@ -2007,12 +2007,12 @@ class MedicalStoreApi extends BaseController $mpdfConfig = [ 'tempDir' => $tmpDir, 'mode' => 'utf-8', - 'format' => $isA5 ? 'A5' : 'A4', - 'orientation' => 'P', + 'format' => $isA5 ? 'A5-L' : 'A4', + 'orientation' => $isA5 ? 'L' : 'P', 'margin_left' => $isA5 ? 6 : 8, 'margin_right' => $isA5 ? 6 : 8, - 'margin_top' => $isA5 ? 6 : 8, - 'margin_bottom' => $isA5 ? 6 : 8, + 'margin_top' => $isA5 ? 5 : 8, + 'margin_bottom' => $isA5 ? 5 : 8, 'default_font' => 'dejavusans' ]; @@ -2022,7 +2022,7 @@ class MedicalStoreApi extends BaseController $mpdf->WriteHTML($html); $safeInv = preg_replace('/[^A-Za-z0-9_-]/', '_', $data['sale']['invoice_no'] ?: ('INV_' . $saleId)); - $fileName = "Invoice_{$safeInv}_{$format}.pdf"; + $fileName = "Invoice_{$safeInv}_" . ($isA5 ? 'a5_landscape' : $format) . ".pdf"; $pdfBinary = $mpdf->Output('', \Mpdf\Output\Destination::STRING_RETURN); diff --git a/public/App/MedicalStore/index.html b/public/App/MedicalStore/index.html index 07dd64d..85e81b0 100644 --- a/public/App/MedicalStore/index.html +++ b/public/App/MedicalStore/index.html @@ -391,13 +391,13 @@ border-radius: 4px; } - /* 2. A5 Half-Page Invoice */ + /* 2. A5 Landscape Invoice (210mm x 148mm) */ .print-a5-invoice { width: 100%; - max-width: 650px; + max-width: 820px; min-height: auto; font-family: 'Inter', sans-serif; - font-size: 11px; + font-size: 10.5px; color: #1e293b; padding: 16px; margin: auto; @@ -3297,7 +3297,7 @@ function PosCounter({ store, notify }) { className={`btn ${printFormat === 'a5' ? 'btn-warning text-dark fw-bold' : 'btn-outline-light'}`} onClick={() => setPrintFormat('a5')} > - A5 (PDF) + A5 Landscape (PDF) @@ -3367,7 +3367,7 @@ function PosCounter({ store, notify }) { Thermal (Text) - - + ) : ( <> )} @@ -3436,19 +3426,10 @@ function PosCounter({ store, notify }) { 80mm Thermal Receipt (Plain Text) -
+
-
@@ -3997,21 +3978,16 @@ function PosCounter({ store, notify }) { Done / Close (Esc) {printFormat === 'thermal' ? ( - <> - - - + ) : ( <> )}