feat: include cash control details in closing receipt and reduce overall font sizes for better layout consistency

This commit is contained in:
Suherdy Yacob 2026-06-12 08:18:44 +07:00
parent 43f92c39a2
commit fbf70c34b8
4 changed files with 50 additions and 29 deletions

View File

@ -45,7 +45,7 @@
<t t-foreach="docs" t-as="session">
<t t-set="data" t-value="session.get_closing_summary_data()"/>
<div style="font-family: 'Courier New', Courier, monospace;
font-size: 28px;
font-size: 25px;
width: 100%;
max-width: 320px;
margin: 0 auto;
@ -54,14 +54,14 @@
<!-- ===== HEADER ===== -->
<div style="text-align: center; margin-bottom: 10px;">
<div style="font-size: 36px; font-weight: bold;
<div style="font-size: 33px; font-weight: bold;
letter-spacing: 1px; text-transform: uppercase;">
<t t-esc="data['session_name']"/>
</div>
<div style="margin-top: 4px; font-size: 24px; letter-spacing: 2px;">
<div style="margin-top: 4px; font-size: 21px; letter-spacing: 2px;">
SESSION CLOSING SUMMARY
</div>
<div style="margin-top: 2px; font-size: 22px; color: #666;">
<div style="margin-top: 2px; font-size: 19px; color: #666;">
(REPRINT)
</div>
</div>
@ -78,7 +78,7 @@
</tr>
<tr>
<td style="font-weight: bold; padding: 5px 0;">Date/Time</td>
<td style="text-align: right; padding: 5px 0; font-size: 24px;">
<td style="text-align: right; padding: 5px 0; font-size: 21px;">
<t t-esc="data['closing_time']"/>
</td>
</tr>
@ -119,8 +119,8 @@
<!-- ===== GRAND TOTAL ===== -->
<table style="width: 100%; border-collapse: collapse; margin-bottom: 8px;">
<tr>
<td style="font-weight: bold; font-size: 32px; padding: 6px 0;">TOTAL</td>
<td style="text-align: right; font-weight: bold; font-size: 32px; padding: 6px 0;">
<td style="font-weight: bold; font-size: 29px; padding: 6px 0;">TOTAL</td>
<td style="text-align: right; font-weight: bold; font-size: 29px; padding: 6px 0;">
<t t-esc="data['grand_total']"
t-options="{'widget': 'monetary', 'display_currency': session.currency_id}"/>
</td>
@ -159,7 +159,7 @@
<!-- ===== FOOTER ===== -->
<div style="text-align: center; margin-top: 12px;
font-size: 24px; letter-spacing: 1px;">
font-size: 21px; letter-spacing: 1px;">
*** Session Closed ***
</div>

View File

@ -1,6 +1,6 @@
.pos-closing-receipt-print {
width: 512px;
font-size: 28px;
font-size: 25px;
color: #000000;
}

View File

@ -8,14 +8,14 @@
-->
<t t-name="pos_closing_receipt.ClosingReceipt">
<div class="pos-closing-receipt-print">
<div class="pos-receipt" style="font-family: 'Courier New', Courier, monospace; font-size: 28px; width: 100%; max-width: 320px; margin: 0 auto; padding: 12px;">
<div class="pos-receipt" style="font-family: 'Courier New', Courier, monospace; font-size: 25px; width: 100%; max-width: 320px; margin: 0 auto; padding: 12px;">
<!-- ===== HEADER ===== -->
<div style="text-align: center; margin-bottom: 10px;">
<div style="font-size: 36px; font-weight: bold; letter-spacing: 1px; text-transform: uppercase;">
<div style="font-size: 33px; font-weight: bold; letter-spacing: 1px; text-transform: uppercase;">
<t t-esc="props.sessionName"/>
</div>
<div style="margin-top: 4px; font-size: 24px; letter-spacing: 2px;">
<div style="margin-top: 4px; font-size: 21px; letter-spacing: 2px;">
SESSION CLOSING SUMMARY
</div>
</div>
@ -32,7 +32,7 @@
</tr>
<tr>
<td style="font-weight: bold; padding: 5px 0;">Date/Time</td>
<td style="text-align: right; padding: 5px 0; font-size: 24px;">
<td style="text-align: right; padding: 5px 0; font-size: 21px;">
<t t-esc="props.closingTime"/>
</td>
</tr>
@ -72,8 +72,8 @@
<!-- ===== GRAND TOTAL ===== -->
<table style="width: 100%; border-collapse: collapse; margin-bottom: 8px;">
<tr>
<td style="font-weight: bold; font-size: 32px; padding: 6px 0;">TOTAL</td>
<td style="text-align: right; font-weight: bold; font-size: 32px; padding: 6px 0;">
<td style="font-weight: bold; font-size: 29px; padding: 6px 0;">TOTAL</td>
<td style="text-align: right; font-weight: bold; font-size: 29px; padding: 6px 0;">
<t t-esc="props.grandTotal"/>
</td>
</tr>
@ -107,7 +107,7 @@
<div style="border-top: 1px dashed #000; margin: 8px 0;"/>
<!-- ===== FOOTER ===== -->
<div style="text-align: center; margin-top: 12px; font-size: 24px; letter-spacing: 1px;">
<div style="text-align: center; margin-top: 12px; font-size: 21px; letter-spacing: 1px;">
*** Session Closed ***
</div>

