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
61324f72
Commit
61324f72
authored
Jun 28, 2023
by
François C.
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/4704-envoi-montant-eligible-au-tpe' into pour_mep
parents
99d20d7f
ca720dd5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
pos_payment_terminal.js
...os_payment_terminal/static/src/js/pos_payment_terminal.js
+15
-0
No files found.
extra_addons/pos_payment_terminal/static/src/js/pos_payment_terminal.js
View file @
61324f72
...
...
@@ -61,6 +61,21 @@ 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
);
}
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