add pos_cashdro_refund,pos_cashdro_allow_manual

This commit is contained in:
Luis 2026-04-24 13:34:06 +02:00
parent 9b25650118
commit b7e8f8967c
14 changed files with 409 additions and 0 deletions

View file

@ -11,6 +11,17 @@ import { PaymentCashdro } from "@pos_payment_method_cashdro/js/payment_cashdro.e
PaymentCashdro.prototype.cashdro_send_payment_request = async function (order) {
const payment_line = order.selected_paymentline;
try {
// If pos_cashdro_refund is installed this method handles payouts.
// Rounding is not applicable to refunds so we delegate and return.
const due = order.get_due(payment_line);
if (due < 0) {
if (this._cashdro_send_refund_request) {
return this._cashdro_send_refund_request(order);
}
// Refund module not installed nothing we can do.
payment_line.set_payment_status("retry");
return false;
}
// Cashdro treats decimals as positions in an integer we also have
// to deal with floating point computing to avoid decimals at the
// end or the drawer will reject our request.