Merge branch 'thierry' of ssh://git.marbelium.com:10023/Viiciouss/XJC into anis

thierry
Viiciouss 7 years ago
commit adf1f8937c

@ -62,7 +62,7 @@
<div class="col-md-12" id="listeCartePart2">
<h4 class="mb-5 mt-1 font-bold wow fadeInDown text-center" style="padding-top: 5%;">Liste des cartes de parrainages issues de l'opération commerciale ci-dessus : {{opComm?.name}} ({{(carteParList | async)?.length}})</h4>
<div class="list-group wow fadeInLeftBig">
<div class="card mainCard" *ngFor="let crt of carteParList | async">
<div class="card mainCard" *ngFor="let crt of (carteParList | async); let i = index;">
<div class="row no-margin">
<img class="col-md-6 card-image subCard1" id="image1" src={{crt.carteTemplate.downloadURL}}>
<!--<div class="col-md-6 card-image mb-1 subCard1" [ngStyle]="{ 'background-image': 'url(' + crt.carteTemplate.downloadURL + ')'}">

@ -122,13 +122,13 @@
<label>Commercant: {{op.commercantOpCom.commercialName}}</label>
</div>
<div id="opAvantages">
<label>Avantage parrain: {{op.avantageParrain}} €</label>
<label>Avantage filleul: {{op.avantageFilleul}} €</label>
<label>Avantage parrain: {{op.avantageParrain === ''? '0' : op.avantageParrain}} €</label>
<label>Avantage filleul: {{op.avantageFilleul === ''? '0' : op.avantageFilleul}} €</label>
</div>
<div id="opLogs">
<label>Carte(s) envoyée(s): {{op.nbEnvoie}}</label>
<label>Carte(s) scannée(s): {{op.nbScan}}</label>
<label>Carte(s) débitée(s): {{op.nbDebiter}}</label>
<label>Carte(s) envoyée(s): {{op.nbEnvoie === ''? '0' : op.nbEnvoie}}</label>
<label>Carte(s) scannée(s): {{op.nbScan === ''? '0' : op.nbScan}}</label>
<label>Carte(s) débitée(s): {{op.nbDebiter === ''? '0' : op.nbDebiter}}</label>
</div>
</div>
<div class="btn-block d-flex flex-lg-row flex-md-column flex-sm-row" id="subCard2Part2">

@ -29,7 +29,7 @@
<a (click)="loadResetPasswordComponent()" class="blue-text">Mot de passe oublié ?</a>
</div>
<div *ngIf="echecLogin" class="alert alert-danger">
Erreur: votre <strong>email</strong> ou votre <strong>mot de passe n'est pas correct !</strong>.
Erreur: votre <strong>email/mot de passe n'est pas correct ou bien vous n'avez pas validé votre adresse email !</strong>.
</div>
</form>

@ -5,7 +5,7 @@
<h5 class="mb-5 mt-1 font-bold wow fadeInDown text-center">Nouvelle operation commerciale</h5>
<div class="md-form">
<i class="fa fa-address-card prefix grey-text"></i>
<input type="text" id="orangeForm-Familyname" [(ngModel)]="opComm.name" placeholder="Name">
<input type="text" id="orangeForm-Familyname" [(ngModel)]="opComm.name" placeholder="Nom">
</div>
<div class="md-form birthdayPar">
<i class="fa fa-calendar-check-o prefix grey-text"></i>

@ -113,7 +113,7 @@
<div *ngIf="carteEnvoieOK" class="alert alert-success">
Une carte vient d'être envoyée au nouveau Parrain {{cartePar.parrainCarte.firstname}} {{cartePar.parrainCarte.familyname}}
</div>
<div *ngIf="echecRegisterPar" class="alert alert-danger">
<div *ngIf="echecRegisterPar && !carteEnvoieOK" class="alert alert-danger">
Erreur: Un compte avec cet <strong>email</strong> existe déjà.
</div>
</div>

