Commit 03d76c13 by Yvon

Merge branch 'develop'

parents e4a06722 7c35e29b
......@@ -291,6 +291,45 @@ form[name="formEncaissement"] label {
}
}
#login-password-container {
position: relative;
}
#show-login-password-icon {
cursor: pointer;
position: absolute;
right: 23px;
top: 7px;
}
#show-login-password-icon:hover + #show-login-text {
display: block;
}
#show-login-text {
position: absolute;
right: 16px;
top: 32px;
background-color: black;
color: white;
padding: 2px 12px;
border: 1px solid black;
border-radius: 6px;
text-align: center;
font-size: 0.95em;
display: none;
}
#show-login-text::after {
content: " ";
position: absolute;
bottom: 100%; /* At the top of the tooltip */
left: 90%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: transparent transparent black transparent;
}
/**
* END Success check animation.
*/
\ No newline at end of file
......@@ -548,6 +548,31 @@ $(function() {
}
});
$("#show-login-password-icon").on("click", () => {
let type = $("#login-password-container #password").prop("type");
if (type === "password") {
$("#login-password-container #password").prop("type", "input");
$("#login-password-container #show-login-text").text("Masquer le mot de passe");
$("#login-password-container #show-login-password-icon").removeClass("fa-eye").addClass("fa-eye-slash");
} else {
$("#login-password-container #password").prop("type", "password");
$("#login-password-container #show-login-text").text("Afficher le mot de passe");
$("#login-password-container #show-login-password-icon").removeClass("fa-eye-slash").addClass("fa-eye");
}
});
/**
* Display loader after validating Encaissement form
*/
$("form[name='formEncaissement']").on("submit", (event) => {
// non strict equality check
if (formEncaissementValidation == true) {
$("#formEncaissement_save").parent().append('<span class="spinner-border" role="status" aria-hidden="true"></span>');
$("#formEncaissement_save").hide()
}
})
// $('.js-datepicker').datepicker({
// closeText: 'Fermer',
// prevText: '&#x3c;Préc',
......@@ -573,4 +598,4 @@ $(function() {
// showButtonPanel: true
// });
});
\ No newline at end of file
});
--This script has been used to delete unwanted transactions for
--https://redmine.cooperatic.fr/issues/4725
--Several variables must be set :
--@nb : nb of transactions that should be removed
--@date_before : time just before the first transaction we want to remove (ok if includes other transaction as soon as amount is different ; ok to include the first transaction (the true one))
--@date_after : time just after the last transaction we want to remove (ok if includes other transaction as soon as amount is different ; ok to include the first transaction (the true one))
--@montant : positive
--set first name, last name and raison
--CAREFUL ! Variable not working in limit clause : https://stackoverflow.com/questions/245180/using-variable-in-a-limit-clause-in-mysql
--setting limit manualy is therefore REQUIRED in the two first DELETE FROM requests
--It is probably better to identify the flux that have to be deleted and to deduce the operations that have to be deleted as well
--instead of doing so, we sort the operations (prestataire and adherent) by flux_id before performing a DELETE LIMIT in order
--to be sure to delete the operations that are associated to the same flux.
--then we remove the flux
--the drawback of this technique is that it does not make sure that the FIRST flux is the one that is kept if it was in the time interval
set @nb = 42;
set @date_before = 'aaaa-mm-dd HH:MM:SS';
set @date_after = 'aaaa-mm-dd HH:MM:SS';
set @montant = 4242.42;
select @account_adherent := account_adherent.id from user
inner join adherent on adherent.id = user.adherent_id
inner join account_adherent on account_adherent.adherent_id = user.adherent_id
where user.firstname = 'Prénom' and user.lastname = 'Nom';
select @account_prestataire := account_prestataire.id from prestataire
inner join account_prestataire on account_prestataire.prestataire_id = prestataire.id
where prestataire.raison = 'Kumbi' and currency = 'emlc';
DELETE FROM operation_adherent
WHERE account_id = @account_adherent AND montant = -@montant AND created_at > @date_before AND created_at < @date_after
ORDER BY flux_id DESC LIMIT 0;
UPDATE account_adherent SET balance = balance + @nb*@montant WHERE id = @account_adherent;
DELETE FROM operation_prestataire
WHERE account_id = @account_prestataire AND montant = @montant AND created_at > @date_before AND created_at < @date_after
ORDER BY flux_id DESC LIMIT 0;
UPDATE account_prestataire SET balance = balance - @nb*@montant WHERE id = @account_prestataire;
DELETE flux FROM flux LEFT JOIN operation_adherent oa ON oa.flux_id = flux.id WHERE oa.id IS NULL AND flux.type='adherent_prestataire';
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -3,10 +3,10 @@
"app": {
"js": [
"/build/runtime.6ad5c9da.js",
"/build/app.fe8f482e.js"
"/build/app.1a688d7d.js"
],
"css": [
"/build/app.8f9aaf53.css"
"/build/app.9c351632.css"
]
},
"admin": {
......
{
"build/app.css": "/build/app.8f9aaf53.css",
"build/app.js": "/build/app.fe8f482e.js",
"build/app.css": "/build/app.9c351632.css",
"build/app.js": "/build/app.1a688d7d.js",
"build/admin.css": "/build/admin.5dc0eea7.css",
"build/admin.js": "/build/admin.cee4d78d.js",
"build/runtime.js": "/build/runtime.6ad5c9da.js",
......
......@@ -19,8 +19,10 @@
<div class='col-6 text-right'>
<label for="password">{{ 'security.login.password'|trans }} :</label>
</div>
<div class='col-6 text-left'>
<div class='col-6 text-left' id="login-password-container">
<input type="password" id="password" name="_password" required="required" class='d-block w-100' />
<i class="fas fa-eye" id="show-login-password-icon"></i>
<span id="show-login-text">Afficher le mot de passe</span>
</div>
</div>
<div class='row mt-4'>
......
......@@ -63,6 +63,9 @@
{{ form_end(form) }}
</div>
</div>
<script type="text/javascript">
var formEncaissementValidation = '{{ validation }}';
</script>
{% endblock %}
{% block footer %}{% endblock footer %}
\ No newline at end of file
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