| 1 |
import { AddZatcaRefundReasonPopup } from "@l10n_sa_pos/app/add_zatca_refund_reason_popup/add_zatca_refund_reason_popup"; |
| 2 |
import { TicketScreen } from "@point_of_sale/app/screens/ticket_screen/ticket_screen"; |
| 3 |
import { makeAwaitable } from "@point_of_sale/app/utils/make_awaitable_dialog"; |
| 4 |
import { patch } from "@web/core/utils/patch"; |
| 5 |
|
| 6 |
patch(TicketScreen.prototype, { |
| 7 |
async addAdditionalRefundInfo(order, destinationOrder) { |
| 8 |
if (this.pos.company.country_id.code === "SA") { |
| 9 |
const payload = await makeAwaitable(this.dialog, AddZatcaRefundReasonPopup, { |
| 10 |
order: destinationOrder, |
| 11 |
}); |
| 12 |
if (payload) { |
| 13 |
destinationOrder.l10n_sa_reason = payload.l10n_sa_reason; |
| 14 |
destinationOrder.to_invoice = true; |
| 15 |
} |
| 16 |
} |
| 17 |
return super.addAdditionalRefundInfo(...arguments); |
| 18 |
}, |
| 19 |
}); |