View File

@ -218,6 +218,26 @@ patch(ClosePosPopup.prototype, {
</tr>`
);
let cashControlBlock = "";
if (receiptData.hasCashControl) {
cashControlBlock = `
<div class="dashed"></div>
<table>
<tr>
<td style="padding:5px 0;">Expected Cash</td>
<td class="right" style="padding:5px 0;">${receiptData.expectedCash}</td>
</tr>
<tr>
<td style="padding:5px 0;">Counted Cash</td>
<td class="right" style="padding:5px 0;">${receiptData.countedCash}</td>
</tr>
<tr>
<td class="bold" style="padding:5px 0;">Cash Difference</td>
<td class="right bold" style="padding:5px 0;">${receiptData.cashDifference}</td>
</tr>
</table>`;
}
const html = `<!DOCTYPE html>
<html>
<head>
@ -227,7 +247,7 @@ patch(ClosePosPopup.prototype, {
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: 'Courier New', Courier, monospace;
font-size: 28px;
font-size: 25px;
background: #fff;
color: #000;
}
@ -239,14 +259,14 @@ patch(ClosePosPopup.prototype, {
}
.center { text-align: center; }
.header-title {
font-size: 36px;
font-size: 33px;
font-weight: bold;
letter-spacing: 1px;
text-transform: uppercase;
}
.header-sub {
margin-top: 4px;
font-size: 24px;
font-size: 21px;
letter-spacing: 2px;
}
.dashed { border-top: 1px dashed #000; margin: 8px 0; }
@ -255,11 +275,11 @@ patch(ClosePosPopup.prototype, {
td { padding: 5px 0; }
.right { text-align: right; }
.bold { font-weight: bold; }
.total-row td { font-weight: bold; font-size: 32px; padding: 6px 0; }
.total-row td { font-weight: bold; font-size: 29px; padding: 6px 0; }
.footer {
text-align: center;
margin-top: 12px;
font-size: 24px;
font-size: 21px;
letter-spacing: 1px;
}
.feed { margin-top: 28px; }
@ -282,7 +302,7 @@ patch(ClosePosPopup.prototype, {
</tr>
<tr>
<td class="bold">Date/Time</td>
<td class="right" style="font-size:24px;">${receiptData.closingTime}</td>
<td class="right" style="font-size:21px;">${receiptData.closingTime}</td>
</tr>
</table>
<div class="dashed"></div>
@ -297,6 +317,7 @@ patch(ClosePosPopup.prototype, {
<td class="right">${receiptData.grandTotal}</td>
</tr>
</table>
${cashControlBlock}
<div class="dashed"></div>
<div class="footer">*** Session Closed ***</div>
<div class="feed">&nbsp;</div>
@ -495,7 +516,7 @@ patch(Navbar.prototype, {
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: 'Courier New', Courier, monospace;
font-size: 28px;
font-size: 25px;
background: #fff;
color: #000;
}
@ -507,19 +528,19 @@ patch(Navbar.prototype, {
}
.center { text-align: center; }
.header-title {
font-size: 36px;
font-size: 33px;
font-weight: bold;
letter-spacing: 1px;
text-transform: uppercase;
}
.header-sub {
margin-top: 4px;
font-size: 24px;
font-size: 21px;
letter-spacing: 2px;
}
.reprint-label {
margin-top: 2px;
font-size: 22px;
font-size: 19px;
color: #666;
}
.dashed { border-top: 1px dashed #000; margin: 8px 0; }
@ -528,11 +549,11 @@ patch(Navbar.prototype, {
td { padding: 5px 0; }
.right { text-align: right; }
.bold { font-weight: bold; }
.total-row td { font-weight: bold; font-size: 32px; padding: 6px 0; }
.total-row td { font-weight: bold; font-size: 29px; padding: 6px 0; }
.footer {
text-align: center;
margin-top: 12px;
font-size: 24px;
font-size: 21px;
letter-spacing: 1px;
}
.feed { margin-top: 28px; }
@ -556,7 +577,7 @@ patch(Navbar.prototype, {
</tr>
<tr>
<td class="bold">Date/Time</td>
<td class="right" style="font-size:24px;">${sessionData.closing_time}</td>
<td class="right" style="font-size:21px;">${sessionData.closing_time}</td>
</tr>
</table>
<div class="dashed"></div>