View | Details | Raw Unified | Return to bug 40445
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/js/cashup_modal.js (-6 / +45 lines)
Lines 104-113 $(document).ready(function () { Link Here
104
                var tfoot = summary_modal.find("tfoot");
104
                var tfoot = summary_modal.find("tfoot");
105
                tfoot.empty();
105
                tfoot.empty();
106
106
107
                // Determine if this is a negative cashup (float deficit scenario)
108
                var isNegativeCashup = data.summary.total < 0;
109
110
                // Add informational notice for negative cashups
111
                if (isNegativeCashup) {
112
                    var noticeText = __(
113
                        "This cashup shows a negative amount because refunds exceeded collections during this session. " +
114
                            "The register float was topped up to restore the expected balance."
115
                    );
116
                    tbody.prepend(
117
                        "<tr class='reconciliation-info'><td colspan='2'>" +
118
                            "<i class='fa-solid fa-info-circle'></i> " +
119
                            "<strong>" +
120
                            __("Float deficit:") +
121
                            "</strong> " +
122
                            noticeText +
123
                            "</td></tr>"
124
                    );
125
                }
126
107
                // 1. Total (sum of all transactions)
127
                // 1. Total (sum of all transactions)
128
                var totalLabel = isNegativeCashup
129
                    ? __("Total float deficit")
130
                    : __("Total");
131
108
                tfoot.append(
132
                tfoot.append(
109
                    "<tr class='total-row'><td><strong>" +
133
                    "<tr class='total-row'><td><strong>" +
110
                        __("Total") +
134
                        totalLabel +
111
                        "</strong></td><td><strong>" +
135
                        "</strong></td><td><strong>" +
112
                        data.summary.total.format_price() +
136
                        data.summary.total.format_price() +
113
                        "</strong></td></tr>"
137
                        "</strong></td></tr>"
Lines 130-138 $(document).ready(function () { Link Here
130
                    }
154
                    }
131
                }
155
                }
132
                if (cashCollected !== null) {
156
                if (cashCollected !== null) {
157
                    var cashLabel =
158
                        cashCollected < 0
159
                            ? __("Cash added to register")
160
                            : __("Cash collected");
161
133
                    tfoot.append(
162
                    tfoot.append(
134
                        "<tr><td><strong>" +
163
                        "<tr><td><strong>" +
135
                            __("Cash collected") +
164
                            cashLabel +
136
                            "</strong></td><td><strong>" +
165
                            "</strong></td><td><strong>" +
137
                            cashCollected.format_price() +
166
                            cashCollected.format_price() +
138
                            "</strong></td></tr>"
167
                            "</strong></td></tr>"
Lines 146-156 $(document).ready(function () { Link Here
146
                        type.payment_type !== "Cash" &&
175
                        type.payment_type !== "Cash" &&
147
                        type.payment_type !== "CASH"
176
                        type.payment_type !== "CASH"
148
                    ) {
177
                    ) {
178
                        var paymentTypeLabel =
179
                            type.total < 0
180
                                ? __x("{payment_type} to add", {
181
                                      payment_type: escape_str(
182
                                          type.payment_type
183
                                      ),
184
                                  })
185
                                : __x("{payment_type} collected", {
186
                                      payment_type: escape_str(
187
                                          type.payment_type
188
                                      ),
189
                                  });
190
149
                        tfoot.append(
191
                        tfoot.append(
150
                            "<tr><td><strong>" +
192
                            "<tr><td><strong>" +
151
                                __x("{payment_type} collected", {
193
                                paymentTypeLabel +
152
                                    payment_type: escape_str(type.payment_type),
153
                                }) +
154
                                "</strong></td><td><strong>" +
194
                                "</strong></td><td><strong>" +
155
                                type.total.format_price() +
195
                                type.total.format_price() +
156
                                "</strong></td></tr>"
196
                                "</strong></td></tr>"
157
- 

Return to bug 40445