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
5c8f5cf7
Commit
5c8f5cf7
authored
Jun 16, 2023
by
Yvon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
much easier solution which only involves one change in pos_payement_terminal
parent
6c9d92f2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
pos_payment_terminal.js
...os_payment_terminal/static/src/js/pos_payment_terminal.js
+16
-0
No files found.
extra_addons/pos_payment_terminal/static/src/js/pos_payment_terminal.js
View file @
5c8f5cf7
...
...
@@ -61,6 +61,22 @@ odoo.define('pos_payment_terminal.pos_payment_terminal', function (require) {
var
order
=
this
.
pos
.
get_order
();
var
line
=
order
.
selected_paymentline
;
var
data
=
self
.
get_data_send
(
order
,
line
,
currency_iso
);
//Special case of meal voucher payement line :
if
(
line
.
is_meal_voucher
&&
line
.
is_meal_voucher
())
{
//Make sure function exists (module meal_voucher might not be active)
//TODO : factor (already 3 occurences of this code in pos_meal_voucher)
var
total_eligible
=
order
.
get_total_meal_voucher_eligible
();
var
total_received
=
order
.
get_total_meal_voucher_received
();
var
max_amount
=
this
.
pos
.
config
.
max_meal_voucher_amount
;
var
current_max
=
total_eligible
;
if
(
max_amount
)
{
current_max
=
Math
.
min
(
total_eligible
,
max_amount
);
}
// Check how much is still possible to pay with meal voucher
// The selected line is "by default" set to the rest to pay of the order
const
max_curent_amount
=
current_max
-
total_received
+
order
.
selected_paymentline
.
get_amount
();
data
[
"amount"
]
=
round_pr
(
Math
.
max
(
0
,
max_curent_amount
),
this
.
pos
.
currency
.
rounding
);
}
console
.
log
(
data
[
"amount"
]);
if
(
this
.
wait_terminal_answer
())
{
screen
.
$
(
'.delete-button'
).
css
(
'display'
,
'none'
);
this
.
message
(
'payment_terminal_transaction_start_with_return'
,
{
'payment_info'
:
JSON
.
stringify
(
data
)},
{
timeout
:
240000
}).
then
(
function
(
answer
)
{
...
...
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