Commit 52e714ac by Yvon

Merge branch 'dev_cooperatic' into lacagette_prod

parents 54614157 29145f78
Pipeline #3351 failed with stage
in 1 minute 4 seconds
"""Company specific data values."""
MAG_NAME = ''
COMPANY_NAME = 'GRAOUCOOP'
OFFICE_NAME = ''
EMAIL_DOMAIN = 'graoucoop.fr'
COMPANY_LOGO = 'https://graoucoop.fr/wp-content/uploads/2023/02/logo-graoucoop-horiz-og.png'
# OPEN_ON_SUNDAY = True
MAX_BEGIN_HOUR = '19:00'
WELCOME_ENTRANCE_MSG = 'Bienvenue à Graoucoop !'
WELCOME_MAIL_SUBJECT = 'Dernière étape de votre inscription à Graoucoop.'
WELCOME_MAIL_TEMPLATE = 'members/graoucoop/bienvenue.html'
TOOLS_SERVER = 'https://outils.graoucoop.fr'
DAV_PATH = '/shared_dir/dav/'
ADMIN_IDS = [1,38]
BRINKS_MUST_IDENTIFY = True
CAP_JOURNAL_ID = 9
CAP_APPELE_NON_VERSE_ACCOUNT_ID = 529
CAP_APPELE_VERSE_ACCOUNT_ID = 8
CAP_INVOICE_LINE_ACCOUNT_ID = 7
FUNDRAISING_CAT_ID = 1
UNITE_UOM_ID = 1
PARTS_A_PRODUCT_ID = 5
PARTS_B_PRODUCT_ID = 6
PARTS_C_PRODUCT_ID = 7
PARTS_PRICE_UNIT = 10.0
PARTS_A_PRICE_UNIT = PARTS_PRICE_UNIT
COOP_BARCODE_RULE_ID = 11
CHECK_PAYMENT_ID = 97
VIREMENT_PAYMENT_ID = 98
CASH_PAYMENT_ID = 18
#CB_PAYMENT_ID = 15
#HELLO_ASSO_PAYMENT_ID = 29
STOCK_LOC_ID = 12
CATEG_FRUIT = 151
CATEG_LEGUME = 152
VRAC_CATEGS = [166, 167, 174, 179]
#EXPORT_POS_CAT_FOR_SCALES = True
FLV_CSV_NB = 2
COEFF_MAG_ID = 1
RECEPTION_PDT_LABELS_FN = 'print_product_labels()'
RECEPTION_PDT_LABELS_TEXT = 'Cliquez sur ce bouton pour imprimer les étiquettes code-barres à coller sur les produits'
RECEPTION_PDT_LABELS_BTN_TEXT = 'Lancer l\'impression'
RECEPTION_SHELF_LABEL_PRINT = True
FIXED_BARCODE_PREFIX = '0490'
RECEPTION_ADD_ADMIN_MODE = True
RECEPTION_ADD_ALL_LEFT_IS_GOOD = True
RECEPTION_MERGE_ORDERS_PSWD='pass2makeApause'
DISPLAY_COL_AUTRES = False
RECEPTION_ADD_PRODUCTS_PSWD= 'pass2makeApause'
NO_BARCODE_MAIL_MSG = "contact@graoucoop.fr"
SUBSCRIPTION_PAYMENT_MEANINGS = [
{'code': 'cash', 'title': 'Espèces','journal_id': CASH_PAYMENT_ID},
{'code': 'ch', 'title': 'Chèque', 'journal_id': CHECK_PAYMENT_ID},
{'code': 'vir', 'title': 'Virement', 'journal_id': VIREMENT_PAYMENT_ID},
]
CAN_CREATE_BINOME = False
SUBSCRIPTION_NAME_SEP = ', '
CONCAT_NAME_ORDER = 'LF'
SUBSCRIPTION_ASK_FOR_SEX = True
WITH_WEBSITE_MENU = True
SUBSCRIPTION_ADD_STREET2 = True
SUBSCRIPTION_ADD_SECOND_PHONE = True
FORCE_HYPHEN_IN_SUBSCRIPTION_FIRSTNAME = False
ENTRANCE_EXTRA_BUTTONS_DISPLAY = False
ADMIN_BINOME_ACTIVE = False
SHOP_CAN_BUY = True
DELIVERY_CAN_BUY = True
SHOP_HEADER_IMG = 'https://graoucoop.fr/wp-content/uploads/2021/01/logo-graoucoop-horiz.png'
SHOP_OPENING = {'jeu.': [{'start': '15:45', 'end': '18:15'}, {'start': '18:30', 'end': '21:00'}],
'ven.': [{'start': '15:45', 'end': '18:15'}, {'start': '18:30', 'end': '21:00'}],
'sam.': [{'start': '10:15', 'end': '12:45'}, {'start': '13:00', 'end': '15:30'}]}
SHOP_SLOT_SIZE = 15 # minutes
SHOP_CATEGORIES = {
'epicerie': {'id': 75, 'label': 'Epicerie'},
'liquide': {'id': 96, 'label': 'Liquides'},
'produits_frais': {'id': 104, 'label': 'Frais'},
'surgeles': {'id': 115, 'label': 'Surgelés'},
'bazar': {'id': 122, 'label': 'Maison & Bazar'},
'droguerie': {'id': 127, 'label': 'Droguerie Hygiène'},
'parfumerie': {'id': 133, 'label': 'Parfumerie'}
}
ALLOW_NON_MEMBER_TO_CONNECT = True
EXCLUDE_SHOP_CATEGORIES=[]
DEFAULT_MAX_TIMESLOT_CARTS = 1
MIN_DELAY_FOR_SLOT = 0
HOURS_FOR_VALIDATION_SHOP = 2
SHOW_SUBSTITUTION_OPTION = False
CART_VALIDATION_BOTTOM_MSG = ""
SHOP_STOCK_WARNING = False
SHOP_BOTTOM_VALIDATION_MSG = 'Message personnalisable'
#SHOP_LIMIT_PRODUCTS = ['relatively_available', 'no_shelf']
#VALIDATION_ORDER_MAIL_TEMPLATE = 'shop/lgds_validation_mail.html'
EM_URL = ''
USE_NEW_MEMBERS_SPACE = True
USE_NEW_MEMBERS_SPACE = True
REMOVE_15_MINUTES_AT_SHIFT_END = False
CAN_ADD_SHIFT = True
COOP_CAN_CHANGE_SHIFT_TEMPLATE = True
SHIFT_EXCHANGE_DAYS_TO_HIDE = ''
SHIFT_INFO = """Un service est une plage de trois heures un jour en particulier, par exemple : le mardi 25/09/2018 à 13h15.
<br />A l'inverse, un créneau est une plage de trois heures régulière, par exemple, tous les mardi de semaine A à 13h15."""
PB_INSTRUCTIONS="""Si j'ai un problème, que je suis désinscrit, que je veux changer de créneaux ou quoi que ce soit, merci de se rendre au magasin"""
CALENDAR_NO_MORE_LINK = True
MEMBERS_SPACE_SHOW_UNDERSTAND_MY_STATUS = True
MEMBERS_SPACE_FAQ_TEMPLATE = 'members_space/graoucoop/faq.html'
MEMBERS_SPACE_UNDERSTAND_MY_STATUS_TEMPLATE = 'members_space/graoucoop/understand_my_status.html'
BRINKS_MUST_IDENTIFY = True
PROMOTE_SHELFS_IDS = []
DISCOUNT_SHELFS_IDS = []
FL_SHELFS = []
VRAC_SHELFS = []
ENTRANCE_FTOP_BUTTON_DISPLAY = False
#CUSTOM_CSS_FILES = {'all': ['common_lgds.css'],
# 'members': ['inscription_lgds.css']}
LOSSES_LOC_ID = 33
LOSSES_PICKING_TYPE_ID = 10
AUTOCONSO_LOC_ID = 27
AUTOCONSO_PICKING_TYPE_ID = 7
MEALS_LOC_ID = 36
MEALS_PICKING_TYPE_ID = 16
SUBSCRIPTION_ASK_FOR_SEX = True
\ No newline at end of file
"""Company specific data values."""
ODOO_PUBLIC_URL='https://odoo.lacagette-coop.fr'
MAG_NAME = 'Cleme'
OFFICE_NAME = ''
MAX_BEGIN_HOUR = '19:00'
COMPANY_CODE = 'lacagette'
COMPANY_NAME = 'La Cagette'
COMPANY_LOGO = 'https://lacagette-coop.fr/files/HeaderAccueil_image_accueil_opt3_20200208170224_20200208160306.jpg'
WELCOME_ENTRANCE_MSG = 'Bienvenue à La Cagette !'
WELCOME_MAIL_SUBJECT = 'Dernière étape de votre inscription à la Cagette.'
WELCOME_MAIL_TEMPLATE = 'members/bienvenue.html'
OPEN_ON_SUNDAY = True
ENTRANCE_WITH_LATE_MODE = True
BLOCK_SERVICE_EXCHANGE_24H_BEFORE = False
USE_NEW_MEMBERS_SPACE = True
ASSOCIATE_MEMBER_SHIFT = 430
BLOCK_ACTIONS_FOR_ATTACHED_PEOPLE = False
START_DATE_FOR_POINTS_HISTORY = "2021-07-01"
START_DATE_FOR_SHIFTS_HISTORY = "2021-07-01"
COMPANY_CODE = "lacagette"
AMNISTIE_DATE= "2021-11-24 23:00:00"
DEFAULT_SHIFT_TYPE = 'standard'
SHOW_FTOP_BUTTON = False
USE_STANDARD_SHIFT = True
# OPEN_ON_SUNDAY = True
FLV_CSV_NB = 6
FLV_CSV_NB = 4
CAP_JOURNAL_ID = 9
CAP_APPELE_NON_VERSE_ACCOUNT_ID = 529
......@@ -22,6 +38,7 @@ UNITE_UOM_ID = 1
PARTS_A_PRODUCT_ID = 1008
PARTS_A_PRICE_UNIT = 10.0
COOP_BARCODE_RULE_ID = 11
ASSOCIATE_BARCODE_RULE_ID = 12
CHECK_PAYMENT_ID = 8
CASH_PAYMENT_ID = 18
......@@ -53,23 +70,37 @@ SUBSCRIPTION_PAYMENT_MEANINGS = [{'code': 'cash', 'title': 'Espèces', 'journal_
{'code': 'ch', 'title': 'Chèque', 'journal_id': CHECK_PAYMENT_ID}]
EM_URL = ''
PREPA_ODOO_URL = "https://inscriptions.lacagette-coop.fr/members/prepa-odoo/"
RECEPTION_SHELF_LABEL_PRINT = True
RECEPTION_MERGE_ORDERS_PSWD = 'jpsrcp'
RECEPTION_ADD_PRODUCTS_PSWD = 'jpsrcp'
RECEPTION_UPDATE_QTY_PSWD = 'jpsrcp'
RECEPTION_PDT_LABELS_FN = 'print_product_labels()'
RECEPTION_PDT_LABELS_TEXT = 'Cliquez sur ce bouton pour imprimer les étiquettes code-barres à coller sur les produits'
RECEPTION_PDT_LABELS_BTN_TEXT = 'Lancer l\'impression'
FIXED_BARCODE_PREFIX = '0490'
RECEPTION_PB = "Ici, vous pouvez signaler toute anomalie lors d'une réception, les produits non commandés, cassés ou pourris. \
Merci d'indiquer un maximum d'informations, le nom du produit et son code barre."
DISPLAY_COL_AUTRES = False
RECEPTION_ADD_ALL_LEFT_IS_GOOD_QTIES = False
RECEPTION_ADD_ALL_LEFT_IS_GOOD_PRICES = True
NO_BARCODE_MAIL_SUBJECT = " Articles sans codebarre de la commande : {}"
NO_BARCODE_MAIL_MSG = """
Bonjour {0},
Vous avez crée la commande {1}, le {2}, pour {3}
Voici la liste des codes barres qui manquent :
"""
DAV_PATH = '/shared_dir/dav/'
TOOLS_SERVER = 'https://outils.lacagette-coop.fr'
ADMIN_IDS = [13]
BRINKS_MUST_IDENTIFY = False
BRINKS_MUST_IDENTIFY = True
SHOP_CAN_BUY = False
# SHOP_OPENING = {'mar.': [{'start': '10:30', 'end': '14:00'}, {'start': '15:30', 'end': '20:00'}],
......@@ -100,6 +131,8 @@ DISCOUNT_SHELFS_IDS = [74]
FL_SHELFS = [16, 17, 18]
VRAC_SHELFS = [20, 38]
SHELFS_TO_BE_AHEAD_IN_SELECT_LIST = [90,74]
SHIFT_EXCHANGE_DAYS_TO_HIDE = '0'
SHIFT_INFO = """A la cagette, un service est une plage de trois heures un jour en particulier, par exemple : le mardi 25/09/2018 à 13h15.
<br />A l'inverse, un créneau est une plage de trois heures régulière, par exemple, tous les mardi de semaine A à 13h15."""
......@@ -108,44 +141,28 @@ PB_INSTRUCTIONS = """Si j'ai un problème, que je suis désinscrit, que je veux
ENTRANCE_COME_FOR_SHOPING_MSG = "Hey coucou toi ! Cet été nous sommes plus de <strong>1000 acheteur·euses</strong> pour seulement <strong>300 coopérateur·rice·s</strong> en service. <br />Tu fais tes courses à La Cagette cet été ?<br/> Inscris-toi sur ton espace membre !"
ENTRANCE_EXTRA_BUTTONS_DISPLAY = False
ENTRANCE_EASY_SHIFT_VALIDATE = True
ENTRANCE_MISSED_SHIFT_BEGIN_MSG = """La période pendant laquelle il est possible de s'enregistrer est close.<br />
Merci de remplir le formulaire <em>"arrivé·e en retard"</em> <br/>
que vous trouverez <em>sur le site internet de La Cagette</em>
dans la rubrique<br />
"Espace Membre" > "J\'ai un problème ou une demande".<br/>
Le bureau des membres traitera votre demande !'
ENTRANCE_MISSED_SHIFT_BEGIN_MSG = """La période pendant laquelle il est possible de s'enregistrer est close.<br/>
Pour tout problème ou demande vous pouvez contacter le Bureau des Membres via les formulaires depuis votre espace membre.
"""
ENTRANCE_EASY_SHIFT_VALIDATE_MSG = """Si vous faites un service dans un comité, merci de <br/>
valider votre présence en cherchant<br/>
votre nom ou numéro ci-dessous
"""
PREPA_ODOO_URL = '[...]'
ENTRANCE_VALIDATE_PRESENCE_MESSAGE = """
<div class="explanations">
Ta présence a bien été validée ! Merci de te diriger au fond du magasin pour le lancement du créneau !
</div>
Ton prochain service <span class="service_verb">est prévu</span> le <span class="next_shift"></span>
"""
MINIMUM_SECONDS_BETWEEN_TWO_COMITEE_VALIDATION = 1
# Members space / shifts
UNSUBSCRIBED_FORM_LINK = 'https://docs.google.com/forms/d/e/1FAIpQLScWcpls-ruYIp7HdrjRF1B1TyuzdqhvlUIcUWynbEujfj3dTg/viewform'
UNSUBSCRIBED_MSG = 'Vous êtes désincrit·e, merci de remplir <a href="https://docs.google.com/forms/d/e/1FAIpQLSfPiC2PkSem9x_B5M7LKpoFNLDIz0k0V5I2W3Mra9AnqnQunw/viewform">ce formulaire</a> pour vous réinscrire sur un créneau.<br />Vous pouvez également contacter le Bureau des Membres en remplissant <a href="https://docs.google.com/forms/d/e/1FAIpQLSeZP0m5-EXPVJxEKJk6EjwSyZJtnbiGdYDuAeFI3ENsHAOikg/viewform">ce formulaire</a>'
UNSUBSCRIBED_FORM_LINK = 'https://docs.google.com/forms/d/e/1FAIpQLScWcpls-ruYIp7HdrjRF1B1TyuzdqhvlUIcUWynbEujfj3dTg/viewform'
CONFIRME_PRESENT_BTN = 'Clique ici pour valider ta présence'
BLOCK_ACTIONS_FOR_ATTACHED_PEOPLE = False
RECEPTION_PB = "Ici, vous pouvez signaler toute anomalie lors d'une réception, les produits non commandés, cassés ou pourris. \
Merci d'indiquer un maximum d'informations, le nom du produit et son code barre. \
Dans le cas de produits déteriorés, merci d'envoyer une photo avec votre téléphone à [Adresse_email]"
# display or not column "Autres" in reception process
DISPLAY_COL_AUTRES = False
# Should block service exchange if old service is happening in less than 24h
BLOCK_SERVICE_EXCHANGE_24H_BEFORE = True
# URL to the metabase dashboard for orders helper
ORDERS_HELPER_METABASE_URL = "url_meta_base"
# New members space
USE_NEW_MEMBERS_SPACE = True
START_DATE_FOR_SHIFTS_HISTORY = "2018-01-01"
AMNISTIE_DATE= "2021-11-24 00:00:00"
ORDERS_HELPER_METABASE_URL = "https://metabase.lacagette-coop.fr/dashboard/16"
# BDM Admin
BDM_SHOW_FTOP_BUTTON = True
# Entree
MINIMUM_SECONDS_BETWEEN_TWO_COMITEE_VALIDATION = 0
\ No newline at end of file
SUBSCRIPTION_ASK_FOR_SEX = True
\ No newline at end of file
......@@ -160,4 +160,5 @@ LOSSES_PICKING_TYPE_ID = 10
AUTOCONSO_LOC_ID = 27
AUTOCONSO_PICKING_TYPE_ID = 7
SUBSCRIPTION_ASK_FOR_SEX = True
\ No newline at end of file
SUBSCRIPTION_ASK_FOR_SEX = True
SUBSCRIPTION_ASK_FOR_JOB = True
\ No newline at end of file
......@@ -403,6 +403,8 @@ class CagetteMember(models.Model):
}
if ('sex' in post_data):
received_data['sex'] = post_data['sex']
if ('function' in post_data):
received_data['function'] = post_data['function']
if 'street2' in post_data:
received_data['street2'] = post_data['street2']
if 'phone' in post_data:
......@@ -450,11 +452,15 @@ class CagetteMember(models.Model):
partner_id = None
name_sep = getattr(settings, 'SUBSCRIPTION_NAME_SEP', ' ')
ask_4_sex = getattr(settings, 'SUBSCRIPTION_ASK_FOR_SEX', False)
ask_4_job = getattr(settings, 'SUBSCRIPTION_ASK_FOR_JOB', False)
concat_order = getattr(settings, 'CONCAT_NAME_ORDER', 'FL')
sex = 'o'
function = ''
if ask_4_sex is True:
sex = post_data['sex']
if ask_4_job is True:
function = post_data['function']
# With input type="date", transmitted value is YYYY-mm-dd
# But, it could be dd/mm/YYYY if not supported by browser
......@@ -484,7 +490,8 @@ class CagetteMember(models.Model):
'zip': post_data['zip'],
'city': post_data['city'],
'phone': format_phone_number(post_data['mobile']), # Because list view default show Phone and people mainly gives mobile
'barcode_rule_id': settings.COOP_BARCODE_RULE_ID
'barcode_rule_id': settings.COOP_BARCODE_RULE_ID,
'function': function
}
if ('_id' in post_data):
f['email'] = post_data['_id']
......@@ -556,7 +563,8 @@ class CagetteMember(models.Model):
'phone': format_phone_number(post_data['mobile']), # Because list view default show Phone and people mainly gives mobile
'barcode_rule_id': settings.ASSOCIATE_BARCODE_RULE_ID,
'parent_id' : post_data['parent_id'],
'is_associated_people': True
'is_associated_people': True,
'function': function
}
associated_member_id = api.create('res.partner', associated_member)
am = CagetteMember(associated_member_id)
......
......@@ -121,10 +121,12 @@ function display_makeups_members() {
render: function (data, type, full) {
var html = `<b>${data}</b>`
if(full.shift_type == 'standard') {
html += `
<button class="decrement_makeup btn--primary" id="decrement_member_${full.id}">
<i class="fas fa-minus"></i>
</button>`;
if(data > 0) {
html += `
<button class="decrement_makeup btn--primary" id="decrement_member_${full.id}">
<i class="fas fa-minus"></i>
</button>`;
}
html += `
<button class="increment_makeup btn--primary" id="increment_member_${full.id}">
<i class="fas fa-plus"></i>
......
......@@ -17,6 +17,7 @@ var latest_odoo_coop_bb = null,
subs_cap = $('#subs_cap'),
m_barcode = $('#m_barcode'),
sex = $('#sex'),
job = $('#job'),
self_records = [],
selected_associate=null,
associated_old_choice= null,
......@@ -158,7 +159,7 @@ function swipe_to_shift_choice() {
retrieve_and_draw_shift_tempates();
schoice_view.show();
}
function _really_save_new_coop(email, fname, lname, cap, pm, cn, bc, msex) {
function _really_save_new_coop(email, fname, lname, cap, pm, cn, bc, msex, mjob) {
var coop = current_coop || {};
......@@ -214,6 +215,7 @@ function _really_save_new_coop(email, fname, lname, cap, pm, cn, bc, msex) {
if (m_barcode.length > 0) coop.m_barcode = bc;
if (sex.length > 0) coop.sex = msex;
if (job.length > 0) coop.function = mjob;
coop.validation_state = "to_fill";
dbc.put(coop, function callback(err, result) {
if (!err) {
......@@ -244,6 +246,7 @@ function store_new_coop(event) {
var errors = [],
bc = '', // barcode may not be present
msex = '', // sex may not be present
mjob = '', //job may not be present
active_asso_area = $('#associate_area .choice_active'); // need to ckeck if associated data are available
// 1- Un coop avec le meme mail ne doit pas exister dans odoo (dans base intermediaire, le cas est géré par l'erreur à l'enregistrement)
let email = $('input[name="email"]').val()
......@@ -260,6 +263,9 @@ function store_new_coop(event) {
if (sex.length > 0) {
msex = $('input[name="sex"]:checked').val();
}
if (job.length > 0) {
mjob = $('input[name="job"]').val();
}
if (payment_meaning.val() == 'ch') {
if (ch_qty.val() <1) {
......@@ -319,7 +325,7 @@ function store_new_coop(event) {
if (errors.length == 0) {
_really_save_new_coop(
email, fname, lname,
subs_cap.val(), payment_meaning.val(), ch_qty.val(), bc, msex
subs_cap.val(), payment_meaning.val(), ch_qty.val(), bc, msex, mjob
);
} else {
......@@ -331,7 +337,7 @@ function store_new_coop(event) {
if (errors.length == 0) {
_really_save_new_coop(
email, fname, lname,
subs_cap.val(), payment_meaning.val(), ch_qty.val(), bc, msex
subs_cap.val(), payment_meaning.val(), ch_qty.val(), bc, msex, mjob
);
} else {
......@@ -405,6 +411,9 @@ function modify_current_coop() {
reset_sex_radios();
$('#' + current_coop.sex + '_sex').prop('checked', true);
}
if (job.length > 0) {
ncoop_view.find('input[name="job"]').val(current_coop.function);
}
ncoop_view.show();
}
......
......@@ -163,6 +163,7 @@ function submit_full_coop_form() {
var form_data = new FormData(form.get(0)),
m_barcode = form.find('[name="m_barcode"]'),
sex = $('#sex'),
job = $('#job'),
has_empty_values = false;
for (var pair of form_data.entries()) {
......@@ -205,6 +206,12 @@ function submit_full_coop_form() {
if (sex.length > 0) {
form_data.set('sex', $('input[name="sex"]:checked').val());
}
if (job.length > 0) {
form_data.set(
'function',
vform.find('input[name="job"]').val()
);
}
post_form(
'/members/coop_validated_data', form_data,
function(err) {
......@@ -246,7 +253,8 @@ function save_current_coop(callback) {
let form = coop_validation_form,
_id = form.find('[name="email"]').val(),
m_barcode = form.find('[name="m_barcode"]'),
sex = form.find('[name="sex"]');
sex = form.find('[name="sex"]'),
job = form.find('[name="job"]');
if (current_coop != null && _id.length > 0) {
//Birthdate verification
......@@ -300,6 +308,9 @@ function save_current_coop(callback) {
current_coop.sex = $('input[name="sex"]:checked').val();
if (typeof current_coop.sex == "undefined") sex_error = true;
}
if (job.length > 0) {
current_coop.function = $('input[name="job"]').val();
}
if (street2_input.length > 0) {
current_coop.street2 = street2_input.val();
}
......
......@@ -28,7 +28,8 @@ function display_current_coop_form() {
chgt_shift_btn = $('#change_shift_template');
var ftop_shift = $('#choosen_shift [name="ftop"]'),
m_barcode = form.find('[name="m_barcode"]'),
sex = $('#sex');
sex = $('#sex'),
job = $('#job');
let street2_input = form.find('[name="street2"]'),
phone_input = form.find('[name="phone"]');
......@@ -52,6 +53,9 @@ function display_current_coop_form() {
if (sex.length > 0 && typeof current_coop.sex != "undefined") {
$('input[name="sex"][value="' + current_coop.sex + '"]').prop('checked', true);
}
if (job.length > 0) {
form.find('[name="job"]').val(current_coop.function);
}
// form.find('[name="barcode_base"]').val(current_coop.barcode_base);
form.find('[name="email"]').val(current_coop._id);
if (current_coop.shift_template &&
......
......@@ -112,6 +112,7 @@ def inscriptions(request, type=1):
'input_barcode': getattr(settings, 'SUBSCRIPTION_INPUT_BARCODE', False),
'email_domain': getattr(settings, 'EMAIL_DOMAIN', 'lacagette-coop.fr'),
'ask_for_sex': getattr(settings, 'SUBSCRIPTION_ASK_FOR_SEX', False),
'ask_for_job': getattr(settings, 'SUBSCRIPTION_ASK_FOR_JOB', False),
'open_on_sunday': getattr(settings, 'OPEN_ON_SUNDAY', False),
'POUCHDB_VERSION': getattr(settings, 'POUCHDB_VERSION', ''),
'max_chq_nb': getattr(settings, 'MAX_CHQ_NB', 12),
......@@ -154,6 +155,7 @@ def prepa_odoo(request):
'input_phone_pattern': getattr(settings, 'INPUT_PHONE_PATTERN', default_input_phone_pattern),
'input_barcode': getattr(settings, 'SUBSCRIPTION_INPUT_BARCODE', False),
'ask_for_sex': getattr(settings, 'SUBSCRIPTION_ASK_FOR_SEX', False),
'ask_for_job': getattr(settings, 'SUBSCRIPTION_ASK_FOR_JOB', False),
'ask_for_street2': getattr(settings, 'SUBSCRIPTION_ADD_STREET2', False),
'ask_for_second_phone': getattr(settings, 'SUBSCRIPTION_ADD_SECOND_PHONE', False),
'show_ftop_button': getattr(settings, 'SHOW_FTOP_BUTTON', True),
......@@ -191,6 +193,7 @@ def validation_inscription(request, email):
'payment_meanings': settings.SUBSCRIPTION_PAYMENT_MEANINGS,
'input_phone_pattern': getattr(settings, 'INPUT_PHONE_PATTERN', default_input_phone_pattern),
'ask_for_sex': getattr(settings, 'SUBSCRIPTION_ASK_FOR_SEX', False),
'ask_for_job': getattr(settings, 'SUBSCRIPTION_ASK_FOR_JOB', False),
'ask_for_street2': getattr(settings, 'SUBSCRIPTION_ADD_STREET2', False),
'ask_for_second_phone': getattr(settings, 'SUBSCRIPTION_ADD_SECOND_PHONE', False),
'show_ftop_button': getattr(settings, 'SHOW_FTOP_BUTTON', True),
......
......@@ -81,6 +81,12 @@
gap: 10px;
}
.member_job_area {
display: flex;
flex-direction: column;
gap: 10px;
}
.edit-btn{
cursor: pointer;
}
......@@ -97,6 +103,9 @@
#edit_phone_form #mobile_form {
margin: 5px 0;
}
#edit_job_form {
display: none ;
}
@media screen and (max-width: 992px) {
......
......@@ -49,6 +49,19 @@ function init_my_info() {
$(".member_phone_line").hide();
}
$(".member_job").empty();
if (partner_data.function !== "" && partner_data.function !== "False" && partner_data.function !== false && partner_data.function !== null) {
$(".member_job")
.append(partner_data.function)
.show();
} else {
$(".member_job").hide();
}
if ($(".member_job").text() === "") {
$(".member_job_line").hide();
}
$('#edit_address').off('click')
.on('click', () => {
$("#street_form").val(partner_data.street.replace(/&#39;/g, "'"));
......@@ -90,12 +103,30 @@ function init_my_info() {
});
$('#save_edit_phone').off('click')
.on('click', () => {
console.log('ici');
data =[];
data['phone']= $("#phone_form").val();
data['mobile']= $("#mobile_form").val();
saveInfo(data, 'phone');
});
$('#edit_job').off('click')
.on('click', () => {
if (partner_data.function === "False") partner_data.function = "";
$("#job_form").val(partner_data.function);
$('#edit_job_value').hide();
$('#edit_job_form').show();
});
$('#cancel_edit_job').off('click')
.on('click', () => {
$('#edit_job_form').hide();
$('#edit_job_value').show();
});
$('#save_edit_job').off('click')
.on('click', () => {
console.log('ici');
data =[];
data['function']= $("#job_form").val();
saveInfo(data, 'function');
});
}
......@@ -127,6 +158,10 @@ function saveInfo(data, field) {
$('#edit_phone_form').hide();
$('#edit_phone_value').show();
}
if (field == 'function') {
$('#edit_job_form').hide();
$('#edit_job_value').show();
}
},
error: function(error) {
console.log(error);
......
......@@ -69,6 +69,8 @@ def index(request, exception=None):
'WELCOME_SUBTITLE_ENTRANCE_MSG': getattr(settings, 'WELCOME_SUBTITLE_ENTRANCE_MSG', '')}
if hasattr(settings, 'SUBSCRIPTION_ASK_FOR_SEX'):
context['ask_for_sex'] = settings.SUBSCRIPTION_ASK_FOR_SEX
if hasattr(settings, 'SUBSCRIPTION_ASK_FOR_JOB'):
context['ask_for_job'] = settings.SUBSCRIPTION_ASK_FOR_JOB
if hasattr(settings, 'SUBSCRIPTION_ADD_STREET2'):
context['ask_for_street2'] = settings.SUBSCRIPTION_ADD_STREET2
if hasattr(settings, 'SUBSCRIPTION_ADD_SECOND_PHONE'):
......
......@@ -40,6 +40,8 @@ var dbc = null,
sync = null,
fingerprint = null;
let lastKeypressTime = 0;
/* UTILS */
function back() {
......@@ -525,10 +527,16 @@ function initLists() {
if ('barcode' in full) {
display_barcode = full.barcode;
}
let supplier_code = "Aucune";
if ('supplier_code' in full && full.supplier_code) {
supplier_code = full.supplier_code;
}
return '<div class="tooltip">' + data
+ ' <span class="tooltiptext tt_twolines">Code barre : '
+ display_barcode + '</span> </div>';
+ ' <span class="tooltiptext tooltip-lg tt_twolines">Code barre : '
+ display_barcode
+ ' Réf. fournisseur : '
+ supplier_code + '</span> </div>';
}
},
{ data:"product_uom.1",
......@@ -604,10 +612,17 @@ function initLists() {
if ('barcode' in full) {
display_barcode = full.barcode;
}
let supplier_code = "Aucune";
if ('supplier_code' in full && full.supplier_code) {
supplier_code = full.supplier_code;
}
let display = '<div class="tooltip">' + data
+ ' <span class="tooltiptext tt_twolines">Code barre : '
+ display_barcode + '</span> </div>';
+ ' <span class="tooltiptext tooltip-lg tt_twolines">Code barre : '
+ display_barcode
+ ' Réf. fournisseur : '
+ supplier_code + '</span> </div>';
if (full.supplier_shortage) {
display += ' <div class="tooltip"><i class="fas fa-info-circle"></i>'
......@@ -2583,6 +2598,19 @@ function init_dom(partners_display_data) {
// Barcode reader
$(document).pos();
$(document).on('keydown','#edition_input',function(event) {
const keypressTime = event.timeStamp;
const timeDifference = keypressTime - lastKeypressTime;
lastKeypressTime = keypressTime;
// Assuming a scanner would input faster than 50ms between keystrokes
if (timeDifference < 50) {
// Looks like scanner input, ignore or handle differently
event.preventDefault();
// You can display a message or handle the input differently
alert("Vous ne pouvez pas scanner pour saisir une quantité.");
}
});
$(document).on('scan.pos.barcode', function(event) {
//access `event.code` - barcode data
var barcode = event.code;
......
......@@ -35,6 +35,7 @@ var shelf = null,
all_shelfs = null, // Use get_all_shelfs to access it's value
debounce_timeout = null;
let lastKeypressTime = 0;
/* UTILS */
......@@ -1241,6 +1242,19 @@ function init() {
});
$(document).pos();
$(document).on('keydown','#edition_input',function(event) {
const keypressTime = event.timeStamp;
const timeDifference = keypressTime - lastKeypressTime;
lastKeypressTime = keypressTime;
// Assuming a scanner would input faster than 50ms between keystrokes
if (timeDifference < 50) {
// Looks like scanner input, ignore or handle differently
event.preventDefault();
// You can display a message or handle the input differently
alert("Vous ne pouvez pas scanner pour saisir une quantité.");
}
});
$(document).on('scan.pos.barcode', function(event) {
//access `event.code` - barcode data
var barcode = event.code;
......
......@@ -120,7 +120,7 @@ class CagetteShift(models.Model):
'shift_type', 'date_alert_stop', 'date_delay_stop', 'extension_ids',
'cooperative_state', 'final_standard_point', 'create_date',
'final_ftop_point', 'shift_type', 'leave_ids', 'makeups_to_do', 'barcode_base',
'street', 'street2', 'zip', 'city', 'mobile', 'phone', 'email',
'street', 'street2', 'zip', 'city', 'mobile', 'phone', 'function', 'email',
'is_associated_people', 'parent_id', 'extra_shift_done']
partnerData = self.o_api.search_read('res.partner', cond, fields, 1)
if partnerData:
......@@ -328,11 +328,17 @@ class CagetteShift(models.Model):
"state": 'open',
"is_makeup":data['is_makeup'],
"origin":canceled_res[0]['origin'] + ' reopened from memberspace'}
"""In case shift to reopen is a makeup, we want the counter to be incremented once shift is done
That is why template_created must be set to false
However if shift to reopen is not a makeup, counter should not be incremented so template_created should not be changed."""
if data["is_makeup"]:
#following code is required to properly set template_created.
#TODO : factor with set_shift code
shift_type = "standard"
if data['shift_type'] == "ftop" or getattr(settings, 'USE_STANDARD_SHIFT', True) == False:
shift_type = "ftop"
if (shift_type == "standard" and data['is_makeup'] is not True) or shift_type == "ftop":
fieldsDatas['template_created'] = 1 # It's not true but otherwise, presence add 1 standard point , which is not wanted
else: #the else does not exist in set_shift but is mandatory here as template_created value in reopened registration can be any value
fieldsDatas["template_created"] = False
response = self.o_api.update('shift.registration', [shift_res['id']], fieldsDatas)
except Exception as e:
coop_logger.error("Reopen shift : %s", str(e))
......
......@@ -28,7 +28,7 @@
<div class="page_content">
<div id="table_top_area">
<h3>Liste des membres ayant au moins un rattrapage à choisir dans leur espace</h3>
<h3>Liste des membres ayant au moins un rattrapage à faire</h3>
<div class="table_grouped_action">
<button type="button" class="btn--primary" id="decrement_selected_members_makeups">
-1 rattrapage pour les membres sélectionnés
......
......@@ -61,6 +61,11 @@
<input type="text" placeholder="email" name="email" value="" pattern="(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*)@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])" required autocomplete="off" />
(*)
</p>
{% if ask_for_job %}
<p>
{% include "members/job_input.html" %}
</p>
{% endif %}
<p>
<input type="number" step="10" min="10" placeholder="Montant souscription" name="subs_cap" id="subs_cap" required/>
<select name="payment_meaning" id="payment_meaning" autocomplete="off" required >
......
<div id="job">
<input type="text" placeholder="Profession" name="job" autocomplete="off" />
</div>
......@@ -33,6 +33,11 @@
<a id="change_shift_template" class="btn--primary">Changer</a>
</span>
</p>
{% if ask_for_job %}
<p>
{% include "members/job_input.html" %}
</p>
{% endif %}
<p>
<input type="number" step="1" min="1" placeholder="Nombre de parts" name="shares_nb" id="shares_nb" class="b_yellow" required disabled/>
<label for="shares_nb">Parts sociales</label>
......
<div id="faqBDM" class=" mt-3">
<div class="page_title txtcenter"><h1> Problèmes et demandes </h1></div>
<div class="tiles_container">
<div class="tile full_width_tile">
<p>Un problème ? Une demande ? Une question pas résolue par les fonctionnalités de cet espace membre ?</p
<p>Viens au magasin, on s’en occupe ensemble ! Informations pratiques et horaires d’ouverture disponibles sur :</p>
<p><a href="https://graoucoop.fr" target="_blank">https://graoucoop.fr</a></p>
<p>On ne s’interdit pas de mettre en place une adresse mail et/ou un numéro de téléphone dédié à l’avenir, mais pour l’instant, on préfère le contact humain en direct :)</p>
</div>
</div>
</div>
<div class="tile full_width_tile">
<div class="tile_title">
Comprendre mon statut
</div>
<div class="my_info_line_middle">
<p>À Graoucoop, on se base sur les expériences ayant réussi avant nous. En ce qui concerne ton “statut” de membre, il détermine ton droit de faire tes courses, en fonction de la régularité de ta participation bénévole. </p>
<p>Tant que tu participes 3 heures toutes les 4 semaines, tu es “à jour”.</p>
<p>Si tu rates un service sans l’avoir déplacé, tu es en “alerte” et dois faire un “rattrapage” (à choisir via ton espace membre).</p>
<p>Si tu ne fais pas ton rattrapage, au bout de deux mois, tu peux être “suspendu.e”. Si tu ne donnes pas de nouvelles pendant six mois, tu peux même être “désinscrit.e” (ton créneau de bénévolat est libéré pour permettre à une autre personne de s’y inscrire). </p>
<p>Attention, les “suspendu.e.s” et “désinscrit.e.s” ne peuvent pas faire leurs courses. Passe vite au bureau des membres pour programmer un rattrapage et/ou demander un “délai” !</p>
<p>En cas de maladie ou incapacité, tu peux aussi demander à être “exempté.e”. Dans tous les cas, en cas de souci, passe au bureau des membres au magasin, on t’y recevra bien !</p>
<p>Ci-dessous un schéma approximatif des statuts dans un supermarché coopératif.</p>
</div>
<a href="/static/img/diagramme_etat_statut_cooperateurs.png" target="”_blank”">
<img class="status_info_image" src="/static/img/diagramme_etat_statut_cooperateurs.png" alt="diagramme_etat_statut_cooperateurs">
</a>
</div>
......@@ -151,6 +151,7 @@
"city" : "{{partnerData.city|safe}}",
"mobile" : "{{partnerData.mobile}}",
"phone" : "{{partnerData.phone}}",
"function" : "{{partnerData.function}}",
"email" : "{{partnerData.email}}",
"is_associated_people" : "{{partnerData.is_associated_people}}",
"parent_id" : "{{partnerData.parent_id}}",
......
......@@ -88,6 +88,20 @@
<span id="save_edit_phone"><i class="fas fa-check tile_icon edit-btn"></i></span>
</div>
</div>
<div class="my_info_line member_job_line">
<div class="my_info_line_left">
Profession
</div>
<div class="my_info_line_right member_job_area" id="edit_job_value">
<span class="member_job member_info"></span>
<span id="edit_job"><i class="fas fa-edit tile_icon edit-btn" ></i></span>
</div>
<div class="my_info_line_right member_job_area1" id="edit_job_form">
<input type="text" name="job" id="job_form" placeholder="Profession"> <br>
<span id="cancel_edit_job"><i class="fas fa-times tile_icon edit-btn"></i></span>
<span id="save_edit_job"><i class="fas fa-check tile_icon edit-btn"></i></span>
</div>
</div>
</div>
</div>
<div class="tile full_width_tile" id="attached_info_area">
......
......@@ -21,7 +21,8 @@
city : '{{data.city}}',
email: '{{data.email}}',
mobile : '{{data.mobile}}',
phone : '{{data.phone}}'
phone : '{{data.phone}}',
function: '{{data.job}}'
},
name_sep = '{{data.name_sep}}'
</script>
......@@ -70,6 +71,9 @@
<select name="yyyy"></select>
<input type="hidden" name="birthdate" value="{{data.birthdate}}" />
</p>
<p>
{% include "members/job_input.html" %}
</p>
</div>
</div>
<div id="address">
......
......@@ -65,6 +65,8 @@ def index(request):
'WELCOME_SUBTITLE_ENTRANCE_MSG': getattr(settings, 'WELCOME_SUBTITLE_ENTRANCE_MSG', '')}
if hasattr(settings, 'SUBSCRIPTION_ASK_FOR_SEX'):
context['ask_for_sex'] = settings.SUBSCRIPTION_ASK_FOR_SEX
if hasattr(settings, 'SUBSCRIPTION_ASK_FOR_JOB'):
context['ask_for_job'] = settings.SUBSCRIPTION_ASK_FOR_JOB
if hasattr(settings, 'SUBSCRIPTION_ADD_STREET2'):
context['ask_for_street2'] = settings.SUBSCRIPTION_ADD_STREET2
if hasattr(settings, 'SUBSCRIPTION_ADD_SECOND_PHONE'):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment