Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
third-party
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
2
Merge Requests
2
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
third-party
Commits
9479e21d
Commit
9479e21d
authored
Oct 03, 2022
by
Damien Moulard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
linting
parent
a91c4f18
Pipeline
#2397
passed with stage
in 1 minute 28 seconds
Changes
8
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
41 additions
and
22 deletions
+41
-22
manage_attached.js
members/static/js/admin/manage_attached.js
+1
-0
inscriptions.js
members/static/js/inscriptions.js
+9
-6
members.js
members/static/js/members.js
+5
-4
members-space-home.js
members_space/static/js/members-space-home.js
+9
-4
members-space-shifts-exchange.js
members_space/static/js/members-space-shifts-exchange.js
+3
-1
members-space.js
members_space/static/js/members-space.js
+1
-0
orders_helper.js
orders/static/js/orders_helper.js
+2
-1
reception_produits.js
reception/static/js/reception_produits.js
+11
-6
No files found.
members/static/js/admin/manage_attached.js
View file @
9479e21d
...
...
@@ -284,6 +284,7 @@ function create_pair(payload) {
data
.
responseJSON
.
errors
.
map
(
function
(
error
)
{
message
+=
(
'
\
n'
+
error
);
return
null
;
});
}
...
...
members/static/js/inscriptions.js
View file @
9479e21d
...
...
@@ -92,12 +92,12 @@ function new_coop_validation() {
coop_registration_details
.
find
(
'.shift_template'
).
text
(
st
);
process_state
.
html
(
current_coop
.
firstname
+
' '
+
current_coop
.
lastname
);
coop_registration_details
.
find
(
"#parentName"
).
text
(
""
)
coop_registration_details
.
find
(
"#parent"
).
attr
(
"hidden"
,
true
)
coop_registration_details
.
find
(
"#parentName"
).
text
(
""
)
;
coop_registration_details
.
find
(
"#parent"
).
attr
(
"hidden"
,
true
)
;
if
(
current_coop
.
parent_name
!==
undefined
)
{
coop_registration_details
.
find
(
"#parentName"
).
text
(
current_coop
.
parent_name
)
coop_registration_details
.
find
(
"#parent"
).
removeAttr
(
"hidden"
)
coop_registration_details
.
find
(
"#parentName"
).
text
(
current_coop
.
parent_name
);
coop_registration_details
.
find
(
"#parent"
).
removeAttr
(
"hidden"
);
}
if
(
current_coop
.
shift_template
.
data
&&
current_coop
.
shift_template
.
data
.
id
!=
ASSOCIATE_MEMBER_SHIFT
)
{
...
...
@@ -126,7 +126,7 @@ function create_new_coop() {
$
(
'.chosen_associate'
).
html
(
""
);
$
(
'.chosen_associate_area'
).
hide
();
$
(
'.member_choice'
).
removeClass
(
'choice_active'
);
$
(
".remove_binome_icon"
).
on
(
"click"
,
hide_chosen_associate
)
$
(
".remove_binome_icon"
).
on
(
"click"
,
hide_chosen_associate
)
;
local_in_process
=
getLocalInProcess
();
if
(
getLocalInProcess
().
length
>
0
)
{
empty_waiting_local_processes
();
...
...
@@ -271,8 +271,10 @@ function store_new_coop(event) {
if
(
active_asso_area
.
length
>
0
)
{
// If user click as if a "binôme" is beeing created, data about parent member must exist
let
associated_data_ok
=
false
;
if
(
(
$
(
active_asso_area
[
0
]).
attr
(
'id'
)
===
"new_member_choice"
&&
$
(
'#new_member_input'
).
val
().
trim
().
length
>
0
)
(
$
(
active_asso_area
[
0
]).
attr
(
'id'
)
===
"new_member_choice"
&&
$
(
'#new_member_input'
).
val
()
.
trim
().
length
>
0
)
||
(
$
(
active_asso_area
[
0
]).
attr
(
'id'
)
===
"existing_member_choice"
&&
$
(
'#existing_member_choice_action .chosen_associate div.member'
).
length
>
0
)
)
{
...
...
@@ -361,6 +363,7 @@ function modify_current_coop() {
$
(
'#new_member_choice_action'
).
hide
();
$
(
'#existing_member_choice'
).
addClass
(
'choice_active'
);
var
member_button
=
'<div>'
+
current_coop
.
parent_name
+
'</div>'
;
$
(
'.chosen_associate'
).
html
(
member_button
);
$
(
'.chosen_associate_area'
).
show
();
associated_old_choice
=
'existing_member_choice'
;
...
...
members/static/js/members.js
View file @
9479e21d
...
...
@@ -75,7 +75,7 @@ var reset_shift_process_actions_zone = function() {
current_shift_process_data_actions
.
off
(
'click'
,
'a'
);
current_shift_process_data_actions
.
hide
();
current_shift_process_data_actions
.
empty
();
}
}
;
function
fill_member_slide
(
member
)
{
no_pict_msg
.
hide
();
...
...
@@ -330,12 +330,13 @@ function fill_service_entry(s) {
if
(
s
.
state
==
'draft'
||
s
.
state
==
'confirm'
)
{
let
btn
=
$
(
'<a>'
).
addClass
(
'btn btn--primary txtcenter'
)
.
text
(
'Enregistrer les absences / présences'
)
.
attr
(
'id'
,
'record_shift_absences'
);
.
attr
(
'id'
,
'record_shift_absences'
);
current_shift_process_data_actions
.
append
(
btn
);
current_shift_process_data_actions
.
on
(
'click'
,
'#record_shift_absences'
,
function
(){
current_shift_process_data_actions
.
on
(
'click'
,
'#record_shift_absences'
,
function
()
{
msg
=
"<p>Lancer le traitement des présences et absences de ce service</p>"
;
openModal
(
msg
,
function
()
{
btn
.
attr
(
'disabled'
,
'true'
)
btn
.
attr
(
'disabled'
,
'true'
)
;
try
{
$
.
ajax
({
url
:
'/members/record_shift_absences/'
+
s
.
id
,
...
...
members_space/static/js/members-space-home.js
View file @
9479e21d
...
...
@@ -25,7 +25,7 @@ function init_my_shifts_tile() {
function
process_asked_shift_template_change
(
shift_t_id
)
{
var
s_data
=
shift_templates
[
shift_t_id
].
data
;
var
shift_name
=
get_shift_name
(
s_data
);
let
msg
=
'Inscription au créneau '
+
shift_name
let
msg
=
'Inscription au créneau '
+
shift_name
;
openModal
(
msg
,
...
...
@@ -94,8 +94,9 @@ function process_asked_shift_template_change(shift_t_id) {
);
}
function
edit_shift_template_registration
(){
function
edit_shift_template_registration
()
{
let
external
=
true
;
if
(
calendar
==
null
)
calendar
=
$
(
'#modal-calendar-choice'
).
clone
();
if
(
$
(
'#modal-calendar-choice'
).
html
().
length
>
0
)
{
$
(
'#modal-calendar-choice'
).
empty
();
...
...
@@ -103,7 +104,10 @@ function edit_shift_template_registration(){
}
calendar
.
find
(
'.oddeven_selector'
).
empty
();
displayMsg
(
calendar
.
html
());
$
(
'#week_types'
).
find
(
'input'
).
change
(()
=>
{
filter_weeks
(
external
)});
$
(
'#week_types'
).
find
(
'input'
)
.
change
(()
=>
{
filter_weeks
(
external
);
});
retrieve_and_draw_shift_tempates
(
external
);
...
...
@@ -127,7 +131,8 @@ function init_home() {
});
$
(
".member_shift_name_area"
).
on
(
"click"
,
".fa-edit"
,
(
e
)
=>
{
$
(
'#week_types'
).
find
(
'input'
).
change
(
filter_weeks
);
$
(
'#week_types'
).
find
(
'input'
)
.
change
(
filter_weeks
);
e
.
preventDefault
();
edit_shift_template_registration
();
});
...
...
members_space/static/js/members-space-shifts-exchange.js
View file @
9479e21d
...
...
@@ -599,6 +599,7 @@ function init_calendar_page() {
}
else
{
// Display modal
let
modal_template
=
$
(
"#modal_add_shift_template"
);
modal_template
.
find
(
".date_new_shift"
).
text
(
new_shift_date
);
modal_template
.
find
(
".time_new_shift"
).
text
(
new_shift_time
);
openModal
(
...
...
@@ -757,7 +758,8 @@ function init_delete_registration_buttons() {
if
(
partner_data
.
extra_shift_done
>
0
)
{
$
(
".delete_registration_button"
).
on
(
"click"
,
function
()
{
let
shift_name
=
$
(
this
).
closest
(
"div"
)
.
parent
().
parent
()
.
parent
()
.
parent
()
.
find
(
".shift_line_date"
)
.
text
()
.
trim
();
...
...
members_space/static/js/members-space.js
View file @
9479e21d
...
...
@@ -314,6 +314,7 @@ $(document).ready(function() {
// For associated people, their parent name is attached in their display name
let
partner_name_split
=
partner_data
.
name
.
split
(
', '
);
partner_data
.
name
=
partner_name_split
[
partner_name_split
.
length
-
1
];
base_location
=
(
app_env
===
'dev'
)
?
'/members_space/'
:
'/'
;
...
...
orders/static/js/orders_helper.js
View file @
9479e21d
...
...
@@ -138,7 +138,7 @@ function debounceFunction(func, delay = 1000) {
*/
function
handle_unauthorize
()
{
alert
(
"La session a expiré. Vous allez devoir vous reconnecter."
);
$
(
"#logout"
).
trigger
(
"click"
);
$
(
"#logout"
).
trigger
(
"click"
);
}
/* - PRODUCTS */
...
...
@@ -314,6 +314,7 @@ function compute_and_affect_product_supplier_quantities(coeff, days) {
// Set qty to purchase for supplier with higher priority
let
target_supplierinfo_index
=
0
;
let
min_sequence
=
Number
.
POSITIVE_INFINITY
;
// min sequence = higher priority
for
(
let
i
in
products
[
key
].
suppliersinfo
)
{
let
suppliersinfo_sequence
=
products
[
key
].
suppliersinfo
[
i
].
sequence
;
...
...
reception/static/js/reception_produits.js
View file @
9479e21d
...
...
@@ -1979,10 +1979,12 @@ function add_products_action() {
for
(
let
qty_input
of
qty_inputs
)
{
if
(
$
(
qty_input
).
val
()
===
""
)
{
has_empty_qty_input
=
true
;
$
(
qty_input
).
closest
(
".product_qty"
).
find
(
".product_qty_input_alert"
)
$
(
qty_input
).
closest
(
".product_qty"
)
.
find
(
".product_qty_input_alert"
)
.
show
();
}
else
{
$
(
qty_input
).
closest
(
".product_qty"
).
find
(
".product_qty_input_alert"
)
$
(
qty_input
).
closest
(
".product_qty"
)
.
find
(
".product_qty_input_alert"
)
.
hide
();
}
}
...
...
@@ -2024,8 +2026,10 @@ function create_orders() {
for
(
let
i
=
0
;
i
<
add_products_lines
.
length
;
i
++
)
{
let
line
=
add_products_lines
[
i
];
if
(
$
(
line
).
find
(
".product_name"
).
text
()
===
p
.
name
)
{
product_uom
=
$
(
line
).
find
(
".product_uom"
).
text
();
if
(
$
(
line
).
find
(
".product_name"
)
.
text
()
===
p
.
name
)
{
product_uom
=
$
(
line
).
find
(
".product_uom"
)
.
text
();
if
(
product_uom
.
includes
(
"kg"
))
{
product_qty
=
parseFloat
(
$
(
line
).
find
(
".product_qty_input"
)
...
...
@@ -2045,15 +2049,16 @@ function create_orders() {
// If package qty is > than input value, package qty will be used while creating order
let
package_qty
=
p_supplierinfo
.
package_qty
;
if
(
product_qty
<
package_qty
)
{
package_qty
=
product_qty
;
}
// Round differently for unit & kg products
if
(
product_uom
.
includes
(
"kg"
)
)
{
if
(
product_uom
.
includes
(
"kg"
))
{
item_qty_package
=
Math
.
round
((
product_qty
/
package_qty
)
*
1
e2
)
/
1
e2
;
}
else
{
item_qty_package
=
Math
.
round
(
product_qty
/
package_qty
)
item_qty_package
=
Math
.
round
(
product_qty
/
package_qty
)
;
}
orders_data
.
suppliers_data
[
supplier_id
].
lines
.
push
({
...
...
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