Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
odoo
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cooperatic-foodcoops
odoo
Commits
c64229fe
Commit
c64229fe
authored
Oct 12, 2022
by
Damien Moulard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
display error message if selecting meal voucher payment method and no amount eligible
parent
fd231727
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
7 deletions
+25
-7
screens.js
lacagette_addons/pos_meal_voucher/static/src/js/screens.js
+25
-7
No files found.
lacagette_addons/pos_meal_voucher/static/src/js/screens.js
View file @
c64229fe
...
@@ -249,6 +249,15 @@ odoo.define("pos_meal_voucher.screens", function (require) {
...
@@ -249,6 +249,15 @@ odoo.define("pos_meal_voucher.screens", function (require) {
},
},
click_paymentmethods_meal_voucher_mixed
:
function
(
id
)
{
click_paymentmethods_meal_voucher_mixed
:
function
(
id
)
{
var
order
=
this
.
pos
.
get_order
();
if
(
order
.
get_total_meal_voucher_eligible
()
==
0
)
{
this
.
gui
.
show_popup
(
"alert"
,
{
'title'
:
_t
(
"Meal Voucher 0 amount"
),
'body'
:
_t
(
"can't pay"
),
});
return
false
;
}
var
cashregister
=
null
;
var
cashregister
=
null
;
for
(
var
i
=
0
;
i
<
this
.
pos
.
cashregisters
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
this
.
pos
.
cashregisters
.
length
;
i
++
)
{
if
(
this
.
pos
.
cashregisters
[
i
].
journal_id
[
0
]
===
id
){
if
(
this
.
pos
.
cashregisters
[
i
].
journal_id
[
0
]
===
id
){
...
@@ -262,7 +271,6 @@ odoo.define("pos_meal_voucher.screens", function (require) {
...
@@ -262,7 +271,6 @@ odoo.define("pos_meal_voucher.screens", function (require) {
this
.
reset_input
();
this
.
reset_input
();
this
.
render_paymentlines
();
this
.
render_paymentlines
();
},
},
render_paymentmethods
:
function
()
{
render_paymentmethods
:
function
()
{
var
self
=
this
;
var
self
=
this
;
var
methods
=
this
.
_super
.
apply
(
this
,
arguments
);
var
methods
=
this
.
_super
.
apply
(
this
,
arguments
);
...
@@ -279,7 +287,23 @@ odoo.define("pos_meal_voucher.screens", function (require) {
...
@@ -279,7 +287,23 @@ odoo.define("pos_meal_voucher.screens", function (require) {
var
paymentScreen
=
this
.
pos
.
gui
.
current_screen
;
var
paymentScreen
=
this
.
pos
.
gui
.
current_screen
;
var
order
=
this
.
pos
.
get_order
();
var
order
=
this
.
pos
.
get_order
();
if
(
order
.
selected_paymentline
.
is_meal_voucher
()
&&
order
.
get_total_meal_voucher_eligible
()
==
0
)
{
this
.
gui
.
show_popup
(
"alert"
,
{
'title'
:
_t
(
"Impossible de payer en titre restaurant"
),
'body'
:
_t
(
"Aucun article du panier n'est éligible en titres restaurants (Montant éligible : 0€)."
),
cancel
:
function
()
{
this
.
pos
.
get_order
().
remove_paymentline
(
order
.
selected_paymentline
);
var
paymentScreen
=
this
.
pos
.
gui
.
current_screen
;
paymentScreen
.
reset_input
();
paymentScreen
.
render_paymentlines
();
}
});
return
false
;
}
if
(
order
.
selected_paymentline
.
is_meal_voucher
()
&&
order
.
selected_paymentline
.
is_dematerialized_meal_voucher
()){
if
(
order
.
selected_paymentline
.
is_meal_voucher
()
&&
order
.
selected_paymentline
.
is_dematerialized_meal_voucher
()){
var
total_eligible
=
order
.
get_total_meal_voucher_eligible
();
var
total_eligible
=
order
.
get_total_meal_voucher_eligible
();
...
@@ -325,14 +349,8 @@ odoo.define("pos_meal_voucher.screens", function (require) {
...
@@ -325,14 +349,8 @@ odoo.define("pos_meal_voucher.screens", function (require) {
},
},
});
});
}
}
},
},
render_paymentlines
:
function
()
{
render_paymentlines
:
function
()
{
var
self
=
this
;
var
self
=
this
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment