Skip to content

Commit

Permalink
[UPD] fiscal_epos_print: aggiornata PR OCA#3060
Browse files Browse the repository at this point in the history
  • Loading branch information
Borruso committed May 23, 2024
1 parent 422a257 commit cf5f4d2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,20 @@ odoo.define("fiscal_epos_print.SetLotteryCodeButton", function (require) {

const PosComponent = require("point_of_sale.PosComponent");
const ProductScreen = require("point_of_sale.ProductScreen");
const {useListener} = require("@web/core/utils/hooks");
const Registries = require("point_of_sale.Registries");
const {Gui} = require("point_of_sale.Gui");
const core = require("web.core");
const _t = core._t;

class SetLotteryCodeButton extends PosComponent {
constructor() {
super(...arguments);
useListener("click", this.onClick);
}

render() {
var color = this.lottery_get_button_color();
$(this.el).css("background", color);
}

async onClick() {
async onClickLotteryCode() {
var self = this;
var current_order = this.env.pos.get_order();
Gui.showPopup("LotteryCodePopup", {
this.showPopup("LotteryCodePopup", {
title: _t("Lottery Code"),
lottery_code: current_order.lottery_code,
update_lottery_info_button: function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ odoo.define("fiscal_epos_print.SetRefundInfoButton", function (require) {
async onClickRefund() {
var self = this;
var current_order = this.env.pos.get_order();
if (current_order.refund_date === null || current_order.refund_date === "") {
this.showPopup("ErrorPopup", {
title: _t("Error"),
body: _t(
"Must select a refund order before clicking on this button!"
),
});
}
var dd = ("0" + current_order.refund_date.getDate()).slice(-2);
var mm = ("0" + (current_order.refund_date.getMonth() + 1)).slice(-2);
var yyyy = current_order.refund_date.getFullYear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<templates id="template" xml:space="preserve">

<t t-name="SetLotteryCodeButton" owl="1">
<div id="lottery_code_button" class='control-button' t-on-click="onClick">
<div id="lottery_code_button" class='control-button' t-on-click="onClickLotteryCode">
<i class='fa fa-pencil-square-o' />
Lottery Code
</div>
Expand Down

0 comments on commit cf5f4d2

Please sign in to comment.