@ -80,7 +80,7 @@ export class AuthService {
Parrain.forEach(elementParrain => {
this.parrain = elementParrain;
this.utilisateur = elementParrain;
if (/*user.emailVerified*/true){
if (user.emailVerified){
firebase.auth().onAuthStateChanged(function (userUpdate) {
if (userUpdate !== null){
@ -99,9 +99,9 @@ export class AuthService {
} else if (this.utilisateur.status === 'Commercant') {
this.router.navigate(['/opCommercial']);
}
}/*else{
}else{
console.log('email non verifié!!');
}*/
}
});
});
}
@ -119,7 +119,7 @@ export class AuthService {
Commercant.forEach(elementCommercant => {
this.commercant = elementCommercant;
this.utilisateur = elementCommercant;
if (/*user.emailVerified*/true){
if (user.emailVerified){
firebase.auth().onAuthStateChanged(function (userUpdate) {
if (userUpdate !== null){
userUpdate.updateProfile({
@ -137,9 +137,9 @@ export class AuthService {
}
this.router.navigate(['/opCommercial']);
}
}/*else{
}else{
console.log('email non verifié!!');
}*/
}
});
});
}
@ -219,7 +219,6 @@ export class AuthService {
const folder = this.folder;
const path = `${this.folder}`;
const iRef = storageRef.child(path);
console.log(selectedFile);
if(selectedFile !== undefined){
try{
iRef.put(selectedFile).then((snapshot) => {

@ -70,30 +70,15 @@ export class OpCommercialService {
);
}
getFilleuls(): FirebaseListObservable<any> {
return this.afDb.list('/Filleul/', {
query: {
orderByChild: 'uid'
}
}
);
}
updateOpCommStatus() {
const opComAll = this.getOpComs();
opComAll.subscribe(tabOpComs => {
if (tabOpComs.length > 0) {
for (let i = 0; i < tabOpComs.length ; ++i){
console.log('tabOpComs[i].name' + tabOpComs[i].name);
if(tabOpComs[i].name !== ''){
if (tabOpComs[i].name !== '') {
let monOpCom = tabOpComs[i];
console.log('tabOpComs[i].name not vide' + tabOpComs[i].name);
if (monOpCom !== undefined){
console.log(monOpCom);
var todayTemp = new Date(Date.now());
var debutTemp = new Date(monOpCom.dateDebut);
var finTemp = new Date(monOpCom.dateFin);
@ -101,22 +86,16 @@ export class OpCommercialService {
if (todayTemp.getTime() >= debutTemp.getTime() && todayTemp.getTime() <= finTemp.getTime()) {
if (monOpCom.uid !== undefined && monOpCom.status !== undefined && monOpCom.name !== undefined
&& monOpCom.uid !== '' && monOpCom.status !== '' && monOpCom.name !== '') {
console.log(monOpCom.uid);
console.log(monOpCom.status);
monOpCom.status = 'Active';
}
} else {
if (monOpCom.uid !== undefined && monOpCom.status !== undefined && monOpCom.name !== undefined
&& monOpCom.uid !== '' && monOpCom.status !== '' && monOpCom.name !== ''){
console.log(monOpCom.uid);
console.log(monOpCom.status);
monOpCom.status = 'Inactive';
}
}
if (monOpCom.uid !== undefined && monOpCom.status !== undefined && monOpCom.name !== undefined
&& monOpCom.uid !== '' && monOpCom.status !== '' && monOpCom.name !== '') {
console.log('monOpCom.uid: ' + monOpCom.uid);
console.log('monOpCom.status: ' + monOpCom.status);
const carteStatusRef = firebase.database().ref().child('OperationCommercial').child(monOpCom.uid).child('status');
carteStatusRef.set(monOpCom.status);
}
@ -134,18 +113,18 @@ export class OpCommercialService {
});
}
updateCarteEtOpCom(){
updateCarteEtOpCom() {
this.updateOpCommStatus();
this.updateCarteStatus();
}
updateCarteStatus(){
const carteAll = this.getCartes();
carteAll.subscribe(tabCarte => {
if (tabCarte.length > 0) {
for (let i = 0; i < tabCarte.length ; ++i){
console.log('tabCarte[i].parrainCarte.firstname' + tabCarte[i].parrainCarte.firstname);
if (tabCarte[i].parrainCarte.firstname !== '') {
let maCarte = tabCarte[i];
@ -156,22 +135,16 @@ export class OpCommercialService {
if (todayTemp.getTime() >= debutTemp.getTime() && todayTemp.getTime() <= finTemp.getTime()) {
if(maCarte.status !== undefined && maCarte.uid !== undefined && maCarte.parrainCarte !== undefined
&& maCarte.status !== '' && maCarte.uid !== '' && maCarte.parrainCarte.firstname !== '') {
console.log('maCarte.uid: ' + maCarte.uid);
console.log('maCarte.status: ' + maCarte.status);
maCarte.status = 'Active';
}
} else {
if (maCarte.status !== undefined && maCarte.uid !== undefined && maCarte.parrainCarte !== undefined
&& maCarte.status !== '' && maCarte.uid !== '' && maCarte.parrainCarte.firstname !== '') {
console.log('maCarte.uid: ' + maCarte.uid);
console.log('maCarte.status: ' + maCarte.status);
maCarte.status = 'Inactive';
}
}
if (maCarte.status !== undefined && maCarte.uid !== undefined && maCarte.parrainCarte !== undefined
&& maCarte.status !== '' && maCarte.uid !== '' && maCarte.parrainCarte.firstname !== '') {
console.log('maCarte.uid: ' + maCarte.uid);
console.log('maCarte.status: ' + maCarte.status);
const carteStatusRef = firebase.database().ref().child('CarteParrainage').child(maCarte.uid).child('status');
carteStatusRef.set(maCarte.status);
}
@ -189,12 +162,14 @@ export class OpCommercialService {
}
saveOpComm(user: firebase.User, infoOpCom: OperationCommerciale) {
if (infoOpCom.name !== '' && infoOpCom.avantageParrain !== '' && infoOpCom.avantageFilleul !== '') {
infoOpCom.uid = firebase.database().ref().child('OperationCommercial').push().key;
let updates = {};
updates['/OperationCommercial/' + infoOpCom.uid] = infoOpCom;
firebase.database().ref().update(updates);
this.upload(infoOpCom);
}
infoOpCom.uid = firebase.database().ref().child('OperationCommercial').push().key;
let updates = {};
updates['/OperationCommercial/' + infoOpCom.uid] = infoOpCom;
firebase.database().ref().update(updates);
this.upload(infoOpCom);
}

Loading…
Cancel
Save